r23314 - gnucash/trunk - [PATCH] Register rewrite Update, remove update for next release.

Geert Janssens gjanssens at code.gnucash.org
Tue Oct 22 14:26:57 EDT 2013


Author: gjanssens
Date: 2013-10-22 14:26:55 -0400 (Tue, 22 Oct 2013)
New Revision: 23314
Trac: http://svn.gnucash.org/trac/changeset/23314

Removed:
   gnucash/trunk/src/gnome-utils/gnc-tree-control-split-reg.c
   gnucash/trunk/src/gnome-utils/gnc-tree-control-split-reg.h
   gnucash/trunk/src/gnome-utils/gnc-tree-model-split-reg.c
   gnucash/trunk/src/gnome-utils/gnc-tree-model-split-reg.h
   gnucash/trunk/src/gnome-utils/gnc-tree-util-split-reg.c
   gnucash/trunk/src/gnome-utils/gnc-tree-util-split-reg.h
   gnucash/trunk/src/gnome-utils/gnc-tree-view-split-reg.c
   gnucash/trunk/src/gnome-utils/gnc-tree-view-split-reg.h
   gnucash/trunk/src/gnome/dialog-find-transactions2.c
   gnucash/trunk/src/gnome/dialog-find-transactions2.h
   gnucash/trunk/src/gnome/dialog-print-check2.c
   gnucash/trunk/src/gnome/dialog-print-check2.h
   gnucash/trunk/src/gnome/dialog-sx-editor2.c
   gnucash/trunk/src/gnome/dialog-sx-editor2.h
   gnucash/trunk/src/gnome/gnc-plugin-page-register2.c
   gnucash/trunk/src/gnome/gnc-plugin-page-register2.h
   gnucash/trunk/src/gnome/gnc-plugin-register2.c
   gnucash/trunk/src/gnome/gnc-plugin-register2.h
   gnucash/trunk/src/gnome/gnc-split-reg2.c
   gnucash/trunk/src/gnome/gnc-split-reg2.h
   gnucash/trunk/src/gnome/gtkbuilder/gnc-plugin-page-register2.glade
   gnucash/trunk/src/gnome/ui/gnc-plugin-page-account-tree2-ui.xml
   gnucash/trunk/src/gnome/ui/gnc-plugin-page-register2-ui.xml
   gnucash/trunk/src/gnome/ui/gnc-plugin-register2-ui.xml
   gnucash/trunk/src/gnome/window-reconcile2.c
   gnucash/trunk/src/gnome/window-reconcile2.h
   gnucash/trunk/src/register/ledger-core/gnc-ledger-display2.c
   gnucash/trunk/src/register/ledger-core/gnc-ledger-display2.h
Modified:
   gnucash/trunk/po/POTFILES.in
   gnucash/trunk/src/gnome-utils/Makefile.am
   gnucash/trunk/src/gnome-utils/gtkbuilder/dialog-preferences.glade
   gnucash/trunk/src/gnome/Makefile.am
   gnucash/trunk/src/gnome/dialog-sx-since-last-run.c
   gnucash/trunk/src/gnome/gnc-plugin-basic-commands.c
   gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.c
   gnucash/trunk/src/gnome/gnc-plugin-page-register.c
   gnucash/trunk/src/gnome/gnc-plugin-page-sx-list.c
   gnucash/trunk/src/gnome/gnc-plugin-register.c
   gnucash/trunk/src/gnome/gschemas/org.gnucash.gschema.xml.in
   gnucash/trunk/src/gnome/gtkbuilder/Makefile.am
   gnucash/trunk/src/gnome/top-level.c
   gnucash/trunk/src/gnome/ui/Makefile.am
   gnucash/trunk/src/gnome/ui/gnc-plugin-page-sx-list-ui.xml
   gnucash/trunk/src/import-export/aqbanking/gnc-plugin-aqbanking.c
   gnucash/trunk/src/register/ledger-core/Makefile.am
Log:
[PATCH] Register rewrite Update, remove update for next release.

This update removes the register2 changes for the next release
as it is not complete yet.

Author: Robert Fewell

Modified: gnucash/trunk/po/POTFILES.in
===================================================================
--- gnucash/trunk/po/POTFILES.in	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/po/POTFILES.in	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,13 +1,14 @@
 # This is a list of files which contain translatable strings.
 # This file was generated by ../make-gnucash-potfiles.
+src/app-utils/QuickFill.c
 src/app-utils/business-helpers.c
 src/app-utils/business-options.c
 src/app-utils/calculation/expression_parser.c
 src/app-utils/calculation/fin.c
 src/app-utils/file-utils.c
 src/app-utils/gfec.c
-src/app-utils/gnc-accounting-period.c
 src/app-utils/gnc-account-merge.c
+src/app-utils/gnc-accounting-period.c
 src/app-utils/gnc-addr-quickfill.c
 src/app-utils/gnc-component-manager.c
 src/app-utils/gnc-entry-quickfill.c
@@ -15,16 +16,15 @@
 src/app-utils/gnc-exp-parser.c
 src/app-utils/gnc-gettext-util.c
 src/app-utils/gnc-gsettings.c
-src/app-utils/gnc-helpers.c
 src/app-utils/gnc-help-utils.c
-src/app-utils/gncmod-app-utils.c
+src/app-utils/gnc-helpers.c
 src/app-utils/gnc-prefs-utils.c
 src/app-utils/gnc-sx-instance-model.c
 src/app-utils/gnc-ui-balances.c
 src/app-utils/gnc-ui-util.c
+src/app-utils/gncmod-app-utils.c
 src/app-utils/guile-util.c
 src/app-utils/option-util.c
-src/app-utils/QuickFill.c
 src/backend/dbi/gnc-backend-dbi.c
 src/backend/sql/escape.c
 src/backend/sql/gnc-account-sql.c
@@ -76,12 +76,12 @@
 src/backend/xml/io-gncxml-v1.c
 src/backend/xml/io-gncxml-v2.c
 src/backend/xml/io-utils.c
-src/backend/xml/sixtp.c
 src/backend/xml/sixtp-dom-generators.c
 src/backend/xml/sixtp-dom-parsers.c
 src/backend/xml/sixtp-stack.c
 src/backend/xml/sixtp-to-dom-parser.c
 src/backend/xml/sixtp-utils.c
+src/backend/xml/sixtp.c
 src/bin/gnucash-bin.c
 src/business/business-gnome/business-gnome-utils.c
 src/business/business-gnome/business-options-gnome.c
@@ -96,10 +96,10 @@
 src/business/business-gnome/dialog-order.c
 src/business/business-gnome/dialog-payment.c
 src/business/business-gnome/dialog-vendor.c
-src/business/business-gnome/gncmod-business-gnome.c
 src/business/business-gnome/gnc-plugin-business.c
 src/business/business-gnome/gnc-plugin-page-invoice.c
 src/business/business-gnome/gnc-plugin-page-owner-tree.c
+src/business/business-gnome/gncmod-business-gnome.c
 src/business/business-gnome/gtkbuilder/business-options-gnome.glade
 src/business/business-gnome/gtkbuilder/business-prefs.glade
 src/business/business-gnome/gtkbuilder/dialog-billterms.glade
@@ -133,99 +133,47 @@
 src/core-utils/gnc-uri-utils.c
 src/doc/doxygen_main_page.c
 src/engine/Account.c
+src/engine/Query.c
+src/engine/Recurrence.c
+src/engine/SX-book.c
+src/engine/SX-ttinfo.c
+src/engine/SchedXaction.c
+src/engine/Scrub.c
+src/engine/Scrub2.c
+src/engine/Scrub3.c
+src/engine/Split.c
+src/engine/TransLog.c
+src/engine/Transaction.c
 src/engine/cap-gains.c
 src/engine/cashobjects.c
 src/engine/engine-helpers.c
 src/engine/glib-helpers.c
+src/engine/gnc-budget.c
+src/engine/gnc-commodity.c
+src/engine/gnc-engine.c
+src/engine/gnc-event.c
+src/engine/gnc-hooks.c
+src/engine/gnc-lot.c
+src/engine/gnc-pricedb.c
+src/engine/gnc-session.c
 src/engine/gncAddress.c
 src/engine/gncBillTerm.c
-src/engine/gnc-budget.c
 src/engine/gncBusGuile.c
 src/engine/gncBusiness.c
-src/engine/gnc-commodity.c
 src/engine/gncCustomer.c
 src/engine/gncEmployee.c
-src/engine/gnc-engine.c
 src/engine/gncEntry.c
-src/engine/gnc-event.c
-src/engine/gnc-hooks.c
 src/engine/gncIDSearch.c
 src/engine/gncInvoice.c
 src/engine/gncJob.c
-src/engine/gnc-lot.c
-src/engine/gncmod-engine.c
 src/engine/gncOrder.c
 src/engine/gncOwner.c
-src/engine/gnc-pricedb.c
-src/engine/gnc-session.c
 src/engine/gncTaxTable.c
 src/engine/gncVendor.c
+src/engine/gncmod-engine.c
 src/engine/kvp-scm.c
 src/engine/policy.c
-src/engine/Query.c
-src/engine/Recurrence.c
-src/engine/SchedXaction.c
-src/engine/Scrub2.c
-src/engine/Scrub3.c
-src/engine/Scrub.c
-src/engine/Split.c
-src/engine/SX-book.c
-src/engine/SX-ttinfo.c
-src/engine/Transaction.c
-src/engine/TransLog.c
 src/gnc-module/gnc-module.c
-src/gnome/assistant-acct-period.c
-src/gnome/assistant-hierarchy.c
-src/gnome/assistant-loan.c
-src/gnome/assistant-stock-split.c
-src/gnome/dialog-commodities.c
-src/gnome/dialog-fincalc.c
-src/gnome/dialog-find-transactions2.c
-src/gnome/dialog-find-transactions.c
-src/gnome/dialog-lot-viewer.c
-src/gnome/dialog-new-user.c
-src/gnome/dialog-price-edit-db.c
-src/gnome/dialog-price-editor.c
-src/gnome/dialog-print-check2.c
-src/gnome/dialog-print-check.c
-src/gnome/dialog-progress.c
-src/gnome/dialog-sx-editor2.c
-src/gnome/dialog-sx-editor.c
-src/gnome/dialog-sx-from-trans.c
-src/gnome/dialog-sx-since-last-run.c
-src/gnome/dialog-tax-info.c
-src/gnome/gnc-budget-view.c
-src/gnome/gnc-plugin-account-tree.c
-src/gnome/gnc-plugin-basic-commands.c
-src/gnome/gnc-plugin-budget.c
-src/gnome/gnc-plugin-page-account-tree.c
-src/gnome/gnc-plugin-page-budget.c
-src/gnome/gnc-plugin-page-register2.c
-src/gnome/gnc-plugin-page-register.c
-src/gnome/gnc-plugin-page-sx-list.c
-src/gnome/gnc-plugin-register2.c
-src/gnome/gnc-plugin-register.c
-src/gnome/gnc-split-reg2.c
-src/gnome/gnc-split-reg.c
-src/gnome/gtkbuilder/assistant-acct-period.glade
-src/gnome/gtkbuilder/assistant-hierarchy.glade
-src/gnome/gtkbuilder/assistant-loan.glade
-src/gnome/gtkbuilder/assistant-stock-split.glade
-src/gnome/gtkbuilder/dialog-commodities.glade
-src/gnome/gtkbuilder/dialog-fincalc.glade
-src/gnome/gtkbuilder/dialog-lot-viewer.glade
-src/gnome/gtkbuilder/dialog-new-user.glade
-src/gnome/gtkbuilder/dialog-price.glade
-src/gnome/gtkbuilder/dialog-print-check.glade
-src/gnome/gtkbuilder/dialog-progress.glade
-src/gnome/gtkbuilder/dialog-sx.glade
-src/gnome/gtkbuilder/dialog-tax-info.glade
-src/gnome/gtkbuilder/gnc-plugin-page-budget.glade
-src/gnome/gtkbuilder/gnc-plugin-page-register2.glade
-src/gnome/gtkbuilder/gnc-plugin-page-register.glade
-src/gnome/gtkbuilder/window-autoclear.glade
-src/gnome/gtkbuilder/window-reconcile.glade
-src/gnome/reconcile-view.c
 src/gnome-search/dialog-search.c
 src/gnome-search/dialog-search.glade
 src/gnome-search/gnc-general-search.c
@@ -240,7 +188,6 @@
 src/gnome-search/search-numeric.c
 src/gnome-search/search-reconciled.c
 src/gnome-search/search-string.c
-src/gnome/top-level.c
 src/gnome-utils/account-quickfill.c
 src/gnome-utils/assistant-utils.c
 src/gnome-utils/assistant-xml-encoding.c
@@ -264,17 +211,17 @@
 src/gnome-utils/gnc-amount-edit.c
 src/gnome-utils/gnc-autosave.c
 src/gnome-utils/gnc-cell-renderer-date.c
-src/gnome-utils/gnc-cell-renderer-popup.c
 src/gnome-utils/gnc-cell-renderer-popup-entry.c
+src/gnome-utils/gnc-cell-renderer-popup.c
 src/gnome-utils/gnc-combott.c
 src/gnome-utils/gnc-commodity-edit.c
 src/gnome-utils/gnc-currency-edit.c
 src/gnome-utils/gnc-date-delta.c
 src/gnome-utils/gnc-date-edit.c
 src/gnome-utils/gnc-date-format.c
-src/gnome-utils/gnc-dense-cal.c
 src/gnome-utils/gnc-dense-cal-model.c
 src/gnome-utils/gnc-dense-cal-store.c
+src/gnome-utils/gnc-dense-cal.c
 src/gnome-utils/gnc-embedded-window.c
 src/gnome-utils/gnc-file.c
 src/gnome-utils/gnc-frequency.c
@@ -287,36 +234,32 @@
 src/gnome-utils/gnc-keyring.c
 src/gnome-utils/gnc-main-window.c
 src/gnome-utils/gnc-menu-extensions.c
-src/gnome-utils/gncmod-gnome-utils.c
 src/gnome-utils/gnc-period-select.c
-src/gnome-utils/gnc-plugin.c
 src/gnome-utils/gnc-plugin-file-history.c
 src/gnome-utils/gnc-plugin-manager.c
 src/gnome-utils/gnc-plugin-menu-additions.c
 src/gnome-utils/gnc-plugin-page.c
+src/gnome-utils/gnc-plugin.c
 src/gnome-utils/gnc-query-view.c
 src/gnome-utils/gnc-recurrence.c
 src/gnome-utils/gnc-splash.c
 src/gnome-utils/gnc-sx-instance-dense-cal-adapter.c
 src/gnome-utils/gnc-sx-list-tree-model-adapter.c
-src/gnome-utils/gnc-tree-control-split-reg.c
-src/gnome-utils/gnc-tree-model-account.c
 src/gnome-utils/gnc-tree-model-account-types.c
+src/gnome-utils/gnc-tree-model-account.c
 src/gnome-utils/gnc-tree-model-budget.c
-src/gnome-utils/gnc-tree-model.c
 src/gnome-utils/gnc-tree-model-commodity.c
 src/gnome-utils/gnc-tree-model-owner.c
 src/gnome-utils/gnc-tree-model-price.c
-src/gnome-utils/gnc-tree-model-split-reg.c
-src/gnome-utils/gnc-tree-util-split-reg.c
+src/gnome-utils/gnc-tree-model.c
 src/gnome-utils/gnc-tree-view-account.c
-src/gnome-utils/gnc-tree-view.c
 src/gnome-utils/gnc-tree-view-commodity.c
 src/gnome-utils/gnc-tree-view-owner.c
 src/gnome-utils/gnc-tree-view-price.c
-src/gnome-utils/gnc-tree-view-split-reg.c
 src/gnome-utils/gnc-tree-view-sx-list.c
+src/gnome-utils/gnc-tree-view.c
 src/gnome-utils/gnc-window.c
+src/gnome-utils/gncmod-gnome-utils.c
 src/gnome-utils/gtkbuilder/assistant-xml-encoding.glade
 src/gnome-utils/gtkbuilder/dialog-account.glade
 src/gnome-utils/gtkbuilder/dialog-book-close.glade
@@ -339,35 +282,80 @@
 src/gnome-utils/print-session.c
 src/gnome-utils/search-param.c
 src/gnome-utils/window-main-summarybar.c
+src/gnome/assistant-acct-period.c
+src/gnome/assistant-hierarchy.c
+src/gnome/assistant-loan.c
+src/gnome/assistant-stock-split.c
+src/gnome/dialog-commodities.c
+src/gnome/dialog-fincalc.c
+src/gnome/dialog-find-transactions.c
+src/gnome/dialog-lot-viewer.c
+src/gnome/dialog-new-user.c
+src/gnome/dialog-price-edit-db.c
+src/gnome/dialog-price-editor.c
+src/gnome/dialog-print-check.c
+src/gnome/dialog-progress.c
+src/gnome/dialog-sx-editor.c
+src/gnome/dialog-sx-from-trans.c
+src/gnome/dialog-sx-since-last-run.c
+src/gnome/dialog-tax-info.c
+src/gnome/gnc-budget-view.c
+src/gnome/gnc-plugin-account-tree.c
+src/gnome/gnc-plugin-basic-commands.c
+src/gnome/gnc-plugin-budget.c
+src/gnome/gnc-plugin-page-account-tree.c
+src/gnome/gnc-plugin-page-budget.c
+src/gnome/gnc-plugin-page-register.c
+src/gnome/gnc-plugin-page-sx-list.c
+src/gnome/gnc-plugin-register.c
+src/gnome/gnc-split-reg.c
+src/gnome/gtkbuilder/assistant-acct-period.glade
+src/gnome/gtkbuilder/assistant-hierarchy.glade
+src/gnome/gtkbuilder/assistant-loan.glade
+src/gnome/gtkbuilder/assistant-stock-split.glade
+src/gnome/gtkbuilder/dialog-commodities.glade
+src/gnome/gtkbuilder/dialog-fincalc.glade
+src/gnome/gtkbuilder/dialog-lot-viewer.glade
+src/gnome/gtkbuilder/dialog-new-user.glade
+src/gnome/gtkbuilder/dialog-price.glade
+src/gnome/gtkbuilder/dialog-print-check.glade
+src/gnome/gtkbuilder/dialog-progress.glade
+src/gnome/gtkbuilder/dialog-sx.glade
+src/gnome/gtkbuilder/dialog-tax-info.glade
+src/gnome/gtkbuilder/gnc-plugin-page-budget.glade
+src/gnome/gtkbuilder/gnc-plugin-page-register.glade
+src/gnome/gtkbuilder/window-autoclear.glade
+src/gnome/gtkbuilder/window-reconcile.glade
+src/gnome/reconcile-view.c
+src/gnome/top-level.c
 src/gnome/window-autoclear.c
-src/gnome/window-reconcile2.c
 src/gnome/window-reconcile.c
-src/html/gnc-html.c
 src/html/gnc-html-factory.c
 src/html/gnc-html-history.c
 src/html/gnc-html-webkit.c
+src/html/gnc-html.c
 src/html/gncmod-html.c
 src/import-export/aqbanking/assistant-ab-initial.c
 src/import-export/aqbanking/assistant-ab-initial.glade
 src/import-export/aqbanking/dialog-ab-daterange.c
-src/import-export/aqbanking/dialog-ab.glade
 src/import-export/aqbanking/dialog-ab-trans.c
+src/import-export/aqbanking/dialog-ab.glade
 src/import-export/aqbanking/gnc-ab-getbalance.c
 src/import-export/aqbanking/gnc-ab-gettrans.c
 src/import-export/aqbanking/gnc-ab-kvp.c
-src/import-export/aqbanking/gnc-ab-transfer.c
 src/import-export/aqbanking/gnc-ab-trans-templ.c
+src/import-export/aqbanking/gnc-ab-transfer.c
 src/import-export/aqbanking/gnc-ab-utils.c
 src/import-export/aqbanking/gnc-file-aqb-import.c
 src/import-export/aqbanking/gnc-gwen-gui.c
-src/import-export/aqbanking/gncmod-aqbanking.c
 src/import-export/aqbanking/gnc-plugin-aqbanking.c
+src/import-export/aqbanking/gncmod-aqbanking.c
 src/import-export/csv-export/assistant-csv-export.c
 src/import-export/csv-export/assistant-csv-export.glade
 src/import-export/csv-export/csv-transactions-export.c
 src/import-export/csv-export/csv-tree-export.c
-src/import-export/csv-export/gncmod-csv-export.c
 src/import-export/csv-export/gnc-plugin-csv-export.c
+src/import-export/csv-export/gncmod-csv-export.c
 src/import-export/csv-import/assistant-csv-account-import.c
 src/import-export/csv-import/assistant-csv-account-import.glade
 src/import-export/csv-import/assistant-csv-trans-import.c
@@ -375,8 +363,8 @@
 src/import-export/csv-import/csv-account-import.c
 src/import-export/csv-import/gnc-csv-gnumeric-popup.c
 src/import-export/csv-import/gnc-csv-model.c
-src/import-export/csv-import/gncmod-csv-import.c
 src/import-export/csv-import/gnc-plugin-csv-import.c
+src/import-export/csv-import/gncmod-csv-import.c
 src/import-export/dialog-import.glade
 src/import-export/gncmod-generic-import.c
 src/import-export/import-account-matcher.c
@@ -390,27 +378,29 @@
 src/import-export/import-settings.c
 src/import-export/import-utilities.c
 src/import-export/log-replay/gnc-log-replay.c
-src/import-export/log-replay/gncmod-log-replay.c
 src/import-export/log-replay/gnc-plugin-log-replay.c
-src/import-export/ofx/gncmod-ofx-import.c
+src/import-export/log-replay/gncmod-log-replay.c
 src/import-export/ofx/gnc-ofx-import.c
 src/import-export/ofx/gnc-ofx-kvp.c
 src/import-export/ofx/gnc-plugin-ofx.c
+src/import-export/ofx/gncmod-ofx-import.c
 src/import-export/qif-import/assistant-qif-import.c
 src/import-export/qif-import/assistant-qif-import.glade
 src/import-export/qif-import/dialog-account-picker.c
 src/import-export/qif-import/dialog-account-picker.glade
-src/import-export/qif-import/gncmod-qif-import.c
 src/import-export/qif-import/gnc-plugin-qif-import.c
+src/import-export/qif-import/gncmod-qif-import.c
 src/import-export/qif/qif-context.c
 src/import-export/qif/qif-file.c
 src/import-export/qif/qif-objects.c
 src/libqof/qof/gnc-date.c
 src/libqof/qof/gnc-numeric.c
 src/libqof/qof/guid.c
-src/libqof/qof/kvp_frame.c
 src/libqof/qof/kvp-util.c
+src/libqof/qof/kvp_frame.c
 src/libqof/qof/md5.c
+src/libqof/qof/qof-string-cache.c
+src/libqof/qof/qof-win32.c
 src/libqof/qof/qofbackend.c
 src/libqof/qof/qofbook.c
 src/libqof/qof/qofchoice.c
@@ -425,34 +415,31 @@
 src/libqof/qof/qofquerycore.c
 src/libqof/qof/qofreference.c
 src/libqof/qof/qofsession.c
-src/libqof/qof/qof-string-cache.c
 src/libqof/qof/qofutil.c
-src/libqof/qof/qof-win32.c
-src/plugins/bi_import/dialog-bi-import.c
 src/plugins/bi_import/dialog-bi-import-gui.c
 src/plugins/bi_import/dialog-bi-import-helper.c
-src/plugins/bi_import/gncmod-bi-import.c
+src/plugins/bi_import/dialog-bi-import.c
 src/plugins/bi_import/gnc-plugin-bi-import.c
+src/plugins/bi_import/gncmod-bi-import.c
 src/plugins/bi_import/gtkbuilder/dialog-bi-import-gui.glade
-src/plugins/customer_import/dialog-customer-import.c
 src/plugins/customer_import/dialog-customer-import-gui.c
+src/plugins/customer_import/dialog-customer-import.c
 src/plugins/customer_import/gnc-plugin-customer_import.c
 src/plugins/customer_import/gtkbuilder/dialog-customer-import-gui.glade
 src/plugins/customer_import/libgncmod-customer_import.c
 src/python/gncmod-python.c
-src/register/ledger-core/gnc-ledger-display2.c
 src/register/ledger-core/gnc-ledger-display.c
 src/register/ledger-core/gncmod-ledger-core.c
-src/register/ledger-core/split-register.c
 src/register/ledger-core/split-register-control.c
 src/register/ledger-core/split-register-layout.c
 src/register/ledger-core/split-register-load.c
-src/register/ledger-core/split-register-model.c
 src/register/ledger-core/split-register-model-save.c
+src/register/ledger-core/split-register-model.c
 src/register/ledger-core/split-register-util.c
+src/register/ledger-core/split-register.c
 src/register/register-core/basiccell.c
-src/register/register-core/cellblock.c
 src/register/register-core/cell-factory.c
+src/register/register-core/cellblock.c
 src/register/register-core/checkboxcell.c
 src/register/register-core/formulacell.c
 src/register/register-core/gncmod-register-core.c
@@ -487,16 +474,16 @@
 src/report/report-gnome/dialog-custom-report.c
 src/report/report-gnome/dialog-custom-report.glade
 src/report/report-gnome/dialog-report-column-view.c
-src/report/report-gnome/dialog-report.glade
 src/report/report-gnome/dialog-report-style-sheet.c
-src/report/report-gnome/gncmod-report-gnome.c
+src/report/report-gnome/dialog-report.glade
 src/report/report-gnome/gnc-plugin-page-report.c
+src/report/report-gnome/gncmod-report-gnome.c
 src/report/report-gnome/window-report.c
-src/report/report-system/gncmod-report-system.c
 src/report/report-system/gnc-report.c
+src/report/report-system/gncmod-report-system.c
 src/report/standard-reports/gncmod-standard-reports.c
-src/report/stylesheets/gncmod-stylesheets.c
 src/report/stylesheets/gnc-plugin-stylesheets.c
+src/report/stylesheets/gncmod-stylesheets.c
 src/report/utility-reports/gncmod-utility-reports.c
 src/tax/us/gncmod-tax-us.c
 src/gnome/gnucash.desktop.in.in

Modified: gnucash/trunk/src/gnome/Makefile.am
===================================================================
--- gnucash/trunk/src/gnome/Makefile.am	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/Makefile.am	2013-10-22 18:26:55 UTC (rev 23314)
@@ -31,16 +31,13 @@
   dialog-commodities.c \
   dialog-fincalc.c \
   dialog-find-transactions.c \
-  dialog-find-transactions2.c \
   dialog-lot-viewer.c \
   dialog-new-user.c \
   dialog-price-editor.c \
   dialog-price-edit-db.c \
   dialog-print-check.c \
-  dialog-print-check2.c \
   dialog-progress.c \
   dialog-sx-editor.c \
-  dialog-sx-editor2.c \
   dialog-sx-from-trans.c \
   dialog-sx-since-last-run.c \
   dialog-tax-info.c \
@@ -49,18 +46,14 @@
   gnc-plugin-basic-commands.c \
   gnc-plugin-budget.c \
   gnc-plugin-register.c \
-  gnc-plugin-register2.c \
   gnc-plugin-page-account-tree.c \
   gnc-plugin-page-budget.c \
   gnc-plugin-page-sx-list.c \
   gnc-plugin-page-register.c \
-  gnc-plugin-page-register2.c \
   gnc-split-reg.c \
-  gnc-split-reg2.c \
   reconcile-view.c \
   top-level.c \
   window-reconcile.c \
-  window-reconcile2.c \
   window-autoclear.c
 
 gnomeappdir = ${datadir}/applications
@@ -82,14 +75,11 @@
   assistant-stock-split.h \
   dialog-fincalc.h \
   dialog-find-transactions.h \
-  dialog-find-transactions2.h \
   dialog-lot-viewer.h \
   dialog-new-user.h \
   dialog-print-check.h \
-  dialog-print-check2.h \
   dialog-progress.h \
   dialog-sx-editor.h \
-  dialog-sx-editor2.h \
   dialog-sx-from-trans.h \
   dialog-sx-since-last-run.h \
   gnc-budget-view.h \
@@ -97,18 +87,14 @@
   gnc-plugin-basic-commands.h \
   gnc-plugin-budget.h \
   gnc-plugin-register.h \
-  gnc-plugin-register2.h \
   gnc-plugin-page-account-tree.h \
   gnc-plugin-page-budget.h \
   gnc-plugin-page-sx-list.h \
   gnc-plugin-page-register.h \
-  gnc-plugin-page-register2.h \
   gnc-split-reg.h \
-  gnc-split-reg2.h \
   reconcile-view.h \
   top-level.h \
   window-reconcile.h \
-  window-reconcile2.h \
   window-autoclear.h
 
 if BUILDING_FROM_SCM

Deleted: gnucash/trunk/src/gnome/dialog-find-transactions2.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-find-transactions2.c	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/dialog-find-transactions2.c	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,216 +0,0 @@
-/********************************************************************\
- * dialog-find-transactions2.c : locate transactions and show them   *
- * Copyright (C) 2000 Bill Gribble <grib at billgribble.com>           *
- *                                                                  *
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
-\********************************************************************/
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#include <stdio.h>
-
-#include "gnc-ui-util.h"
-#include "Query.h"
-#include "qof.h"
-#include "SX-book.h"
-#include "Transaction.h"
-#include "dialog-find-transactions2.h"
-#include "gnc-main-window.h"
-#include "gnc-plugin-page-register2.h"
-#include "search-param.h"
-
-#define GNC_PREFS_GROUP_SEARCH "dialogs.find"
-
-struct _ftd_data
-{
-    QofQuery *		q;
-    QofQuery *		ledger_q;
-    GNCSearchWindow *	sw;
-};
-
-static void
-do_find_cb (QofQuery *query, gpointer user_data, gpointer *result)
-{
-    struct _ftd_data *ftd = user_data;
-    GNCLedgerDisplay2 *ledger;
-    gboolean new_ledger = FALSE;
-    GncPluginPage *page;
-
-    ledger = gnc_ledger_display2_find_by_query (ftd->ledger_q);
-
-    if (!ledger)
-    {
-        new_ledger = TRUE;
-        ledger = gnc_ledger_display2_query (query, SEARCH_LEDGER2,
-                                           REG2_STYLE_JOURNAL);
-    }
-    else
-        gnc_ledger_display2_set_query (ledger, query);
-
-    gnc_ledger_display2_refresh (ledger);
-
-    if (new_ledger)
-    {
-        page = gnc_plugin_page_register2_new_ledger (ledger);
-        gnc_main_window_open_page (NULL, page);
-    }
-
-    qof_query_destroy (ftd->q);
-
-    gnc_search_dialog_destroy (ftd->sw);
-}
-
-static void
-free_ftd_cb (gpointer user_data)
-{
-    struct _ftd_data *ftd = user_data;
-
-    if (!ftd)
-        return;
-
-    g_free (ftd);
-}
-
-GNCSearchWindow *
-gnc_ui_find_transactions_dialog_create2 (GNCLedgerDisplay2 * orig_ledg)
-{
-    QofIdType type = GNC_ID_SPLIT;
-    struct _ftd_data *ftd;
-    static GList *params = NULL;
-    QofQuery *start_q, *show_q = NULL;
-    gboolean num_action =
-                qof_book_use_split_action_for_num_field(gnc_get_current_book());
-
-    /* Build parameter list in reverse order */
-    if (params == NULL)
-    {
-        params = gnc_search_param_prepend (params, N_("All Accounts"),
-                                           ACCOUNT_MATCH_ALL_TYPE,
-                                           type, SPLIT_TRANS, TRANS_SPLITLIST,
-                                           SPLIT_ACCOUNT_GUID, NULL);
-        params = gnc_search_param_prepend (params, N_("Account"), GNC_ID_ACCOUNT,
-                                           type, SPLIT_ACCOUNT, QOF_PARAM_GUID,
-                                           NULL);
-        params = gnc_search_param_prepend (params, N_("Balanced"), NULL,
-                                           type, SPLIT_TRANS, TRANS_IS_BALANCED,
-                                           NULL);
-        params = gnc_search_param_prepend (params, N_("Reconcile"), RECONCILED_MATCH_TYPE,
-                                           type, SPLIT_RECONCILE, NULL);
-        params = gnc_search_param_prepend (params, N_("Share Price"), NULL,
-                                           type, SPLIT_SHARE_PRICE, NULL);
-        params = gnc_search_param_prepend (params, N_("Shares"), NULL,
-                                           type, SPLIT_AMOUNT, NULL);
-        params = gnc_search_param_prepend (params, N_("Value"), NULL,
-                                           type, SPLIT_VALUE, NULL);
-        params = gnc_search_param_prepend (params, N_("Date Posted"), NULL,
-                                           type, SPLIT_TRANS, TRANS_DATE_POSTED,
-                                           NULL);
-        params = gnc_search_param_prepend (params, N_("Notes"), NULL,
-                                           type, SPLIT_TRANS, TRANS_NOTES, NULL);
-        params = gnc_search_param_prepend (params, (num_action
-                                                    ? N_("Number/Action")
-                                                    : N_("Action")), NULL,
-                                           type, SPLIT_ACTION, NULL);
-        params = gnc_search_param_prepend (params, (num_action
-                                                    ? N_("Transaction Number")
-                                                    : N_("Number")), NULL,
-                                           type, SPLIT_TRANS, TRANS_NUM, NULL);
-        params = gnc_search_param_prepend (params, N_("Memo"), NULL,
-                                           type, SPLIT_MEMO, NULL);
-        params = gnc_search_param_prepend (params, N_("Description"), NULL,
-                                           type, SPLIT_TRANS, TRANS_DESCRIPTION,
-                                           NULL);
-    }
-    else
-    {
-        GList *l;
-        for (l = params; l; l = l->next)
-        {
-            GNCSearchParam *param = l->data;
-
-            if (num_action)
-            {
-                if (strcmp (param->title, N_("Action")) == 0)
-                    gnc_search_param_set_title (param, N_("Number/Action"));
-                if (strcmp (param->title, N_("Number")) == 0)
-                    gnc_search_param_set_title (param, N_("Transaction Number"));
-            }
-            else
-            {
-                if (strcmp (param->title, N_("Number/Action")) == 0)
-                    gnc_search_param_set_title (param, N_("Action"));
-                if (strcmp (param->title, N_("Transaction Number")) == 0)
-                    gnc_search_param_set_title (param, N_("Number"));
-            }
-        }
-    }
-
-    ftd = g_new0 (struct _ftd_data, 1);
-
-    if (orig_ledg)
-    {
-        ftd->ledger_q = gnc_ledger_display2_get_query (orig_ledg);
-        start_q = show_q = qof_query_copy (ftd->ledger_q);
-    }
-    else
-    {
-        start_q = qof_query_create ();
-        qof_query_set_book (start_q, gnc_get_current_book ());
-
-        /* In lieu of not "mis-using" some portion of the infrastructure by writing
-         * a bunch of new code, we just filter out the accounts of the template
-         * transactions.  While these are in a seperate Account trees just for this
-         * reason, the query engine makes no distinction between Account trees.
-         * See Gnome Bug 86302.
-         * 	-- jsled
-         *
-         * copied from gnc-ledger-display2.c:gnc_ledger_display2_gl()  -- warlord
-         *
-         * <jsled> Alternatively, you could look for a GNC_SX_ACCOUNT [SchedAction.h]
-         * key in the KVP frame of the split.
-         */
-        {
-            Account *tRoot;
-            GList *al;
-
-            tRoot = gnc_book_get_template_root( gnc_get_current_book() );
-            al = gnc_account_get_descendants( tRoot );
-            xaccQueryAddAccountMatch( start_q, al, QOF_GUID_MATCH_NONE, QOF_QUERY_AND );
-            g_list_free (al);
-            al = NULL;
-            tRoot = NULL;
-        }
-
-        ftd->q = start_q;		/* save this to destroy it later */
-    }
-
-    ftd->sw = gnc_search_dialog_create (type, _("Find Transaction"),
-                                        params, NULL, start_q, show_q,
-                                        NULL, do_find_cb, NULL,
-                                        ftd, free_ftd_cb, GNC_PREFS_GROUP_SEARCH, NULL);
-
-    if (!ftd->sw)
-    {
-        free_ftd_cb (ftd);
-        return NULL;
-    }
-
-    return ftd->sw;
-}

Deleted: gnucash/trunk/src/gnome/dialog-find-transactions2.h
===================================================================
--- gnucash/trunk/src/gnome/dialog-find-transactions2.h	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/dialog-find-transactions2.h	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,33 +0,0 @@
-/********************************************************************\
- * dialog-find-transactions2.h : locate transactions/splits matching *
- *                              criteria.                           *
- * Copyright (C) 2000 Bill Gribble <grib at billgribble.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                   *
-\********************************************************************/
-
-#ifndef DIALOG_FIND_TRANSACTIONS2_H
-#define DIALOG_FIND_TRANSACTIONS2_H
-
-#include "gnc-ledger-display2.h"
-#include "dialog-search.h"
-
-GNCSearchWindow *
-gnc_ui_find_transactions_dialog_create2 (GNCLedgerDisplay2 * ledger);
-
-#endif

Deleted: gnucash/trunk/src/gnome/dialog-print-check2.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-print-check2.c	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/dialog-print-check2.c	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,2645 +0,0 @@
-/********************************************************************\
- * dialog-print-check2.c : dialog to control check printing.         *
- * Copyright (C) 2000 Bill Gribble <grib at billgribble.com>           *
- * Copyright (C) 2006,2007 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                   *
-\********************************************************************/
-
-/**
- * @file dialog-print-check2.c
- * @brief Print Checks Dialog
- * @author Copyright (C) 2000 Bill Gribble <grib at billgribble.com>
- * @author Copyright (C) 2006,2007 David Hampton <hampton at employees.org>
- */
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#include <stdio.h>
-#include <locale.h>
-#include <math.h>
-
-#include <gnc-gdate-utils.h>
-#include "qof.h"
-#include "gnc-date.h"
-#include "gnc-prefs.h"
-#include "gnc-numeric.h"
-#include "gnc-plugin-page-register2.h"
-#include "dialog-print-check2.h"
-#include "dialog-utils.h"
-#include "print-session.h"
-#include "gnc-ui.h"
-#include "gnc-date-format.h"
-#include "gnc-ui-util.h"
-#include "gnc-path.h"
-#include "gnc-filepath-utils.h"
-#include "gnc-gkeyfile-utils.h"
-
-#include "gnc-engine.h"
-#include "engine-helpers.h"
-#include "Split.h"
-#include "Transaction.h"
-
-#undef G_LOG_DOMAIN
-#define G_LOG_DOMAIN "gnc.printing.checks"
-
-/* This static indicates the debugging module that this .o belongs to.
- */
-G_GNUC_UNUSED static QofLogModule log_module = "gnc.printing.checks";
-
-#define GNC_PREFS_GROUP             "dialogs.checkprinting"
-#define GNC_PREF_CHECK_FORMAT_GUID  "check-format-guid"
-#define GNC_PREF_CHECK_POSITION     "check-position"
-#define GNC_PREF_FIRST_PAGE_COUNT   "first-page-count"
-#define GNC_PREF_DATE_FORMAT_USER   "date-format-custom"
-#define GNC_PREF_CUSTOM_PAYEE       "custom-payee"
-#define GNC_PREF_CUSTOM_DATE        "custom-date"
-#define GNC_PREF_CUSTOM_WORDS       "custom-amount-words"
-#define GNC_PREF_CUSTOM_NUMBER      "custom-amount-number"
-#define GNC_PREF_CUSTOM_ADDRESS     "custom-address"
-#define GNC_PREF_CUSTOM_NOTES       "custom-notes"
-#define GNC_PREF_CUSTOM_MEMO        "custom-memo"
-#define GNC_PREF_CUSTOM_TRANSLATION "custom-translation"
-#define GNC_PREF_CUSTOM_ROTATION    "custom-rotation"
-#define GNC_PREF_CUSTOM_UNITS       "custom-units"
-#define GNC_PREF_PRINT_DATE_FMT     "print-date-format"
-#define GNC_PREF_DEFAULT_FONT       "default-font"
-#define GNC_PREF_BLOCKING_CHARS     "blocking-chars"
-#define GNC_PREF_SPLITS_AMOUNT      "splits-amount"
-#define GNC_PREF_SPLITS_MEMO        "splits-memo"
-#define GNC_PREF_SPLITS_ACCOUNT     "splits-account"
-
-
-#define DEFAULT_FONT            "sans 12"
-#define CHECK_FMT_DIR           "checks"
-#define CHECK_NAME_EXTENSION    ".chk"
-#define DEGREES_TO_RADIANS      (G_PI / 180.0)
-
-#define BLOCKING_CHAR_OFF	0
-#define BLOCKING_CHAR_ON	1
-
-#define KF_GROUP_TOP       "Top"
-#define KF_GROUP_POS       "Check Positions"
-#define KF_GROUP_ITEMS     "Check Items"
-#define KF_KEY_GUID        "Guid"
-#define KF_KEY_TITLE       "Title"
-#define KF_KEY_ROTATION    "Rotation"
-#define KF_KEY_TRANSLATION "Translation"
-#define KF_KEY_FONT        "Font"
-#define KF_KEY_ALIGN       "Align"
-#define KF_KEY_BLOCKING    "Blocking_Chars"
-#define KF_KEY_SHOW_GRID   "Show_Grid"
-#define KF_KEY_SHOW_BOXES  "Show_Boxes"
-#define KF_KEY_NAMES       "Names"
-#define KF_KEY_HEIGHT      "Height"
-#define KF_KEY_TYPE        "Type"
-#define KF_KEY_COORDS      "Coords"
-#define KF_KEY_TEXT        "Text"
-#define KF_KEY_FILENAME    "Filename"
-#define KF_KEY_DATE_FORMAT "DateFormat"
-#define KF_KEY_SPLITS_AMOUNT  "SplitsAmount"
-#define KF_KEY_SPLITS_MEMO    "SplitsMemo"
-#define KF_KEY_SPLITS_ACCOUNT "SplitsAccount"
-
-/* This enum specifies the columns used in the check format combobox.
- */
-typedef enum format_combo_col_t
-{
-    COL_NAME = 0,               /**< This column holds a copy of the check
-                                 *   format name and is what is displayed to
-                                 *   the user in the combobox. It is NULL for
-                                 *   separator lines. */
-    COL_DATA,                   /**< This column holds a pointer to the check
-                                 *   format data read in from a file.  It is
-                                 *   NULL for the custom check format and for
-                                 *   separator lines. */
-    COL_SEP,                    /**< This column contains the value TRUE if
-                                 *   this entry specifies a separator line. */
-} format_combo_col;
-
-void gnc_ui_print_check_response_cb2 (GtkDialog *dialog, gint response, PrintCheckDialog *pcd);
-void gnc_print_check_format_changed2 (GtkComboBox *widget, PrintCheckDialog *pcd);
-void gnc_print_check_position_changed2 (GtkComboBox *widget, PrintCheckDialog *pcd);
-void gnc_print_check_save_button_clicked2 (GtkButton *button, PrintCheckDialog *pcd);
-void gnc_check_format_title_changed2 (GtkEditable *editable, GtkWidget *ok_button);
-
-static void initialize_format_combobox (PrintCheckDialog *pcd);
-gchar* get_check_address2 (PrintCheckDialog *pcd);
-static gboolean check_format_has_address (PrintCheckDialog *pcd);
-gchar* get_check_splits_amount2 (PrintCheckDialog *pcd);
-gchar* get_check_splits_memo2 (PrintCheckDialog *pcd);
-gchar* get_check_splits_account2 (PrintCheckDialog *pcd);
-
-/* This enum defines the types of items that gnucash knows how to
- * print on checks.  Most refer to specific fields from a gnucash
- * transaction and split, but some are generic items unrelated to
- * gnucash.
- */
-#define ENUM_CHECK_ITEM_TYPE(_) \
-        _(NONE,) \
-        _(PAYEE,) \
-        _(DATE,) \
-        _(NOTES,) \
-        _(CHECK_NUMBER,) \
-                  \
-        _(MEMO,) \
-        _(ACTION,) \
-        _(AMOUNT_NUMBER,) \
-        _(AMOUNT_WORDS,) \
-                         \
-        _(TEXT,) \
-        _(ADDRESS,) \
-        _(DATE_FORMAT,) \
-        _(SPLITS_AMOUNT,) \
-        _(SPLITS_MEMO,) \
-        _(SPLITS_ACCOUNT,) \
-        _(PICTURE,)
-
-DEFINE_ENUM(CheckItemType2, ENUM_CHECK_ITEM_TYPE)
-FROM_STRING_DEC(CheckItemType2, ENUM_CHECK_ITEM_TYPE)
-FROM_STRING_FUNC(CheckItemType2, ENUM_CHECK_ITEM_TYPE)
-AS_STRING_DEC(CheckItemType2, ENUM_CHECK_ITEM_TYPE)
-AS_STRING_FUNC(CheckItemType2, ENUM_CHECK_ITEM_TYPE)
-
-/* This data structure describes a single item printed on a check.
- * It is built from a description in a text file.
- */
-typedef struct _check_item
-{
-
-    CheckItemType2 type;         /**< What type of item is this?  */
-
-    gdouble x, y;               /**< The x/y coordinates where this item should
-                                 *   be printed.  The origin for these
-                                 *   coordinates is determined by the print
-                                 *   system used.  */
-
-    gdouble w, h;               /**< Optional. The width and height of this
-                                 *   item.  Text will be clipped to this
-                                 *   size. Pictures will be shrunk to fit if
-                                 *   necessary.  */
-
-    gchar *filename;            /**< The filename for picture items. Otherwise
-                                 *   unused. */
-
-    gchar *text;                /**< The text to be displayed (for text based
-                                 *   items.) Otherwise unused.  */
-
-    gchar *font;                /**< The font to use for text based items. This
-                                 *   overrides any font in the check format.
-                                 *   Unused for non-text items. */
-
-    gboolean blocking;          /**< Optional. Overrides blocking in the check
-                                 *   format. Default is no blocking characters
-                                 *   are written.  Unused for non-text
-                                 *   items. */
-
-    gboolean print_date_format; /**< Optional.  Print date format.  Only
-                                 *   applies to DATE items.  Default is no
-                                 *   format is written. */
-
-    PangoAlignment align;       /**< The alignment of a text based item. Only
-                                 *   used for text based items when a width is
-                                 *   specified.  */
-} check_item_t;
-
-/* This data structure describes an entire page of checks.  Depending
- * upon the check format, the page may contain multiple checks or
- * only a single check.  The data structure is built from a
- * description in a text file.
- */
-typedef struct _check_format
-{
-
-    gchar *guid;                /**< Unique identifier for this format. */
-
-    const gchar *group;         /**< The group where this format was found. */
-
-    gchar *filename;            /**< The name of the file from which this data
-                                 *   was read.  */
-
-    gchar *title;               /**< Title of this check format. Displayed in
-                                 *   the dialog box. */
-
-    gboolean blocking;          /**< Default for printing blocking characters for
-                                 *   this page of checks.  */
-
-    gboolean print_date_format; /**< Default for printing date format characters for
-                                 *   this page of checks.  */
-
-    gboolean show_grid;         /**< Print a grid pattern on the page */
-
-    gboolean show_boxes;        /**< Print boxes when width and height are
-                                 *   known. */
-
-    gdouble rotation;           /**< Rotate the entire page by this amount. */
-
-    gdouble trans_x;            /**< Move entire page left by this amount. */
-
-    gdouble trans_y;            /**< Move entire page down by this amount. */
-
-    gchar *font;                /**< Default font for this page of checks. */
-
-    gdouble height;             /**< Height of one check on a page. */
-
-    GSList *positions;          /**< Names of the checks on the page. */
-
-    GSList *items;              /**< List of items printed on each check. */
-} check_format_t;
-
-
-/* This data structure is used to manage the print check dialog, and
- * the overall check printing process.  It contains pointers to many
- * of the widgets in the dialog, pointers to the check descriptions
- * that have been read, and also contains the data from the gnucash
- * transaction/split that is to be printed.
- */
-struct _print_check_dialog
-{
-    GtkBuilder *builder;
-    GtkWidget *dialog;
-    GtkWindow *caller_window;
-
-    GncPluginPageRegister2 *plugin_page;
-    Split *split;
-    GList *splits;
-
-    GtkWidget *format_combobox;
-    gint format_max;
-    GtkWidget *position_combobox;
-    gint position_max;
-    GtkSpinButton *first_page_count;
-    GtkWidget *custom_table;
-    GtkSpinButton *payee_x, *payee_y;
-    GtkSpinButton *date_x, *date_y;
-    GtkSpinButton *words_x, *words_y;
-    GtkSpinButton *number_x, *number_y;
-    GtkSpinButton *address_x, *address_y;
-    GtkSpinButton *notes_x, *notes_y;
-    GtkSpinButton *memo_x, *memo_y;
-    GtkSpinButton *splits_amount_x, *splits_amount_y;
-    GtkSpinButton *splits_memo_x, *splits_memo_y;
-    GtkSpinButton *splits_account_x, *splits_account_y;
-    GtkSpinButton *translation_x, *translation_y;
-    GtkSpinButton *check_rotation;
-    GtkWidget *translation_label;
-
-    GtkWidget *units_combobox;
-
-    GtkWidget *date_format;
-
-    GtkWidget *check_address_name;
-    GtkWidget *check_address_1;
-    GtkWidget *check_address_2;
-    GtkWidget *check_address_3;
-    GtkWidget *check_address_4;
-
-    gchar *default_font;
-
-    check_format_t *selected_format;
-};
-
-
-/* This function walks ths list of available check formats looking for a
- * specific format as specified by guid number.  If found, a pointer to it is
- * returned to the caller.  Additionally, if the caller passed a pointer to a
- * GtkTreeIter, then the iter for that entry will also be returned.
- */
-static check_format_t *
-find_existing_format (GtkListStore *store, gchar *guid, GtkTreeIter *iter_out)
-{
-    GtkTreeIter iter;
-    check_format_t *format;
-
-    g_return_val_if_fail(store, NULL);
-    g_return_val_if_fail(guid, NULL);
-
-    if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter))
-        return NULL;
-
-    do
-    {
-        gtk_tree_model_get(GTK_TREE_MODEL(store), &iter,
-                           COL_DATA, &format, -1);
-        if (format == NULL)
-            continue;
-        if (strcmp(format->guid, guid) != 0)
-            continue;
-
-        if (iter_out)
-            *iter_out = iter;
-        return format;
-    }
-    while (gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter));
-
-    return NULL;
-}
-
-
-/* This function returns a string containing the check address in a five-line
- * format.
- *
- * Note that the string needs to be freed with g_free.
- */
-gchar *
-get_check_address2( PrintCheckDialog *pcd)
-{
-    gchar *address;
-    address = g_strconcat(gtk_entry_get_text(GTK_ENTRY(pcd->check_address_name)), "\n",
-                          gtk_entry_get_text(GTK_ENTRY(pcd->check_address_1)), "\n",
-                          gtk_entry_get_text(GTK_ENTRY(pcd->check_address_2)), "\n",
-                          gtk_entry_get_text(GTK_ENTRY(pcd->check_address_3)), "\n",
-                          gtk_entry_get_text(GTK_ENTRY(pcd->check_address_4)),
-                          NULL);
-    return address;
-}
-
-
-//@{
-/** @name Split printing functions */
-
-/* This function formats the splits amounts for printing.
- */
-gchar *
-get_check_splits_amount2(PrintCheckDialog *pcd)
-{
-    gchar* amount = NULL;
-    gchar* amt_temp;
-    int cnt;
-    const gchar* split_amount;
-    int nSplits;
-    Transaction *trans;
-    Split *split;
-    GList *node;
-    SplitList* s_list;
-
-    trans = xaccSplitGetParent(pcd->split);
-    nSplits = xaccTransCountSplits(trans);
-    s_list = xaccTransGetSplitList(trans);
-    if ( !s_list ) return NULL;
-
-    amount = g_strconcat("", NULL);
-    node = s_list;
-    cnt = 1;
-    while ( cnt < nSplits )
-    {
-        cnt++;
-        split = node->data;
-        split_amount = xaccPrintAmount(xaccSplitGetAmount(split), gnc_split_amount_print_info(split, TRUE));
-        amt_temp = amount;
-        amount = g_strconcat(amt_temp, "\n", split_amount, NULL);
-        g_free(amt_temp);
-        node = node->next;
-    }
-    return amount;
-}
-
-
-/* This function formats the splits memo fields for printing.
- */
-gchar *
-get_check_splits_memo2(PrintCheckDialog *pcd)
-{
-    gchar* memo = NULL;
-    gchar* memo_temp;
-    int cnt;
-    const gchar* split_memo;
-    int nSplits;
-    Transaction *trans;
-    Split *split;
-    GList *node;
-    SplitList* s_list;
-
-    trans = xaccSplitGetParent(pcd->split);
-    nSplits = xaccTransCountSplits(trans);
-    s_list = xaccTransGetSplitList(trans);
-    if ( !s_list ) return NULL;
-
-    memo = g_strconcat("", NULL);
-    node = s_list;
-    cnt = 1;
-    while ( cnt < nSplits )
-    {
-        cnt++;
-        split = node->data;
-        split_memo = xaccSplitGetMemo(split);
-        memo_temp = memo;
-        memo = g_strconcat(memo_temp, "\n", split_memo, NULL);
-        g_free(memo_temp);
-        node = node->next;
-    }
-    return memo;
-}
-
-
-/* This function formats the splits accounts for printing.
- */
-gchar *
-get_check_splits_account2(PrintCheckDialog *pcd)
-{
-    gchar* account = NULL;
-    gchar* account_temp;
-    int cnt;
-    const gchar* aName = NULL;
-    int nSplits;
-    Account *pAccount;
-    Transaction *trans;
-    Split *split;
-    GList *node;
-    SplitList* s_list;
-
-    trans = xaccSplitGetParent(pcd->split);
-    nSplits = xaccTransCountSplits(trans);
-    s_list = xaccTransGetSplitList(trans);
-    if ( !s_list ) return NULL;
-
-    account = g_strconcat("", NULL);
-    node = s_list;
-    cnt = 1;
-    while ( cnt < nSplits )
-    {
-        cnt++;
-        split = node->data;
-        pAccount = xaccSplitGetAccount(split);
-        aName = gnc_get_account_name_for_register(pAccount);
-        account_temp = account;
-        account = g_strconcat(account_temp, "\n", aName, NULL);
-        g_free(account_temp);
-        node = node->next;
-    }
-    return account;
-}
-//@}
-
-
-/* This function determines if an address item is present in the check format.
- */
-static gboolean
-check_format_has_address ( PrintCheckDialog *pcd )
-{
-    /* check format for an ADDRESS item */
-    check_item_t *item = NULL;
-    GSList *elem;
-    check_format_t *format = NULL;
-
-    if ( !pcd ) return FALSE;
-
-    /* If we're printing more than one check no addresses are allowed */
-    if (g_list_length(pcd->splits) != 1)
-        return FALSE;
-
-    /* if format is NULL, then the custom format is being used
-     * which has an ADDRESS item by definition */
-    format = pcd->selected_format;
-    if ( !format ) return TRUE;
-
-    for (elem = pcd->selected_format->items; elem; elem = g_slist_next(elem))
-    {
-        item = elem->data;
-        if ( item->type == ADDRESS ) return TRUE;
-    }
-    return FALSE;
-}
-
-
-static void
-gnc_ui_print_save_dialog(PrintCheckDialog *pcd)
-{
-    GtkTreeModel *model;
-    GtkTreeIter iter;
-    check_format_t *check;
-    const gchar *format;
-    gint active;
-
-    /* Options page */
-    if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(pcd->format_combobox),
-                                      &iter))
-    {
-        model = gtk_combo_box_get_model(GTK_COMBO_BOX(pcd->format_combobox));
-        gtk_tree_model_get(model, &iter, COL_DATA, &check, -1);
-        gnc_prefs_set_string (GNC_PREFS_GROUP, GNC_PREF_CHECK_FORMAT_GUID,
-                              check ? check->guid : "custom");
-    }
-    active = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->position_combobox));
-    gnc_prefs_set_int(GNC_PREFS_GROUP, GNC_PREF_CHECK_POSITION, active);
-    active = gtk_spin_button_get_value_as_int(pcd->first_page_count);
-    gnc_prefs_set_int(GNC_PREFS_GROUP, GNC_PREF_FIRST_PAGE_COUNT, active);
-    active = gnc_date_format_get_format (GNC_DATE_FORMAT(pcd->date_format));
-    gnc_prefs_set_int(GNC_PREFS_GROUP, GNC_PREF_DATE_FORMAT, active);
-    if (active == QOF_DATE_FORMAT_CUSTOM)
-    {
-        format = gnc_date_format_get_custom (GNC_DATE_FORMAT(pcd->date_format));
-        gnc_prefs_set_string (GNC_PREFS_GROUP, GNC_PREF_DATE_FORMAT_USER, format);
-    }
-    else
-    {
-        gnc_prefs_reset (GNC_PREFS_GROUP, GNC_PREF_DATE_FORMAT_USER);
-    }
-
-    /* Custom format page */
-    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_PAYEE,
-                    gtk_spin_button_get_value(pcd->payee_x),
-                    gtk_spin_button_get_value(pcd->payee_y));
-    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_DATE,
-                    gtk_spin_button_get_value(pcd->date_x),
-                    gtk_spin_button_get_value(pcd->date_y));
-    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_WORDS,
-                    gtk_spin_button_get_value(pcd->words_x),
-                    gtk_spin_button_get_value(pcd->words_y));
-    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NUMBER,
-                    gtk_spin_button_get_value(pcd->number_x),
-                    gtk_spin_button_get_value(pcd->number_y));
-    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NOTES,
-                    gtk_spin_button_get_value(pcd->notes_x),
-                    gtk_spin_button_get_value(pcd->notes_y));
-    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_MEMO,
-                    gtk_spin_button_get_value(pcd->memo_x),
-                    gtk_spin_button_get_value(pcd->memo_y));
-    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ADDRESS,
-                    gtk_spin_button_get_value(pcd->address_x),
-                    gtk_spin_button_get_value(pcd->address_y));
-    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_SPLITS_AMOUNT,
-                    gtk_spin_button_get_value(pcd->splits_amount_x),
-                    gtk_spin_button_get_value(pcd->splits_amount_y));
-    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_SPLITS_MEMO,
-                    gtk_spin_button_get_value(pcd->splits_memo_x),
-                    gtk_spin_button_get_value(pcd->splits_memo_y));
-    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_SPLITS_ACCOUNT,
-                    gtk_spin_button_get_value(pcd->splits_account_x),
-                    gtk_spin_button_get_value(pcd->splits_account_y));
-    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_TRANSLATION,
-                    gtk_spin_button_get_value(pcd->translation_x),
-                    gtk_spin_button_get_value(pcd->translation_y));
-    gnc_prefs_set_float(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ROTATION,
-                        gtk_spin_button_get_value(pcd->check_rotation));
-    active = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->units_combobox));
-    gnc_prefs_set_int(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_UNITS, active);
-}
-
-
-static void
-gnc_ui_print_restore_dialog(PrintCheckDialog *pcd)
-{
-    GtkTreeModel *model;
-    GtkTreeIter iter;
-    gchar *format, *guid;
-    gdouble x, y;
-    gint active;
-
-    /* Options page */
-    guid = gnc_prefs_get_string (GNC_PREFS_GROUP, GNC_PREF_CHECK_FORMAT_GUID);
-    if (guid == NULL)
-        gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->format_combobox), 0);
-    else if (strcmp(guid, "custom") == 0)
-        gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->format_combobox),
-                                 pcd->format_max - 1);
-    else
-    {
-        model = gtk_combo_box_get_model(GTK_COMBO_BOX(pcd->format_combobox));
-        if (find_existing_format(GTK_LIST_STORE(model), guid, &iter))
-        {
-            gtk_combo_box_set_active_iter(GTK_COMBO_BOX(pcd->format_combobox), &iter);
-        }
-        else
-        {
-            gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->format_combobox), 0);
-        }
-    }
-    active = gnc_prefs_get_int(GNC_PREFS_GROUP, GNC_PREF_CHECK_POSITION);
-
-    /* If the check format used last time no longer exists, then the saved check
-       position may be invalid.  If so set it to the first position. */
-    if (active < 0 || active > pcd->position_max)
-        active = 0;
-    gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->position_combobox), active);
-    active = gnc_prefs_get_int(GNC_PREFS_GROUP, GNC_PREF_FIRST_PAGE_COUNT);
-    gtk_spin_button_set_value(pcd->first_page_count, (gdouble) active);
-    active = gnc_prefs_get_int(GNC_PREFS_GROUP, GNC_PREF_DATE_FORMAT);
-    gnc_date_format_set_format(GNC_DATE_FORMAT(pcd->date_format), active);
-    if (active == QOF_DATE_FORMAT_CUSTOM)
-    {
-        format = gnc_prefs_get_string (GNC_PREFS_GROUP, GNC_PREF_DATE_FORMAT_USER);
-        if (format)
-        {
-            gnc_date_format_set_custom(GNC_DATE_FORMAT(pcd->date_format), format);
-            g_free(format);
-        }
-    }
-
-    /* Custom format page */
-    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_PAYEE, &x, &y);
-    gtk_spin_button_set_value(pcd->payee_x, x);
-    gtk_spin_button_set_value(pcd->payee_y, y);
-
-    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_DATE, &x, &y);
-    gtk_spin_button_set_value(pcd->date_x, x);
-    gtk_spin_button_set_value(pcd->date_y, y);
-    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_WORDS, &x, &y);
-    gtk_spin_button_set_value(pcd->words_x, x);
-    gtk_spin_button_set_value(pcd->words_y, y);
-    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NUMBER, &x, &y);
-    gtk_spin_button_set_value(pcd->number_x, x);
-    gtk_spin_button_set_value(pcd->number_y, y);
-    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ADDRESS, &x, &y);
-    gtk_spin_button_set_value(pcd->address_x, x);
-    gtk_spin_button_set_value(pcd->address_y, y);
-    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NOTES, &x, &y);
-    gtk_spin_button_set_value(pcd->notes_x, x);
-    gtk_spin_button_set_value(pcd->notes_y, y);
-    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_MEMO, &x, &y);
-    gtk_spin_button_set_value(pcd->memo_x, x);
-    gtk_spin_button_set_value(pcd->memo_y, y);
-    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_SPLITS_AMOUNT, &x, &y);
-    gtk_spin_button_set_value(pcd->splits_amount_x, x);
-    gtk_spin_button_set_value(pcd->splits_amount_y, y);
-    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_SPLITS_MEMO, &x, &y);
-    gtk_spin_button_set_value(pcd->splits_memo_x, x);
-    gtk_spin_button_set_value(pcd->splits_memo_y, y);
-    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_SPLITS_ACCOUNT, &x, &y);
-    gtk_spin_button_set_value(pcd->splits_account_x, x);
-    gtk_spin_button_set_value(pcd->splits_account_y, y);
-    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_TRANSLATION, &x, &y);
-    gtk_spin_button_set_value(pcd->translation_x, x);
-    gtk_spin_button_set_value(pcd->translation_y, y);
-    x = gnc_prefs_get_float(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ROTATION);
-    gtk_spin_button_set_value(pcd->check_rotation, x);
-    active = gnc_prefs_get_int(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_UNITS);
-    gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->units_combobox), active);
-}
-
-
-static gdouble
-pcd_get_custom_multip(PrintCheckDialog *pcd)
-{
-    gint selected;
-
-    selected = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->units_combobox));
-    switch (selected)
-    {
-    default:
-        return 72.0;        /* inches */
-    case 1:
-        return 28.346;      /* cm */
-    case 2:
-        return 2.8346;      /* mm */
-    case 3:
-        return 1.0;         /* points */
-    }
-}
-
-
-/* This function saves a coordinate pair into a check description file.  It
- * extracts the values from the spin buttons, adjusts them according to the
- * unit multiplier (inches, pixels, etc), then adds them to the gKeyFile.
- */
-static void
-pcd_key_file_save_xy (GKeyFile *key_file, const gchar *group_name,
-                      const gchar *key_name, gdouble multip,
-                      GtkSpinButton *spin0, GtkSpinButton *spin1)
-{
-    gdouble dd[2];
-
-    dd[0] = multip * gtk_spin_button_get_value(spin0);
-    dd[1] = multip * gtk_spin_button_get_value(spin1);
-
-    /* Clip the numbers to three decimal places. */
-    dd[0] = round(dd[0] * 1000) / 1000;
-    dd[1] = round(dd[1] * 1000) / 1000;
-    g_key_file_set_double_list(key_file, group_name, key_name, dd, 2);
-}
-
-
-/* This function saves the information about a single printed item into a
- * check description file.  It uses a helper function to extracts and save the
- * item coordinates.
- */
-static void
-pcd_key_file_save_item_xy (GKeyFile *key_file, int index,
-                           CheckItemType2 type, gdouble multip,
-                           GtkSpinButton *spin0, GtkSpinButton *spin1)
-{
-    gchar *key;
-    key = g_strdup_printf("Type_%d", index);
-    g_key_file_set_string(key_file, KF_GROUP_ITEMS, key,
-                          CheckItemType2asString(type));
-    g_free(key);
-    key = g_strdup_printf("Coords_%d", index);
-    pcd_key_file_save_xy(key_file, KF_GROUP_ITEMS, key, multip, spin0, spin1);
-    g_free(key);
-}
-
-
-/* This function saves all of the information from the custom check dialog
- *  into a check description file.
- */
-static void
-pcd_save_custom_data(PrintCheckDialog *pcd, const gchar *title)
-{
-    GKeyFile *key_file;
-    GError *error = NULL;
-    GtkWidget *dialog;
-    gdouble multip;
-    gint i = 1;
-    GncGUID guid;
-    char buf[GUID_ENCODING_LENGTH+1];
-    gchar *filename, *pathname;
-
-    multip = pcd_get_custom_multip(pcd);
-
-    key_file = g_key_file_new();
-    guid_new(&guid);
-    guid_to_string_buff(&guid, buf);
-    g_key_file_set_string(key_file, KF_GROUP_TOP, KF_KEY_GUID, buf);
-    g_key_file_set_string(key_file, KF_GROUP_TOP, KF_KEY_TITLE, title);
-    g_key_file_set_boolean(key_file, KF_GROUP_TOP, KF_KEY_SHOW_GRID, FALSE);
-    g_key_file_set_boolean(key_file, KF_GROUP_TOP, KF_KEY_SHOW_BOXES, FALSE);
-    g_key_file_set_double(key_file, KF_GROUP_TOP, KF_KEY_ROTATION,
-                          gtk_spin_button_get_value(pcd->check_rotation));
-    pcd_key_file_save_xy(key_file, KF_GROUP_TOP, KF_KEY_TRANSLATION, multip,
-                         pcd->translation_x, pcd->translation_y);
-
-    pcd_key_file_save_item_xy(key_file, i++, PAYEE, multip,
-                              pcd->payee_x, pcd->payee_y);
-    pcd_key_file_save_item_xy(key_file, i++, DATE, multip,
-                              pcd->date_x, pcd->date_y);
-    pcd_key_file_save_item_xy(key_file, i++, AMOUNT_WORDS, multip,
-                              pcd->words_x, pcd->words_y);
-    pcd_key_file_save_item_xy(key_file, i++, AMOUNT_NUMBER, multip,
-                              pcd->number_x, pcd->number_y);
-    pcd_key_file_save_item_xy(key_file, i++, ADDRESS, multip,
-                              pcd->address_x, pcd->address_y);
-    pcd_key_file_save_item_xy(key_file, i++, NOTES, multip,
-                              pcd->notes_x, pcd->notes_y);
-    pcd_key_file_save_item_xy(key_file, i++, MEMO, multip,
-                              pcd->memo_x, pcd->memo_y);
-    pcd_key_file_save_item_xy(key_file, i++, SPLITS_AMOUNT, multip,
-                              pcd->splits_amount_x, pcd->splits_amount_y);
-    pcd_key_file_save_item_xy(key_file, i++, SPLITS_MEMO, multip,
-                              pcd->splits_memo_x, pcd->splits_memo_y);
-    pcd_key_file_save_item_xy(key_file, i++, SPLITS_ACCOUNT, multip,
-                              pcd->splits_account_x, pcd->splits_account_y);
-
-    filename = g_strconcat(title, CHECK_NAME_EXTENSION, NULL);
-    pathname = g_build_filename(gnc_dotgnucash_dir(), CHECK_FMT_DIR,
-                                filename, NULL);
-
-    if (gnc_key_file_save_to_file(pathname, key_file, &error))
-    {
-        if (!gnc_prefs_get_bool(GNC_PREFS_GROUP, GNC_PREF_PRINT_DATE_FMT))
-            /* Reload the format combo box and reselect the "custom" entry */
-            initialize_format_combobox(pcd);
-
-        gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->format_combobox),
-                                 pcd->format_max - 1);
-    }
-    else
-    {
-        dialog = gtk_message_dialog_new(GTK_WINDOW(pcd->dialog),
-                                        GTK_DIALOG_DESTROY_WITH_PARENT,
-                                        GTK_MESSAGE_ERROR,
-                                        GTK_BUTTONS_CLOSE, "%s",
-                                        _("Cannot save check format file."));
-        gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
-                "%s", error->message);
-        gtk_dialog_run(GTK_DIALOG(dialog));
-        gtk_widget_destroy(dialog);
-        g_error_free(error);
-    }
-    g_free(pathname);
-    g_free(filename);
-}
-
-
-/* This function makes the OK button active iff a title has been entered.
- */
-void
-gnc_check_format_title_changed2 (GtkEditable *editable, GtkWidget *ok_button)
-{
-    const gchar *text;
-    gboolean sensitive;
-
-    text = gtk_entry_get_text(GTK_ENTRY(editable));
-    sensitive = text && *text;
-    gtk_widget_set_sensitive(ok_button, sensitive);
-}
-
-
-/* This function is called when the user clicks the "save format" button in
- * the check printing dialog.  It presents another dialog to the user to get
- * the filename for saving the data.
- */
-void
-gnc_print_check_save_button_clicked2(GtkButton *unused, PrintCheckDialog *pcd)
-{
-    GtkWidget *dialog, *entry, *button;
-    GtkBuilder *builder;
-    gchar *title;
-
-    builder = gtk_builder_new();
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "Format Title Dialog");
-
-    /* Get a title for the new check format. */
-    dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Format Title Dialog"));
-    entry = GTK_WIDGET(gtk_builder_get_object (builder, "format_title"));
-    button = GTK_WIDGET(gtk_builder_get_object (builder, "ok_button"));
-    gnc_check_format_title_changed2(GTK_EDITABLE(entry), button);
-    gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, pcd);
-
-    gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(pcd->dialog));
-    if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_OK)
-    {
-        gtk_widget_destroy(dialog);
-        g_object_unref(G_OBJECT(builder));
-        return;
-    }
-
-    title = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
-    gtk_widget_destroy (dialog);
-
-    g_object_unref(G_OBJECT(builder));
-
-    pcd_save_custom_data(pcd, title);
-    g_free(title);
-}
-
-
-/* This function is an auxiliary debugging function for converting an array of
- * doubles into a printable string.
- */
-static gchar *
-doubles_to_string(gdouble *dd, gint len)
-{
-    GString *str;
-    gint i;
-
-    str = g_string_new_len(NULL, 50);
-    for (i = 0; i < len; i++)
-        g_string_append_printf(str, "%f ", dd[i]);
-    return g_string_free(str, FALSE);
-}
-
-
-/* This function reads in the information describing the placement for each
- * item to be printed on a check.  This information is all relative to the
- * upper left hand corner of a "check".  See the format_read_multicheck_info()
- * function for determining if there are multiple checks on a single page of
- * paper. This data is build into a linked list and saved as part of the check
- * format information.  These items will be printed in the same order they are
- * read, meaning that items listed later in the date file can be printed over
- * top of items that appear earlier in the file.
- */
-static GSList *
-format_read_item_placement(const gchar *file,
-                           GKeyFile *key_file, check_format_t *format)
-{
-    check_item_t *data = NULL;
-    GError *error = NULL;
-    GSList *list = NULL;
-    gchar *key, *value, *name;
-    int item_num;
-    gboolean bval;
-    gdouble *dd;
-    gsize dd_len;
-
-    /* Read until failure. */
-    for (item_num = 1;; item_num++)
-    {
-
-        /* Create the per-item data structure */
-        data = g_new0(check_item_t, 1);
-        if (NULL == data)
-            return list;
-
-        /* Get the item type */
-        key = g_strdup_printf("%s_%d", KF_KEY_TYPE, item_num);
-        value = g_key_file_get_string(key_file, KF_GROUP_ITEMS, key, &error);
-        if (error)
-        {
-            if ((error->domain == G_KEY_FILE_ERROR)
-                    && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND))
-            {
-                /* This is the expected exit from this function. */
-                goto cleanup;
-            }
-            goto failed;
-        }
-        g_debug("Check file %s, group %s, key %s, value: %s",
-                file, KF_GROUP_ITEMS, key, value);
-        g_free(key);
-
-        /* Convert the type from a string to an enum, ignoring case. */
-        name = g_utf8_strup(value, -1);
-        data->type = CheckItemType2fromString(name);
-        g_free(name);
-        g_free(value);
-
-
-        /* Get the item location */
-        key = g_strdup_printf("%s_%d", KF_KEY_COORDS, item_num);
-        dd = g_key_file_get_double_list(key_file, KF_GROUP_ITEMS,
-                                        key, &dd_len, &error);
-        if (error)
-            goto failed;
-        value = doubles_to_string(dd, dd_len);
-        g_debug("Check file %s, group %s, key %s, length %"G_GSIZE_FORMAT"; values: %s",
-                file, KF_GROUP_ITEMS, key, dd_len, value);
-        g_free(value);
-
-        /* Must have "x;y" or "x;y;w;h". */
-        switch (dd_len)
-        {
-        case 4:
-            data->w = dd[2];
-            data->h = dd[3];
-            /* fall through */
-        case 2:
-            data->x = dd[0];
-            data->y = dd[1];
-            break;
-        default:
-            g_warning
-            ("Check file %s, group %s, key %s, error: 2 or 4 values only",
-             file, KF_GROUP_ITEMS, key);
-            goto cleanup;
-        }
-        g_free(dd);
-        g_free(key);
-
-        /* Any text item can specify:
-         *   a font  FONT_n
-         *   an alignment if a width was provided for the item  ALIGN_n
-         *   blocking chars flag  BLOCKING_CHARS_n
-         * These values are optional and do not cause a failure if they are missing. */
-
-        if (data->type != PICTURE)
-        {
-            key = g_strdup_printf("%s_%d", KF_KEY_FONT, item_num);
-            data->font =
-                g_key_file_get_string(key_file, KF_GROUP_ITEMS, key, &error);
-            if (!error)
-            {
-                g_debug("Check file %s, group %s, key %s, value: %s",
-                        file, KF_GROUP_ITEMS, key, data->font);
-            }
-            else
-            {
-                if (!((error->domain == G_KEY_FILE_ERROR)
-                        && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
-                    g_warning("Check file %s, group %s, key %s, error: %s",
-                              file, KF_GROUP_ITEMS, key, error->message);
-                g_clear_error(&error);
-            }
-            g_free(key);
-
-            key = g_strdup_printf("%s_%d", KF_KEY_ALIGN, item_num);
-            value =
-                g_key_file_get_string(key_file, KF_GROUP_ITEMS, key, &error);
-            if (!error)
-            {
-                g_debug("Check file %s, group %s, key %s, value: %s",
-                        file, KF_GROUP_ITEMS, key, value);
-                name = g_utf8_strdown(value, -1);
-                if (strcmp(name, "right") == 0)
-                    data->align = PANGO_ALIGN_RIGHT;
-                else if (strcmp(name, "center") == 0)
-                    data->align = PANGO_ALIGN_CENTER;
-                else
-                    data->align = PANGO_ALIGN_LEFT;
-                g_free(name);
-                g_free(value);
-            }
-            else
-            {
-                if (!((error->domain == G_KEY_FILE_ERROR)
-                        && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
-                    g_warning("Check file %s, group %s, key %s, error: %s",
-                              file, KF_GROUP_ITEMS, key, error->message);
-                data->align = PANGO_ALIGN_LEFT;
-                g_clear_error(&error);
-            }
-            g_free(key);
-
-            key = g_strdup_printf("%s_%d", KF_KEY_BLOCKING, item_num);
-            bval =
-                g_key_file_get_boolean(key_file, KF_GROUP_ITEMS, key, &error);
-            if (!error)
-            {
-                g_debug("Check file %s, group %s, key %s, value: %d",
-                        file, KF_GROUP_ITEMS, key, bval);
-                data->blocking = bval;
-            }
-            else
-            {
-                if (!((error->domain == G_KEY_FILE_ERROR)
-                        && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
-                    g_warning("Check file %s, group %s, key %s, error: %s",
-                              file, KF_GROUP_ITEMS, key, error->message);
-                data->blocking = format->blocking;
-                g_clear_error(&error);
-            }
-            g_free(key);
-        }
-        /* Get any extra data for specific items. */
-        switch (data->type)
-        {
-        case PICTURE:
-            key = g_strdup_printf("%s_%d", KF_KEY_FILENAME, item_num);
-            data->filename =
-                g_key_file_get_string(key_file, KF_GROUP_ITEMS, key,
-                                      &error);
-            if (error)
-                goto failed;
-            g_debug("Check file %s, group %s, key %s, value: %s",
-                    file, KF_GROUP_ITEMS, key, data->filename);
-            g_free(key);
-            break;
-        case TEXT:
-            key = g_strdup_printf("%s_%d", KF_KEY_TEXT, item_num);
-            data->text =
-                g_key_file_get_string(key_file, KF_GROUP_ITEMS, key,
-                                      &error);
-            if (error)
-                goto failed;
-            g_debug("Check file %s, group %s, key %s, value: %s",
-                    file, KF_GROUP_ITEMS, key, data->text);
-            g_free(key);
-            break;
-        case DATE:
-            /* no error if the date_format is not present */
-            key = g_strdup_printf("%s_%d", KF_KEY_DATE_FORMAT, item_num);
-            bval = g_key_file_get_boolean(key_file, KF_GROUP_ITEMS, key, &error);
-            if (!error)
-            {
-                g_debug("Check file %s, group %s, key %s, value: %d",
-                        file, KF_GROUP_ITEMS, key, bval);
-                data->print_date_format = bval;
-            }
-            else
-            {
-                if (!((error->domain == G_KEY_FILE_ERROR)
-                        && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
-                    g_warning("Check file %s, group %s, key %s, error: %s",
-                              file, KF_GROUP_ITEMS, key, error->message);
-                data->print_date_format = format->print_date_format;
-                g_clear_error(&error);
-            }
-            g_free(key);
-            break;
-        default:
-            break;
-        }
-
-        list = g_slist_append(list, data);
-        data = NULL;
-    }
-
-    /* Should never be reached. */
-    return list;
-
-failed:
-    g_warning("Check file %s, group %s, key %s, error: %s",
-              file, KF_GROUP_ITEMS, key, error->message);
-cleanup:
-    if (error)
-        g_error_free(error);
-    if (data)
-        g_free(data);
-    if (key)
-        g_free(key);
-    return list;
-}
-
-
-/* Free the data describing the placement of a single item on a check.
- */
-static void
-format_free_item_placement(check_item_t *data)
-{
-    if (data->font)
-        g_free(data->font);
-    if (data->text)
-        g_free(data->text);
-    if (data->filename)
-        g_free(data->filename);
-    g_free(data);
-}
-
-
-/* Read the information describing whether a page contains multiple checks or
- * a single check.  If there are multiple checks on a page, this functions
- * builds a linked list of the position names and their offsets (from the
- * upper left corner of the page).
- */
-static GSList *
-format_read_multicheck_info(const gchar *file,
-                            GKeyFile *key_file, check_format_t *format)
-{
-    GError *error = NULL;
-    GSList *list = NULL;
-    gchar *key, **names;
-    gsize length;
-    gint i;
-
-    key = g_strdup_printf("%s", KF_KEY_HEIGHT);
-    format->height = g_key_file_get_double(key_file, KF_GROUP_POS, key, &error);
-    if (error)
-    {
-        if ((error->domain == G_KEY_FILE_ERROR)
-                && ((error->code == G_KEY_FILE_ERROR_GROUP_NOT_FOUND)
-                    || (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
-        {
-            g_clear_error(&error);
-            format->height = 0.0;
-        }
-        else
-        {
-            g_warning("Check file %s, error reading group %s, key %s: %s",
-                      file, KF_GROUP_POS, key, error->message);
-            g_free(key);
-            return NULL;
-        }
-    }
-
-    names = g_key_file_get_string_list(key_file, KF_GROUP_POS, KF_KEY_NAMES,
-                                       &length, &error);
-    if (error)
-    {
-        if ((error->domain == G_KEY_FILE_ERROR)
-                && ((error->code == G_KEY_FILE_ERROR_GROUP_NOT_FOUND)
-                    || (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
-        {
-            /* This is the expected exit from this function. */
-            g_free(key);
-            return NULL;
-        }
-        g_warning("Check file %s, error reading group %s, key %s: %s",
-                  file, KF_GROUP_POS, key, error->message);
-        g_free(key);
-        return list;
-    }
-
-    for (i = 0; i < length; i++)
-        list = g_slist_append(list, g_strdup(names[i]));
-
-    g_strfreev(names);
-    return list;
-}
-
-
-/* Free the data describing the placement of multiple checks on a page.
- */
-static void
-free_check_position(gchar *name)
-{
-    g_free(name);
-}
-
-
-/* Read the information describing the general layout of a page of checks.
- * All items in this section are optional except or the name of the check
- * style.
- */
-static gboolean
-format_read_general_info(const gchar *file,
-                         GKeyFile *key_file, check_format_t *format)
-{
-    GError *error = NULL;
-    gchar **parts;
-    gchar *value;
-    double *dd;
-    gsize dd_len;
-
-    value = g_key_file_get_string(key_file, KF_GROUP_TOP, KF_KEY_GUID, &error);
-    if (error)
-    {
-        g_warning("Check file %s, group %s, key %s, error: %s",
-                  file, KF_GROUP_TOP, KF_KEY_GUID, error->message);
-        g_error_free(error);
-        return FALSE;
-    }
-    parts = g_strsplit(value, "-", -1);
-    format->guid = g_strjoinv("", parts);
-    g_strfreev(parts);
-    g_debug("Check file %s, group %s, key %s, value: %s",
-            file, KF_GROUP_TOP, KF_KEY_GUID, format->guid);
-
-    format->title =
-        g_key_file_get_string(key_file, KF_GROUP_TOP, KF_KEY_TITLE, &error);
-    if (!error)
-    {
-        g_debug("Check file %s, group %s, key %s, value: %s",
-                file, KF_GROUP_TOP, KF_KEY_TITLE, format->title);
-    }
-    else
-    {
-        g_warning("Check file %s, group %s, key %s, error: %s",
-                  file, KF_GROUP_TOP, KF_KEY_TITLE, error->message);
-        return FALSE;
-    }
-
-    format->blocking =
-        g_key_file_get_boolean(key_file, KF_GROUP_TOP, KF_KEY_BLOCKING,
-                               &error);
-    if (!error)
-    {
-        g_debug("Check file %s, group %s, key %s, value: %d",
-                file, KF_GROUP_TOP, KF_KEY_BLOCKING, format->blocking);
-    }
-    else
-    {
-        if (!((error->domain == G_KEY_FILE_ERROR)
-                && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
-            g_warning("Check file %s, group %s, key %s, error: %s",
-                      file, KF_GROUP_TOP, KF_KEY_BLOCKING, error->message);
-        if ( gnc_prefs_get_bool(GNC_PREFS_GROUP, GNC_PREF_BLOCKING_CHARS) )
-        {
-            format->blocking = TRUE;
-        }
-        else
-        {
-            format->blocking = FALSE;
-        }
-        g_clear_error(&error);
-    }
-
-    format->print_date_format =
-        g_key_file_get_boolean(key_file, KF_GROUP_TOP, KF_KEY_DATE_FORMAT,
-                               &error);
-    if (!error)
-    {
-        g_debug("Check file %s, group %s, key %s, value: %d",
-                file, KF_GROUP_TOP, KF_KEY_DATE_FORMAT, format->print_date_format);
-    }
-    else
-    {
-        if (!((error->domain == G_KEY_FILE_ERROR)
-                && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
-            g_warning("Check file %s, group %s, key %s, error: %s",
-                      file, KF_GROUP_TOP, KF_KEY_DATE_FORMAT, error->message);
-        if ( gnc_prefs_get_bool(GNC_PREFS_GROUP, GNC_PREF_PRINT_DATE_FMT) )
-        {
-            format->print_date_format = TRUE;
-        }
-        else
-        {
-            format->print_date_format = FALSE;
-        }
-        g_clear_error(&error);
-    }
-
-    format->show_grid =
-        g_key_file_get_boolean(key_file, KF_GROUP_TOP, KF_KEY_SHOW_GRID,
-                               &error);
-    if (!error)
-    {
-        g_debug("Check file %s, group %s, key %s, value: %d",
-                file, KF_GROUP_TOP, KF_KEY_SHOW_GRID, format->show_grid);
-    }
-    else
-    {
-        if (!((error->domain == G_KEY_FILE_ERROR)
-                && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
-            g_warning("Check file %s, group %s, key %s, error: %s",
-                      file, KF_GROUP_TOP, KF_KEY_SHOW_GRID, error->message);
-        format->show_grid = FALSE;
-        g_clear_error(&error);
-    }
-
-    format->show_boxes =
-        g_key_file_get_boolean(key_file, KF_GROUP_TOP, KF_KEY_SHOW_BOXES,
-                               &error);
-    if (!error)
-    {
-        g_debug("Check file %s, group %s, key %s, value: %d",
-                file, KF_GROUP_TOP, KF_KEY_SHOW_BOXES, format->show_boxes);
-    }
-    else
-    {
-        if (!((error->domain == G_KEY_FILE_ERROR)
-                && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
-            g_warning("Check file %s, group %s, key %s, error: %s",
-                      file, KF_GROUP_TOP, KF_KEY_SHOW_BOXES, error->message);
-        format->show_boxes = FALSE;
-        g_clear_error(&error);
-    }
-
-    format->font =
-        g_key_file_get_string(key_file, KF_GROUP_TOP, KF_KEY_FONT, &error);
-    if (!error)
-    {
-        g_debug("Check file %s, group %s, key %s, value: %s",
-                file, KF_GROUP_TOP, KF_KEY_FONT, format->font);
-    }
-    else
-    {
-        if (!((error->domain == G_KEY_FILE_ERROR)
-                && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
-            g_warning("Check file %s, group %s, key %s, error: %s",
-                      file, KF_GROUP_TOP, KF_KEY_FONT, error->message);
-        g_clear_error(&error);
-    }
-
-    format->rotation =
-        g_key_file_get_double(key_file, KF_GROUP_TOP, KF_KEY_ROTATION, &error);
-    if (!error)
-    {
-        g_debug("Check file %s, group %s, key %s, value: %f",
-                file, KF_GROUP_TOP, KF_KEY_ROTATION, format->rotation);
-    }
-    else
-    {
-        if (!((error->domain == G_KEY_FILE_ERROR)
-                && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
-            g_warning("Check file %s, group %s, key %s, error: %s",
-                      file, KF_GROUP_TOP, KF_KEY_ROTATION, error->message);
-        format->rotation = 0.0;
-        g_clear_error(&error);
-    }
-
-    dd = g_key_file_get_double_list(key_file, KF_GROUP_TOP, KF_KEY_TRANSLATION,
-                                    &dd_len, &error);
-    if (!error)
-    {
-        value = doubles_to_string(dd, dd_len);
-        g_debug("Check file %s, group %s, key %s, length %"G_GSIZE_FORMAT"; values: %s",
-                file, KF_GROUP_TOP, KF_KEY_TRANSLATION, dd_len, value);
-        g_free(value);
-
-        if (dd_len == 2)
-        {
-            format->trans_x = dd[0];
-            format->trans_y = dd[1];
-        }
-        else
-        {
-            g_warning("Check file %s, error top %s, key %s: 2 values only",
-                      file, KF_GROUP_TOP, KF_KEY_TRANSLATION);
-        }
-        g_free(dd);
-    }
-    else
-    {
-        if (!((error->domain == G_KEY_FILE_ERROR)
-                && (error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)))
-            g_warning("Check file %s, group top %s, key %s: %s",
-                      file, KF_GROUP_ITEMS, KF_KEY_TRANSLATION, error->message);
-        g_clear_error(&error);
-    }
-
-    return TRUE;
-}
-
-
-/* Free all of the information describing a page of checks.
- */
-static void
-free_check_format(check_format_t *data)
-{
-    g_free(data->guid);
-    g_free(data->filename);
-    g_free(data->title);
-    g_free(data->font);
-    g_slist_foreach(data->positions, (GFunc) free_check_position, NULL);
-    g_slist_free(data->positions);
-    g_slist_foreach(data->items, (GFunc) format_free_item_placement, NULL);
-    g_slist_free(data->items);
-    g_free(data);
-}
-
-
-/* Read a single check format file and append the resulting format to the
- * list of all known formats.  This function calls other functions to read
- * each section of the data file.
- */
-static check_format_t *
-read_one_check_format(PrintCheckDialog *pcd, const gchar *groupname,
-                      const gchar *dirname, const gchar *file)
-{
-    gchar *pathname;
-    GKeyFile *key_file;
-    check_format_t *format;
-
-    pathname = g_build_filename(dirname, file, (char *)NULL);
-    key_file = gnc_key_file_load_from_file(pathname, FALSE, FALSE, NULL);
-    g_free(pathname);
-    if (!key_file)
-    {
-        g_warning("Check file %s, cannot load file", file);
-        return NULL;
-    }
-
-    format = g_new0(check_format_t, 1);
-    format->group = groupname;
-    format->filename = g_strdup(file);
-    if (format_read_general_info(file, key_file, format))
-    {
-        format->positions = format_read_multicheck_info(file, key_file, format);
-        format->items = format_read_item_placement(file, key_file, format);
-    }
-
-    g_key_file_free(key_file);
-    if ((NULL == format->title) || (NULL == format->items))
-    {
-        g_warning("Check file %s, no items read. Dropping file.", file);
-        free_check_format(format);
-        return NULL;
-    }
-
-    return format;
-}
-
-
-/* Iterate over a single check directory, throwing out any backup files and
- * then calling a helper function to read and parse the check format withing
- * the file.
- */
-static void
-read_one_check_directory(PrintCheckDialog *pcd, GtkListStore *store,
-                         const gchar *groupname, const gchar *dirname)
-{
-    check_format_t *format, *existing;
-    GDir *dir;
-    const gchar *filename;
-    GtkTreeIter iter;
-    GtkWidget *dialog;
-    gboolean found = FALSE;
-
-    dir = g_dir_open(dirname, 0, NULL);
-    if (dir == NULL)
-        return;
-
-    while ((filename = g_dir_read_name(dir)) != NULL)
-    {
-        if (g_str_has_prefix(filename, "#"))
-            continue;
-        if (!g_str_has_suffix(filename, ".chk"))
-            continue;
-
-        format = read_one_check_format(pcd, groupname, dirname, filename);
-        if (NULL == format)
-            continue;
-
-        existing = find_existing_format(store, format->guid, NULL);
-        if (existing)
-        {
-            dialog = gtk_message_dialog_new
-                     (GTK_WINDOW(pcd->dialog),
-                      GTK_DIALOG_DESTROY_WITH_PARENT,
-                      GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s",
-                      _("There is a duplicate check format file."));
-            gtk_message_dialog_format_secondary_text
-            (GTK_MESSAGE_DIALOG(dialog),
-             /* Translators: %1$s is the type of the first check
-              * format (user defined or application defined); %2$s
-              * is the filename of that format; %3$s the type of
-              * the other check format; and %4$s the filename of
-              * that other format. */
-             _("The GUIDs in the %s check format file '%s' and "
-               "the %s check format file '%s' match."),
-             existing->group, existing->filename,
-             format->group, format->filename);
-            gtk_dialog_run(GTK_DIALOG(dialog));
-            gtk_widget_destroy(dialog);
-        }
-        else
-        {
-            gtk_list_store_append(store, &iter);
-            gtk_list_store_set(store, &iter, COL_NAME, format->title,
-                               COL_DATA, format, -1);
-            found = TRUE;
-        }
-    }
-    g_dir_close(dir);
-
-    /* If any files were added to the list, add a separator between
-     *  this group and the next. */
-    if (found)
-    {
-        gtk_list_store_append(store, &iter);
-        gtk_list_store_set(store, &iter, COL_SEP, TRUE, -1);
-    }
-}
-
-
-/* Read all check formats.  This function first looks in the system directory
- * for check files, and then looks in the user's .gnucash directory for any
- * custom check files.
- */
-static void
-read_formats(PrintCheckDialog *pcd, GtkListStore *store)
-{
-    gchar *dirname, *pkgdatadir;
-
-    pkgdatadir = gnc_path_get_pkgdatadir();
-    dirname = g_build_filename(pkgdatadir, CHECK_FMT_DIR, (char *)NULL);
-    /* Translators: This is a directory name. It may be presented to
-     * the user to indicate that some data file was defined by the
-     * gnucash application. */
-    read_one_check_directory(pcd, store, _("application"), dirname);
-    g_free(dirname);
-    g_free(pkgdatadir);
-
-    dirname = gnc_build_dotgnucash_path(CHECK_FMT_DIR);
-    /* Translators: This is a directory name. It may be presented to
-     * the user to indicate that some data file was defined by a
-     * user herself. */
-    read_one_check_directory(pcd, store, _("user"), dirname);
-    g_free(dirname);
-}
-
-
-static gboolean
-format_is_a_separator (GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
-{
-    gboolean separator;
-
-    gtk_tree_model_get(model, iter, COL_SEP, &separator, -1);
-    return separator;
-}
-
-
-static void
-initialize_format_combobox (PrintCheckDialog *pcd)
-{
-    GtkListStore *store;
-    GtkTreeIter iter;
-
-    store = gtk_list_store_new(3, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_BOOLEAN);
-    read_formats(pcd, store);
-    gtk_list_store_append(store, &iter);
-    gtk_list_store_set(store, &iter, COL_NAME, _("Custom"), -1);
-    pcd->format_max = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), NULL);
-    gtk_combo_box_set_model(GTK_COMBO_BOX(pcd->format_combobox),
-                            GTK_TREE_MODEL(store));
-    gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(pcd->format_combobox),
-                                         format_is_a_separator, NULL, NULL);
-}
-
-
-/*****************************************************
- * gnc_ui_print_check_dialog_create2                  *
- * make a new print check dialog and wait for it.    *
- *****************************************************/
-void
-gnc_ui_print_check_dialog_create2(GncPluginPageRegister2 *plugin_page,
-                                 GList *splits)
-{
-    PrintCheckDialog *pcd;
-    GtkBuilder *builder;
-    GtkWidget *table;
-    GtkWindow *window;
-    gchar *font;
-    Transaction *trans = NULL;
-
-    pcd = g_new0(PrintCheckDialog, 1);
-    pcd->plugin_page = plugin_page;
-    pcd->splits = g_list_copy(splits);
-
-    builder = gtk_builder_new();
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment1");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment2");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment3");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment4");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment5");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment6");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment7");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment8");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment9");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment10");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment11");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment12");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment13");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment14");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment15");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment16");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment17");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment18");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment19");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment20");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment21");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment22");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment23");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "adjustment24");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "liststore1");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "liststore2");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "liststore3");
-    gnc_builder_add_from_file (builder, "dialog-print-check.glade", "Print Check Dialog");
-
-    gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, pcd);
-
-    pcd->builder = builder;
-    pcd->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Print Check Dialog"));
-
-    /* now pick out the relevant child widgets */
-    pcd->format_combobox = GTK_WIDGET(gtk_builder_get_object (builder, "check_format_combobox"));
-    pcd->position_combobox = GTK_WIDGET(gtk_builder_get_object (builder, "check_position_combobox"));
-    pcd->first_page_count = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "first_page_count_entry"));
-
-    pcd->custom_table = GTK_WIDGET(gtk_builder_get_object (builder, "custom_table"));
-    pcd->payee_x = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "payee_x_entry"));
-    pcd->payee_y = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "payee_y_entry"));
-    pcd->date_x = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "date_x_entry"));
-    pcd->date_y = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "date_y_entry"));
-    pcd->words_x = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "amount_words_x_entry"));
-    pcd->words_y = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "amount_words_y_entry"));
-    pcd->number_x = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "amount_numbers_x_entry"));
-    pcd->number_y = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "amount_numbers_y_entry"));
-    pcd->notes_x = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "notes_x_entry"));
-    pcd->notes_y = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "notes_y_entry"));
-    pcd->memo_x = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "memo_x_entry"));
-    pcd->memo_y = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "memo_y_entry"));
-    pcd->address_x = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "address_x_entry"));
-    pcd->address_y = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "address_y_entry"));
-    pcd->splits_amount_x = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "splits_amount_x_entry"));
-    pcd->splits_amount_y = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "splits_amount_y_entry"));
-    pcd->splits_memo_x = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "splits_memo_x_entry"));
-    pcd->splits_memo_y = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "splits_memo_y_entry"));
-    pcd->splits_account_x = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "splits_account_x_entry"));
-    pcd->splits_account_y = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "splits_account_y_entry"));
-    pcd->translation_x = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "translation_x_entry"));
-    pcd->translation_y = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "translation_y_entry"));
-    pcd->translation_label = GTK_WIDGET(gtk_builder_get_object (builder, "translation_label"));
-    pcd->check_rotation = GTK_SPIN_BUTTON(gtk_builder_get_object (builder, "check_rotation_entry"));
-    pcd->units_combobox = GTK_WIDGET(gtk_builder_get_object (builder, "units_combobox"));
-
-    window = GTK_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window);
-    gtk_window_set_transient_for(GTK_WINDOW(pcd->dialog), window);
-    pcd->caller_window = GTK_WINDOW(window);
-
-    /* Create and attach the date-format chooser */
-    table = GTK_WIDGET(gtk_builder_get_object (builder, "options_table"));
-    pcd->date_format = gnc_date_format_new_without_label();
-    gtk_table_attach_defaults(GTK_TABLE(table), pcd->date_format, 1, 3, 4, 7);
-
-    /* Default font (set in preferences) */
-    font = gnc_prefs_get_string(GNC_PREFS_GROUP, GNC_PREF_DEFAULT_FONT);
-    pcd->default_font = font ? font : g_strdup(DEFAULT_FONT);
-
-    /* Update the combo boxes bases on the available check formats */
-    initialize_format_combobox(pcd);
-
-    /* address */
-    pcd->check_address_name = GTK_WIDGET(gtk_builder_get_object (builder, "check_address_name"));
-    pcd->check_address_1 = GTK_WIDGET(gtk_builder_get_object (builder, "check_address_1"));
-    pcd->check_address_2 = GTK_WIDGET(gtk_builder_get_object (builder, "check_address_2"));
-    pcd->check_address_3 = GTK_WIDGET(gtk_builder_get_object (builder, "check_address_3"));
-    pcd->check_address_4 = GTK_WIDGET(gtk_builder_get_object (builder, "check_address_4"));
-    /* fill in any available address data */
-    /* Can't access business objects e.g. Customer,Vendor,Employee because
-     * it would create build problems */
-    if (g_list_length(pcd->splits) == 1)
-        trans = xaccSplitGetParent((Split *)(pcd->splits->data));
-    else
-        trans = NULL;
-    if ( trans )
-    {
-        gtk_entry_set_text(GTK_ENTRY(pcd->check_address_name), xaccTransGetDescription(trans));
-    }
-    else
-    {
-        /* nothing to do - defaults to blank */
-    }
-
-    gtk_widget_destroy(GTK_WIDGET(gtk_builder_get_object (builder, "lower_left")));
-
-    gnc_ui_print_restore_dialog(pcd);
-    gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(pcd->dialog));
-
-    g_object_unref(G_OBJECT(builder));
-    gtk_widget_show_all(pcd->dialog);
-}
-
-
-/**************************************
- * Print check contents to the page.  *
- **************************************/
-
-/* Draw a grid pattern on the page to be printed.  This grid is helpful when
- * figuring out the offsets for where to print various items on the page.
- */
-static void
-draw_grid(GtkPrintContext *context, gint width, gint height, const gchar *font)
-{
-    const double dash_pattern[2] = { 1.0, 5.0 };
-    PangoFontDescription *desc;
-    PangoLayout *layout;
-    cairo_t *cr;
-    gchar *text;
-    gint i;
-
-    /* Initialize for printing text */
-    layout = gtk_print_context_create_pango_layout(context);
-    desc = pango_font_description_from_string(font);
-    pango_layout_set_font_description(layout, desc);
-    pango_font_description_free(desc);
-    pango_layout_set_alignment(layout, PANGO_ALIGN_LEFT);
-    pango_layout_set_width(layout, -1);
-
-    /* Set up the line to draw with. */
-    cr = gtk_print_context_get_cairo_context(context);
-    cairo_save(cr);
-    cairo_set_line_width(cr, 1.0);
-    cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND);
-    cairo_set_dash(cr, dash_pattern, 2, 0);
-
-    /* Draw horizontal lines */
-    for (i = -200; i < (height + 200); i += 50)
-    {
-        text = g_strdup_printf("%d", (int)i);
-        cairo_move_to(cr, -200, i);
-        cairo_line_to(cr, width + 200, i);
-        cairo_stroke(cr);
-        pango_layout_set_text(layout, text, -1);
-        cairo_move_to(cr, 0, i);
-        pango_cairo_show_layout(cr, layout);
-        g_free(text);
-    }
-
-    /* Draw vertical lines */
-    for (i = -200; i < (width + 200); i += 50)
-    {
-        text = g_strdup_printf("%d", (int)i);
-        cairo_move_to(cr, i, -200);
-        cairo_line_to(cr, i, height + 200);
-        cairo_stroke(cr);
-        pango_layout_set_text(layout, text, -1);
-        cairo_move_to(cr, i, 0);
-        pango_cairo_show_layout(cr, layout);
-        g_free(text);
-    }
-
-    /* Clean up after ourselves */
-    cairo_restore(cr);
-    g_object_unref(layout);
-}
-
-
-/* Print a single line of text to the printed page.  If a width and height
- * are specified, the line will be wrapped at the specified width, and the
- * resulting text will be clipped if it does not fit in the space
- * available.
- */
-static gdouble
-draw_text(GtkPrintContext *context, const gchar *text, check_item_t *data,
-          PangoFontDescription *default_desc)
-{
-    PangoFontDescription *desc;
-    PangoLayout *layout;
-    cairo_t *cr;
-    gint layout_height, layout_width;
-    gdouble width, height;
-    gchar *new_text;
-
-    if ((NULL == text) || (strlen(text) == 0))
-        return 0.0;
-
-    /* Initialize for printing text */
-    layout = gtk_print_context_create_pango_layout(context);
-    if (data->font)
-    {
-        desc = pango_font_description_from_string(data->font);
-        pango_layout_set_font_description(layout, desc);
-        pango_font_description_free(desc);
-    }
-    else
-    {
-        pango_layout_set_font_description(layout, default_desc);
-    }
-    pango_layout_set_alignment(layout,
-                               data->w ? data->align : PANGO_ALIGN_LEFT);
-    pango_layout_set_width(layout, data->w ? data->w * PANGO_SCALE : -1);
-    pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_END);
-    if ( data->blocking )
-    {
-        new_text = g_strdup_printf("***%s***", text);
-        pango_layout_set_text(layout, new_text, -1);
-        g_free(new_text);
-    }
-    else
-    {
-        pango_layout_set_text(layout, text, -1);
-    }
-    pango_layout_get_size(layout, &layout_width, &layout_height);
-    width = (gdouble) layout_width / PANGO_SCALE;
-    height = (gdouble) layout_height / PANGO_SCALE;
-
-    cr = gtk_print_context_get_cairo_context(context);
-    cairo_save(cr);
-
-    /* Clip text to the enclosing rectangle */
-    if (data->w && data->h)
-    {
-        g_debug("Text clip rectangle, coords %f,%f, size %f,%f",
-                data->x, data->y - data->h, data->w, data->h);
-        cairo_rectangle(cr, data->x, data->y - data->h, data->w, data->h);
-        cairo_clip_preserve(cr);
-    }
-
-    /* Draw the text */
-    g_debug("Text move to %f,%f, print '%s'", data->x, data->y,
-            text ? text : "(null)");
-    cairo_move_to(cr, data->x, data->y - height);
-    pango_cairo_show_layout(cr, layout);
-
-    /* Clean up after ourselves */
-    cairo_restore(cr);
-    g_object_unref(layout);
-    return width;
-
-}
-
-
-/* Find and load the specified image.  If the specified filename isn't an
- * absolute path name, this code will also look in the gnucash system check
- * format directory, and then in the user's private check format
- * directory.
- *
- * NOTE: The gtk_image_new_from_file() function never fails.  If it can't
- * find the specified file, it returns the "broken image" icon.  This function
- * takes advantage of that.
-*/
-static GtkWidget *
-read_image (const gchar *filename)
-{
-    GtkWidget *image;
-    gchar *pkgdatadir, *dirname, *tmp_name;
-
-    if (g_path_is_absolute(filename))
-        return gtk_image_new_from_file(filename);
-
-    pkgdatadir = gnc_path_get_pkgdatadir();
-    tmp_name = g_build_filename(pkgdatadir, CHECK_FMT_DIR, filename, (char *)NULL);
-    if (!g_file_test(tmp_name, G_FILE_TEST_EXISTS))
-    {
-        g_free(tmp_name);
-        dirname = gnc_build_dotgnucash_path(CHECK_FMT_DIR);
-        tmp_name = g_build_filename(dirname, filename, (char *)NULL);
-        g_free(dirname);
-    }
-    image = gtk_image_new_from_file(tmp_name);
-    g_free(tmp_name);
-    return image;
-}
-
-
-/* Print a single image to the printed page.  This picture will be scaled
- * down to fit in the specified size rectangle.  Scaling is done with the
- * proportions locked 1:1 so as not to distort the image.
- */
-static void
-draw_picture(GtkPrintContext *context, check_item_t *data)
-{
-    cairo_t *cr;
-    GdkPixbuf *pixbuf, *scaled_pixbuf;
-    GtkImage *image;
-    gint pix_w, pix_h;
-    gdouble scale_w, scale_h, scale;
-
-    cr = gtk_print_context_get_cairo_context(context);
-    cairo_save(cr);
-
-    /* Get the picture. */
-    image = GTK_IMAGE(read_image(data->filename));
-    pixbuf = gtk_image_get_pixbuf(image);
-    if (pixbuf)
-    {
-        g_object_ref(pixbuf);
-    }
-    else
-    {
-        g_warning("Filename '%s' cannot be read or understood.",
-                  data->filename);
-        pixbuf = gtk_widget_render_icon(GTK_WIDGET(image),
-                                        GTK_STOCK_MISSING_IMAGE,
-                                        -1, NULL);
-    }
-    pix_w = gdk_pixbuf_get_width(pixbuf);
-    pix_h = gdk_pixbuf_get_height(pixbuf);
-
-    /* Draw the enclosing rectangle */
-    if (data->w && data->h)
-    {
-        cairo_rectangle(cr, data->x, data->y - data->h, data->w, data->h);
-        g_debug("Picture clip rectangle, user coords %f,%f, user size %f,%f",
-                data->x, data->y - data->h, data->w, data->h);
-    }
-    else
-    {
-        cairo_rectangle(cr, data->x, data->y - pix_h, pix_w, pix_h);
-        g_debug("Picture clip rectangle, user coords %f,%f, pic size %d,%d",
-                data->x, data->y - data->h, pix_w, pix_h);
-    }
-    cairo_clip_preserve(cr);
-
-    /* Scale down to fit.  Never scale up. */
-    scale_w = scale_h = 1;
-    if (data->w && (pix_w > data->w))
-        scale_w = data->w / pix_w;
-    if (data->h && (pix_h > data->h))
-        scale_h = data->h / pix_h;
-    scale = MIN(scale_w, scale_h);
-
-    if (scale != 1)
-    {
-        scaled_pixbuf = gdk_pixbuf_scale_simple(pixbuf, pix_w * scale,
-                                                pix_h * scale,
-                                                GDK_INTERP_BILINEAR);
-        pix_h = gdk_pixbuf_get_height(scaled_pixbuf);
-        gdk_cairo_set_source_pixbuf(cr, scaled_pixbuf, data->x,
-                                    data->y - pix_h);
-
-        g_object_unref(scaled_pixbuf);
-    }
-    else
-    {
-        gdk_cairo_set_source_pixbuf(cr, pixbuf, data->x, data->y - pix_h);
-    }
-    g_object_unref(pixbuf);
-    cairo_paint(cr);
-
-    /* Clean up after ourselves */
-    cairo_restore(cr);
-    gtk_widget_destroy(GTK_WIDGET(image));
-}
-
-
-#define DATE_FMT_HEIGHT 8
-#define DATE_FMT_SLOP   2
-
-/* There is a new Canadian requirement that all software that prints the date
- * on a check must also print the format of that date underneath using a 6-8
- * point font.  This function implements that requirement.  It requires the
- * font description used in printing the date so that it can print in the same
- * font using a smaller point size.  It also requires width of the printed
- * date as an argument, allowing it to center the format string under the
- * date.
- *
- * Note: This code only prints a date if the user has explicitly requested it
- * via a preference setting.  This is because gnucash has no way of
- * knowing if the user's checks already have a date format printed on them.
- */
-static void
-draw_date_format(GtkPrintContext *context, const gchar *date_format,
-                 check_item_t *data, PangoFontDescription *default_desc,
-                 gdouble width)
-{
-    PangoFontDescription *date_desc;
-    check_item_t date_item;
-    gchar *text = NULL, *expanded = NULL;
-    const gchar *c;
-    GString *cdn_fmt;
-
-    setlocale(LC_ALL, NULL);
-    if ( !data->print_date_format ) return;
-
-    date_desc = pango_font_description_copy_static(default_desc);
-    pango_font_description_set_size(date_desc, DATE_FMT_HEIGHT * PANGO_SCALE);
-    date_item = *data;
-    date_item.y += (DATE_FMT_HEIGHT + DATE_FMT_SLOP);
-    date_item.w = width;
-    date_item.h = DATE_FMT_HEIGHT + DATE_FMT_SLOP;
-    date_item.align = PANGO_ALIGN_CENTER;
-
-    /* This is a date format string. It should only contain ascii. */
-    cdn_fmt = g_string_new_len(NULL, 50);
-    for (c = date_format; c && *c; )
-    {
-        if ((c[0] != '%') || (c[1] == '\0'))
-        {
-            c += 1;
-            continue;
-        }
-        switch (c[1])
-        {
-        case 'F':
-            cdn_fmt = g_string_append(cdn_fmt, "YYYYMMDD");
-            break;
-        case 'Y':
-            cdn_fmt = g_string_append(cdn_fmt, "YYYY");
-            break;
-        case 'y':
-            cdn_fmt = g_string_append(cdn_fmt, "YY");
-            break;
-        case 'm':
-            cdn_fmt = g_string_append(cdn_fmt, "MM");
-            break;
-        case 'd':
-        case 'e':
-            cdn_fmt = g_string_append(cdn_fmt, "DD");
-            break;
-        case 'x':
-            expanded = g_strdup_printf("%s%s",
-                                       qof_date_format_get_string(QOF_DATE_FORMAT_LOCALE),
-                                       c + 2);
-            c = expanded;
-            continue;
-        default:
-            break;
-        }
-        c += 2;
-    }
-
-    text = g_string_free(cdn_fmt, FALSE);
-    draw_text(context, text, &date_item, date_desc);
-    g_free(text);
-    if (expanded)
-        g_free(expanded);
-    pango_font_description_free(date_desc);
-}
-
-
-/* Print each of the items that in the description of a single check.  This
- * function uses helper functions to print text based and picture based items.
- */
-static void
-draw_page_items(GtkPrintContext *context,
-                check_format_t *format, gpointer user_data)
-{
-    PrintCheckDialog *pcd = (PrintCheckDialog *) user_data;
-    PangoFontDescription *default_desc;
-    Transaction *trans;
-    gnc_numeric amount;
-    GNCPrintAmountInfo info;
-    const gchar *date_format;
-    gchar *text = NULL, buf[100];
-    GSList *elem;
-    check_item_t *item;
-    gdouble width;
-    gchar *address = NULL;
-
-    trans = xaccSplitGetParent(pcd->split);
-    /* This was valid when the check printing dialog was instantiated. */
-    g_return_if_fail(trans);
-    amount = gnc_numeric_abs(xaccSplitGetAmount(pcd->split));
-
-    if (format->font)
-        default_desc = pango_font_description_from_string(format->font);
-    else
-        default_desc = pango_font_description_from_string(pcd->default_font);
-
-    /* Now put the actual data onto the page. */
-    for (elem = format->items; elem; elem = g_slist_next(elem))
-    {
-        item = elem->data;
-
-        switch (item->type)
-        {
-        case DATE:
-	{
-	    GDate date;
-	    g_date_clear (&date, 1);
-            gnc_gdate_set_time64 (&date, xaccTransGetDate(trans));
-            date_format =
-                gnc_date_format_get_custom(GNC_DATE_FORMAT
-                                           (pcd->date_format));
-            g_date_strftime(buf, 100, date_format, &date);
-            width = draw_text(context, buf, item, default_desc);
-            draw_date_format(context, date_format, item, default_desc, width);
-            break;
-	}
-
-        case PAYEE:
-            draw_text(context, xaccTransGetDescription(trans), item, default_desc);
-            break;
-
-        case NOTES:
-            draw_text(context, xaccTransGetNotes(trans), item, default_desc);
-            break;
-
-        case MEMO:
-            draw_text(context, xaccSplitGetMemo(pcd->split), item, default_desc);
-            break;
-
-        case ACTION:
-            draw_text(context, gnc_get_action_num(trans, pcd->split), item,
-                                                                default_desc);
-            break;
-
-        case CHECK_NUMBER:
-            draw_text(context, gnc_get_num_action(trans, pcd->split), item,
-                                                                default_desc);
-            break;
-
-        case AMOUNT_NUMBER:
-            info = gnc_default_print_info(FALSE);
-            draw_text(context, xaccPrintAmount(amount, info),
-                      item, default_desc);
-            break;
-
-        case AMOUNT_WORDS:
-            text = numeric_to_words(amount);
-            draw_text(context, text, item, default_desc);
-            g_free(text);
-            break;
-
-        case TEXT:
-            draw_text(context, item->text, item, default_desc);
-            break;
-
-        case ADDRESS:
-            address = get_check_address2(pcd);
-            draw_text(context, address, item, default_desc);
-            g_free(address);
-            break;
-
-        case SPLITS_AMOUNT:
-            text = get_check_splits_amount2(pcd);
-            draw_text(context, text, item, default_desc);
-            g_free(text);
-            break;
-
-        case SPLITS_MEMO:
-            text = get_check_splits_memo2(pcd);
-            draw_text(context, text, item, default_desc);
-            g_free(text);
-            break;
-
-        case SPLITS_ACCOUNT:
-            text = get_check_splits_account2(pcd);
-            draw_text(context, text, item, default_desc);
-            g_free(text);
-            break;
-
-        case PICTURE:
-            draw_picture(context, item);
-            break;
-
-        default:
-            text = g_strdup_printf("(unknown check field, type %d)", item->type);
-            draw_text(context, text, item, default_desc);
-            g_free(text);
-            break;
-        }
-    }
-
-    pango_font_description_free(default_desc);
-}
-
-
-/* Print each of the items that in the description of a single check.  This
- * function uses helper functions to print text based and picture based items.
- */
-static void
-draw_page_boxes(GtkPrintContext *context,
-                check_format_t *format, gpointer user_data)
-{
-    cairo_t *cr;
-    GSList *elem;
-    check_item_t *item;
-
-    cr = gtk_print_context_get_cairo_context(context);
-
-    /* Now put the actual data onto the page. */
-    for (elem = format->items; elem; elem = g_slist_next(elem))
-    {
-        item = elem->data;
-        if (!item->w || !item->h)
-            continue;
-        cairo_rectangle(cr, item->x, item->y - item->h, item->w, item->h);
-        cairo_stroke(cr);
-    }
-}
-
-
-/* Print an entire page based upon the layout in a check description file. This
- * function takes care of translating/rotating the page, calling the function to
- * print the grid pattern (if requested), and calls a helper function to print
- * all check items.
- */
-static void
-draw_check_format(GtkPrintContext *context, gint position,
-                  check_format_t *format, gpointer user_data)
-{
-    PrintCheckDialog *pcd = (PrintCheckDialog *) user_data;
-    cairo_t *cr;
-    gdouble x, y, r, multip;
-
-    cr = gtk_print_context_get_cairo_context(context);
-    cairo_translate(cr, format->trans_x, format->trans_y);
-    g_debug("Page translated by %f,%f", format->trans_x, format->trans_y);
-    cairo_rotate(cr, format->rotation * DEGREES_TO_RADIANS);
-    g_debug("Page rotated by %f degrees", format->rotation);
-
-    /* The grid is useful when determining check layouts */
-    if (format->show_grid)
-    {
-        draw_grid(context,
-                  gtk_print_context_get_width(context),
-                  gtk_print_context_get_height(context),
-                  pcd->default_font);
-    }
-
-    /* Translate all subsequent check items if requested.
-     * For check position 0, no translation is needed. */
-    if ((position > 0) && (position < pcd->position_max))
-    {
-        /* Standard positioning is used.
-         * Note that the first check on the page (position 0) doesn't
-         * need to be moved (hence the test for position > 0 above. */
-        cairo_translate(cr, 0, format->height);
-        g_debug("Position %d translated by %f (pre-defined)", position, format->height);
-    }
-    else if (position == pcd->position_max)
-    {
-        /* Custom positioning is used. */
-        multip = pcd_get_custom_multip(pcd);
-        x = multip * gtk_spin_button_get_value(pcd->translation_x);
-        y = multip * gtk_spin_button_get_value(pcd->translation_y);
-        cairo_translate(cr, x, y);
-        g_debug("Position translated by %f,%f (custom)", x, y);
-        r = gtk_spin_button_get_value(pcd->check_rotation);
-        cairo_rotate(cr, r * DEGREES_TO_RADIANS);
-        g_debug("Position rotated by %f degrees (custom)", r);
-    }
-
-    /* Draw layout boxes if requested. Also useful when determining check
-     * layouts. */
-    if (format->show_boxes)
-        draw_page_boxes(context, format, user_data);
-
-    /* Draw the actual check data. */
-    draw_page_items(context, format, user_data);
-}
-
-
-static void
-draw_check_custom(GtkPrintContext *context, gpointer user_data)
-{
-    PrintCheckDialog *pcd = (PrintCheckDialog *) user_data;
-    GNCPrintAmountInfo info;
-    PangoFontDescription *desc;
-    Transaction *trans;
-    gnc_numeric amount;
-    cairo_t *cr;
-    const gchar *date_format;
-    gchar *text = NULL, buf[100];
-    check_item_t item = { 0 };
-    gdouble x, y, multip, degrees;
-    GDate date;
-    gchar *address;
-
-    trans = xaccSplitGetParent(pcd->split);
-    /* This was valid when the check printing dialog was instantiated. */
-    g_return_if_fail(trans);
-
-    desc = pango_font_description_from_string(pcd->default_font);
-
-    multip = pcd_get_custom_multip(pcd);
-    degrees = gtk_spin_button_get_value(pcd->check_rotation);
-    cr = gtk_print_context_get_cairo_context(context);
-    cairo_rotate(cr, degrees * DEGREES_TO_RADIANS);
-    g_debug("Page rotated by %f degrees", degrees);
-
-    x = multip * gtk_spin_button_get_value(pcd->translation_x);
-    y = multip * gtk_spin_button_get_value(pcd->translation_y);
-    cairo_translate(cr, x, y);
-    g_debug("Page translated by %f,%f", x, y);
-
-    item.x = multip * gtk_spin_button_get_value(pcd->payee_x);
-    item.y = multip * gtk_spin_button_get_value(pcd->payee_y);
-    draw_text(context, xaccTransGetDescription(trans), &item, desc);
-
-    item.x = multip * gtk_spin_button_get_value(pcd->date_x);
-    item.y = multip * gtk_spin_button_get_value(pcd->date_y);
-    g_date_clear (&date, 1);
-    gnc_gdate_set_time64 (&date, xaccTransGetDate(trans));
-    date_format = gnc_date_format_get_custom(GNC_DATE_FORMAT(pcd->date_format));
-    g_date_strftime(buf, 100, date_format, &date);
-    draw_text(context, buf, &item, desc);
-
-    item.x = multip * gtk_spin_button_get_value(pcd->number_x);
-    item.y = multip * gtk_spin_button_get_value(pcd->number_y);
-    info = gnc_default_print_info(FALSE);
-    amount = gnc_numeric_abs(xaccSplitGetAmount(pcd->split));
-    draw_text(context, xaccPrintAmount(amount, info), &item, desc);
-
-    item.x = multip * gtk_spin_button_get_value(pcd->words_x);
-    item.y = multip * gtk_spin_button_get_value(pcd->words_y);
-    text = numeric_to_words(amount);
-    draw_text(context, text, &item, desc);
-    g_free(text);
-
-    item.x = multip * gtk_spin_button_get_value(pcd->address_x);
-    item.y = multip * gtk_spin_button_get_value(pcd->address_y);
-    address = get_check_address2(pcd);
-    draw_text(context, address, &item, desc);
-    g_free(address);
-
-    item.x = multip * gtk_spin_button_get_value(pcd->splits_amount_x);
-    item.y = multip * gtk_spin_button_get_value(pcd->splits_amount_y);
-    text = get_check_splits_amount2(pcd);
-    draw_text(context, text, &item, desc);
-    g_free(text);
-
-    item.x = multip * gtk_spin_button_get_value(pcd->splits_memo_x);
-    item.y = multip * gtk_spin_button_get_value(pcd->splits_memo_y);
-    text = get_check_splits_memo2(pcd);
-    draw_text(context, text, &item, desc);
-    g_free(text);
-
-    item.x = multip * gtk_spin_button_get_value(pcd->splits_account_x);
-    item.y = multip * gtk_spin_button_get_value(pcd->splits_account_y);
-    text = get_check_splits_account2(pcd);
-    draw_text(context, text, &item, desc);
-    g_free(text);
-
-    item.x = multip * gtk_spin_button_get_value(pcd->notes_x);
-    item.y = multip * gtk_spin_button_get_value(pcd->notes_y);
-    draw_text(context, xaccTransGetNotes(trans), &item, desc);
-
-    item.x = multip * gtk_spin_button_get_value(pcd->memo_x);
-    item.y = multip * gtk_spin_button_get_value(pcd->memo_y);
-    draw_text(context, xaccSplitGetMemo(pcd->split), &item, desc);
-
-    pango_font_description_free(desc);
-}
-
-
-/* Print a page of checks. This takes into account the number of checks to print,
- * the number of checks on a page, and the starting check position on the page.
- * This function is called once by the GtkPrint code once for each page to be printed.
- */
-static void
-draw_page(GtkPrintOperation *operation,
-          GtkPrintContext *context, gint page_nr, gpointer user_data)
-{
-    PrintCheckDialog *pcd = (PrintCheckDialog *) user_data;
-    check_format_t *format;
-
-    format = pcd->selected_format;
-    if (format)
-    {
-        gint    first_check, last_check;
-        gint    first_page_count;
-        guint   check_count = g_list_length(pcd->splits);
-        gint    check_number;
-        gint    position = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->position_combobox));
-        gint    checks_per_page;
-        GList   *next_split;
-
-        if (position == pcd->position_max)
-        {
-            /* Custom position, one check per page */
-            checks_per_page = 1;
-            first_page_count = 1;
-        }
-        else
-        {
-            checks_per_page = pcd->position_max;
-            first_page_count = gtk_spin_button_get_value_as_int(pcd->first_page_count);
-        }
-
-        if (page_nr == 0)
-        {
-            first_check = 0;
-            last_check = first_page_count - 1;
-            next_split = pcd->splits;
-        }
-        else
-        {
-            first_check = first_page_count + (page_nr - 1) * checks_per_page;
-            last_check = MIN(check_count - 1, first_check + checks_per_page - 1);
-            next_split = g_list_nth(pcd->splits, first_check);
-            /* If position is not "custom" reset it to top */
-            if (position < pcd->position_max)
-                position = 0;
-        }
-
-        for (check_number = first_check; check_number <= last_check;
-                check_number++, position++)
-        {
-            pcd->split = (Split *) next_split->data;
-            next_split = g_list_next(next_split);
-            draw_check_format(context, position, format, user_data);
-        }
-    }
-    else
-    {
-        /* Custom check format */
-        pcd->split = (Split *) g_list_nth_data(pcd->splits, page_nr);
-        g_return_if_fail(pcd->split);
-        draw_check_custom(context, user_data);
-    }
-}
-
-
-/* Compute the number of pages required to complete this print operation.
- * This function is called once by the GtkPrint code to determine the number
- * of pages required to complete the print operation.
- */
-static void
-begin_print(GtkPrintOperation *operation,
-            GtkPrintContext *context, gpointer user_data)
-{
-    PrintCheckDialog *pcd = (PrintCheckDialog *) user_data;
-    guint check_count = g_list_length(pcd->splits);
-    gint first_page_count;
-    gint pages;
-    gint position = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->position_combobox));
-
-    if (pcd->selected_format && pcd->position_max > 1 && position < pcd->position_max)
-    {
-        first_page_count = gtk_spin_button_get_value_as_int(pcd->first_page_count);
-        pages = ((check_count - first_page_count) + pcd->position_max - 1) /
-                pcd->position_max + 1;
-    }
-    else
-        pages = check_count;
-    gtk_print_operation_set_n_pages(operation, pages);
-}
-
-
-/************************************
- * gnc_ui_print_check_dialog_ok_cb  *
- ************************************/
-static void
-gnc_ui_print_check_dialog_ok_cb(PrintCheckDialog *pcd)
-{
-    GtkPrintOperation *print;
-    GtkPrintOperationResult res;
-
-    print = gtk_print_operation_new();
-
-    gnc_print_operation_init(print, "GnuCash-Checks");
-    gtk_print_operation_set_unit(print, GTK_UNIT_POINTS);
-    gtk_print_operation_set_use_full_page(print, TRUE);
-    g_signal_connect(print, "begin_print", G_CALLBACK(begin_print), pcd);
-    g_signal_connect(print, "draw_page", G_CALLBACK(draw_page), pcd);
-
-    res = gtk_print_operation_run(print,
-                                  GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
-                                  pcd->caller_window, NULL);
-
-    if (res == GTK_PRINT_OPERATION_RESULT_APPLY)
-        gnc_print_operation_save_print_settings(print);
-
-    g_object_unref(print);
-}
-
-
-static void
-gnc_print_check_set_sensitive (GtkWidget *widget, gpointer data)
-{
-    gboolean sensitive;
-    if (GTK_IS_LABEL(widget) || GTK_IS_SEPARATOR(widget))
-        return;
-    sensitive = GPOINTER_TO_INT(data);
-    gtk_widget_set_sensitive(widget, sensitive);
-}
-
-
-void
-gnc_print_check_format_changed2 (GtkComboBox *widget,
-                                PrintCheckDialog *pcd)
-{
-    GtkListStore *p_store;
-    GtkTreeModel *f_model;
-    GtkTreeIter f_iter, iter;
-    gboolean sensitive;
-    gint pnum;
-    check_format_t *format;
-    gboolean separator;
-    GSList *elem;
-
-    if (!gtk_combo_box_get_active_iter(GTK_COMBO_BOX(pcd->format_combobox), &f_iter))
-        return;
-    f_model = gtk_combo_box_get_model(GTK_COMBO_BOX(pcd->format_combobox));
-    gtk_tree_model_get(f_model, &f_iter, COL_DATA, &format, COL_SEP, &separator, -1);
-    if (separator)
-        return;
-
-    pnum = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->position_combobox));
-
-    /* Update the positions combobox */
-    pcd->selected_format = format;
-    p_store = gtk_list_store_new (1, G_TYPE_STRING);
-    gtk_combo_box_set_model(GTK_COMBO_BOX(pcd->position_combobox),
-                            GTK_TREE_MODEL(p_store));
-    if (format)
-    {
-        if (format->positions)
-        {
-            pcd->position_max = g_slist_length(format->positions); /* -1 for 0 base, +1 for custom entry */
-            for (elem = format->positions; elem; elem = g_slist_next(elem))
-            {
-                gtk_list_store_append(GTK_LIST_STORE(p_store), &iter);
-                gtk_list_store_set (GTK_LIST_STORE(p_store), &iter, 0, elem->data, -1);
-            }
-        }
-        else
-        {
-            /* Invent a "Top" position if format has no positions */
-            pcd->position_max = 1;
-            gtk_list_store_append(GTK_LIST_STORE(p_store), &iter);
-            gtk_list_store_set (GTK_LIST_STORE(p_store), &iter, 0, _("Top"), -1);
-        }
-    }
-    else
-    {
-        pcd->position_max = 0;
-    }
-    gtk_list_store_append(GTK_LIST_STORE(p_store), &iter);
-    gtk_list_store_set (GTK_LIST_STORE(p_store), &iter, 0, _("Custom"), -1);
-
-    /* If there's only one thing in the position combobox, make it insensitive */
-    sensitive = (pcd->position_max > 0);
-    gtk_widget_set_sensitive(GTK_WIDGET(pcd->position_combobox), sensitive);
-
-    /* Update the custom page, this must be done before setting the active
-       entry in the position combo box since gnc_print_check_position_changed2
-       will adjust these settings in some cases. */
-    sensitive = (!separator && !format);
-    gtk_container_foreach(GTK_CONTAINER(pcd->custom_table),
-                          gnc_print_check_set_sensitive,
-                          GINT_TO_POINTER(sensitive));
-
-    /* Set the active entry in the position combo box, this will trigger a
-       call to gnc_print_check_position_changed2 */
-    pnum = MAX(MIN(pnum, pcd->position_max), 0);
-    gtk_combo_box_set_active(GTK_COMBO_BOX(pcd->position_combobox), pnum);
-
-    /* Update address fields */
-    sensitive = check_format_has_address(pcd);
-    gtk_widget_set_sensitive(pcd->check_address_name, sensitive);
-    gtk_widget_set_sensitive(pcd->check_address_1, sensitive);
-    gtk_widget_set_sensitive(pcd->check_address_2, sensitive);
-    gtk_widget_set_sensitive(pcd->check_address_3, sensitive);
-    gtk_widget_set_sensitive(pcd->check_address_4, sensitive);
-}
-
-
-void
-gnc_print_check_position_changed2 (GtkComboBox *widget,
-                                  PrintCheckDialog *pcd)
-{
-    gboolean sensitive;
-    gint pnum;
-    guint check_count;
-    gint first_page_max, first_page_min, first_page_value;
-
-    pnum = gtk_combo_box_get_active(GTK_COMBO_BOX(pcd->position_combobox));
-
-    /* Make the translation and rotation fields active if the position is "custom" */
-    sensitive = pnum == pcd->position_max;
-    gtk_widget_set_sensitive(GTK_WIDGET(pcd->translation_x), sensitive);
-    gtk_widget_set_sensitive(GTK_WIDGET(pcd->translation_y), sensitive);
-    gtk_widget_set_sensitive(GTK_WIDGET(pcd->check_rotation), sensitive);
-    gtk_widget_set_sensitive(GTK_WIDGET(pcd->units_combobox), sensitive);
-
-    /* Set up the first page check count spin box */
-    check_count = g_list_length(pcd->splits);
-    first_page_max = MAX(1, MIN(pcd->position_max - pnum, check_count));
-    first_page_min = 1;
-    pnum = gtk_spin_button_get_value_as_int(pcd->first_page_count);
-    first_page_value = MAX(MIN(pnum, first_page_max), first_page_min);
-    gtk_spin_button_set_range(pcd->first_page_count, (gdouble)first_page_min, (gdouble)first_page_max);
-    gtk_spin_button_set_value(pcd->first_page_count, (gdouble)first_page_value);
-    sensitive = first_page_max > 1;
-    gtk_widget_set_sensitive(GTK_WIDGET(pcd->first_page_count), sensitive);
-}
-
-
-void
-gnc_ui_print_check_response_cb2(GtkDialog *dialog,
-                               gint response,
-                               PrintCheckDialog *pcd)
-{
-    switch (response)
-    {
-    case GTK_RESPONSE_HELP:
-        gnc_gnome_help(HF_HELP, HL_PRINTCHECK);
-        return;
-
-    case GTK_RESPONSE_OK:
-        gnc_ui_print_check_dialog_ok_cb(pcd);
-        gnc_ui_print_save_dialog(pcd);
-        gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(dialog));
-        break;
-
-    case GTK_RESPONSE_CANCEL:
-        gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(dialog));
-        break;
-    }
-
-    gtk_widget_destroy(pcd->dialog);
-    g_free(pcd->default_font);
-    g_list_free(pcd->splits);
-    g_free(pcd);
-}

Deleted: gnucash/trunk/src/gnome/dialog-print-check2.h
===================================================================
--- gnucash/trunk/src/gnome/dialog-print-check2.h	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/dialog-print-check2.h	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,34 +0,0 @@
-/********************************************************************\
- * dialog-print-check2.h : dialog to control check printing          *
- * 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   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
-\********************************************************************/
-
-#ifndef DIALOG_PRINT_CHECK2_H
-#define DIALOG_PRINT_CHECK2_H
-
-#include "print-session.h"
-
-typedef struct _print_check_dialog PrintCheckDialog;
-
-void gnc_ui_print_check_dialog_create2 (GncPluginPageRegister2 *plugin_page,
-                                      GList *splits);
-
-#endif

Deleted: gnucash/trunk/src/gnome/dialog-sx-editor2.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-sx-editor2.c	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/dialog-sx-editor2.c	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,1785 +0,0 @@
-/********************************************************************\
- * dialog-sx-editor2.c : dialog for scheduled transaction editing   *
- * Copyright (C) 2001,2002,2006 Joshua Sled <jsled at asynchronous.org>*
- * Copyright (C) 2011 Robert Fewell                                 *
- *                                                                  *
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of version 2 and/or version 3 of the   *
- * GNU General Public License as published by the Free Software     *
- * Foundation.                                                      *
- *                                                                  *
- * As a special exception, permission is granted to link the binary *
- * module resultant from this code with the OpenSSL project's       *
- * "OpenSSL" library (or modified versions of it that use the same  *
- * license as the "OpenSSL" library), and distribute the linked     *
- * executable.  You must obey the GNU General Public License in all *
- * respects for all of the code used other than "OpenSSL". If you   *
- * modify this file, you may extend this exception to your version  *
- * of the file, but you are not obligated to do so. If you do not   *
- * wish to do so, delete this exception statement from your version *
- * of this file.                                                    *
- *                                                                  *
- * 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 <locale.h>
-
-#include <gnc-gdate-utils.h>
-#include "qof.h"
-#include "Account.h"
-#include "SchedXaction.h"
-#include "SX-book.h"
-#include "dialog-preferences.h"
-#include "dialog-sx-editor2.h"
-#include "dialog-utils.h"
-#include "gnc-component-manager.h"
-#include "gnc-date.h"
-#include "gnc-date-edit.h"
-#include "gnc-dense-cal.h"
-#include "gnc-dense-cal-store.h"
-#include "gnc-embedded-window.h"
-#include "gnc-engine.h"
-#include "gnc-frequency.h"
-#include "gnc-gui-query.h"
-#include "gnc-hooks.h"
-#include "gnc-ledger-display.h"
-#include "gnc-plugin-page.h"
-#include "gnc-plugin-page-register2.h"
-#include "gnc-prefs.h"
-#include "gnc-ui.h"
-#include "gnc-ui-util.h"
-#include "gnc-tree-model-split-reg.h"
-#include "gnc-tree-control-split-reg.h"
-
-#include "gnc-sx-instance-model.h"
-#include "dialog-sx-since-last-run.h"
-
-#undef G_LOG_DOMAIN
-#define G_LOG_DOMAIN "gnc.gui.sx.editor"
-
-static QofLogModule log_module = GNC_MOD_GUI_SX;
-
-static gint _sx_engine_event_handler_id = -1;
-
-#define END_NEVER_OPTION 0
-#define END_DATE_OPTION  1
-#define NUM_OCCUR_OPTION 2
-
-#define NUM_LEDGER_LINES_DEFAULT 6
-
-#define EX_CAL_NUM_MONTHS 6
-#define EX_CAL_MO_PER_COL 3
-
-#define GNC_D_WIDTH 25
-#define GNC_D_BUF_WIDTH 26
-
-/** Datatypes ***********************************************************/
-
-typedef enum _EndTypeEnum
-{
-    END_NEVER,
-    END_DATE,
-    END_OCCUR,
-} EndType;
-
-typedef enum { NO_END, DATE_END, COUNT_END } END_TYPE;
-
-struct _GncSxEditorDialog2
-{
-    GtkWidget    *dialog;
-    GtkBuilder   *builder;
-    GtkNotebook  *notebook;
-    SchedXaction *sx;
-    /* If this is a new scheduled transaction or not. */
-    int newsxP;
-
-    /* The various widgets in the dialog */
-    GNCLedgerDisplay2 *ledger;
-
-    GncFrequency     *gncfreq;
-    GncDenseCalStore *dense_cal_model;
-    GncDenseCal      *example_cal;
-
-    GtkEditable *nameEntry;
-
-    GtkLabel *lastOccurLabel;
-
-    GtkToggleButton *enabledOpt;
-    GtkToggleButton *autocreateOpt;
-    GtkToggleButton *notifyOpt;
-    GtkToggleButton *advanceOpt;
-    GtkSpinButton   *advanceSpin;
-    GtkToggleButton *remindOpt;
-    GtkSpinButton   *remindSpin;
-
-    GtkToggleButton *optEndDate;
-    GtkToggleButton *optEndNone;
-    GtkToggleButton *optEndCount;
-    GtkEntry        *endCountSpin;
-    GtkEntry        *endRemainSpin;
-    GNCDateEdit     *endDateEntry;
-
-    char *sxGUIDstr;
-
-    GncEmbeddedWindow *embed_window;
-    GncPluginPage     *plugin_page;
-};
-
-/** Prototypes **********************************************************/
-
-static void schedXact_editor_create_freq_sel (GncSxEditorDialog2 *sxed);
-static void schedXact_editor_create_ledger (GncSxEditorDialog2 *sxed);
-static void schedXact_editor_populate (GncSxEditorDialog2 *);
-static void endgroup_rb_toggled_cb (GtkButton *b, gpointer d);
-static void set_endgroup_toggle_states (GncSxEditorDialog2 *sxed, EndType t);
-static void advance_toggled_cb (GtkButton *b, GncSxEditorDialog2 *sxed);
-static void remind_toggled_cb (GtkButton *b, GncSxEditorDialog2 *sxed);
-static gboolean gnc_sxed_check_consistent (GncSxEditorDialog2 *sxed);
-static gboolean gnc_sxed_check_changed (GncSxEditorDialog2 *sxed);
-static void gnc_sxed_save_sx (GncSxEditorDialog2 *sxed);
-static void gnc_sxed_freq_changed (GncFrequency *gf, gpointer ud);
-static void sxed_excal_update_adapt_cb (GtkObject *o, gpointer ud);
-static void gnc_sxed_update_cal (GncSxEditorDialog2 *sxed);
-static void on_sx_check_toggled_cb (GtkWidget *togglebutton, gpointer user_data);
-//void on_sx_check_toggled_cb (GtkWidget *togglebutton, gpointer user_data);
-static void gnc_sxed_reg_check_close (GncSxEditorDialog2 *sxed);
-static gboolean sxed_delete_event (GtkWidget *widget, GdkEvent *event, gpointer ud);
-static gboolean sxed_confirmed_cancel (GncSxEditorDialog2 *sxed);
-static gboolean editor_component_sx_equality (gpointer find_data, gpointer user_data);
-
-static GtkActionEntry gnc_sxed_menu_entries [] =
-{
-    { "EditAction", NULL, N_("_Edit"), NULL, NULL, NULL },
-    { "TransactionAction", NULL, N_("_Transaction"), NULL, NULL, NULL },
-    { "ViewAction", NULL, N_("_View"), NULL, NULL, NULL },
-    { "ActionsAction", NULL, N_("_Actions"), NULL, NULL, NULL },
-};
-static guint gnc_sxed_menu_n_entries = G_N_ELEMENTS (gnc_sxed_menu_entries);
-
-/** Implementations *****************************************************/
-
-static void
-sxed_close_handler(gpointer user_data)
-{
-    GncSxEditorDialog2 *sxed = user_data;
-
-    gnc_sxed_reg_check_close(sxed);
-    gnc_save_window_size( GNC_PREFS_GROUP_SXED, GTK_WINDOW(sxed->dialog) );
-    gtk_widget_destroy(sxed->dialog);
-    /* The data will be cleaned up in the destroy handler. */
-}
-
-
-/**
- * @return TRUE if the user does want to cancel, FALSE if not.  If TRUE is
- * returned, the register's changes have been cancelled.
- **/
-static gboolean
-sxed_confirmed_cancel (GncSxEditorDialog2 *sxed)
-{
-    GncTreeViewSplitReg *view;
-
-    view = gnc_ledger_display2_get_split_view_register (sxed->ledger);
-    /* check for changes */
-    if (gnc_sxed_check_changed (sxed))
-    {
-        const char *sx_changed_msg =
-            _( "This Scheduled Transaction has changed; are you "
-               "sure you want to cancel?" );
-        if (!gnc_verify_dialog (sxed->dialog, FALSE, "%s", sx_changed_msg))
-        {
-            return FALSE;
-        }
-    }
-    /* cancel ledger changes */
-    gnc_tree_view_split_reg_cancel_edit (view, TRUE);
-    return TRUE;
-}
-
-
-/**********************************
- * Dialog Action Button functions *
- *********************************/
-static void
-editor_cancel_button_clicked_cb (GtkButton *b, GncSxEditorDialog2 *sxed)
-{
-    /* close */
-    if (!sxed_confirmed_cancel (sxed))
-        return;
-
-    gnc_close_gui_component_by_data (DIALOG_SCHEDXACTION2_EDITOR_CM_CLASS,
-                                     sxed);
-}
-
-
-static void
-editor_help_button_clicked_cb (GtkButton *b, GncSxEditorDialog2 *sxed)
-{
-    gnc_gnome_help (HF_HELP, HL_SXEDITOR);
-}
-
-
-static void
-editor_ok_button_clicked_cb (GtkButton *b, GncSxEditorDialog2 *sxed)
-{
-    QofBook *book;
-    SchedXactions *sxes;
-
-    if (!gnc_sxed_check_consistent (sxed))
-        return;
-
-    gnc_sxed_save_sx (sxed);
-
-    /* add to list */
-    // @@fixme -- forget 'new'-flag: check for existance of the SX [?]
-    if ( sxed->newsxP )
-    {
-        book = gnc_get_current_book ();
-        sxes = gnc_book_get_schedxactions (book);
-        gnc_sxes_add_sx (sxes, sxed->sx);
-        sxed->newsxP = FALSE;
-    }
-
-    /* cleanup */
-    gnc_close_gui_component_by_data (DIALOG_SCHEDXACTION2_EDITOR_CM_CLASS,
-                                     sxed);
-}
-
-
-/*************************************************************************
- * Checks to see if the SX has been modified from it's previously-saved
- * state.
- * @return TRUE if this is a 'new' SX, or if the SX has changed from it's
- *   previous configuration.
- ************************************************************************/
-static gboolean
-gnc_sxed_check_changed (GncSxEditorDialog2 *sxed)
-{
-    if (sxed->newsxP)
-        return TRUE;
-
-    /* name */
-    {
-        char *name;
-
-        name = gtk_editable_get_chars (GTK_EDITABLE (sxed->nameEntry), 0, -1);
-        if (strlen (name) == 0)
-        {
-            return TRUE;
-
-        }
-        if ((xaccSchedXactionGetName (sxed->sx) == NULL)
-                || (strcmp( xaccSchedXactionGetName (sxed->sx),
-                            name ) != 0))
-        {
-            return TRUE;
-        }
-    }
-
-    /* end options */
-    {
-        /* dialog says... no end */
-        if (gtk_toggle_button_get_active (sxed->optEndNone))
-        {
-            if (xaccSchedXactionHasEndDate (sxed->sx)
-                    || xaccSchedXactionHasOccurDef (sxed->sx))
-            {
-                return TRUE;
-            }
-        }
-
-        /* dialog says... end date */
-        if (gtk_toggle_button_get_active (sxed->optEndDate))
-        {
-            GDate sxEndDate, dlgEndDate;
-
-            if (!xaccSchedXactionHasEndDate (sxed->sx))
-            {
-                return TRUE;
-            }
-            sxEndDate = *xaccSchedXactionGetEndDate (sxed->sx);
-            gnc_gdate_set_time64 (&dlgEndDate,
-                               gnc_date_edit_get_date( sxed->
-                                       endDateEntry));
-
-            if (g_date_compare (&sxEndDate, &dlgEndDate) != 0)
-            {
-                return TRUE;
-            }
-        }
-
-        /* dialog says... num occur */
-        if (gtk_toggle_button_get_active (sxed->optEndCount))
-        {
-            gint sxNumOccur, sxNumRem, dlgNumOccur, dlgNumRem;
-
-            if (!xaccSchedXactionGetNumOccur (sxed->sx))
-            {
-                return TRUE;
-            }
-
-            dlgNumOccur  =
-                gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (sxed->endCountSpin));
-
-            dlgNumRem =
-                gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (sxed->endRemainSpin));
-
-            sxNumOccur = xaccSchedXactionGetNumOccur (sxed->sx);
-            sxNumRem = xaccSchedXactionGetRemOccur (sxed->sx);
-
-            if ((dlgNumOccur != sxNumOccur)
-                    || (dlgNumRem != sxNumRem))
-            {
-                return TRUE;
-            }
-        }
-    }
-
-    /* SX options [autocreate, notify, reminder, advance] */
-    {
-        gboolean dlgEnabled,
-                 dlgAutoCreate,
-                 dlgNotify,
-                 sxEnabled,
-                 sxAutoCreate,
-                 sxNotify;
-        gint dlgAdvance, sxAdvance;
-        gint dlgRemind, sxRemind;
-
-        dlgEnabled =
-            gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sxed->
-                                          enabledOpt));
-        dlgAutoCreate =
-            gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sxed->
-                                          autocreateOpt));
-        dlgNotify =
-            gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sxed->
-                                          notifyOpt));
-
-        sxEnabled = xaccSchedXactionGetEnabled (sxed->sx);
-        if (!((dlgEnabled == sxEnabled)))
-        {
-            return TRUE;
-        }
-
-        xaccSchedXactionGetAutoCreate (sxed->sx, &sxAutoCreate, &sxNotify);
-        if (!((dlgAutoCreate == sxAutoCreate)
-                && (dlgNotify == sxNotify)))
-        {
-            return TRUE;
-        }
-
-        dlgAdvance = 0;
-        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sxed->advanceOpt)))
-        {
-            dlgAdvance =
-                gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (sxed->
-                                                  advanceSpin));
-        }
-        sxAdvance = xaccSchedXactionGetAdvanceCreation (sxed->sx);
-        if (dlgAdvance != sxAdvance)
-        {
-            return TRUE;
-        }
-
-        dlgRemind = 0;
-        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sxed->remindOpt)))
-        {
-            dlgRemind =
-                gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (sxed->remindSpin));
-        }
-        sxRemind = xaccSchedXactionGetAdvanceReminder (sxed->sx);
-        if (dlgRemind != sxRemind)
-        {
-            return TRUE;
-        }
-    }
-
-    {
-        GList *dialog_schedule = NULL;
-        GDate dialog_start_date, sx_start_date;
-        gchar *dialog_schedule_str, *sx_schedule_str;
-        gboolean schedules_are_the_same, start_dates_are_the_same;
-
-        g_date_clear (&dialog_start_date, 1);
-        gnc_frequency_save_to_recurrence (sxed->gncfreq, &dialog_schedule, &dialog_start_date);
-        dialog_schedule_str = recurrenceListToString (dialog_schedule);
-        recurrenceListFree (&dialog_schedule);
-
-        sx_start_date = *xaccSchedXactionGetStartDate (sxed->sx);
-        sx_schedule_str = recurrenceListToString (gnc_sx_get_schedule (sxed->sx));
-
-        g_debug ("dialog schedule [%s], sx schedule [%s]",
-                dialog_schedule_str, sx_schedule_str);
-
-        schedules_are_the_same = (strcmp (dialog_schedule_str, sx_schedule_str) == 0);
-        g_free (dialog_schedule_str);
-        g_free (sx_schedule_str);
-
-        start_dates_are_the_same = (g_date_compare (&dialog_start_date, &sx_start_date) == 0);
-
-        if (!schedules_are_the_same || !start_dates_are_the_same)
-            return TRUE;
-    }
-
-    /* template transactions */
-    {
-        GncTreeViewSplitReg *view = gnc_ledger_display2_get_split_view_register (sxed->ledger);
-        /* Make sure we have finished the edit */
-        gnc_tree_view_split_reg_finish_edit (view);
-        if (gnc_tree_view_split_reg_get_dirty_trans (view) != NULL)
-            return TRUE;
-    }
-    return FALSE;
-}
-
-
-/*****************************************************************************
- * Holds the credit- and debit-sum for a given Transaction, as used in
- * gnc_sxed_check_consistent.
- ****************************************************************************/
-typedef struct _txnCreditDebitSums
-{
-    gnc_numeric creditSum;
-    gnc_numeric debitSum;
-} txnCreditDebitSums;
-
-
-static
-void
-set_sums_to_zero (gpointer key,
-                  gpointer val,
-                  gpointer ud)
-{
-    txnCreditDebitSums *tcds = (txnCreditDebitSums*)val;
-    tcds->creditSum = gnc_numeric_zero();
-    tcds->debitSum  = gnc_numeric_zero();
-}
-
-
-static void
-check_credit_debit_balance (gpointer key,
-                            gpointer val,
-                            gpointer ud)
-{
-    txnCreditDebitSums *tcds = (txnCreditDebitSums*)val;
-    gboolean *unbalanced = (gboolean*)ud;
-    *unbalanced |= !(gnc_numeric_zero_p (
-                         gnc_numeric_sub_fixed (tcds->debitSum,
-                                 tcds->creditSum)));
-
-    if (qof_log_check (G_LOG_DOMAIN, QOF_LOG_DEBUG))
-    {
-        if (gnc_numeric_zero_p (gnc_numeric_sub_fixed (tcds->debitSum,
-                                 tcds->creditSum)))
-        {
-            g_debug ("%p | true [%s - %s = %s]",
-                     key,
-                     gnc_numeric_to_string (tcds->debitSum),
-                     gnc_numeric_to_string (tcds->creditSum),
-                     gnc_numeric_to_string (gnc_numeric_sub_fixed (tcds->debitSum,
-                                           tcds->creditSum)));
-        }
-        else
-        {
-            g_debug ("%p | false [%s - %s = %s]",
-                     key,
-                     gnc_numeric_to_string (tcds->debitSum),
-                     gnc_numeric_to_string (tcds->creditSum),
-                     gnc_numeric_to_string (gnc_numeric_sub_fixed (tcds->debitSum,
-                                           tcds->creditSum)));
-        }
-    }
-}
-
-
-/*******************************************************************************
- * Checks to make sure that the SX is in a reasonable state to save.
- * @return true if checks out okay, false otherwise.
- ******************************************************************************/
-static gboolean
-gnc_sxed_check_consistent (GncSxEditorDialog2 *sxed)
-{
-    gboolean multi_commodity = FALSE;
-    gnc_commodity *base_cmdty = NULL;
-    gint ttVarCount, splitCount;
-    GList *schedule = NULL;
-
-    /* Do checks on validity and such, interrupting the user if
-     * things aren't right.
-     *
-     * Features...
-     * X support formulas [?!]
-     * X balancing the SX if contain numeric-only formula data.
-     *   X agreement with create-automagically/notification controls
-     * X the 'will ever be valid' check should take num-occur vals into
-     *   account.
-     * X SX name is unique
-     * X SX has a name
-     * X "weekly" FS has some days set.
-     * X "once" with reasonable start/end dates.
-     *   X This doesn't work at the time the 'weekly' one was fixed with
-     *     user-confirmation, below; the once SX is always valid.
-     * [X more generically, creating a "not scheduled" SX is probably not
-     *   right... ]
-     */
-
-    ttVarCount = 0;
-    splitCount = 0;
-    {
-        static const int NUM_ITERS_WITH_VARS = 5;
-        static const int NUM_ITERS_NO_VARS = 1;
-        int numIters, i;
-        GHashTable *vars, *txns;
-        GList *splitList = NULL;
-        char *str;
-        kvp_frame *f;
-        kvp_value *v;
-        Split *s;
-        Transaction *t;
-        gnc_numeric tmp;
-        gboolean unbalanceable;
-        gpointer unusedKey, unusedValue;
-
-        unbalanceable = FALSE; /* innocent until proven guilty */
-        vars = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify)gnc_sx_variable_free);
-        txns = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free);
-        numIters = NUM_ITERS_NO_VARS;
-        /**
-         * Plan:
-         * . Do a first pass to get the variables.
-         * . Set each variable to random values.
-         * . see if we balance after that
-         *   . true: all good
-         *   . false: indicate to user, allow decision.
-         */
-
-        /* numeric-formulas-get-balanced determination */
-        gnc_sx_get_variables (sxed->sx, vars);
-
-        ttVarCount = g_hash_table_size (vars);
-        if (ttVarCount != 0)
-        {
-            /* balance with random variable bindings some number
-             * of times in an attempt to ferret out
-             * un-balanceable transactions.
-             *
-             * NOTE: The Real Way to do this is with some
-             * symbolic math to eliminate the variables.  This is
-             * hard, and we don't do it.  This solution will
-             * suffice for now, and perhaps for the lifetime of
-             * the software. --jsled */
-            numIters = NUM_ITERS_WITH_VARS;
-        }
-
-        for (i = 0; i < numIters && !unbalanceable; i++)
-        {
-            gnc_sx_randomize_variables (vars);
-            g_hash_table_foreach (txns, set_sums_to_zero, NULL);
-            tmp = gnc_numeric_zero();
-
-            splitList = xaccSchedXactionGetSplits (sxed->sx);
-            splitCount += g_list_length (splitList);
-
-            for (; splitList; splitList = splitList->next)
-            {
-                GncGUID *acct_guid;
-                Account *acct;
-                gnc_commodity *split_cmdty;
-                txnCreditDebitSums *tcds;
-
-                s = (Split*)splitList->data;
-                t = xaccSplitGetParent (s);
-
-                if (!(tcds =
-                            (txnCreditDebitSums*)g_hash_table_lookup (txns,
-                                    (gpointer)t)))
-                {
-                    tcds = g_new0 (txnCreditDebitSums, 1 );
-                    tcds->creditSum = gnc_numeric_zero();
-                    tcds->debitSum  = gnc_numeric_zero();
-                    g_hash_table_insert (txns, (gpointer)t, (gpointer)tcds);
-                }
-
-                f = xaccSplitGetSlots (s);
-
-                /* contains the guid of the split's actual account. */
-                v = kvp_frame_get_slot_path (f,
-                                            GNC_SX_ID,
-                                            GNC_SX_ACCOUNT,
-                                            NULL);
-                acct_guid = kvp_value_get_guid (v);
-                acct = xaccAccountLookup (acct_guid, gnc_get_current_book ());
-                split_cmdty = xaccAccountGetCommodity (acct);
-                if (base_cmdty == NULL)
-                {
-                    base_cmdty = split_cmdty;
-                }
-                multi_commodity |= !gnc_commodity_equal (split_cmdty, base_cmdty);
-
-                v = kvp_frame_get_slot_path (f,
-                                             GNC_SX_ID,
-                                             GNC_SX_CREDIT_FORMULA,
-                                             NULL);
-                if (v
-                        && (str = kvp_value_get_string (v))
-                        && strlen( str ) != 0)
-                {
-                    if (gnc_sx_parse_vars_from_formula (str, vars, &tmp ) < 0)
-                    {
-                        GString *errStr;
-
-                        errStr = g_string_sized_new (32);
-                        g_string_printf (errStr,
-                                         _( "Couldn't parse credit formula for "
-                                            "split \"%s\"."),
-                                         xaccSplitGetMemo (s));
-                        gnc_error_dialog (GTK_WIDGET (sxed->dialog), "%s",
-                                          errStr->str);
-                        g_string_free (errStr, TRUE);
-
-                        return FALSE;
-                    }
-                    tcds->creditSum =
-                        gnc_numeric_add (tcds->creditSum, tmp, 100,
-                                         (GNC_DENOM_AUTO | GNC_HOW_DENOM_LCD));
-                    tmp = gnc_numeric_zero();
-                }
-                v = kvp_frame_get_slot_path (f,
-                                             GNC_SX_ID,
-                                             GNC_SX_DEBIT_FORMULA,
-                                             NULL);
-                if (v
-                        && (str = kvp_value_get_string (v))
-                        && strlen(str) != 0 )
-                {
-                    if (gnc_sx_parse_vars_from_formula (str, vars, &tmp ) < 0)
-                    {
-                        GString *errStr;
-
-                        errStr = g_string_sized_new (32);
-                        g_string_printf (errStr,
-                                         _( "Couldn't parse debit formula for "
-                                            "split \"%s\"."),
-                                         xaccSplitGetMemo (s));
-                        gnc_error_dialog (GTK_WIDGET (sxed->dialog), "%s",
-                                          (gchar*)errStr->str);
-                        g_string_free (errStr, TRUE);
-
-                        return FALSE;
-                    }
-                    tcds->debitSum = gnc_numeric_add (tcds->debitSum, tmp, 100,
-                                                      (GNC_DENOM_AUTO | GNC_HOW_DENOM_LCD));
-                    tmp = gnc_numeric_zero();
-                }
-            }
-
-            g_hash_table_foreach (txns,
-                                  check_credit_debit_balance,
-                                  &unbalanceable);
-        }
-
-        /* Subtract out pre-defined vars */
-        if (g_hash_table_lookup_extended (vars, "i",
-                                         &unusedKey,
-                                         &unusedValue))
-        {
-            ttVarCount -= 1;
-        }
-
-        g_hash_table_destroy (vars);
-        g_hash_table_destroy (txns);
-
-        if (unbalanceable
-                && !gnc_verify_dialog (sxed->dialog, FALSE,
-                                       "%s",
-                                       _("The Scheduled Transaction Editor "
-                                         "cannot automatically balance "
-                                         "this transaction. "
-                                         "Should it still be "
-                                         "entered?")))
-        {
-            return FALSE;
-        }
-    }
-
-    /* read out data back into SchedXaction object. */
-    /* FIXME: this is getting too deep; split out. */
-    {
-        gchar *name, *nameKey;
-        gboolean nameExists, nameHasChanged;
-        GList *sxList;
-
-        name = gtk_editable_get_chars (GTK_EDITABLE (sxed->nameEntry), 0, -1);
-        if (strlen (name) == 0 )
-        {
-            const char *sx_has_no_name_msg =
-                _("Please name the Scheduled Transaction.");
-            gnc_error_dialog (sxed->dialog, "%s", sx_has_no_name_msg);
-            g_free (name);
-            return FALSE;
-
-        }
-
-        nameExists = FALSE;
-        nameKey = g_utf8_collate_key (name, -1);
-        nameHasChanged =
-            (xaccSchedXactionGetName (sxed->sx) == NULL)
-            || (strcmp (xaccSchedXactionGetName (sxed->sx), name) != 0);
-        for ( sxList =
-                    gnc_book_get_schedxactions (gnc_get_current_book())->sx_list;
-                nameHasChanged && !nameExists && sxList;
-                sxList = sxList->next )
-        {
-            char *existingName, *existingNameKey;
-            existingName =
-                xaccSchedXactionGetName ((SchedXaction*)sxList->data);
-            existingNameKey = g_utf8_collate_key (existingName, -1);
-            nameExists |= (strcmp (nameKey, existingNameKey) == 0);
-            g_free (existingNameKey);
-        }
-        if (nameHasChanged && nameExists)
-        {
-            const char *sx_has_existing_name_msg =
-                _("A Scheduled Transaction with the "
-                   "name \"%s\" already exists. "
-                   "Are you sure you want to name "
-                   "this one the same?");
-            if (!gnc_verify_dialog (sxed->dialog, FALSE,
-                                      sx_has_existing_name_msg,
-                                      name))
-            {
-                g_free (nameKey);
-                g_free (name);
-                return FALSE;
-            }
-        }
-        g_free (nameKey);
-        g_free (name);
-    }
-
-    // @@FIXME: similar to below, check the commodities involved, and disallow autocreation
-    {
-        gboolean autocreateState;
-
-        autocreateState =
-            gtk_toggle_button_get_active (
-                GTK_TOGGLE_BUTTON (sxed->autocreateOpt));
-
-        if (((ttVarCount > 0) || multi_commodity) && autocreateState)
-        {
-            gnc_warning_dialog (sxed->dialog, "%s",
-                               _("Scheduled Transactions with variables "
-                                 "cannot be automatically created."));
-            return FALSE;
-        }
-
-        /* Fix for part of Bug#121740 -- auto-create transactions are
-         * only valid if there's actually a transaction to create. */
-        if (autocreateState && splitCount == 0)
-        {
-            gnc_warning_dialog (sxed->dialog, "%s",
-                               _("Scheduled Transactions without a template "
-                                 "transaction cannot be automatically created."));
-            return FALSE;
-        }
-    }
-
-    /* deal with time. */
-    {
-        GDate startDate, endDate, nextDate;
-
-        if (!gtk_toggle_button_get_active (sxed->optEndDate)
-                && !gtk_toggle_button_get_active (sxed->optEndCount)
-                && !gtk_toggle_button_get_active (sxed->optEndNone) )
-        {
-            const char *sx_end_spec_msg =
-                _("Please provide a valid end selection.");
-            gnc_error_dialog (sxed->dialog, "%s", sx_end_spec_msg);
-            return FALSE;
-        }
-
-        if (gtk_toggle_button_get_active (sxed->optEndCount))
-        {
-            gint occur, rem;
-
-            occur  =
-                gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (sxed->endCountSpin));
-
-            rem =
-                gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (sxed->endRemainSpin));
-
-            if (occur == 0)
-            {
-                const char *sx_occur_count_zero_msg =
-                    _("There must be some number of occurrences.");
-                gnc_error_dialog (sxed->dialog, "%s",
-                                  sx_occur_count_zero_msg);
-                return FALSE;
-            }
-
-            if (rem > occur)
-            {
-                const char *sx_occur_counts_wrong_msg =
-                    _("The number of remaining occurrences "
-                       "(%d) is greater than the number of "
-                       "total occurrences (%d).");
-                gnc_error_dialog (sxed->dialog,
-                                  sx_occur_counts_wrong_msg,
-                                  rem, occur);
-                return FALSE;
-            }
-
-        }
-
-        g_date_clear (&endDate, 1);
-        if ( gtk_toggle_button_get_active(sxed->optEndDate))
-        {
-            gnc_gdate_set_time64 (&endDate,
-                               gnc_date_edit_get_date (sxed->
-                                       endDateEntry));
-        }
-
-        g_date_clear (&nextDate, 1);
-        gnc_frequency_save_to_recurrence (sxed->gncfreq, &schedule, &startDate);
-        if (g_list_length (schedule) > 0)
-        {
-            g_date_subtract_days (&startDate, 1);
-            recurrenceListNextInstance (schedule, &startDate, &nextDate);
-        }
-        recurrenceListFree (&schedule);
-
-        if (!g_date_valid (&nextDate)
-                || (g_date_valid (&endDate) && (g_date_compare (&nextDate, &endDate) > 0)))
-        {
-            const char *invalid_sx_check_msg =
-                _("You have attempted to create a Scheduled "
-                  "Transaction which will never run. Do you "
-                  "really want to do this?");
-            if (!gnc_verify_dialog (sxed->dialog, FALSE,
-                                   "%s", invalid_sx_check_msg))
-                return FALSE;
-        }
-    }
-    return TRUE;
-}
-
-
-/******************************************************************************
- * Saves the contents of the SX.  This assumes that gnc_sxed_check_consistent
- * has returned true.
- *****************************************************************************/
-static void
-gnc_sxed_save_sx (GncSxEditorDialog2 *sxed )
-{
-    gnc_sx_begin_edit (sxed->sx);
-
-    /* name */
-    {
-        char *name;
-
-        name = gtk_editable_get_chars (sxed->nameEntry, 0, -1);
-        xaccSchedXactionSetName (sxed->sx, name);
-        g_free (name);
-    }
-
-    /* date */
-    {
-        GDate gdate;
-
-        if (gtk_toggle_button_get_active (sxed->optEndDate))
-        {
-            /* get the end date data */
-            gnc_gdate_set_time64 (&gdate,
-                               gnc_date_edit_get_date (
-                                   sxed->endDateEntry));
-            xaccSchedXactionSetEndDate (sxed->sx, &gdate);
-            /* set the num occurrences data */
-            xaccSchedXactionSetNumOccur (sxed->sx, 0);
-        }
-        else if (gtk_toggle_button_get_active (sxed->optEndCount))
-        {
-            gint num;
-
-            /* get the occurrences data */
-            num  =
-                gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (sxed->endCountSpin));
-            xaccSchedXactionSetNumOccur (sxed->sx, num);
-
-            num =
-                gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (sxed->endRemainSpin));
-            xaccSchedXactionSetRemOccur (sxed->sx, num );
-
-            g_date_clear (&gdate, 1);
-            xaccSchedXactionSetEndDate (sxed->sx, &gdate);
-        }
-        else if (gtk_toggle_button_get_active (sxed->optEndNone))
-        {
-            xaccSchedXactionSetNumOccur (sxed->sx, 0);
-            g_date_clear (&gdate, 1);
-            xaccSchedXactionSetEndDate (sxed->sx, &gdate);
-        }
-        else
-        {
-            g_critical ("no valid end specified\n");
-        }
-    }
-
-    /* Enabled states */
-    {
-        gboolean enabledState;
-
-        enabledState = gtk_toggle_button_get_active (sxed->enabledOpt);
-        xaccSchedXactionSetEnabled (sxed->sx, enabledState);
-    }
-
-    /* Auto-create/notification states */
-    {
-        gboolean autocreateState, notifyState;
-
-        autocreateState = gtk_toggle_button_get_active (sxed->autocreateOpt);
-        notifyState = gtk_toggle_button_get_active (sxed->notifyOpt);
-        /* "Notify" only makes sense if AutoCreate is actived;
-         * enforce that here. */
-        xaccSchedXactionSetAutoCreate (sxed->sx,
-                                       autocreateState,
-                                       (autocreateState & notifyState));
-    }
-
-    /* days in advance */
-    {
-        int daysInAdvance;
-
-        daysInAdvance = 0;
-        if (gtk_toggle_button_get_active (sxed->advanceOpt))
-        {
-            daysInAdvance =
-                gtk_spin_button_get_value_as_int (sxed->advanceSpin);
-        }
-        xaccSchedXactionSetAdvanceCreation (sxed->sx, daysInAdvance);
-
-        daysInAdvance = 0;
-        if (gtk_toggle_button_get_active (sxed->remindOpt))
-        {
-            daysInAdvance =
-                gtk_spin_button_get_value_as_int (sxed->remindSpin);
-        }
-        xaccSchedXactionSetAdvanceReminder (sxed->sx, daysInAdvance);
-    }
-
-    /* start date and freq spec */
-    {
-        GDate gdate;
-        GList *schedule = NULL;
-
-        gnc_frequency_save_to_recurrence (sxed->gncfreq, &schedule, &gdate);
-        gnc_sx_set_schedule (sxed->sx, schedule);
-        {
-            gchar *recurrence_str = recurrenceListToCompactString (schedule);
-            g_debug("recurrences parsed [%s]", recurrence_str);
-            g_free (recurrence_str);
-        }
-
-        /* now that we have it, set the start date */
-        xaccSchedXactionSetStartDate (sxed->sx, &gdate);
-    }
-
-    gnc_sx_commit_edit (sxed->sx);
-}
-
-
-static void
-enabled_toggled_cb (GtkObject *o, GncSxEditorDialog2 *sxed)
-{
-    return;
-}
-
-
-static void
-autocreate_toggled_cb (GtkObject *o, GncSxEditorDialog2 *sxed)
-{
-    if ( !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(o)))
-    {
-        gtk_toggle_button_set_active (sxed->notifyOpt, FALSE);
-    }
-    gtk_widget_set_sensitive (GTK_WIDGET (sxed->notifyOpt),
-                              gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(o)));
-}
-
-
-static void
-advance_toggled_cb (GtkButton *o, GncSxEditorDialog2 *sxed)
-{
-
-    gtk_widget_set_sensitive(GTK_WIDGET (sxed->advanceSpin),
-                              gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sxed->advanceOpt)));
-    gtk_editable_set_editable(GTK_EDITABLE (sxed->advanceSpin), TRUE);
-}
-
-
-static void
-remind_toggled_cb (GtkButton *o, GncSxEditorDialog2 *sxed)
-{
-
-    gtk_widget_set_sensitive (GTK_WIDGET (sxed->remindSpin),
-                              gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sxed->remindOpt)));
-    gtk_editable_set_editable (GTK_EDITABLE (sxed->remindSpin), TRUE);
-}
-
-
-/* Local destruction of dialog */
-static void
-scheduledxaction_editor_dialog_destroy (GtkObject *object, gpointer data)
-{
-    GncSxEditorDialog2 *sxed = data;
-
-    if (sxed == NULL)
-        return;
-
-    gnc_unregister_gui_component_by_data
-    (DIALOG_SCHEDXACTION2_EDITOR_CM_CLASS, sxed);
-
-    gnc_embedded_window_close_page (sxed->embed_window, sxed->plugin_page);
-    gtk_widget_destroy (GTK_WIDGET (sxed->embed_window));
-    sxed->embed_window = NULL;
-    sxed->plugin_page = NULL;
-    sxed->ledger = NULL;
-
-    g_free (sxed->sxGUIDstr);
-    sxed->sxGUIDstr = NULL;
-
-    if ( sxed->newsxP )
-    {
-        /* FIXME: WTF???
-         *
-         * "WTF" explaination: in the "new" click from the caller, we
-         * set this flag.  When "ok" is pressed on the dialog, we set
-         * this flag to false, and thus leave the SX live.  If
-         * "Cancel" is clicked, the flag will still be true, and this
-         * SX will be cleaned, here. -- jsled
-         */
-        gnc_sx_begin_edit (sxed->sx);
-        xaccSchedXactionDestroy (sxed->sx);
-    }
-    sxed->sx = NULL;
-
-    g_free (sxed);
-}
-
-
-static
-gboolean
-sxed_delete_event (GtkWidget *widget, GdkEvent *event, gpointer ud)
-{
-    GncSxEditorDialog2 *sxed = (GncSxEditorDialog2*)ud;
-
-    /* We've already processed the SX, likely because of "ok" being
-     * clicked. */
-    if (sxed->sx == NULL)
-    {
-        return FALSE;
-    }
-
-    if (!sxed_confirmed_cancel (sxed))
-    {
-        return TRUE;
-    }
-    return FALSE;
-}
-
-
-/*************************************
- * Create the Schedule Editor Dialog *
- ************************************/
-GncSxEditorDialog2 *
-gnc_ui_scheduled_xaction_editor_dialog_create2 (SchedXaction *sx,
-					       gboolean newSX)
-{
-    GncSxEditorDialog2 *sxed;
-    GtkBuilder *builder;
-    GtkWidget *button;
-    int i;
-    GList *dlgExists = NULL;
-
-    static struct widgetSignalCallback
-    {
-        char     *name;
-        char     *signal;
-        void     (*fn)();
-        gpointer objectData;
-    } widgets[] =
-    {
-        { "ok_button",      "clicked",       editor_ok_button_clicked_cb,     NULL },
-        { "cancel_button",  "clicked",       editor_cancel_button_clicked_cb, NULL },
-        { "help_button",    "clicked",       editor_help_button_clicked_cb,   NULL },
-        { "rb_noend",       "toggled",       endgroup_rb_toggled_cb,          GINT_TO_POINTER(END_NEVER_OPTION) },
-        { "rb_enddate",     "toggled",       endgroup_rb_toggled_cb,          GINT_TO_POINTER(END_DATE_OPTION) },
-        { "rb_num_occur",   "toggled",       endgroup_rb_toggled_cb,          GINT_TO_POINTER(NUM_OCCUR_OPTION) },
-        { "remain_spin" ,   "value-changed", sxed_excal_update_adapt_cb,      NULL },
-        { "enabled_opt",    "toggled",       enabled_toggled_cb,              NULL },
-        { "autocreate_opt", "toggled",       autocreate_toggled_cb,           NULL },
-        { "advance_opt",    "toggled",       advance_toggled_cb,              NULL },
-        { "remind_opt",     "toggled",       remind_toggled_cb,               NULL },
-        { NULL,             NULL,            NULL,                            NULL }
-    };
-
-    dlgExists = gnc_find_gui_components (DIALOG_SCHEDXACTION2_EDITOR_CM_CLASS,
-                                         editor_component_sx_equality,
-                                         sx);
-    if (dlgExists != NULL)
-    {
-        g_debug ("dialog already exists; using that one.");
-        sxed = (GncSxEditorDialog2*)dlgExists->data;
-        gtk_window_present (GTK_WINDOW (sxed->dialog));
-        g_list_free (dlgExists);
-        return sxed;
-    }
-
-    sxed = g_new0 (GncSxEditorDialog2, 1);
-
-    sxed->sx     = sx;
-    sxed->newsxP = newSX;
-
-    /* Load up Glade file */
-    builder = gtk_builder_new();
-    gnc_builder_add_from_file (builder, "dialog-sx.glade", "advance_days_adj");
-    gnc_builder_add_from_file (builder, "dialog-sx.glade", "remind_days_adj");
-    gnc_builder_add_from_file (builder, "dialog-sx.glade", "end_spin_adj");
-    gnc_builder_add_from_file (builder, "dialog-sx.glade", "remain_spin_adj");
-    gnc_builder_add_from_file (builder, "dialog-sx.glade", "Scheduled Transaction Editor");
-
-    sxed->builder = builder;
-
-    /* Connect the Widgets */
-    sxed->dialog = GTK_WIDGET (gtk_builder_get_object (builder, "Scheduled Transaction Editor"));
-    sxed->notebook = GTK_NOTEBOOK (gtk_builder_get_object (builder, "editor_notebook"));
-    sxed->nameEntry = GTK_EDITABLE (gtk_builder_get_object (builder, "sxe_name"));
-    sxed->enabledOpt = GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "enabled_opt"));
-    sxed->autocreateOpt = GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "autocreate_opt"));
-    sxed->notifyOpt = GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "notify_opt"));
-    sxed->advanceOpt = GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "advance_opt"));
-    sxed->advanceSpin = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "advance_days"));
-    sxed->remindOpt = GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "remind_opt"));
-    sxed->remindSpin = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "remind_days"));
-    sxed->lastOccurLabel = GTK_LABEL (gtk_builder_get_object (builder, "last_occur_label"));
-    sxed->optEndNone = GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "rb_noend"));
-    sxed->optEndDate = GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "rb_enddate"));
-    sxed->optEndCount = GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "rb_num_occur"));
-    sxed->endCountSpin = GTK_ENTRY (gtk_builder_get_object (builder, "end_spin"));
-    sxed->endRemainSpin = GTK_ENTRY (gtk_builder_get_object (builder, "remain_spin"));
-
-    /* Setup the end-date GNC widget */
-    {
-        GtkWidget *endDateBox = GTK_WIDGET (gtk_builder_get_object (builder, "end_date_hbox"));
-        sxed->endDateEntry = GNC_DATE_EDIT (gnc_date_edit_new (gnc_time (NULL),
-							      FALSE, FALSE));
-        gtk_widget_show (GTK_WIDGET (sxed->endDateEntry));
-        g_signal_connect (sxed->endDateEntry, "date-changed",
-                          G_CALLBACK (sxed_excal_update_adapt_cb), sxed);
-        gtk_box_pack_start (GTK_BOX (endDateBox), GTK_WIDGET (sxed->endDateEntry),
-                            TRUE, TRUE, 0 );
-    }
-
-    gnc_register_gui_component (DIALOG_SCHEDXACTION2_EDITOR_CM_CLASS,
-                                NULL, /* no refresh handler */
-                                sxed_close_handler,
-                                sxed);
-
-    g_signal_connect (sxed->dialog, "delete_event",
-                      G_CALLBACK (sxed_delete_event), sxed);
-    g_signal_connect (sxed->dialog, "destroy",
-                      G_CALLBACK (scheduledxaction_editor_dialog_destroy),
-                      sxed );
-
-    for (i = 0; widgets[i].name != NULL; i++)
-    {
-        button = GTK_WIDGET (gtk_builder_get_object (builder, widgets[i].name));
-        if (widgets[i].objectData != NULL)
-        {
-            g_object_set_data (G_OBJECT (button), "whichOneAmI",
-                               widgets[i].objectData);
-        }
-        g_signal_connect (button, widgets[i].signal,
-                          G_CALLBACK (widgets[i].fn ), sxed);
-    }
-
-    /* Set sensitivity settings  */
-    gtk_widget_set_sensitive (GTK_WIDGET (sxed->notifyOpt), FALSE );
-    gtk_widget_set_sensitive (GTK_WIDGET (sxed->advanceSpin), FALSE );
-    gtk_widget_set_sensitive (GTK_WIDGET (sxed->remindSpin), FALSE );
-    gtk_widget_set_sensitive (GTK_WIDGET (sxed->endCountSpin), FALSE );
-    gtk_widget_set_sensitive (GTK_WIDGET (sxed->endRemainSpin), FALSE );
-    gtk_editable_set_editable (GTK_EDITABLE (sxed->advanceSpin), TRUE );
-    gtk_editable_set_editable (GTK_EDITABLE (sxed->remindSpin), TRUE );
-
-    /* Allow resize */
-    gtk_window_set_resizable (GTK_WINDOW (sxed->dialog), TRUE);
-    gnc_restore_window_size (GNC_PREFS_GROUP_SXED, GTK_WINDOW (sxed->dialog));
-
-    /* create the frequency-selection widget and example [dense-]calendar. */
-    schedXact_editor_create_freq_sel (sxed);
-
-    /* create the template-transaction ledger window */
-    schedXact_editor_create_ledger (sxed);
-
-    /* populate */
-    schedXact_editor_populate (sxed);
-
-    /* Do not call show_all here. Screws up the gtkuimanager code */
-    gtk_widget_show (sxed->dialog);
-    gtk_notebook_set_current_page (GTK_NOTEBOOK (sxed->notebook), 0);
-
-    /* Refresh the cal and the ledger */
-    gtk_widget_queue_resize (GTK_WIDGET (sxed->example_cal));
-
-    gnc_ledger_display2_refresh (sxed->ledger);
-
-    /* Move keyboard focus to the name entry */
-    gtk_widget_grab_focus (GTK_WIDGET (sxed->nameEntry));
-
-    gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, sxed);
-    g_object_unref (G_OBJECT (builder));
-
-    return sxed;
-}
-
-
-static
-void
-schedXact_editor_create_freq_sel (GncSxEditorDialog2 *sxed)
-{
-    GtkBox *b;
-
-    b = GTK_BOX (gtk_builder_get_object (sxed->builder, "gncfreq_hbox"));
-
-    sxed->gncfreq =
-        GNC_FREQUENCY (gnc_frequency_new_from_recurrence (gnc_sx_get_schedule (sxed->sx),
-                      xaccSchedXactionGetStartDate (sxed->sx)));
-    g_assert (sxed->gncfreq);
-    g_signal_connect (sxed->gncfreq, "changed",
-                      G_CALLBACK (gnc_sxed_freq_changed),
-                      sxed );
-    gtk_container_add (GTK_CONTAINER (b), GTK_WIDGET (sxed->gncfreq) );
-
-    b = GTK_BOX(gtk_builder_get_object (sxed->builder, "example_cal_hbox" ));
-    sxed->dense_cal_model = gnc_dense_cal_store_new (EX_CAL_NUM_MONTHS * 31);
-    sxed->example_cal = GNC_DENSE_CAL (gnc_dense_cal_new_with_model (GNC_DENSE_CAL_MODEL (sxed->dense_cal_model)));
-    g_assert (sxed->example_cal);
-    gnc_dense_cal_set_num_months (sxed->example_cal, EX_CAL_NUM_MONTHS);
-    gnc_dense_cal_set_months_per_col( sxed->example_cal, EX_CAL_MO_PER_COL);
-    gtk_container_add (GTK_CONTAINER (b), GTK_WIDGET (sxed->example_cal));
-    gtk_widget_show (GTK_WIDGET (sxed->example_cal));
-}
-
-
-static
-void
-schedXact_editor_create_ledger (GncSxEditorDialog2 *sxed)
-{
-    GncTreeModelSplitReg *model;
-    GtkWidget *main_vbox;
-    GtkWidget *label;
-
-    /* Create the ledger */
-    /* THREAD-UNSAFE */
-    sxed->sxGUIDstr = g_strdup (guid_to_string (xaccSchedXactionGetGUID (sxed->sx)));
-    sxed->ledger = gnc_ledger_display2_template_gl (sxed->sxGUIDstr);
-    model = gnc_ledger_display2_get_split_model_register (sxed->ledger);
-
-    /* First the embedded window */
-    main_vbox = GTK_WIDGET (gtk_builder_get_object (sxed->builder, "register_vbox" ));
-    sxed->embed_window =
-        gnc_embedded_window_new ("SXWindowActions",
-                                gnc_sxed_menu_entries,
-                                gnc_sxed_menu_n_entries,
-                                "gnc-sxed-window-ui.xml",
-                                sxed->dialog,
-                                FALSE, /* no accelerators */
-                                sxed);
-
-    gtk_box_pack_start (GTK_BOX (main_vbox), GTK_WIDGET (sxed->embed_window), TRUE, TRUE, 0);
-
-    label = gtk_label_new (_("Note: If you have already accepted changes to the Template, Cancel will not revoke them."));
-    gtk_box_pack_end (GTK_BOX (main_vbox), GTK_WIDGET (label), FALSE, TRUE, 0);
-    gtk_widget_show (label);
-
-    /* Now create the register plugin page. */
-    sxed->plugin_page = gnc_plugin_page_register2_new_ledger (sxed->ledger);
-    gnc_plugin_page_set_ui_description (sxed->plugin_page,
-                                        "gnc-sxed-window-ui-full.xml");
-    gnc_plugin_page_register2_set_options (sxed->plugin_page,
-                                          NUM_LEDGER_LINES_DEFAULT, FALSE );
-
-    gnc_embedded_window_open_page (sxed->embed_window, sxed->plugin_page);
-
-    /* configure... */
-    /* use double-line, so scheduled transaction Notes can be edited */
-    gnc_tree_model_split_reg_config (model, model->type, model->style, TRUE);
-}
-
-
-
-static
-void
-schedXact_editor_populate (GncSxEditorDialog2 *sxed)
-{
-    char *name;
-    time64 tmpDate;
-    GncTreeModelSplitReg *model;
-    struct tm *tmpTm;
-    const GDate *gd;
-    gint daysInAdvance;
-    gboolean enabledState, autoCreateState, notifyState;
-
-    name = xaccSchedXactionGetName (sxed->sx);
-    if (name != NULL)
-    {
-        gtk_entry_set_text (GTK_ENTRY (sxed->nameEntry), name);
-    }
-    {
-        gd = xaccSchedXactionGetLastOccurDate (sxed->sx);
-        if (g_date_valid (gd))
-        {
-            gchar dateBuf[ MAX_DATE_LENGTH+1 ];
-            qof_print_gdate (dateBuf, MAX_DATE_LENGTH, gd);
-            gtk_label_set_text (sxed->lastOccurLabel, dateBuf);
-        }
-        else
-        {
-            gtk_label_set_text (sxed->lastOccurLabel, _("(never)"));
-        }
-        gd = NULL;
-    }
-
-    gd = xaccSchedXactionGetEndDate (sxed->sx);
-    if ( g_date_valid (gd))
-    {
-        gtk_toggle_button_set_active (sxed->optEndDate, TRUE);
-        tmpDate = gnc_time64_get_day_start_gdate (gd);
-        gnc_date_edit_set_time (sxed->endDateEntry, tmpDate);
-
-        set_endgroup_toggle_states (sxed, END_DATE);
-    }
-    else if (xaccSchedXactionHasOccurDef (sxed->sx))
-    {
-        gint numOccur = xaccSchedXactionGetNumOccur (sxed->sx);
-        gint numRemain = xaccSchedXactionGetRemOccur (sxed->sx);
-
-        gtk_toggle_button_set_active (sxed->optEndCount, TRUE);
-
-        gtk_spin_button_set_value (GTK_SPIN_BUTTON (sxed->endCountSpin), numOccur);
-        gtk_spin_button_set_value (GTK_SPIN_BUTTON (sxed->endRemainSpin), numRemain);
-
-        set_endgroup_toggle_states (sxed, END_OCCUR);
-    }
-    else
-    {
-        gtk_toggle_button_set_active (sxed->optEndNone, TRUE);
-        set_endgroup_toggle_states (sxed, END_NEVER);
-    }
-
-    enabledState = xaccSchedXactionGetEnabled (sxed->sx);
-    gtk_toggle_button_set_active (sxed->enabledOpt, enabledState);
-
-    /* Do auto-create/notify setup */
-    if (sxed->newsxP)
-    {
-        autoCreateState =
-            gnc_prefs_get_bool (GNC_PREFS_GROUP_SXED, GNC_PREF_CREATE_AUTO);
-        notifyState =
-            gnc_prefs_get_bool (GNC_PREFS_GROUP_SXED, GNC_PREF_NOTIFY);
-    }
-    else
-    {
-        xaccSchedXactionGetAutoCreate (sxed->sx,
-                                       &autoCreateState,
-                                       &notifyState);
-    }
-    gtk_toggle_button_set_active (sxed->autocreateOpt, autoCreateState);
-    if (!autoCreateState)
-    {
-        notifyState = FALSE;
-    }
-    gtk_toggle_button_set_active( sxed->notifyOpt, notifyState );
-
-    /* Do days-in-advance-to-create widget[s] setup. */
-    if ( sxed->newsxP )
-    {
-        daysInAdvance =
-            gnc_prefs_get_float (GNC_PREFS_GROUP_SXED, GNC_PREF_CREATE_DAYS);
-    }
-    else
-    {
-        daysInAdvance =
-            xaccSchedXactionGetAdvanceCreation (sxed->sx);
-    }
-    if (daysInAdvance != 0)
-    {
-        gtk_toggle_button_set_active (sxed->advanceOpt, TRUE);
-        gtk_spin_button_set_value (sxed->advanceSpin,
-                                   (gfloat)daysInAdvance);
-    }
-
-    /* Do days-in-advance-to-remind widget[s] setup. */
-    if (sxed->newsxP)
-    {
-        daysInAdvance =
-            gnc_prefs_get_float (GNC_PREFS_GROUP_SXED, GNC_PREF_REMIND_DAYS);
-    }
-    else
-    {
-        daysInAdvance =
-            xaccSchedXactionGetAdvanceReminder (sxed->sx);
-    }
-    if (daysInAdvance != 0)
-    {
-        gtk_toggle_button_set_active (sxed->remindOpt, TRUE);
-        gtk_spin_button_set_value (sxed->remindSpin,
-                                   (gfloat)daysInAdvance);
-    }
-
-    if (sxed->newsxP)
-    {
-        gnc_sx_set_instance_count (sxed->sx, 1);
-    }
-
-    /* populate the ledger */
-    {
-        /* create the split list */
-        GList        *splitList;
-
-        splitList = xaccSchedXactionGetSplits (sxed->sx);
-        if (splitList != NULL)
-        {
-            model = gnc_ledger_display2_get_split_model_register (sxed->ledger);
-            gnc_tree_model_split_reg_load (model, splitList, NULL );
-        } /* otherwise, use the existing stuff. */
-    }
-
-    /* Update the example cal */
-    gnc_sxed_update_cal (sxed);
-}
-
-
-static
-void
-set_endgroup_toggle_states (GncSxEditorDialog2 *sxed, EndType type)
-{
-    gtk_widget_set_sensitive (GTK_WIDGET (sxed->endDateEntry), (type == END_DATE) );
-    gtk_widget_set_sensitive (GTK_WIDGET (sxed->endCountSpin), (type == END_OCCUR) );
-    gtk_widget_set_sensitive (GTK_WIDGET (sxed->endRemainSpin), (type == END_OCCUR) );
-}
-
-
-static
-void
-endgroup_rb_toggled_cb (GtkButton *b, gpointer d)
-{
-    /* figure out which one */
-    GncSxEditorDialog2 *sxed;
-    gint id;
-
-    sxed = (GncSxEditorDialog2*)d;
-    id = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (b), "whichOneAmI"));
-
-    switch (id)
-    {
-    case END_NEVER_OPTION:
-        set_endgroup_toggle_states (sxed, END_NEVER);
-        break;
-    case END_DATE_OPTION:
-        set_endgroup_toggle_states (sxed, END_DATE);
-        break;
-    case NUM_OCCUR_OPTION:
-        set_endgroup_toggle_states (sxed, END_OCCUR);
-        break;
-    default:
-        g_critical ("Unknown id %d", id);
-        break;
-    }
-    gnc_sxed_update_cal (sxed);
-}
-
-
-/********************************************************************\
- * gnc_register_check_close                                         *
- *                                                                  *
- * Args:   regData - the data struct for this register              *
- * Return: none                                                     *
-\********************************************************************/
-static void
-gnc_sxed_reg_check_close (GncSxEditorDialog2 *sxed)
-{
-    GncTreeViewSplitReg *view;
-    Transaction *dirty_trans;
-
-    const char *message =
-        _("The current template transaction "
-          "has been changed. "
-          "Would you like to record the changes?");
-
-    view = gnc_ledger_display2_get_split_view_register (sxed->ledger);
-
-    dirty_trans = gnc_tree_view_split_reg_get_dirty_trans (view);
-
-    if (dirty_trans == NULL)
-        return;
-
-    if (gnc_verify_dialog (sxed->dialog, TRUE, "%s", message))
-    {
-        /* Save the template transactions changes */
-        xaccTransCommitEdit (dirty_trans);
-        gnc_tree_view_split_reg_set_dirty_trans (view, NULL);
-        return;
-    }
-    else
-    {
-        /* Cancel the template transactions changes */
-        gnc_tree_view_split_reg_cancel_edit (view, TRUE);
-    }
-}
-
-
-static gboolean
-editor_component_sx_equality (gpointer find_data,
-                              gpointer user_data)
-{
-    return ((SchedXaction*)find_data
-             == ((GncSxEditorDialog2*)user_data)->sx);
-}
-/*
-typedef enum { NO_END, DATE_END, COUNT_END } END_TYPE;
-*/
-
-static void
-gnc_sxed_update_cal (GncSxEditorDialog2 *sxed)
-{
-    GList *recurrences = NULL;
-    GDate start_date, first_date;
-
-    g_date_clear (&start_date, 1);
-
-    gnc_frequency_save_to_recurrence (sxed->gncfreq, &recurrences, &start_date);
-    g_date_subtract_days (&start_date, 1);
-    recurrenceListNextInstance (recurrences, &start_date, &first_date);
-
-    /* Deal with the fact that this SX may have been run before [the
-     * calendar should only show upcoming instances]... */
-    {
-        const GDate *last_sx_inst;
-
-        last_sx_inst = xaccSchedXactionGetLastOccurDate (sxed->sx);
-        if (g_date_valid (last_sx_inst)
-                && g_date_valid (&first_date)
-                && g_date_compare (last_sx_inst, &first_date) != 0)
-        {
-            start_date = *last_sx_inst;
-            recurrenceListNextInstance (recurrences, &start_date, &first_date);
-        }
-    }
-
-    if (!g_date_valid (&first_date))
-    {
-        /* Nothing to do. */
-        gnc_dense_cal_store_clear (sxed->dense_cal_model);
-        goto cleanup;
-    }
-
-    gnc_dense_cal_store_update_name (sxed->dense_cal_model, xaccSchedXactionGetName (sxed->sx));
-    {
-        gchar *schedule_desc = recurrenceListToCompactString (recurrences);
-        gnc_dense_cal_store_update_info (sxed->dense_cal_model, schedule_desc);
-        g_free (schedule_desc);
-    }
-
-    //gnc_dense_cal_set_month(sxed->example_cal, g_date_get_month(&first_date));
-    //gnc_dense_cal_set_year(sxed->example_cal, g_date_get_year(&first_date));
-
-    /* figure out the end restriction */
-    if (gtk_toggle_button_get_active (sxed->optEndDate))
-    {
-        GDate end_date;
-        g_date_clear (&end_date, 1);
-        gnc_gdate_set_time64 (&end_date, gnc_date_edit_get_date (sxed->endDateEntry));
-        gnc_dense_cal_store_update_recurrences_date_end (sxed->dense_cal_model, &first_date, recurrences, &end_date);
-    }
-    else if (gtk_toggle_button_get_active (sxed->optEndNone))
-    {
-        gnc_dense_cal_store_update_recurrences_no_end (sxed->dense_cal_model, &first_date, recurrences);
-    }
-    else if (gtk_toggle_button_get_active (sxed->optEndCount))
-    {
-        gint num_remain
-        = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (sxed->endRemainSpin));
-        gnc_dense_cal_store_update_recurrences_count_end (sxed->dense_cal_model, &first_date, recurrences, num_remain);
-    }
-    else
-    {
-        g_error ("unknown end condition");
-    }
-
-cleanup:
-    recurrenceListFree (&recurrences);
-}
-
-
-static void
-gnc_sxed_freq_changed (GncFrequency *gf, gpointer ud)
-{
-    gnc_sxed_update_cal ((GncSxEditorDialog2*)ud);
-}
-
-
-static void
-sxed_excal_update_adapt_cb (GtkObject *o, gpointer ud)
-{
-    gnc_sxed_update_cal ((GncSxEditorDialog2*)ud);
-}
-
-
-static void
-on_sx_check_toggled_cb (GtkWidget *togglebutton, gpointer user_data)
-{
-    GtkWidget *widget_notify;
-    GHashTable *table;
-
-    PINFO("Togglebutton is %p and user_data is %p", togglebutton, user_data);
-    PINFO("Togglebutton builder name is %s", gtk_buildable_get_name (GTK_BUILDABLE (togglebutton)));
-
-    /* We need to use the hash table to find the required widget to activate. */
-    table = g_object_get_data(G_OBJECT(user_data), "prefs_widget_hash");
-    widget_notify = g_hash_table_lookup(table, "pref/" GNC_PREFS_GROUP_SXED "/" GNC_PREF_NOTIFY);
-
-    if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(togglebutton)))
-        gtk_widget_set_sensitive (widget_notify, TRUE);
-    else
-        gtk_widget_set_sensitive (widget_notify, FALSE);
-}
-
-
-/* ------------------------------------------------------------ */
-/* sx app engine;  move to somewhere appropriate. :/            */
-
-typedef struct _acct_deletion_handler_data
-{
-    GList *affected_sxes;
-    GtkWidget *dialog;
-} acct_deletion_handler_data;
-
-
-static void
-_open_editors (GtkDialog *dialog, gint response_code, gpointer data)
-{
-    acct_deletion_handler_data *adhd = (acct_deletion_handler_data *)data;
-    gtk_widget_hide (adhd->dialog);
-    {
-        GList *sx_iter;
-        for (sx_iter = adhd->affected_sxes; sx_iter; sx_iter = sx_iter->next)
-        {
-            gnc_ui_scheduled_xaction_editor_dialog_create2 ((SchedXaction*)sx_iter->data,
-                    FALSE);
-        }
-    }
-    g_list_free (adhd->affected_sxes);
-    gtk_widget_destroy (GTK_WIDGET (adhd->dialog));
-    g_free (adhd);
-}
-
-
-static void
-_sx_engine_event_handler (QofInstance *ent, QofEventId event_type, gpointer user_data, gpointer evt_data)
-{
-    Account *acct;
-    QofBook *book;
-    GList *affected_sxes;
-
-    if (!(event_type & QOF_EVENT_DESTROY))
-        return;
-    if (!GNC_IS_ACCOUNT(ent))
-        return;
-    acct = GNC_ACCOUNT(ent);
-    book = qof_instance_get_book (QOF_INSTANCE (acct));
-    affected_sxes = gnc_sx_get_sxes_referencing_account (book, acct);
-
-    if (g_list_length (affected_sxes) == 0)
-        return;
-
-    {
-        GList *sx_iter;
-        acct_deletion_handler_data *data;
-        GtkBuilder *builder;
-        GtkWidget *dialog;
-        GtkListStore *name_list;
-        GtkTreeView *list;
-        GtkTreeViewColumn *name_column;
-        GtkCellRenderer *renderer;
-
-        builder = gtk_builder_new();
-        gnc_builder_add_from_file (builder, "dialog-sx.glade", "Account Deletion");
-
-        dialog = GTK_WIDGET (gtk_builder_get_object (builder, "Account Deletion"));
-
-        list = GTK_TREE_VIEW (gtk_builder_get_object (builder, "sx_list"));
-
-        data = (acct_deletion_handler_data*)g_new0 (acct_deletion_handler_data, 1);
-        data->dialog = dialog;
-        data->affected_sxes = affected_sxes;
-        name_list = gtk_list_store_new (1, G_TYPE_STRING);
-        for (sx_iter = affected_sxes; sx_iter != NULL; sx_iter = sx_iter->next)
-        {
-            SchedXaction *sx;
-            GtkTreeIter iter;
-            gchar *sx_name;
-
-            sx = (SchedXaction*)sx_iter->data;
-            sx_name = xaccSchedXactionGetName (sx);
-            gtk_list_store_append (name_list, &iter);
-            gtk_list_store_set (name_list, &iter, 0, sx_name, -1);
-        }
-        gtk_tree_view_set_model (list, GTK_TREE_MODEL (name_list));
-        g_object_unref (G_OBJECT (name_list));
-
-        renderer = gtk_cell_renderer_text_new();
-        name_column = gtk_tree_view_column_new_with_attributes (_("Name"),
-                      renderer,
-                      "text", 0, NULL);
-        gtk_tree_view_append_column (list, name_column);
-
-        g_signal_connect (G_OBJECT (dialog), "response",
-                         G_CALLBACK (_open_editors), data);
-
-        gtk_widget_show_all (GTK_WIDGET (dialog));
-        gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, data);
-        g_object_unref (G_OBJECT (builder));
-    }
-}
-
-
-void
-gnc_ui_sx_initialize2 (void) //FIXME need to remove the 2 when live
-{
-    _sx_engine_event_handler_id = qof_event_register_handler (_sx_engine_event_handler, NULL);
-
-    gnc_hook_add_dangler (HOOK_BOOK_OPENED,
-                         (GFunc)gnc_sx_sxsincelast_book_opened, NULL);
-
-    /* Add page to preferences page for Sheduled Transactions */
-    /* The parameters are; glade file, items to add from glade file - last being the dialog, preference tab name */
-    gnc_preferences_add_page ("dialog-sx.glade",
-                              "create_days_adj,remind_days_adj,sx_prefs",
-                              _("Scheduled Transactions"));
-}

Deleted: gnucash/trunk/src/gnome/dialog-sx-editor2.h
===================================================================
--- gnucash/trunk/src/gnome/dialog-sx-editor2.h	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/dialog-sx-editor2.h	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,50 +0,0 @@
-/********************************************************************\
- * dialog-sx-editor2.h : dialog for scheduled transaction editing    *
- * Copyright (C) 2001,2006 Joshua Sled <jsled at asynchronous.org>     *
- *                                                                  *
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of version 2 and/or version 3 of the   *
- * GNU General Public License as published by the Free Software     *
- * Foundation.                                                      *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
-\********************************************************************/
-
-#ifndef DIALOG_SX_EDITOR2_H
-#define DIALOG_SX_EDITOR2_H
-
-#include "SchedXaction.h"
-
-#define DIALOG_SCHEDXACTION2_CM_CLASS "dialog-scheduledtransactions"
-#define DIALOG_SCHEDXACTION2_EDITOR_CM_CLASS "dialog-scheduledtransaction-editor"
-
-#define GNC_PREFS_GROUP_SXED "dialogs.sxs.transaction-editor"
-#define GNC_PREF_CREATE_DAYS "create-days"
-#define GNC_PREF_REMIND_DAYS "remind-days"
-#define GNC_PREF_CREATE_AUTO "create-auto"
-#define GNC_PREF_NOTIFY      "notify"
-
-typedef struct _GncSxEditorDialog2 GncSxEditorDialog2;
-
-GncSxEditorDialog2* gnc_ui_scheduled_xaction_editor_dialog_create2 (SchedXaction *sx,
-        gboolean newSX);
-
-void gnc_ui_scheduled_xaction_editor_dialog_destroy2 (GncSxEditorDialog2 *sxd);
-
-/**
- * Sets up a book opened hook.  The function called may open a "since
- * last run" dialog based upon the user's preferences.
- **/
-void gnc_ui_sx_initialize2 (void);
-
-#endif

Modified: gnucash/trunk/src/gnome/dialog-sx-since-last-run.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-sx-since-last-run.c	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/dialog-sx-since-last-run.c	2013-10-22 18:26:55 UTC (rev 23314)
@@ -45,10 +45,8 @@
 #include "gnc-ui-util.h"
 #include "Query.h"
 #include "qof.h"
-/*################## Added for Reg2 #################*/
-#include "gnc-ledger-display2.h"
-#include "gnc-plugin-page-register2.h"
-/*################## Added for Reg2 #################*/
+#include "gnc-ledger-display.h"
+#include "gnc-plugin-page-register.h"
 #include "gnc-main-window.h"
 #include "gnc-component-manager.h"
 #include "gnc-gui-query.h"
@@ -1008,7 +1006,7 @@
 static void
 _show_created_transactions(GncSxSinceLastRunDialog *app_dialog, GList *created_txn_guids)
 {
-    GNCLedgerDisplay2 *ledger;
+    GNCLedgerDisplay *ledger;
     GncPluginPage *page;
     Query *book_query, *guid_query, *query;
     GList *guid_iter;
@@ -1021,12 +1019,12 @@
         xaccQueryAddGUIDMatch(guid_query, (GncGUID*)guid_iter->data, GNC_ID_TRANS, QOF_QUERY_OR);
     }
     query = qof_query_merge(book_query, guid_query, QOF_QUERY_AND);
-/*################## Added for Reg2 #################*/
+
     // inspired by dialog-find-transactions:do_find_cb:
-    ledger = gnc_ledger_display2_query(query, SEARCH_LEDGER2, REG2_STYLE_JOURNAL);
-    gnc_ledger_display2_refresh(ledger);
-    page = gnc_plugin_page_register2_new_ledger(ledger);
-/*################## Added for Reg2 #################*/
+    ledger = gnc_ledger_display_query(query, SEARCH_LEDGER, REG_STYLE_JOURNAL);
+    gnc_ledger_display_refresh(ledger);
+    page = gnc_plugin_page_register_new_ledger(ledger);
+
     g_object_set(G_OBJECT(page), "page-name", _("Created Transactions"), NULL);
     gnc_main_window_open_page(NULL, page);
 

Modified: gnucash/trunk/src/gnome/gnc-plugin-basic-commands.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-basic-commands.c	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/gnc-plugin-basic-commands.c	2013-10-22 18:26:55 UTC (rev 23314)
@@ -43,7 +43,6 @@
 #include "dialog-file-access.h"
 #include "dialog-fincalc.h"
 #include "dialog-find-transactions.h"
-#include "dialog-find-transactions2.h"
 #include "dialog-sx-since-last-run.h"
 #include "dialog-totd.h"
 #include "assistant-acct-period.h"
@@ -624,10 +623,7 @@
 static void
 gnc_main_window_cmd_tools_find_transactions (GtkAction *action, GncMainWindowActionData *data)
 {
-//    gnc_ui_find_transactions_dialog_create (NULL);
-/*################## Added for Reg2 #################*/
-    gnc_ui_find_transactions_dialog_create2 (NULL);
-/*################## Added for Reg2 #################*/
+    gnc_ui_find_transactions_dialog_create (NULL);
 }
 
 static void

Modified: gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.c	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.c	2013-10-22 18:26:55 UTC (rev 23314)
@@ -38,7 +38,6 @@
 #include <glib/gi18n.h>
 #include "gnc-plugin-page-account-tree.h"
 #include "gnc-plugin-page-register.h"
-#include "gnc-plugin-page-register2.h"
 
 #include "Scrub.h"
 #include "Scrub3.h"
@@ -146,10 +145,6 @@
 static void gnc_plugin_page_account_tree_cmd_scrub_sub (GtkAction *action, GncPluginPageAccountTree *page);
 static void gnc_plugin_page_account_tree_cmd_scrub_all (GtkAction *action, GncPluginPageAccountTree *page);
 
-/* Command callback for new Register Test */
-static void gnc_plugin_page_account_tree_cmd_open2_account (GtkAction *action, GncPluginPageAccountTree *page);
-static void gnc_plugin_page_account_tree_cmd_open2_subaccounts (GtkAction *action, GncPluginPageAccountTree *page);
-
 static guint plugin_page_signals[LAST_SIGNAL] = { 0 };
 
 
@@ -170,23 +165,13 @@
         G_CALLBACK (gnc_plugin_page_account_tree_cmd_file_new_hierarchy)
     },
     {
-        "FileOpenAccount2Action", GNC_STOCK_OPEN_ACCOUNT, N_("Open _Account"), NULL,
-        N_("Open the selected account"),
-        G_CALLBACK (gnc_plugin_page_account_tree_cmd_open2_account)
-    },
-    {
-        "FileOpenAccountAction", GNC_STOCK_OPEN_ACCOUNT, N_("Open _Old Style Register Account"), NULL,
-        N_("Open the old style register selected account"),
+        "FileOpenAccountAction", GNC_STOCK_OPEN_ACCOUNT, N_("Open _Account"), NULL,
+        N_("Open selected account"),
         G_CALLBACK (gnc_plugin_page_account_tree_cmd_open_account)
     },
     {
-        "FileOpenSubaccounts2Action", GNC_STOCK_OPEN_ACCOUNT, N_("Open _SubAccounts"), NULL,
-        N_("Open the selected account and all its subaccounts"),
-        G_CALLBACK (gnc_plugin_page_account_tree_cmd_open2_subaccounts)
-    },
-    {
-        "FileOpenSubaccountsAction", GNC_STOCK_OPEN_ACCOUNT, N_("Open Old St_yle Subaccounts"), NULL,
-        N_("Open the old style register selected account and all its subaccounts"),
+        "FileOpenSubaccountsAction", GNC_STOCK_OPEN_ACCOUNT, N_("Open _Subaccounts"), NULL,
+        N_("Open selected account and all its subaccounts"),
         G_CALLBACK (gnc_plugin_page_account_tree_cmd_open_subaccounts)
     },
 
@@ -276,7 +261,6 @@
 static const gchar *actions_requiring_account_always[] =
 {
     "FileOpenAccountAction",
-    "FileOpenAccount2Action",
     "FileOpenSubaccountsAction",
     "ActionsLotsAction",
     NULL
@@ -304,7 +288,6 @@
 static action_toolbar_labels toolbar_labels[] =
 {
     { "FileOpenAccountAction", 	            N_("Open") },
-    { "FileOpenAccount2Action", 	    N_("Open2") },
     { "EditEditAccountAction", 	            N_("Edit") },
     { "FileNewAccountAction",    	    N_("New") },
     { "EditDeleteAccountAction", 	    N_("Delete") },
@@ -399,7 +382,7 @@
     g_object_set(G_OBJECT(plugin_page),
                  "page-name",      _("Accounts"),
                  "page-uri",       "default:",
-                 "ui-description", "gnc-plugin-page-account-tree2-ui.xml",
+                 "ui-description", "gnc-plugin-page-account-tree-ui.xml",
                  NULL);
     g_signal_connect (G_OBJECT (plugin_page), "selected",
                       G_CALLBACK (gnc_plugin_page_account_tree_selected), plugin_page);
@@ -792,26 +775,7 @@
     gnc_main_window_open_page (GNC_MAIN_WINDOW(window), new_page);
 }
 
-/*################## Added for Reg2 #################*/
-/*        New Register Common                        */
 static void
-gppat_open2_account_common (GncPluginPageAccountTree *page,
-                           Account *account,
-                           gboolean include_subs)
-{
-    GtkWidget *window;
-    GncPluginPage *new_page;
-
-    if (account == NULL)
-        return;
-
-    window = GNC_PLUGIN_PAGE (page)->window;
-    new_page = gnc_plugin_page_register2_new (account, include_subs);
-    gnc_main_window_open_page (GNC_MAIN_WINDOW(window), new_page);
-}
-/*################## Added for Reg2 #################*/
-
-static void
 gnc_plugin_page_account_tree_double_click_cb (GtkTreeView *treeview,
                                               GtkTreePath        *path,
                                               GtkTreeViewColumn  *col,
@@ -839,7 +803,7 @@
         {
             /* It's an account without any children, so open its register */
             Account *account = gnc_tree_view_account_get_account_from_path (GNC_TREE_VIEW_ACCOUNT(treeview), path);
-            gppat_open2_account_common (page, account, FALSE);
+            gppat_open_account_common (page, account, FALSE);
         }
     }
 }
@@ -929,34 +893,7 @@
     gppat_open_account_common (page, account, TRUE);
 }
 
-
-/*################## Added for Reg2 #################*/
-/* Register Firing - Single Account to start with    */
 static void
-gnc_plugin_page_account_tree_cmd_open2_account (GtkAction *action,
-        GncPluginPageAccountTree *page)
-{
-    Account *account;
-
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE (page));
-    account = gnc_plugin_page_account_tree_get_current_account (page);
-    gppat_open2_account_common (page, account, FALSE);
-}
-
-static void
-gnc_plugin_page_account_tree_cmd_open2_subaccounts (GtkAction *action,
-        GncPluginPageAccountTree *page)
-{
-    Account *account;
-
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_ACCOUNT_TREE (page));
-    account = gnc_plugin_page_account_tree_get_current_account (page);
-    gppat_open2_account_common (page, account, TRUE);
-}
-/*################## Added for Reg2 #################*/
-
-
-static void
 gnc_plugin_page_account_tree_cmd_edit_account (GtkAction *action, GncPluginPageAccountTree *page)
 {
     Account *account;

Modified: gnucash/trunk/src/gnome/gnc-plugin-page-register.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-register.c	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-register.c	2013-10-22 18:26:55 UTC (rev 23314)
@@ -42,9 +42,6 @@
 #include "swig-runtime.h"
 
 #include "gnc-plugin-page-register.h"
-/*################## Added for Reg2 #################*/
-#include "gnc-plugin-page-register2.h"
-/*################## Added for Reg2 #################*/
 #include "gnc-plugin-register.h"
 #include "gnc-plugin-menu-additions.h"
 #include "gnc-plugin-page-report.h"
@@ -634,32 +631,9 @@
     GncPluginPage *page;
     GncPluginPageRegisterPrivate *priv;
 
-/*################## Added for Reg2 #################*/
-    const GList *item;
-    GncPluginPageRegister2  *new_register_page;
-/*################## Added for Reg2 #################*/
-
     ENTER("account=%p, subaccounts=%s", account,
           subaccounts ? "TRUE" : "FALSE");
 
-/*################## Added for Reg2 #################*/
-    // We test for the new register being open here, ie matching account guids
-    item = gnc_gobject_tracking_get_list (GNC_PLUGIN_PAGE_REGISTER2_NAME);
-    for ( ; item; item = g_list_next (item))
-    {
-        Account *new_account;
-        new_register_page = (GncPluginPageRegister2 *)item->data;
-        new_account = gnc_plugin_page_register2_get_account (new_register_page);
-
-        if (guid_equal (xaccAccountGetGUID (account), xaccAccountGetGUID (new_account)))
-        {
-            gnc_error_dialog (NULL, "%s",
-                         _("You have tried to open an account in the old register while it is open in the new register."));
-            return NULL;
-        }
-    }
-/*################## Added for Reg2 #################*/
-
     if (subaccounts)
         ledger = gnc_ledger_display_subaccounts (account);
     else

Deleted: gnucash/trunk/src/gnome/gnc-plugin-page-register2.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-register2.c	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-register2.c	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,4049 +0,0 @@
-/**********************************************************************
- * gnc-plugin-page-register2.c -- register page functions             *
- *                                                                    *
- * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>       *
- * Copyright (C) 2003,2005,2006 David Hampton <hampton at employees.org> *
- * Copyright (C) 2011, Robert Fewell                                  *
- *                                                                    *
- * 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 ContentPlugins
-    @{ */
-/** @addtogroup RegisterPlugin Register Page
-    @{ */
-/** @file gnc-plugin-page-register.c
-    @brief  Functions providing a register page for the GnuCash UI
-    @author Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
-    @author Copyright (C) 2003,2005 David Hampton <hampton at employees.org>
-*/
-
-#include "config.h"
-
-#include <libguile.h>
-#include "guile-mappings.h"
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#include "swig-runtime.h"
-
-#include "gnc-plugin-page-register2.h"
-/*################## Added for Reg2 #################*/
-#include "gnc-plugin-page-register.h"
-/*################## Added for Reg2 #################*/
-#include "gnc-plugin-register2.h"
-#include "gnc-plugin-menu-additions.h"
-#include "gnc-plugin-page-report.h"
-
-#include "gnc-tree-view.h"
-#include "gnc-tree-view-split-reg.h"
-#include "gnc-tree-model-split-reg.h"
-#include "gnc-tree-control-split-reg.h"
-
-#include "dialog-account.h"
-#include "dialog-find-transactions2.h"
-#include "dialog-print-check2.h"
-#include "dialog-transfer.h"
-#include "dialog-utils.h"
-#include "SX-book.h"
-#include "dialog-sx-editor.h"
-/*################## Added for Reg2 #################*/
-#include "dialog-sx-editor2.h"
-/*################## Added for Reg2 #################*/
-#include "dialog-sx-from-trans.h"
-#include "assistant-stock-split.h"
-#include "gnc-component-manager.h"
-#include "gnc-date.h"
-#include "gnc-date-edit.h"
-#include "gnc-engine.h"
-#include "gnc-event.h"
-#include "gnc-gnome-utils.h"
-#include "gnc-gobject-utils.h"
-#include "gnc-gui-query.h"
-#include "gnc-icons.h"
-#include "gnc-prefs.h"
-#include "gnc-split-reg2.h"
-#include "gnc-ui-util.h"
-#include "gnc-window.h"
-#include "gnc-main-window.h"
-#include "gnc-session.h"
-#include "gnome-utils/gnc-warnings.h"
-#include "dialog-lot-viewer.h"
-#include "Scrub.h"
-#include "qof.h"
-#include "window-reconcile2.h"
-#include "window-autoclear.h"
-#include "window-report.h"
-
-/* This static indicates the debugging module that this .o belongs to.  */
-static QofLogModule log_module = GNC_MOD_GUI;
-
-#define DEFAULT_LINES_AMOUNT         50
-
-static void gnc_plugin_page_register2_class_init (GncPluginPageRegister2Class *klass);
-static void gnc_plugin_page_register2_init (GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_finalize (GObject *object);
-
-static GtkWidget *gnc_plugin_page_register2_create_widget (GncPluginPage *plugin_page);
-static void gnc_plugin_page_register2_destroy_widget (GncPluginPage *plugin_page);
-static void gnc_plugin_page_register2_window_changed (GncPluginPage *plugin_page, GtkWidget *window);
-static void gnc_plugin_page_register2_save_page (GncPluginPage *plugin_page, GKeyFile *file, const gchar *group);
-static GncPluginPage *gnc_plugin_page_register2_recreate_page (GtkWidget *window, GKeyFile *file, const gchar *group);
-static void gnc_plugin_page_register2_update_edit_menu (GncPluginPage *page, gboolean hide);
-static gboolean gnc_plugin_page_register2_finish_pending (GncPluginPage *page);
-
-static gboolean gnc_plugin_page_register2_button_press_cb (GtkWidget *widget, GdkEventButton *event, GncPluginPage *page);
-
-static gchar *gnc_plugin_page_register2_get_tab_name (GncPluginPage *plugin_page);
-static gchar *gnc_plugin_page_register2_get_tab_color (GncPluginPage *plugin_page);
-static gchar *gnc_plugin_page_register2_get_long_name (GncPluginPage *plugin_page);
-
-static void gnc_plugin_page_register2_summarybar_position_changed (gpointer prefs, gchar* pref, gpointer user_data);
-
-/* Callbacks for the "Filter By" dialog */
-void gnc_plugin_page_register2_filter_select_range_cb (GtkRadioButton *button, GncPluginPageRegister2 *page);
-void gnc_plugin_page_register2_filter_start_cb (GtkWidget *radio, GncPluginPageRegister2 *page);
-void gnc_plugin_page_register2_filter_end_cb (GtkWidget *radio, GncPluginPageRegister2 *page);
-void gnc_plugin_page_register2_filter_response_cb (GtkDialog *dialog, gint response, GncPluginPageRegister2 *plugin_page);
-void gnc_plugin_page_register2_filter_status_all_cb (GtkButton *button, GncPluginPageRegister2 *plugin_page);
-void gnc_plugin_page_register2_filter_status_one_cb (GtkToggleButton *button, GncPluginPageRegister2 *page);
-void gnc_plugin_page_register2_filter_save_cb (GtkToggleButton *button, GncPluginPageRegister2 *page);
-
-static time64 gnc_plugin_page_register2_filter_dmy2time (char *date_string);
-static gchar *gnc_plugin_page_register2_filter_time2dmy (time64 raw_time);
-static gchar *gnc_plugin_page_register2_get_filter (GncPluginPage *plugin_page);
-void gnc_plugin_page_register2_set_filter (GncPluginPage *plugin_page, const gchar *filter);
-
-static void gnc_ppr_update_status_query (GncPluginPageRegister2 *page, gboolean refresh_page); 
-static void gnc_ppr_update_date_query (GncPluginPageRegister2 *page, gboolean refresh_page); 
-
-/* Command callbacks */
-static void gnc_plugin_page_register2_cmd_print_check (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_cut (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_copy (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_paste (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_edit_account (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_find_transactions (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_cut_transaction (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_copy_transaction (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_paste_transaction (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_void_transaction (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_unvoid_transaction (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_reverse_transaction (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_reload (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_view_filter_by (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_style_changed (GtkAction *action, GtkRadioAction *current, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_style_double_line (GtkToggleAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_style_extra_dates (GtkToggleAction *action, GncPluginPageRegister2 *plugin_page);
-
-static void gnc_plugin_page_register2_cmd_reconcile (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_autoclear (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_transfer (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_stock_split (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_lots (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_enter_transaction (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_cancel_transaction (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_delete_transaction (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_blank_transaction (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_duplicate_transaction (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_reinitialize_transaction (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_expand_transaction (GtkToggleAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_exchange_rate (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_jump (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_schedule (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_scrub_all (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_scrub_current (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_account_report (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_transaction_report (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_entryUp (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-static void gnc_plugin_page_register2_cmd_entryDown (GtkAction *action, GncPluginPageRegister2 *plugin_page);
-
-static void gnc_plugin_page_help_changed_cb (GNCSplitReg2 *gsr, GncPluginPageRegister2 *register_page );
-static void gnc_plugin_page_register2_refresh_cb (GHashTable *changes, gpointer user_data);
-static void gnc_plugin_page_register2_close_cb (gpointer user_data);
-
-static void gnc_plugin_page_register2_ui_update (gpointer various, GncPluginPageRegister2 *page);
-static void gppr_account_destroy_cb (Account *account);
-static void gnc_plugin_page_register2_event_handler (QofInstance *entity,
-        QofEventId event_type,
-        GncPluginPageRegister2 *page,
-        GncEventData *ed);
-
-/************************************************************/
-/*                          Actions                         */
-/************************************************************/
-
-#define CUT_TRANSACTION_LABEL         N_("Cu_t Transaction")
-#define COPY_TRANSACTION_LABEL        N_("_Copy Transaction")
-#define PASTE_TRANSACTION_LABEL       N_("_Paste Transaction")
-#define DUPLICATE_TRANSACTION_LABEL   N_("Dup_licate Transaction")
-#define DELETE_TRANSACTION_LABEL      N_("_Delete Transaction")
-#define CUT_SPLIT_LABEL               N_("Cu_t Split")
-#define COPY_SPLIT_LABEL              N_("_Copy Split")
-#define PASTE_SPLIT_LABEL             N_("_Paste Split")
-#define DUPLICATE_SPLIT_LABEL         N_("Dup_licate Split")
-#define DELETE_SPLIT_LABEL            N_("_Delete Split")
-#define CUT_TRANSACTION_TIP           N_("Cut the selected transaction into clipboard")
-#define COPY_TRANSACTION_TIP          N_("Copy the selected transaction into clipboard")
-#define PASTE_TRANSACTION_TIP         N_("Paste the transaction from the clipboard")
-#define DUPLICATE_TRANSACTION_TIP     N_("Make a copy of the current transaction")
-#define DELETE_TRANSACTION_TIP        N_("Delete the current transaction")
-#define CUT_SPLIT_TIP                 N_("Cut the selected split into clipboard")
-#define COPY_SPLIT_TIP                N_("Copy the selected split into clipboard")
-#define PASTE_SPLIT_TIP               N_("Paste the split from the clipboard")
-#define DUPLICATE_SPLIT_TIP           N_("Make a copy of the current split")
-#define DELETE_SPLIT_TIP              N_("Delete the current split")
-
-#define TRANSACTION_UP_ACTION "TransactionUpAction"
-#define TRANSACTION_DOWN_ACTION "TransactionDownAction"
-
-static GtkActionEntry gnc_plugin_page_register2_actions [] =
-{
-    /* File menu */
-
-    {
-        "FilePrintAction", GTK_STOCK_PRINT, N_("_Print Checks..."), "<control>p", NULL,
-        G_CALLBACK (gnc_plugin_page_register2_cmd_print_check)
-    },
-
-    /* Edit menu */
-
-    {
-        "EditCutAction", GTK_STOCK_CUT, N_("Cu_t"), NULL,
-        N_("Cut the current selection and copy it to clipboard"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_cut)
-    },
-    {
-        "EditCopyAction", GTK_STOCK_COPY, N_("_Copy"), NULL,
-        N_("Copy the current selection to clipboard"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_copy)
-    },
-    {
-        "EditPasteAction", GTK_STOCK_PASTE, N_("_Paste"), NULL,
-        N_("Paste the clipboard content at the cursor position"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_paste)
-    },
-    {
-        "EditEditAccountAction", GNC_STOCK_EDIT_ACCOUNT, N_("Edit _Account"), "<control>e",
-        N_("Edit the selected account"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_edit_account)
-    },
-    {
-        "EditFindTransactionsAction", GTK_STOCK_FIND, N_("_Find..."), "<control>f",
-        N_("Find transactions with a search"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_find_transactions)
-    },
-
-    /* Transaction menu */
-
-    {
-        "CutTransactionAction", GTK_STOCK_CUT, CUT_TRANSACTION_LABEL, "",
-        CUT_TRANSACTION_TIP,
-        G_CALLBACK (gnc_plugin_page_register2_cmd_cut_transaction)
-    },
-    {
-        "CopyTransactionAction", GTK_STOCK_COPY, COPY_TRANSACTION_LABEL, "",
-        COPY_TRANSACTION_TIP,
-        G_CALLBACK (gnc_plugin_page_register2_cmd_copy_transaction)
-    },
-    {
-        "PasteTransactionAction", GTK_STOCK_PASTE, PASTE_TRANSACTION_LABEL, "",
-        PASTE_TRANSACTION_TIP,
-        G_CALLBACK (gnc_plugin_page_register2_cmd_paste_transaction)
-    },
-    {
-        "DuplicateTransactionAction", GTK_STOCK_COPY, DUPLICATE_TRANSACTION_LABEL, "",
-        DUPLICATE_TRANSACTION_TIP,
-        G_CALLBACK (gnc_plugin_page_register2_cmd_duplicate_transaction)
-    },
-    {
-        "DeleteTransactionAction", GTK_STOCK_DELETE, DELETE_TRANSACTION_LABEL, NULL,
-        DELETE_TRANSACTION_TIP,
-        G_CALLBACK (gnc_plugin_page_register2_cmd_delete_transaction)
-    },
-    {
-        "RemoveTransactionSplitsAction", GTK_STOCK_CLEAR, N_("Remo_ve All Splits"), NULL,
-        N_("Remove all splits in the current transaction"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_reinitialize_transaction)
-    },
-    {
-        "RecordTransactionAction", GTK_STOCK_ADD, N_("_Enter Transaction"), NULL,
-        N_("Record the current transaction"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_enter_transaction)
-    },
-    {
-        "CancelTransactionAction", GTK_STOCK_CANCEL, N_("Ca_ncel Transaction"), NULL,
-        N_("Cancel the current transaction"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_cancel_transaction)
-    },
-    {
-        "VoidTransactionAction", NULL, N_("_Void Transaction"), NULL, NULL,
-        G_CALLBACK (gnc_plugin_page_register2_cmd_void_transaction)
-    },
-    {
-        "UnvoidTransactionAction", NULL, N_("_Unvoid Transaction"), NULL, NULL,
-        G_CALLBACK (gnc_plugin_page_register2_cmd_unvoid_transaction)
-    },
-    {
-        "ReverseTransactionAction", NULL, N_("Add _Reversing Transaction"), NULL, NULL,
-        G_CALLBACK (gnc_plugin_page_register2_cmd_reverse_transaction)
-    },
-    {
-        TRANSACTION_UP_ACTION, GTK_STOCK_GO_UP, N_("Move Transaction _Up"), NULL,
-        N_("Move the current transaction one row upwards. Only available if the date and number of both rows are identical and the register window is sorted by date."),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_entryUp)
-    },
-    {
-        TRANSACTION_DOWN_ACTION, GTK_STOCK_GO_DOWN, N_("Move Transaction Do_wn"), NULL,
-        N_("Move the current transaction one row downwards. Only available if the date and number of both rows are identical and the register window is sorted by date."),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_entryDown)
-    },
-
-    /* View menu */
-
-    {
-        "ViewFilterByAction", NULL, N_("_Filter By..."), NULL, NULL,
-        G_CALLBACK (gnc_plugin_page_register2_cmd_view_filter_by)
-    },
-    {
-        "ViewRefreshAction", GTK_STOCK_REFRESH, N_("_Refresh"), "<control>r",
-        N_("Refresh this window"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_reload)
-    },
-
-    /* Actions menu */
-
-    {
-        "ActionsTransferAction", GNC_STOCK_TRANSFER, N_("_Transfer..."), "<control>t",
-        N_("Transfer funds from one account to another"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_transfer)
-    },
-    {
-        "ActionsReconcileAction", GTK_STOCK_INDEX, N_("_Reconcile..."), NULL,
-        N_("Reconcile the selected account"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_reconcile)
-    },
-    {
-        "ActionsAutoClearAction", GTK_STOCK_INDEX, N_("_Auto-clear..."), NULL,
-        N_("Automatically clear individual transactions, so as to reach a certain cleared amount"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_autoclear)
-    },
-    {
-        "ActionsStockSplitAction", NULL, N_("Stoc_k Split..."), NULL,
-        N_("Record a stock split or a stock merger"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_stock_split)
-    },
-    {
-        "ActionsLotsAction", NULL, N_("View _Lots..."), NULL,
-        N_("Bring up the lot viewer/editor window"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_lots)
-    },
-    {
-        "BlankTransactionAction", GTK_STOCK_GOTO_BOTTOM, N_("_Blank Transaction"), "<control>Page_Down",
-        N_("Move to the blank transaction at the bottom of the register"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_blank_transaction)
-    },
-    {
-        "EditExchangeRateAction", NULL, N_("Edit E_xchange Rate"), NULL,
-        N_("Edit the exchange rate for the current transaction"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_exchange_rate)
-    },
-    {
-        "JumpTransactionAction", GNC_STOCK_JUMP_TO, N_("_Jump"), NULL,
-        N_("Jump to the corresponding transaction in the other account"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_jump)
-    },
-    {
-        "ScheduleTransactionAction", GNC_STOCK_SCHEDULE, N_("Sche_dule..."), NULL,
-        N_("Create a Scheduled Transaction with the current transaction as a template"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_schedule)
-    },
-    {
-        "ScrubAllAction", NULL, N_("_All transactions"), NULL, NULL,
-        G_CALLBACK (gnc_plugin_page_register2_cmd_scrub_all)
-    },
-    {
-        "ScrubCurrentAction", NULL, N_("_This transaction"), NULL, NULL,
-        G_CALLBACK (gnc_plugin_page_register2_cmd_scrub_current)
-    },
-
-    /* Reports menu */
-
-    {
-        "ReportsAccountReportAction", NULL, N_("Account Report"), NULL,
-        N_("Open a register report for this Account"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_account_report)
-    },
-    {
-        "ReportsAcctTransReportAction", NULL, N_("Account Report - Single Transaction"), NULL,
-        N_("Open a register report for the selected Transaction"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_transaction_report)
-    },
-};
-
-static guint gnc_plugin_page_register2_n_actions = G_N_ELEMENTS (gnc_plugin_page_register2_actions);
-
-static GtkToggleActionEntry toggle_entries[] =
-{
-    {
-        "ViewStyleDoubleLineAction", NULL, N_("_Double Line"), NULL,
-        N_("Show two lines of information for each transaction"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_style_double_line), FALSE
-    },
-
-    {
-        "ViewStyleExtraDatesAction", NULL, N_("Show _Extra Dates"), NULL,
-        N_("Show entered and reconciled dates"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_style_extra_dates), FALSE
-    },
-
-    {
-        "SplitTransactionAction", GNC_STOCK_SPLIT_TRANS, N_("S_plit Transaction"), NULL,
-        N_("Show all splits in the current transaction"),
-        G_CALLBACK (gnc_plugin_page_register2_cmd_expand_transaction), FALSE
-    },
-};
-
-static guint n_toggle_entries = G_N_ELEMENTS (toggle_entries);
-
-static GtkRadioActionEntry radio_entries_2 [] =
-{
-    /* Translators: This is a menu item in the View menu */
-    {
-        "ViewStyleBasicAction", NULL, N_("_Basic Ledger"), NULL,
-        N_("Show transactions on one or two lines"), REG2_STYLE_LEDGER
-    },
-    /* Translators: This is a menu item in the View menu */
-    {
-        "ViewStyleAutoSplitAction", NULL, N_("_Auto-Split Ledger"), NULL,
-        N_("Show transactions on one or two lines and expand the current transaction"), REG2_STYLE_AUTO_LEDGER
-    },
-    /* Translators: This is a menu item in the View menu */
-    {
-        "ViewStyleJournalAction", NULL, N_("Transaction _Journal"), NULL,
-        N_("Show expanded transactions with all splits"), REG2_STYLE_JOURNAL
-    }
-};
-
-static guint n_radio_entries_2 = G_N_ELEMENTS (radio_entries_2);
-
-/** These are the "important" actions provided by the register page.
- *  Their labels will appear when the toolbar is set to "Icons and
- *  important text" (e.g. GTK_TOOLBAR_BOTH_HORIZ) mode. */
-static const gchar *important_actions[] =
-{
-    "SplitTransactionAction",
-    NULL,
-};
-
-/** Actions that require an account to be selected before they are
- *  enabled. */
-static const gchar *actions_requiring_account[] =
-{
-    "EditEditAccountAction",
-    "ActionsReconcileAction",
-    "ActionsAutoClearAction",
-    "ActionsLotsAction",
-    NULL
-};
-
-/** View Style actions */
-static const gchar *view_style_actions[] =
-{
-    "ViewStyleBasicAction",
-    "ViewStyleAutoSplitAction",
-    "ViewStyleJournalAction",
-    NULL
-};
-
-/** Short labels for use on the toolbar buttons. */
-static action_toolbar_labels toolbar_labels[] =
-{
-    { "ActionsTransferAction", 	  N_("Transfer") },
-    { "RecordTransactionAction", 	  N_("Enter") },
-    { "CancelTransactionAction", 	  N_("Cancel") },
-    { "DeleteTransactionAction", 	  N_("Delete") },
-    { "DuplicateTransactionAction", N_("Duplicate") },
-    { "SplitTransactionAction",     N_("Split") },
-    { "ScheduleTransactionAction",  N_("Schedule") },
-    { "BlankTransactionAction",     N_("Blank") },
-    { "ActionsReconcileAction",     N_("Reconcile") },
-    { "ActionsAutoClearAction",     N_("Auto-clear") },
-    { TRANSACTION_UP_ACTION, N_("Up") },
-    { TRANSACTION_DOWN_ACTION, N_("Down") },
-    { NULL, NULL },
-};
-
-struct status_action
-{
-    const char *action_name;
-    int value;
-    GtkWidget *widget;
-};
-
-static struct status_action status_actions[] =
-{
-    { "filter_status_reconciled",   CLEARED_RECONCILED, NULL },
-    { "filter_status_cleared",      CLEARED_CLEARED, NULL },
-    { "filter_status_voided",       CLEARED_VOIDED, NULL },
-    { "filter_status_frozen",       CLEARED_FROZEN, NULL },
-    { "filter_status_unreconciled", CLEARED_NO, NULL },
-    { NULL, 0, NULL },
-};
-
-#define CLEARED_VALUE "cleared_value"
-#define DEFAULT_FILTER "0x001f"
-
-/************************************************************/
-/*                      Data Structures                     */
-/************************************************************/
-
-typedef struct GncPluginPageRegister2Private
-{
-    GtkWidget *widget;
-
-    GNCLedgerDisplay2 *ledger;
-    GNCSplitReg2 *gsr;
-
-    gint event_handler_id;
-    gint component_manager_id;
-    GncGUID key;  /* The guid of the Account we're watching */
-
-    gint lines_default;
-    gboolean read_only;
-
-    struct
-    {
-        GtkWidget *dialog;
-        GtkWidget *table;
-        GtkWidget *start_date_choose;
-        GtkWidget *start_date_today;
-        GtkWidget *start_date;
-        GtkWidget *end_date_choose;
-        GtkWidget *end_date_today;
-        GtkWidget *end_date;
-        cleared_match_t original_cleared_match;
-        cleared_match_t cleared_match;
-        time64 original_start_time;
-        time64 original_end_time;
-        time64 start_time;
-        time64 end_time;
-        gboolean original_save_filter;
-        gboolean save_filter;
-    } fd;
-} GncPluginPageRegister2Private;
-
-#define GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(o)  \
-   (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_PAGE_REGISTER2, GncPluginPageRegister2Private))
-
-static GObjectClass *parent_class = NULL;
-
-/************************************************************/
-/*                      Implementation                      */
-/************************************************************/
-
-GType
-gnc_plugin_page_register2_get_type (void)
-{
-    static GType gnc_plugin_page_register2_type = 0;
-
-    if (gnc_plugin_page_register2_type == 0)
-    {
-        static const GTypeInfo our_info =
-        {
-            sizeof (GncPluginPageRegister2Class),
-            NULL,
-            NULL,
-            (GClassInitFunc) gnc_plugin_page_register2_class_init,
-            NULL,
-            NULL,
-            sizeof (GncPluginPageRegister2),
-            0,
-            (GInstanceInitFunc) gnc_plugin_page_register2_init
-        };
-
-        gnc_plugin_page_register2_type = g_type_register_static (GNC_TYPE_PLUGIN_PAGE,
-                                        GNC_PLUGIN_PAGE_REGISTER2_NAME,
-                                        &our_info, 0);
-    }
-
-    return gnc_plugin_page_register2_type;
-}
-
-/*#################################################################################*/
-/*#################################################################################*/
-static GncPluginPage *
-gnc_plugin_page_register2_new_common (GNCLedgerDisplay2 *ledger)
-{
-    GncPluginPageRegister2 *register_page;
-    GncPluginPageRegister2Private *priv;
-    GncPluginPage *plugin_page;
-
-    GncTreeModelSplitReg *model; 
-    GtkTreeView *tv; 
-
-    GNCSplitReg2 *gsr;
-
-    const GList *item;
-    GList *book_list;
-    gchar *label;
-    gchar *label_color;
-    QofQuery *q;
-    Account *account;
-
-    /* Is there an existing page? */
-    gsr = gnc_ledger_display2_get_user_data (ledger);
-    if (gsr)
-    {
-        item = gnc_gobject_tracking_get_list (GNC_PLUGIN_PAGE_REGISTER2_NAME);
-        for ( ; item; item = g_list_next (item))
-        {
-            register_page = (GncPluginPageRegister2 *)item->data;
-            priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (register_page);
-            if (priv->gsr == gsr)
-                return GNC_PLUGIN_PAGE (register_page);
-        }
-    }
-
-    register_page = g_object_new (GNC_TYPE_PLUGIN_PAGE_REGISTER2, NULL);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (register_page);
-    priv->ledger = ledger;
-    priv->key = *guid_null();
-
-    plugin_page = GNC_PLUGIN_PAGE (register_page);
-    label = gnc_plugin_page_register2_get_tab_name (plugin_page);
-    gnc_plugin_page_set_page_name (plugin_page, label);
-    g_free (label);
-
-    label_color = gnc_plugin_page_register2_get_tab_color (plugin_page);
-    gnc_plugin_page_set_page_color (plugin_page, label_color);
-    g_free (label_color);
-
-    label = gnc_plugin_page_register2_get_long_name (plugin_page);
-    gnc_plugin_page_set_page_long_name (plugin_page, label);
-    g_free (label);
-
-    q = gnc_ledger_display2_get_query (ledger);
-    book_list = qof_query_get_books (q);
-    for (item = book_list; item; item = g_list_next (item))
-        gnc_plugin_page_add_book (plugin_page, (QofBook *)item->data);
-    // Do not free the list. It is owned by the query.
-
-    priv->component_manager_id = 0;
-    return plugin_page;
-}
-
-/*#################################################################################*/
-
-GncPluginPage *
-gnc_plugin_page_register2_new (Account *account, gboolean subaccounts)
-{
-    GNCLedgerDisplay2 *ledger;
-    GncPluginPage *page;
-    GncPluginPageRegister2Private *priv;
-
-/*################## Added for Reg2 #################*/
-    const GList *item;
-    GncPluginPageRegister  *old_register_page;
-/*################## Added for Reg2 #################*/
-
-    ENTER("account=%p, subaccounts=%s", account,
-          subaccounts ? "TRUE" : "FALSE");
-
-/*################## Added for Reg2 #################*/
-    // We test for the old register being open here, ie matching account guids
-    item = gnc_gobject_tracking_get_list (GNC_PLUGIN_PAGE_REGISTER_NAME);
-    for ( ; item; item = g_list_next (item))
-    {
-        Account *old_account;
-        old_register_page = (GncPluginPageRegister *)item->data;
-        old_account = gnc_plugin_page_register_get_account (old_register_page);
-
-        if (guid_equal (xaccAccountGetGUID (account), xaccAccountGetGUID (old_account)))
-        {
-            gnc_error_dialog (NULL, "%s",
-                         _("You have tried to open an account in the new register while it is open in the old register."));
-            return NULL;
-        }
-    }
-/*################## Added for Reg2 #################*/
-
-    if (subaccounts)
-        ledger = gnc_ledger_display2_subaccounts (account);
-    else
-        ledger = gnc_ledger_display2_simple (account);
-
-    page = gnc_plugin_page_register2_new_common (ledger);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    priv->key = *xaccAccountGetGUID (account);
-
-    LEAVE("%p", page);
-    return page;
-}
-
-GncPluginPage *
-gnc_plugin_page_register2_new_gl (void)
-{
-    GNCLedgerDisplay2 *ledger;
-
-    ledger = gnc_ledger_display2_gl ();
-    return gnc_plugin_page_register2_new_common (ledger);
-}
-
-GncPluginPage *
-gnc_plugin_page_register2_new_ledger (GNCLedgerDisplay2 *ledger)
-{
-    return gnc_plugin_page_register2_new_common (ledger);
-}
-
-static void
-gnc_plugin_page_register2_class_init (GncPluginPageRegister2Class *klass)
-{
-    GObjectClass *object_class = G_OBJECT_CLASS (klass);
-    GncPluginPageClass *gnc_plugin_class = GNC_PLUGIN_PAGE_CLASS(klass);
-
-    parent_class = g_type_class_peek_parent (klass);
-
-    object_class->finalize = gnc_plugin_page_register2_finalize;
-
-    gnc_plugin_class->tab_icon        = GNC_STOCK_ACCOUNT;
-    gnc_plugin_class->plugin_name     = GNC_PLUGIN_PAGE_REGISTER2_NAME;
-    gnc_plugin_class->create_widget   = gnc_plugin_page_register2_create_widget;
-    gnc_plugin_class->destroy_widget  = gnc_plugin_page_register2_destroy_widget;
-    gnc_plugin_class->window_changed  = gnc_plugin_page_register2_window_changed;
-    gnc_plugin_class->save_page       = gnc_plugin_page_register2_save_page;
-    gnc_plugin_class->recreate_page   = gnc_plugin_page_register2_recreate_page;
-    gnc_plugin_class->update_edit_menu_actions = gnc_plugin_page_register2_update_edit_menu;
-    gnc_plugin_class->finish_pending  = gnc_plugin_page_register2_finish_pending;
-
-    g_type_class_add_private(klass, sizeof(GncPluginPageRegister2Private));
-
-    gnc_ui_register_account_destroy_callback (gppr_account_destroy_cb);
-}
-
-static void
-gnc_plugin_page_register2_init (GncPluginPageRegister2 *plugin_page)
-{
-    GncPluginPageRegister2Private *priv;
-    GncPluginPage *parent;
-    GtkActionGroup *action_group;
-    gboolean use_new;
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(plugin_page);
-
-    /* Init parent declared variables */
-    parent = GNC_PLUGIN_PAGE(plugin_page);
-    use_new = gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_USE_NEW);
-    g_object_set(G_OBJECT(plugin_page),
-                 "page-name",      _("General Ledger2"),
-                 "page-uri",       "default:",
-                 "ui-description", "gnc-plugin-page-register2-ui.xml",
-                 "use-new-window", use_new,
-                 NULL);
-
-    /* Create menu and toolbar information */
-    action_group =
-        gnc_plugin_page_create_action_group(parent,
-                                            "GncPluginPageRegister2Actions");
-    gtk_action_group_add_actions (action_group, gnc_plugin_page_register2_actions,
-                                  gnc_plugin_page_register2_n_actions, plugin_page);
-    gtk_action_group_add_toggle_actions (action_group,
-                                         toggle_entries, n_toggle_entries,
-                                         plugin_page);
-    gtk_action_group_add_radio_actions (action_group,
-                                        radio_entries_2, n_radio_entries_2,
-                                        REG2_STYLE_LEDGER,
-                                        G_CALLBACK(gnc_plugin_page_register2_cmd_style_changed),
-                                        plugin_page);
-
-    gnc_plugin_init_short_names (action_group, toolbar_labels);
-    gnc_plugin_set_important_actions (action_group, important_actions);
-
-    priv->lines_default     = DEFAULT_LINES_AMOUNT;
-    priv->read_only         = FALSE;
-    priv->fd.cleared_match  = CLEARED_ALL;
-}
-
-static void
-gnc_plugin_page_register2_finalize (GObject *object)
-{
-    GncPluginPageRegister2 *page;
-    GncPluginPageRegister2Private *priv;
-
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (object));
-
-    ENTER("object %p", object);
-    page = GNC_PLUGIN_PAGE_REGISTER2 (object);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-
-    G_OBJECT_CLASS (parent_class)->finalize (object);
-    LEAVE(" ");
-}
-
-Account *
-gnc_plugin_page_register2_get_account (GncPluginPageRegister2 *page)
-{
-    GncPluginPageRegister2Private *priv;
-    GNCLedgerDisplay2Type ledger_type;
-    Account *leader;
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(page);
-    ledger_type = gnc_ledger_display2_type (priv->ledger);
-    leader = gnc_ledger_display2_leader (priv->ledger);
-
-    if ((ledger_type == LD2_SINGLE) || (ledger_type == LD2_SUBACCOUNT))
-        return leader;
-    return NULL;
-}
-
-/* This is the list of actions which are switched inactive in a read-only book. */
-static const char* readonly_inactive_actions[] =
-{
-    "EditCutAction",
-    "EditPasteAction",
-    "CutTransactionAction",
-    "PasteTransactionAction",
-    TRANSACTION_UP_ACTION,
-    TRANSACTION_DOWN_ACTION,
-    "DuplicateTransactionAction",
-    "DeleteTransactionAction",
-    "RemoveTransactionSplitsAction",
-    "RecordTransactionAction",
-    "CancelTransactionAction",
-    "UnvoidTransactionAction",
-    "VoidTransactionAction",
-    "ReverseTransactionAction",
-    "ActionsTransferAction",
-    "ActionsReconcileAction",
-    "ActionsStockSplitAction",
-    "ScheduleTransactionAction",
-    "ScrubAllAction",
-    "ScrubCurrentAction",
-    NULL
-};
-
-/* This is the list of actions whose text needs to be changed based on whether */
-/* the current cursor class is transaction or split. */
-static const char* tran_vs_split_actions[] =
-{
-    "CutTransactionAction",
-    "CopyTransactionAction",
-    "PasteTransactionAction",
-    "DuplicateTransactionAction",
-    "DeleteTransactionAction",
-    NULL
-};
-
-/* This is the list of labels for when the current cursor class is transaction. */
-static const char* tran_action_labels[] =
-{
-    CUT_TRANSACTION_LABEL,
-    COPY_TRANSACTION_LABEL,
-    PASTE_TRANSACTION_LABEL,
-    DUPLICATE_TRANSACTION_LABEL,
-    DELETE_TRANSACTION_LABEL,
-    NULL
-};
-
-/* This is the list of tooltips for when the current cursor class is transaction. */
-static const char* tran_action_tips[] =
-{
-    CUT_TRANSACTION_TIP,
-    COPY_TRANSACTION_TIP,
-    PASTE_TRANSACTION_TIP,
-    DUPLICATE_TRANSACTION_TIP,
-    DELETE_TRANSACTION_TIP,
-    NULL
-};
-
-/* This is the list of labels for when the current cursor class is split. */
-static const char* split_action_labels[] =
-{
-    CUT_SPLIT_LABEL,
-    COPY_SPLIT_LABEL,
-    PASTE_SPLIT_LABEL,
-    DUPLICATE_SPLIT_LABEL,
-    DELETE_SPLIT_LABEL,
-    NULL
-};
-
-/* This is the list of tooltips for when the current cursor class is split. */
-static const char* split_action_tips[] =
-{
-    CUT_SPLIT_TIP,
-    COPY_SPLIT_TIP,
-    PASTE_SPLIT_TIP,
-    DUPLICATE_SPLIT_TIP,
-    DELETE_SPLIT_TIP,
-    NULL
-};
-
-static void
-gnc_plugin_page_register2_ui_update (gpointer various, GncPluginPageRegister2 *page) // this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-    GncTreeModelSplitReg *model;
-    GtkAction *action;
-    gboolean expanded, voided;
-    Transaction *trans;
-
-    /* Set 'Split Transaction' */
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    g_return_if_fail(priv);
-    model = gnc_ledger_display2_get_split_model_register (priv->ledger);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-    g_return_if_fail(model);
-    g_return_if_fail(view);
-
-    expanded = gnc_tree_view_split_reg_trans_expanded (view, NULL);
-    action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page),
-                                         "SplitTransactionAction");
-    gtk_action_set_sensitive (action, model->style == REG2_STYLE_LEDGER);
-    g_signal_handlers_block_by_func
-    (action, gnc_plugin_page_register2_cmd_expand_transaction, page);
-    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), expanded);
-    g_signal_handlers_unblock_by_func
-    (action, gnc_plugin_page_register2_cmd_expand_transaction, page);
-
-    /* Set 'Void' and 'Unvoid' */
-    trans = gnc_tree_view_split_reg_get_current_trans (view);
-    voided = xaccTransHasSplitsInState (trans, VREC); 
-
-    action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page),
-                                         "VoidTransactionAction");
-    gtk_action_set_sensitive (GTK_ACTION (action), !voided);
-
-    action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page),
-                                         "UnvoidTransactionAction");
-    gtk_action_set_sensitive (GTK_ACTION (action), voided);
-
-    /* Modify the activeness of the up/down arrows */
-    {
-        GtkAction *action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page), TRANSACTION_UP_ACTION);
-        gtk_action_set_sensitive(action,
-                                 gnc_tree_control_split_reg_is_current_movable_updown(view, TRUE));
-        action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page), TRANSACTION_DOWN_ACTION);
-        gtk_action_set_sensitive(action,
-                                 gnc_tree_control_split_reg_is_current_movable_updown(view, FALSE));
-    }
-
-    /* If we are in a readonly book, make any modifying action inactive */
-    if (qof_book_is_readonly(gnc_get_current_book ()))
-    {
-        const char **iter;
-        for (iter = readonly_inactive_actions; *iter; ++iter)
-        {
-            /* Set the action's sensitivity */
-            GtkAction *action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page), *iter);
-            gtk_action_set_sensitive (action, FALSE);
-        }
-    }
-
-    /* Modifying action descriptions based on row depth */
-    {
-        RowDepth depth;
-        const char **iter, **label_iter, **tooltip_iter;
-        gboolean curr_label_trans = FALSE;
-        depth = gnc_tree_view_reg_get_selected_row_depth (view);
-        iter = tran_vs_split_actions;
-        action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page), *iter);
-        label_iter = tran_action_labels;
-        if (g_strcmp0 (gtk_action_get_label (action), _(*label_iter)) == 0)
-            curr_label_trans = TRUE;
-        if ((depth == SPLIT3) && curr_label_trans)
-        {
-            label_iter = split_action_labels;
-            tooltip_iter = split_action_tips;
-            for (iter = tran_vs_split_actions; *iter; ++iter)
-            {
-                /* Adjust the action's label and tooltip */
-                action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page), *iter);
-                gtk_action_set_label (action, _(*label_iter));
-                gtk_action_set_tooltip (action, _(*tooltip_iter));
-                ++label_iter;
-                ++tooltip_iter;
-            }
-        }
-        else if ((depth == TRANS1 || depth == TRANS2) && !curr_label_trans)
-        {
-            label_iter = tran_action_labels;
-            tooltip_iter = tran_action_tips;
-            for (iter = tran_vs_split_actions; *iter; ++iter)
-            {
-                /* Adjust the action's label and tooltip */
-                action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page), *iter);
-                gtk_action_set_label (action, _(*label_iter));
-                gtk_action_set_tooltip (action, _(*tooltip_iter));
-                ++label_iter;
-                ++tooltip_iter;
-            }
-        }
-    }
-}
-
-static void
-gnc_plugin_page_register2_ui_initial_state (GncPluginPageRegister2 *page) // this works
-{
-    GncPluginPageRegister2Private *priv ;
-    GtkActionGroup *action_group;
-    GtkAction *action;
-    Account *account;
-    GncTreeViewSplitReg *view;
-    GncTreeModelSplitReg *model;
-    GNCLedgerDisplay2Type ledger_type;
-    int i;
-    gboolean is_readwrite = !qof_book_is_readonly (gnc_get_current_book());
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    account = gnc_plugin_page_register2_get_account (page);
-    action_group = gnc_plugin_page_get_action_group (GNC_PLUGIN_PAGE (page));
-    gnc_plugin_update_actions(action_group, actions_requiring_account,
-                              "sensitive", is_readwrite && account != NULL);
-
-    /* Set "style" radio button */
-    ledger_type = gnc_ledger_display2_type (priv->ledger);
-    gnc_plugin_update_actions (action_group, view_style_actions,
-                              "sensitive", ledger_type == LD2_SINGLE);
-
-    model = gnc_ledger_display2_get_split_model_register (priv->ledger);
-    for (i = n_radio_entries_2 - 1; i > 0; i--)
-    {
-        DEBUG(" index %d: comparing %x to %x", i, radio_entries_2[i].value,
-              model->style);
-        if (radio_entries_2[i].value == model->style)
-        {
-            DEBUG("match");
-            break;
-        }
-    }
-
-    /* Either a match was found, or fell out with i = 0 */
-    action = gtk_action_group_get_action (action_group, radio_entries_2[i].name);
-    g_signal_handlers_block_by_func (action, gnc_plugin_page_register2_cmd_style_changed, page);
-    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
-    g_signal_handlers_unblock_by_func (action, gnc_plugin_page_register2_cmd_style_changed, page);
-
-    view = gnc_split_reg2_get_register (priv->gsr);
-
-    /* Set "double line" toggle button */
-    action = gtk_action_group_get_action (action_group, "ViewStyleDoubleLineAction");
-    g_signal_handlers_block_by_func (action, gnc_plugin_page_register2_cmd_style_double_line, page);
-    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), model->use_double_line);
-    g_signal_handlers_unblock_by_func (action, gnc_plugin_page_register2_cmd_style_double_line, page);
-
-    /* Set "extra dates" toggle button */
-    action = gtk_action_group_get_action (action_group, "ViewStyleExtraDatesAction");
-    g_signal_handlers_block_by_func (action, gnc_plugin_page_register2_cmd_style_extra_dates, page);
-    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), view->show_extra_dates);
-    g_signal_handlers_unblock_by_func (action, gnc_plugin_page_register2_cmd_style_extra_dates, page);
-}
-
-
-/*#################################################################################*/
-/*#################################################################################*/
-/* Virtual Functions */
-
-static GtkWidget *
-gnc_plugin_page_register2_create_widget (GncPluginPage *plugin_page)
-{
-    GncPluginPageRegister2 *page;
-    GncPluginPageRegister2Private *priv;
-    GNCLedgerDisplay2Type ledger_type;
-    GncWindow *gnc_window;
-    guint numRows;
-    GtkWidget *gsr;
-
-    GncTreeViewSplitReg *view;
-    GncTreeModelSplitReg *model;
-    Account *acct;
-    gchar **filter;
-    gchar *order;
-    int filter_changed = 0;
-
-    ENTER("page %p", plugin_page);
-    page = GNC_PLUGIN_PAGE_REGISTER2 (plugin_page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    if (priv->widget != NULL)
-    {
-        LEAVE("existing widget %p", priv->widget);
-        return priv->widget;
-    }
-
-    priv->widget = gtk_vbox_new (FALSE, 0);
-    gtk_widget_show (priv->widget);
-
-    numRows = priv->lines_default;
-    numRows = MIN (numRows, DEFAULT_LINES_AMOUNT);
-
-    gnc_window = GNC_WINDOW (GNC_PLUGIN_PAGE (page)->window);
-
-    gsr = gnc_split_reg2_new (priv->ledger,
-                            gnc_window_get_gtk_window (gnc_window),
-                            numRows, priv->read_only);
-    priv->gsr = (GNCSplitReg2 *)gsr;
-    gtk_widget_show (gsr);
-
-    gtk_box_pack_start (GTK_BOX (priv->widget), gsr, TRUE, TRUE, 0);
-
-    g_signal_connect (G_OBJECT (gsr), "help-changed",
-                      G_CALLBACK (gnc_plugin_page_help_changed_cb),
-                      page );
-
-    view = gnc_split_reg2_get_register (priv->gsr);
-
-    // Callback for right mouse events
-    g_signal_connect (G_OBJECT (GTK_TREE_VIEW (view)), "button-press-event",
-                      G_CALLBACK (gnc_plugin_page_register2_button_press_cb), page);
-
-    model = gnc_ledger_display2_get_split_model_register (priv->ledger);
-
-    gnc_tree_model_split_reg_config (model, model->type, model->style, model->use_double_line);
-
-    gnc_plugin_page_register2_ui_initial_state (page);
-    gnc_plugin_page_register2_ui_update (NULL, page);
-
-    ledger_type = gnc_ledger_display2_type (priv->ledger);
-
-    if (ledger_type == LD2_SINGLE || ledger_type == LD2_SUBACCOUNT || ledger_type == LD2_GL)
-    {
-        /* Set the filter for the split register and status of save filter button */
-        priv->fd.save_filter = FALSE;
-
-        filter = g_strsplit(gnc_plugin_page_register2_get_filter (plugin_page), ",", -1);
-
-        PINFO("Loaded Filter Status is %s", filter[0]);
-
-        priv->fd.cleared_match = (gint)g_ascii_strtoll (filter[0], NULL, 16 );
-
-        if (filter[0] && (g_strcmp0 (filter[0], DEFAULT_FILTER) != 0))
-            filter_changed = filter_changed + 1;
-
-        if (filter[1] && (g_strcmp0 (filter[1], "0") != 0 ))
-        {
-            PINFO("Loaded Filter Start Date is %s", filter[1]);
-
-            priv->fd.start_time = gnc_plugin_page_register2_filter_dmy2time (filter[1]);
-            priv->fd.start_time = gnc_time64_get_day_start (priv->fd.start_time);
-            filter_changed = filter_changed + 1;
-
-            if (filter[2] && (g_strcmp0 (filter[2], "0") != 0 ))
-            {
-                PINFO("Loaded Filter End Date is %s", filter[2]);
-
-                priv->fd.end_time = gnc_plugin_page_register2_filter_dmy2time (filter[2]);
-                priv->fd.end_time = gnc_time64_get_day_end (priv->fd.end_time);
-                filter_changed = filter_changed + 1;
-            }
-        }
-
-        if (filter_changed != 0)
-            priv->fd.save_filter = TRUE;
-
-        priv->fd.original_save_filter = priv->fd.save_filter;
-        g_strfreev (filter);
-
-        /* Update Query with Filter Status and Dates */
-        gnc_ppr_update_status_query (page, FALSE);
-        gnc_ppr_update_date_query (page, FALSE);
-    }
-
-//FIXME may change, can we load filter at same time of sort so we do one querry on load
-    gnc_ledger_display2_refresh (priv->ledger);
-
-    /* This sets the default selection on load, not required for templates */
-    if (!gnc_tree_model_split_reg_get_template (model))
-       gnc_tree_view_split_reg_default_selection (view);
-
-    plugin_page->summarybar = gnc_split_reg2_create_summary_bar (priv->gsr);
-    if (plugin_page->summarybar)
-    {
-        gtk_widget_show_all (plugin_page->summarybar);
-        gtk_box_pack_start (GTK_BOX (priv->widget), plugin_page->summarybar,
-                           FALSE, FALSE, 0);
-        gnc_plugin_page_register2_summarybar_position_changed (NULL, NULL, page);
-        gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL,
-                               GNC_PREF_SUMMARYBAR_POSITION_TOP,
-                               gnc_plugin_page_register2_summarybar_position_changed,
-                               page);
-        gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL,
-                               GNC_PREF_SUMMARYBAR_POSITION_BOTTOM,
-                               gnc_plugin_page_register2_summarybar_position_changed,
-                               page);
-    }
-
-    priv->event_handler_id = qof_event_register_handler
-                             ((QofEventHandler)gnc_plugin_page_register2_event_handler, page);
-    priv->component_manager_id =
-        gnc_register_gui_component (GNC_PLUGIN_PAGE_REGISTER2_NAME,
-                                   gnc_plugin_page_register2_refresh_cb,
-                                   gnc_plugin_page_register2_close_cb,
-                                   page);
-    gnc_gui_component_set_session (priv->component_manager_id,
-                                   gnc_get_current_session());
-    acct = gnc_plugin_page_register2_get_account (page);
-    if (acct)
-        gnc_gui_component_watch_entity (
-            priv->component_manager_id, xaccAccountGetGUID (acct),
-            QOF_EVENT_DESTROY | QOF_EVENT_MODIFY);
-
-    /* This allows the plugin page to be updated from the view */
-    gnc_split_reg2_set_moved_cb
-    (priv->gsr, (GFunc)gnc_plugin_page_register2_ui_update, page);
-
-    LEAVE(" ");
-    return priv->widget;
-}
-
-/*#################################################################################*/
-
-/** This button press handler calls the common button press handler
- *  for all pages.  The GtkTreeView eats all button presses and
- *  doesn't pass them up the widget tree, even when doesn't do
- *  anything with them.  The only way to get access to the button
- *  presses in an account tree page is here on the tree view widget.
- *  Button presses on all other pages are caught by the signal
- *  registered in gnc-main-window.c. */
-static gboolean
-gnc_plugin_page_register2_button_press_cb (GtkWidget *widget,
-        GdkEventButton *event,
-        GncPluginPage *page)
-{
-
-    g_return_val_if_fail(GNC_IS_PLUGIN_PAGE(page), FALSE);
-
-    ENTER("widget %p, event %p, page %p", widget, event, page);
-    gnc_main_window_button_press_cb (widget, event, page);
-    LEAVE(" ");
-
-    /* Always return FALSE.  This will let the tree view callback run as
-     * well which will select the item under the cursor.  By the time
-     * the user sees the menu both callbacks will have run and the menu
-     * actions will operate on the just-selected account. */
-    return FALSE;
-}
-
-static void
-gnc_plugin_page_register2_destroy_widget (GncPluginPage *plugin_page)
-{
-    GncPluginPageRegister2 *page;
-    GncPluginPageRegister2Private *priv;
-
-    ENTER("page %p", plugin_page);
-    page = GNC_PLUGIN_PAGE_REGISTER2 (plugin_page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(plugin_page);
-
-    gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL,
-                                 GNC_PREF_SUMMARYBAR_POSITION_TOP,
-                                 gnc_plugin_page_register2_summarybar_position_changed,
-                                 page);
-    gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL,
-                                 GNC_PREF_SUMMARYBAR_POSITION_BOTTOM,
-                                 gnc_plugin_page_register2_summarybar_position_changed,
-                                 page);
-
-    if (priv->widget == NULL)
-    {
-        LEAVE(" ");
-        return;
-    }
-
-    if (priv->component_manager_id)
-    {
-        gnc_unregister_gui_component (priv->component_manager_id);
-        priv->component_manager_id = 0;
-    }
-
-    if (priv->event_handler_id)
-    {
-        qof_event_unregister_handler (priv->event_handler_id);
-        priv->event_handler_id = 0;
-    }
-
-    if (priv->fd.dialog)
-    {
-        gtk_widget_destroy (priv->fd.dialog);
-        memset(&priv->fd, 0, sizeof(priv->fd));
-    }
-
-    gtk_widget_hide (priv->widget);
-
-    if (priv->ledger)
-    {
-        gnc_ledger_display2_close (priv->ledger);
-        priv->ledger = NULL;
-    }
-
-    if (priv->widget)
-    {
-        g_object_unref (G_OBJECT(priv->widget));
-        priv->widget = NULL;
-    }
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_window_changed (GncPluginPage *plugin_page,
-        GtkWidget *window) // this works
-{
-    GncPluginPageRegister2 *page;
-    GncPluginPageRegister2Private *priv;
-
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page));
-
-    page = GNC_PLUGIN_PAGE_REGISTER2 (plugin_page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-
-    priv->gsr->window =
-        GTK_WIDGET(gnc_window_get_gtk_window (GNC_WINDOW (window)));
-}
-
-static const gchar *style_names[] =
-{
-    "Ledger",
-    "Auto Ledger",
-    "Journal",
-    NULL
-};
-
-#define KEY_REGISTER_TYPE       "RegisterType"
-#define KEY_ACCOUNT_NAME        "AccountName"
-#define KEY_REGISTER_STYLE      "RegisterStyle"
-#define KEY_DOUBLE_LINE         "DoubleLineMode"
-#define KEY_EXTRA_DATES         "ExtraDatesMode"
-
-#define LABEL_ACCOUNT		"Account"
-#define LABEL_SUBACCOUNT	"SubAccount"
-#define LABEL_GL		"GL"
-#define LABEL_SEARCH		"Search"
-
-#define SPLIT_REGISTER_GUID "SplitRegister GUID"
-
-/** Save enough information about this register page that it can be
- *  recreated next time the user starts gnucash.
- *
- *  @param plugin_page The page to save.
- *
- *  @param key_file A pointer to the GKeyFile data structure where the
- *  page information should be written. gnc_plugin_page_register2_save_page
- *
- *  @param group_name The group name to use when saving data. */
-static void
-gnc_plugin_page_register2_save_page (GncPluginPage *plugin_page,
-                                    GKeyFile *key_file,
-                                    const gchar *group_name)
-{
-    GncPluginPageRegister2 *page;
-    GncPluginPageRegister2Private *priv;
-    GNCLedgerDisplay2Type ledger_type;
-    GncTreeViewSplitReg *view;
-    GncTreeModelSplitReg *model;
-    Account *leader;
-
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page));
-    g_return_if_fail (key_file != NULL);
-    g_return_if_fail (group_name != NULL);
-
-    ENTER("page %p, key_file %p, group_name %s", plugin_page, key_file,
-          group_name);
-
-    page = GNC_PLUGIN_PAGE_REGISTER2 (plugin_page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-    model = gnc_ledger_display2_get_split_model_register (priv->ledger);
-    ledger_type = gnc_ledger_display2_type (priv->ledger);
-    if (ledger_type > LD2_GL)
-    {
-        LEAVE("Unsupported ledger type");
-        return;
-    }
-    if ((ledger_type == LD2_SINGLE) || (ledger_type == LD2_SUBACCOUNT))
-    {
-        const gchar *label;
-        gchar* name;
-        label = (ledger_type == LD2_SINGLE) ? LABEL_ACCOUNT : LABEL_SUBACCOUNT;
-        leader = gnc_ledger_display2_leader (priv->ledger);
-        g_key_file_set_string (key_file, group_name, KEY_REGISTER_TYPE, label);
-        name = gnc_account_get_full_name (leader);
-        g_key_file_set_string (key_file, group_name, KEY_ACCOUNT_NAME, name);
-        g_free (name);
-    }
-    else if (model->type == GENERAL_LEDGER2)
-    {
-        g_key_file_set_string (key_file, group_name, KEY_REGISTER_TYPE,
-                              LABEL_GL);
-    }
-    else if (model->type == SEARCH_LEDGER2)
-    {
-        g_key_file_set_string (key_file, group_name, KEY_REGISTER_TYPE,
-                              LABEL_SEARCH);
-    }
-    else
-    {
-        LEAVE("Unsupported register type");
-        return;
-    }
-
-    g_key_file_set_string (key_file, group_name, KEY_REGISTER_STYLE, style_names[model->style]);
-    g_key_file_set_boolean (key_file, group_name, KEY_DOUBLE_LINE, model->use_double_line);
-    g_key_file_set_boolean (key_file, group_name, KEY_EXTRA_DATES, view->show_extra_dates);
-
-    LEAVE(" ");
-}
-
-/** Read and restore the edit menu settings on the specified register
- *  page. This function will restore the register style (ledger, auto
- *  ledger, journal) and whether or not the register is in double line
- *  mode. It should eventually restore the "filter by" and "sort by"
- *  mode.
- *
- *  @param page The register being restored.
- *
- *  @param key_file A pointer to the GKeyFile data structure where the
- *  page information should be read.
- *
- *  @param group_name The group name to use when restoring data. */
-static void
-gnc_plugin_page_register2_restore_edit_menu (GncPluginPage *page,
-        GKeyFile *key_file,
-        const gchar *group_name)
-{
-    GncPluginPageRegister2Private *priv;
-    GtkAction *action;
-    GError *error = NULL;
-    gchar *style_name;
-    gint i;
-    gboolean use_double_line;
-    gboolean show_extra_dates;
-
-    ENTER(" ");
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-
-    /* Convert the style name to an index */
-    style_name = g_key_file_get_string (key_file, group_name,
-                                       KEY_REGISTER_STYLE, &error);
-    for (i = 0 ; style_names[i]; i++)
-    {
-        if (g_ascii_strcasecmp (style_name, style_names[i]) == 0)
-        {
-            DEBUG("Found match for style name: %s", style_name);
-            break;
-        }
-    }
-    g_free (style_name);
-
-    /* Update the style menu action for this page */
-    if (i <= REG2_STYLE_JOURNAL)
-    {
-        DEBUG("Setting style: %d", i);
-        action = gnc_plugin_page_get_action (page, radio_entries_2[i].name);
-        gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
-    }
-
-    /* Update the double line action on this page */
-    use_double_line =
-        g_key_file_get_boolean (key_file, group_name, KEY_DOUBLE_LINE, &error);
-    DEBUG("Setting double_line_mode: %d", use_double_line);
-    action = gnc_plugin_page_get_action (page, "ViewStyleDoubleLineAction");
-    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), use_double_line);
-
-    /* Update the extra dates action on this page */
-    show_extra_dates =
-        g_key_file_get_boolean (key_file, group_name, KEY_EXTRA_DATES, &error);
-    DEBUG("Setting extra_dates_mode: %d", show_extra_dates);
-    action = gnc_plugin_page_get_action (page, "ViewStyleExtraDatesAction");
-    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), show_extra_dates);
-    LEAVE(" ");
-}
-
-/** Create a new register page based on the information saved during a
- *  previous instantiation of gnucash.
- *
- *  @param window The window where this page should be installed.
- *
- *  @param key_file A pointer to the GKeyFile data structure where the
- *  page information should be read.
- *
- *  @param group_name The group name to use when restoring data. */
-static GncPluginPage *
-gnc_plugin_page_register2_recreate_page (GtkWidget *window,
-                                        GKeyFile *key_file,
-                                        const gchar *group_name)
-{
-    GncPluginPage *page;
-    GError *error = NULL;
-    gchar *reg_type, *acct_name;
-    Account *account;
-    QofBook *book;
-    gboolean include_subs;
-
-    g_return_val_if_fail (key_file, NULL);
-    g_return_val_if_fail (group_name, NULL);
-    ENTER("key_file %p, group_name %s", key_file, group_name);
-
-    /* Create the new page. */
-    reg_type = g_key_file_get_string (key_file, group_name,
-                                     KEY_REGISTER_TYPE, &error);
-    DEBUG("Page type: %s", reg_type);
-    if ((g_ascii_strcasecmp (reg_type, LABEL_ACCOUNT) == 0) ||
-            (g_ascii_strcasecmp (reg_type, LABEL_SUBACCOUNT) == 0))
-    {
-        include_subs = (g_ascii_strcasecmp(reg_type, LABEL_SUBACCOUNT) == 0);
-        DEBUG("Include subs: %d", include_subs);
-        acct_name = g_key_file_get_string (key_file, group_name,
-                                          KEY_ACCOUNT_NAME, &error);
-        book = qof_session_get_book (gnc_get_current_session());
-        account = gnc_account_lookup_by_full_name (gnc_book_get_root_account(book),
-                  acct_name);
-        g_free (acct_name);
-        if (account == NULL)
-        {
-            LEAVE("Bad account name");
-            g_free (reg_type);
-            return NULL;
-        }
-        page = gnc_plugin_page_register2_new (account, include_subs);
-    }
-    else if (g_ascii_strcasecmp (reg_type, LABEL_GL) == 0)
-    {
-        page = gnc_plugin_page_register2_new_gl ();
-    }
-    else
-    {
-        LEAVE("Bad ledger type");
-        g_free (reg_type);
-        return NULL;
-    }
-    g_free (reg_type);
-
-    /* Recreate page in given window */
-    gnc_plugin_page_set_use_new_window (page, FALSE);
-
-    /* Install it now so we can them manipulate the created widget */
-    gnc_main_window_open_page (GNC_MAIN_WINDOW (window), page);
-
-    /* Now update the page to the last state it was in */
-    gnc_plugin_page_register2_restore_edit_menu (page, key_file, group_name);
-    LEAVE(" ");
-    return page;
-}
-
-
-/*
- * Based on code from Epiphany (src/ephy-window.c)
- */
-static void
-gnc_plugin_page_register2_update_edit_menu (GncPluginPage *page, gboolean hide) //this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncPluginPageRegister2 *reg_page;
-    GncTreeViewSplitReg *view;
-    GtkAction *action;
-    gboolean can_copy = FALSE, can_cut = FALSE, can_paste = FALSE;
-    gboolean has_selection;
-    gboolean is_readwrite = !qof_book_is_readonly (gnc_get_current_book());
-    reg_page = GNC_PLUGIN_PAGE_REGISTER2 (page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (reg_page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-
-    // This is set while we are editing a cell
-    if (view->editing_now)
-        has_selection = TRUE;
-    else
-        has_selection = FALSE;
-
-    can_copy = has_selection;
-    can_cut = is_readwrite && has_selection;
-    can_paste = is_readwrite;
-
-    action = gnc_plugin_page_get_action (page, "EditCopyAction");
-    gtk_action_set_sensitive (action, can_copy);
-    gtk_action_set_visible (action, !hide || can_copy);
-    action = gnc_plugin_page_get_action (page, "EditCutAction");
-    gtk_action_set_sensitive (action, can_cut);
-    gtk_action_set_visible (action, !hide || can_cut);
-    action = gnc_plugin_page_get_action (page, "EditPasteAction");
-    gtk_action_set_sensitive (action, can_paste);
-    gtk_action_set_visible (action,  !hide || can_paste);
-}
-
-static gboolean
-gnc_plugin_page_register2_finish_pending (GncPluginPage *page) //this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncPluginPageRegister2 *reg_page;
-    GncTreeViewSplitReg *view;
-    GtkWidget *dialog, *window;
-    const gchar *name;
-    gint response;
-
-    reg_page = GNC_PLUGIN_PAGE_REGISTER2 (page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (reg_page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-
-    /* Make sure we have stopped editing */
-    gnc_tree_view_split_reg_finish_edit (view);
-
-    if (!view || (gnc_tree_view_split_reg_get_dirty_trans (view) == NULL))
-        return TRUE;
-
-    name = gnc_plugin_page_register2_get_tab_name (page);
-    window = gnc_plugin_page_get_window (page);
-    dialog = gtk_message_dialog_new (GTK_WINDOW (window),
-                                    GTK_DIALOG_DESTROY_WITH_PARENT,
-                                    GTK_MESSAGE_WARNING,
-                                    GTK_BUTTONS_NONE,
-                                    /* Translators: %s is the name
-                                       of the tab page */
-                                    _("Save changes to %s?"), name);
-    gtk_message_dialog_format_secondary_text
-    (GTK_MESSAGE_DIALOG (dialog),
-     "%s",
-     _("This register has pending changes to a transaction. "
-       "Would you like to save the changes to this transaction, "
-       "discard the transaction, or cancel the operation?"));
-    gnc_gtk_dialog_add_button (dialog, _("_Discard Transaction"),
-                              GTK_STOCK_DELETE, GTK_RESPONSE_REJECT);
-    gtk_dialog_add_button (GTK_DIALOG (dialog),
-                          GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
-    gnc_gtk_dialog_add_button (dialog, _("_Save Transaction"),
-                              GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT);
-
-    response = gtk_dialog_run (GTK_DIALOG (dialog));
-    gtk_widget_destroy (dialog);
-
-    switch (response)
-    {
-    case GTK_RESPONSE_ACCEPT:
-        return (gnc_tree_control_split_reg_save (view, TRUE));
-
-    case GTK_RESPONSE_REJECT:
-        gnc_tree_control_split_reg_cancel_edit (view, TRUE);
-        return TRUE;
-
-    default:
-        return FALSE;
-    }
-}
-
-static gchar *
-gnc_plugin_page_register2_get_tab_name (GncPluginPage *plugin_page)
-{
-    GncPluginPageRegister2Private *priv;
-    GNCLedgerDisplay2Type ledger_type;
-    GNCLedgerDisplay2 *ld;
-    GncTreeModelSplitReg *model;
-    Account *leader;
-
-    g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page), _("unknown"));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(plugin_page);
-    ld = priv->ledger;
-    model = gnc_ledger_display2_get_split_model_register(ld);
-    ledger_type = gnc_ledger_display2_type (ld);
-    leader = gnc_ledger_display2_leader (ld);
-
-    switch (ledger_type)
-    {
-    case LD2_SINGLE:
-        return g_strdup(xaccAccountGetName (leader));
-
-    case LD2_SUBACCOUNT:
-        return g_strdup_printf("%s+", xaccAccountGetName (leader));
-
-    case LD2_GL:
-        switch (model->type)
-        {
-        case GENERAL_LEDGER:
-        case INCOME_LEDGER:
-            return g_strdup(_("General Ledger"));
-        case PORTFOLIO_LEDGER:
-            return g_strdup(_("Portfolio"));
-        case SEARCH_LEDGER:
-            return g_strdup(_("Search Results"));
-        default:
-            break;
-        }
-        break;
-
-    default:
-        break;
-    }
-
-    return g_strdup(_("unknown"));
-}
-
-static gchar *
-gnc_plugin_page_register2_get_tab_color (GncPluginPage *plugin_page)
-{
-    GncPluginPageRegister2Private *priv;
-    GNCLedgerDisplay2Type ledger_type;
-    GNCLedgerDisplay2 *ld;
-    Account *leader;
-    const char* color;
-
-    g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page), _("unknown"));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(plugin_page);
-    ld = priv->ledger;
-    ledger_type = gnc_ledger_display2_type (ld);
-    leader = gnc_ledger_display2_leader (ld);
-    color = NULL;
-
-    if ((ledger_type == LD2_SINGLE) || (ledger_type == LD2_SUBACCOUNT))
-        color = xaccAccountGetColor (leader);
-
-    return g_strdup(color ? color : "Not Set");
-}
-
-static gchar *
-gnc_plugin_page_register2_get_filter (GncPluginPage *plugin_page)
-{
-    GncPluginPageRegister2Private *priv;
-    GNCLedgerDisplay2Type ledger_type;
-    GNCLedgerDisplay2 *ld;
-    Account *leader;
-    const char* filter;
-
-    g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page), _("unknown"));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(plugin_page);
-    ld = priv->ledger;
-    ledger_type = gnc_ledger_display2_type (ld);
-    leader = gnc_ledger_display2_leader (ld);
-    filter = NULL;
-
-    if ((ledger_type == LD2_SINGLE) || (ledger_type == LD2_SUBACCOUNT))
-        filter = xaccAccountGetFilter (leader);
-
-    return filter ? g_strdup(filter) : g_strdup_printf("%s,%s,%s", DEFAULT_FILTER, "0", "0");
-}
-
-void
-gnc_plugin_page_register2_set_filter (GncPluginPage *plugin_page, const gchar *filter )
-{
-    GncPluginPageRegister2Private *priv;
-    GNCLedgerDisplay2Type ledger_type;
-    GNCLedgerDisplay2 *ld;
-    Account *leader;
-    gchar *default_filter;
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(plugin_page);
-    ld = priv->ledger;
-    ledger_type = gnc_ledger_display2_type (ld);
-    leader = gnc_ledger_display2_leader (ld);
-
-    if (leader != NULL)
-    {
-        default_filter = g_strdup_printf("%s,%s,%s", DEFAULT_FILTER, "0", "0");
-
-        if (!filter || (g_strcmp0 (filter, default_filter) == 0))
-            xaccAccountSetFilter (leader, NULL);
-        else
-            xaccAccountSetFilter (leader, filter);
-
-        g_free (default_filter);
-    }
-    return;
-}
-
-static gchar *
-gnc_plugin_page_register2_get_long_name (GncPluginPage *plugin_page)
-{
-    GncPluginPageRegister2Private *priv;
-    GNCLedgerDisplay2Type ledger_type;
-    GNCLedgerDisplay2 *ld;
-    Account *leader;
-
-    g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page), _("unknown"));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (plugin_page);
-    ld = priv->ledger;
-    ledger_type = gnc_ledger_display2_type (ld);
-    leader = gnc_ledger_display2_leader (ld);
-
-    switch (ledger_type)
-    {
-    case LD2_SINGLE:
-        return gnc_account_get_full_name (leader);
-
-    case LD2_SUBACCOUNT:
-    {
-        gchar *account_full_name = gnc_account_get_full_name (leader);
-        gchar *return_string = g_strdup_printf ("%s+", account_full_name);
-        g_free ((gpointer *) account_full_name);
-        return return_string;
-    }
-
-    default:
-        break;
-    }
-
-    return NULL;
-}
-
-static void
-gnc_plugin_page_register2_summarybar_position_changed (gpointer prefs, gchar* pref, gpointer user_data)
-{
-    GncPluginPage *plugin_page;
-    GncPluginPageRegister2 *page;
-    GncPluginPageRegister2Private *priv;
-    GtkPositionType position = GTK_POS_BOTTOM;
-
-    g_return_if_fail(user_data != NULL);
-
-    plugin_page = GNC_PLUGIN_PAGE (user_data);
-    page = GNC_PLUGIN_PAGE_REGISTER2 (user_data);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-
-    if (gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_SUMMARYBAR_POSITION_TOP))
-        position = GTK_POS_TOP;
-
-    gtk_box_reorder_child(GTK_BOX(priv->widget),
-                          plugin_page->summarybar,
-                          (position == GTK_POS_TOP ? 0 : -1) );
-}
-
-/*#################################################################################*/
-/*#################################################################################*/
-
-/************************************************************/
-/*                    "Filter By" Dialog                    */
-/************************************************************/
-
-/** This function updates the "cleared match" term of the register
- *  query.  It unconditionally removes any old "cleared match" query
- *  term, then adds back a new query term if needed.  There seems to
- *  be a bug in the current g2 register code such that when the number
- *  of entries in the register doesn't fill up the window, the blank
- *  space at the end of the window isn't correctly redrawn.  This
- *  function works around that problem, but a root cause analysis
- *  should probably be done.
- *
- *  @param page A pointer to the GncPluginPageRegister2 that is
- *  associated with this filter dialog.
- */
-static void
-gnc_ppr_update_status_query (GncPluginPageRegister2 *page, gboolean refresh_page)
-{
-    GncPluginPageRegister2Private *priv;
-    GSList *param_list;
-    Query *query;
-
-    ENTER(" ");
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    query = gnc_ledger_display2_get_query (priv->ledger );
-    if (!query)
-    {
-        LEAVE("no query found");
-        return;
-    }
-
-    /* Remove the old status match */
-    param_list = qof_query_build_param_list (SPLIT_RECONCILE, NULL);
-    if (param_list)
-    {
-        qof_query_purge_terms (query, param_list);
-        g_slist_free(param_list);
-    }
-
-    /* Install the new status match */
-    if (priv->fd.cleared_match != CLEARED_ALL)
-        xaccQueryAddClearedMatch(query, priv->fd.cleared_match, QOF_QUERY_AND);
-
-    if (refresh_page)
-        gnc_ledger_display2_refresh (priv->ledger);
-    LEAVE(" ");
-}
-
-/** This function updates the "date posted" term of the register
- *  query.  It unconditionally removes any old "date posted" query
- *  term, then adds back a new query term if needed.  There seems to
- *  be a bug in the current g2 register code such that when the number
- *  of entries in the register doesn't fill up the window, the blank
- *  space at the end of the window isn't correctly redrawn.  This
- *  function works around that problem, but a root cause analysis
- *  should probably be done.
- *
- *  @param page A pointer to the GncPluginPageRegister2 that is
- *  associated with this filter dialog.
- */
-static void
-gnc_ppr_update_date_query (GncPluginPageRegister2 *page, gboolean refresh_page)
-{
-    GncPluginPageRegister2Private *priv;
-    GSList *param_list;
-    Query *query;
-
-    ENTER(" ");
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    if (!priv->ledger)
-    {
-        LEAVE("no ledger");
-        return;
-    }
-
-    query = gnc_ledger_display2_get_query (priv->ledger);
-    if (!query)
-    {
-        LEAVE("no query");
-        return;
-    }
-
-    /* Delete any existing old date spec. */
-    param_list = qof_query_build_param_list (SPLIT_TRANS, TRANS_DATE_POSTED, NULL);
-    if (param_list)
-    {
-        qof_query_purge_terms (query, param_list);
-        g_slist_free(param_list);
-    }
-
-    if (priv->fd.start_time || priv->fd.end_time)
-    {
-        /* Build a new spec */
-        xaccQueryAddDateMatchTT (query,
-                                priv->fd.start_time != 0, priv->fd.start_time,
-                                priv->fd.end_time != 0,   priv->fd.end_time,
-                                QOF_QUERY_AND);
-    }
-
-    if (refresh_page)
-        gnc_ledger_display2_refresh (priv->ledger);
-    LEAVE(" ");
-}
-
-/* This function converts a time64 value date to a string */
-static gchar *
-gnc_plugin_page_register2_filter_time2dmy (time64 raw_time)
-{
-    struct tm * timeinfo;
-    gchar date_string[11];
-    gint i;
-
-    timeinfo = gnc_localtime (&raw_time);
-    i = strftime (date_string, 11, "%d-%m-%Y", timeinfo);
-    PINFO("Date string is %s", date_string);
-
-    gnc_tm_free (timeinfo);
-    return g_strdup (date_string);
-}
-
-/* This function converts a string date to a time64 value */
-static time64
-gnc_plugin_page_register2_filter_dmy2time (char *date_string)
-{
-    struct tm when;
-
-    PINFO("Date string is %s", date_string);
-    memset (&when, 0, sizeof (when));
-    sscanf (date_string, "%d-%d-%d", &when.tm_mday,
-	   &when.tm_mon, &when.tm_year);
-
-    when.tm_year -= 1900;
-    when.tm_mon -=  1;
-
-    return gnc_mktime (&when);
-}
-
-/** This function is called whenever one of the status entries is
- *  checked or unchecked.  It updates the status value maintained for
- *  the filter dialog, and calls another function to do the work of
- *  applying the change to the register itself.
- *
- *  @param button The toggle button that was changed.
- *
- *  @param page A pointer to the GncPluginPageRegister2 that is
- *  associated with this filter dialog.
- */
-void
-gnc_plugin_page_register2_filter_status_one_cb (GtkToggleButton *button,
-        GncPluginPageRegister2 *page)
-{
-    GncPluginPageRegister2Private *priv;
-    const gchar *name;
-    gint i, value;
-
-    g_return_if_fail (GTK_IS_CHECK_BUTTON (button));
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
-
-    name = gtk_buildable_get_name (GTK_BUILDABLE (button));
-    ENTER("toggle button %s (%p), plugin_page %p", name, button, page);
-
-    /* Determine what status bit to change */
-    value = CLEARED_NONE;
-    for (i = 0; status_actions[i].action_name; i++)
-    {
-        if (g_strcmp0 (name, status_actions[i].action_name) == 0)
-        {
-            value = status_actions[i].value;
-            break;
-        }
-    }
-
-    /* Compute the new match status */
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    if (gtk_toggle_button_get_active (button))
-        priv->fd.cleared_match |= value;
-    else
-        priv->fd.cleared_match &= ~value;
-    gnc_ppr_update_status_query (page, TRUE);
-    LEAVE(" ");
-}
-
-/** This function is called whenever the "select all" status button is
- *  clicked. It updates all of the checkbox widgets, then updates the
- *  query on the register.
- *
- *  @param button The button that was clicked.
- *
- *  @param page A pointer to the GncPluginPageRegister2 that is
- *  associated with this filter dialog.
- */
-void
-gnc_plugin_page_register2_filter_status_all_cb (GtkButton *button,
-        GncPluginPageRegister2 *page)
-{
-    GncPluginPageRegister2Private *priv;
-    GtkWidget *widget;
-    gint i;
-
-    g_return_if_fail (GTK_IS_BUTTON (button));
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
-
-    ENTER("(button %p, page %p)", button, page);
-
-    /* Turn on all the check menu items */
-    for (i = 0; status_actions[i].action_name; i++)
-    {
-        widget = status_actions[i].widget;
-        g_signal_handlers_block_by_func (widget, gnc_plugin_page_register2_filter_status_one_cb, page);
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
-        g_signal_handlers_unblock_by_func (widget, gnc_plugin_page_register2_filter_status_one_cb, page);
-    }
-
-    /* Set the requested status */
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    priv->fd.cleared_match = CLEARED_ALL;
-    gnc_ppr_update_status_query (page, TRUE);
-    LEAVE(" ");
-}
-
-/** This function computes the starting and ending times for the
- *  filter by examining the dialog widgets to see which ones are
- *  selected, and will pull times out of the data entry boxes if
- *  necessary. This function must exist to handle the case where the
- *  "show all" button was Selected, and the user clicks on the "select
- *  range" button. Since it exists, it make sense for the rest of the
- *  callbacks to take advantage of it.
- *
- *  @param page A pointer to the GncPluginPageRegister2 that is
- *  associated with this filter dialog.
- */
-static void
-get_filter_times (GncPluginPageRegister2 *page)
-{
-    GncPluginPageRegister2Private *priv;
-    GtkWidget *button, *today, *gde;
-    time64 time_val;
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->fd.start_date_choose)))
-    {
-        time_val = gnc_date_edit_get_date (GNC_DATE_EDIT (priv->fd.start_date));
-        time_val = gnc_time64_get_day_start (time_val);
-        priv->fd.start_time = time_val;
-    }
-    else
-    {
-        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->fd.start_date_today)))
-        {
-            priv->fd.start_time = gnc_time64_get_today_start();
-        }
-        else
-        {
-            priv->fd.start_time = 0;
-        }
-    }
-
-    if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->fd.end_date_choose)))
-    {
-        time_val = gnc_date_edit_get_date (GNC_DATE_EDIT (priv->fd.end_date));
-        time_val = gnc_time64_get_day_end (time_val);
-        priv->fd.end_time = time_val;
-    }
-    else
-    {
-        if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->fd.start_date_today)))
-        {
-            priv->fd.end_time = gnc_time64_get_today_end();
-        }
-        else
-        {
-            priv->fd.end_time = 0;
-        }
-    }
-}
-
-/** This function is called when the "select range" radio button
- *  changes state. Since there are only two choices in this radio
- *  group, this one signal can be used to handle all cases. This
- *  function is responsible for setting the sensitivity of the table
- *  of widgets underneath the "select range" choice, and updating the
- *  time limitation on the register query. This is handled by a
- *  helper function when the radio button is selected (as potentially
- *  all the widgets in the table need to be inspected), and is trivial
- *  for the other case.
- *
- *  @param button A pointer to the "select range" radio button.
- *
- *  @param page A pointer to the GncPluginPageRegister2 that is
- *  associated with this filter dialog.
- */
-void
-gnc_plugin_page_register2_filter_select_range_cb (GtkRadioButton *button,
-        GncPluginPageRegister2 *page)
-{
-    GncPluginPageRegister2Private *priv;
-    gboolean active;
-
-    g_return_if_fail (GTK_IS_RADIO_BUTTON (button));
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
-
-    ENTER("(button %p, page %p)", button, page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
-    gtk_widget_set_sensitive (priv->fd.table, active);
-    if (active)
-    {
-        get_filter_times (page);
-    }
-    else
-    {
-        priv->fd.start_time = 0;
-        priv->fd.end_time = 0;
-    }
-    gnc_ppr_update_date_query (page, TRUE);
-    LEAVE(" ");
-}
-
-/** This function is called when one of the start date entry widgets
- *  is updated. It simply calls common routines to determine the
- *  start/end times and update the register filter.
- *
- *  @param unused A pointer to a GncDateEntry widgets, but it could be
- *  any widget.
- *
- *  @param page A pointer to the GncPluginPageRegister2 that is
- *  associated with this filter dialog.
- */
-static void
-gnc_plugin_page_register2_filter_gde_changed_cb (GtkWidget *unused,
-        GncPluginPageRegister2 *page)
-{
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
-
-    ENTER("(widget %s(%p), page %p)", gtk_buildable_get_name (GTK_BUILDABLE (unused)), unused, page);
-    get_filter_times (page);
-    gnc_ppr_update_date_query (page, TRUE);
-    LEAVE(" ");
-}
-
-/** This function is called when one of the start date radio buttons
- *  is selected. It updates the sensitivity of the date entry widget,
- *  then calls a common routine to determine the start/end times and
- *  update the register query.
- *
- *  *Note: This function is actually called twice for each new radio
- *  button selection. The first time call is to uncheck the old
- *  button, and the second time to check the new button. This does
- *  make a kind of sense, as radio buttons are nothing more than
- *  linked toggle buttons where only one can be active.
- *
- *  @param radio The button whose state is changing. This will be
- *  the previously selected button the first of the pair of calls to
- *  this function, and will be the newly selected button the second
- *  time.
- *
- *  @param page A pointer to the GncPluginPageRegister2 that is
- *  associated with this filter dialog.
- */
-void
-gnc_plugin_page_register2_filter_start_cb (GtkWidget *radio,
-        GncPluginPageRegister2 *page)
-{
-    GncPluginPageRegister2Private *priv;
-    const gchar *name;
-    gboolean active;
-
-    g_return_if_fail (GTK_IS_RADIO_BUTTON (radio));
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
-
-    ENTER("(radio %s(%p), page %p)", gtk_buildable_get_name (GTK_BUILDABLE (radio)), radio, page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio)))
-    {
-        LEAVE("1st callback of pair. Defer to 2nd callback.");
-        return;
-    }
-
-    name = gtk_buildable_get_name (GTK_BUILDABLE (radio));
-    active = (g_strcmp0 (name, g_strdup ("start_date_choose")) == 0 ? 1 : 0 );
-    gtk_widget_set_sensitive (priv->fd.start_date, active);
-    get_filter_times (page);
-    gnc_ppr_update_date_query (page, TRUE);
-    LEAVE(" ");
-}
-
-/** This function is called when one of the end date radio buttons is
- *  selected. It updates the sensitivity of the date entry widget,
- *  then calls a common routine to determine the start/end times and
- *  update the register query.
- *
- *  *Note: This function is actually called twice for each new radio
- *  button selection. The first time call is to uncheck the old
- *  button, and the second time to check the new button. This does
- *  make a kind of sense, as radio buttons are nothing more than
- *  linked toggle buttons where only one can be active.
- *
- *  @param radio The button whose state is changing. This will be
- *  the previously selected button the first of the pair of calls to
- *  this function, and will be the newly selected button the second
- *  time.
- *
- *  @param page A pointer to the GncPluginPageRegister2 that is
- *  associated with this filter dialog.
- */
-void
-gnc_plugin_page_register2_filter_end_cb (GtkWidget *radio,
-                                        GncPluginPageRegister2 *page)
-{
-    GncPluginPageRegister2Private *priv;
-    const gchar *name;
-    gboolean active;
-
-    g_return_if_fail (GTK_IS_RADIO_BUTTON (radio));
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
-
-    ENTER("(radio %s(%p), page %p)", gtk_buildable_get_name (GTK_BUILDABLE (radio)), radio, page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio)))
-    {
-        LEAVE("1st callback of pair. Defer to 2nd callback.");
-        return;
-    }
-
-    name = gtk_buildable_get_name (GTK_BUILDABLE (radio));
-    active = (g_strcmp0 (name, g_strdup ("end_date_choose")) == 0 ? 1 : 0 );
-    gtk_widget_set_sensitive (priv->fd.end_date, active);
-    get_filter_times (page);
-    gnc_ppr_update_date_query (page, TRUE);
-    LEAVE(" ");
-}
-
-/** This function is called whenever the save status is checked
- *  or unchecked. It will allow saving of the filter if required.
- *
- *  @param button The toggle button that was changed.
- *
- *  @param page A pointer to the GncPluginPageRegister2 that is
- *  associated with this filter dialog.
- */
-void
-gnc_plugin_page_register2_filter_save_cb (GtkToggleButton *button,
-        GncPluginPageRegister2 *page)
-{
-    GncPluginPageRegister2Private *priv;
-
-    g_return_if_fail (GTK_IS_CHECK_BUTTON (button));
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
-
-    ENTER("Save toggle button (%p), plugin_page %p", button, page);
-
-    /* Compute the new save filter status */
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    if (gtk_toggle_button_get_active (button))
-        priv->fd.save_filter = TRUE;
-    else
-        priv->fd.save_filter = FALSE;
-    LEAVE(" ");
-}
-
-/** This function is called when the "Filter By..." dialog is closed.
- *  If the dialog was closed by any method other than clicking the OK
- *  button, the original filter will be restored.
- *
- *  @param dialog A pointer to the dialog box.
- *
- *  @param response A numerical value indicating why the dialog box was closed.
- *
- *  @param page A pointer to the GncPluginPageRegister2 associated with
- *  this dialog box.
- */
-void
-gnc_plugin_page_register2_filter_response_cb (GtkDialog *dialog,
-        gint response,
-        GncPluginPageRegister2 *page)
-{
-    GncPluginPageRegister2Private *priv;
-    GncPluginPage *plugin_page;
-
-    g_return_if_fail (GTK_IS_DIALOG (dialog));
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
-
-    ENTER(" ");
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    plugin_page = GNC_PLUGIN_PAGE (page);
-
-    if (response != GTK_RESPONSE_OK)
-    {
-        /* Remove the old status match */
-        priv->fd.cleared_match = priv->fd.original_cleared_match;
-        gnc_ppr_update_status_query (page, FALSE);
-        priv->fd.start_time = priv->fd.original_start_time;
-        priv->fd.end_time = priv->fd.original_end_time;
-        priv->fd.save_filter = priv->fd.original_save_filter;
-        gnc_ppr_update_date_query (page, FALSE);
-        gnc_ledger_display2_refresh (priv->ledger);
-    }
-    else
-    {
-        priv->fd.original_save_filter = priv->fd.save_filter;
-
-        if (priv->fd.save_filter)
-        {
-            gchar* filter;
-            filter = g_strdup_printf ("0x%04x", priv->fd.cleared_match);
-
-            if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->fd.start_date_choose)) && priv->fd.start_time != 0 )
-            {
-                gchar *timeval = gnc_plugin_page_register2_filter_time2dmy (priv->fd.start_time);
-                filter = g_strconcat (filter, ",", timeval, NULL);
-                g_free (timeval);
-            }
-            else
-                filter = g_strconcat (filter, ",0", NULL);
-
-            if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->fd.end_date_choose)) && priv->fd.end_time != 0 )
-            {
-                gchar *timeval = gnc_plugin_page_register2_filter_time2dmy (priv->fd.end_time);
-                filter = g_strconcat (filter, ",", timeval, NULL);
-                g_free (timeval);
-            }
-            else
-                filter = g_strconcat (filter, ",0", NULL);
-
-            PINFO("The filter to save is %s", filter);
-
-            gnc_plugin_page_register2_set_filter (plugin_page, filter);
-            g_free (filter);
-        }
-    }
-    priv->fd.dialog = NULL;
-    gtk_widget_destroy (GTK_WIDGET (dialog));
-    LEAVE(" ");
-}
-
-/*#################################################################################*/
-/*#################################################################################*/
-
-/************************************************************/
-/*                  Report Helper Functions                 */
-/************************************************************/
-
-static char *
-gnc_reg_get_name (GNCLedgerDisplay2 *ledger, gboolean for_window) // this works
-{
-    Account *leader;
-    GncTreeModelSplitReg *model;
-    gchar *account_name;
-    gchar *reg_name;
-    gchar *name;
-    GNCLedgerDisplay2Type ledger_type;
-
-    if (ledger == NULL)
-        return NULL;
-
-    model = gnc_ledger_display2_get_split_model_register (ledger);
-    ledger_type = gnc_ledger_display2_type (ledger);
-
-    switch (model->type)
-    {
-    case GENERAL_LEDGER:
-    case INCOME_LEDGER:
-        if (for_window)
-            reg_name = _("General Ledger");
-        else
-            reg_name = _("General Ledger Report");
-        break;
-    case PORTFOLIO_LEDGER:
-        if (for_window)
-            reg_name = _("Portfolio");
-        else
-            reg_name = _("Portfolio Report");
-        break;
-    case SEARCH_LEDGER:
-        if (for_window)
-            reg_name = _("Search Results");
-        else
-            reg_name = _("Search Results Report");
-        break;
-    default:
-        if (for_window)
-            reg_name = _("Register");
-        else
-            reg_name = _("Register Report");
-        break;
-    }
-
-    leader = gnc_ledger_display2_leader (ledger);
-
-    if ((leader != NULL) && (ledger_type != LD2_GL))
-    {
-        account_name = gnc_account_get_full_name (leader);
-
-        if (ledger_type == LD2_SINGLE)
-        {
-            name = g_strconcat (account_name, " - ", reg_name, NULL);
-        }
-        else
-        {
-            name = g_strconcat (account_name, " ", _("and subaccounts"), " - ", reg_name, NULL);
-        }
-        g_free (account_name);
-    }
-    else
-        name = g_strdup (reg_name);
-
-    return name;
-}
-
-static int
-report_helper (GNCLedgerDisplay2 *ledger, Split *split, Query *query) //this works
-{
-    GncTreeViewSplitReg *view;
-    GncTreeModelSplitReg *model;
-    Account *account;
-    char *str;
-    const char *tmp;
-    swig_type_info * qtype;
-    SCM args;
-    SCM func;
-    SCM arg;
-
-    args = SCM_EOL;
-
-    view = gnc_ledger_display2_get_split_view_register (ledger);
-    model = gnc_ledger_display2_get_split_model_register (ledger);
-
-    func = scm_c_eval_string ("gnc:register-report-create");
-    g_return_val_if_fail (scm_is_procedure (func), -1);
-    tmp = gnc_tree_view_split_reg_get_credit_debit_string (view, TRUE);
-
-    arg = scm_from_locale_string (tmp ? tmp : _("Credit"));
-    args = scm_cons (arg, args);
-    tmp = gnc_tree_view_split_reg_get_credit_debit_string (view, FALSE);
-    arg = scm_from_locale_string (tmp ? tmp : _("Debit"));
-    args = scm_cons (arg, args);
-
-    str = gnc_reg_get_name (ledger, FALSE);
-    arg = scm_from_locale_string (str ? str : "");
-    args = scm_cons (arg, args);
-    g_free (str);
-
-    arg = SCM_BOOL (model->use_double_line);
-    args = scm_cons (arg, args);
-
-    arg = SCM_BOOL (model->type == GENERAL_LEDGER2 || model->type == INCOME_LEDGER2
-                                                   || model->type == SEARCH_LEDGER2);
-    args = scm_cons (arg, args);
-
-    arg = SCM_BOOL (model->style == REG2_STYLE_JOURNAL);
-    args = scm_cons (arg, args);
-
-    if (!query)
-    {
-        query = gnc_ledger_display2_get_query (ledger);
-        g_return_val_if_fail (query != NULL, -1);
-    }
-
-    qtype = SWIG_TypeQuery ("_p__QofQuery");
-    g_return_val_if_fail (qtype, -1);
-
-    arg = SWIG_NewPointerObj (query, qtype, 0);
-    args = scm_cons (arg, args);
-    g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
-
-
-    if (split)
-    {
-        qtype = SWIG_TypeQuery ("_p_Split");
-        g_return_val_if_fail (qtype, -1);
-        arg = SWIG_NewPointerObj (split, qtype, 0);
-    }
-    else
-    {
-        arg = SCM_BOOL_F;
-    }
-    args = scm_cons (arg, args);
-    g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
-
-
-    qtype = SWIG_TypeQuery ("_p_Account");
-    g_return_val_if_fail (qtype, -1);
-
-    account = gnc_ledger_display2_leader (ledger);
-    arg = SWIG_NewPointerObj (account, qtype, 0);
-    args = scm_cons (arg, args);
-    g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
-
-
-    /* Apply the function to the args */
-    arg = scm_apply (func, args, SCM_EOL);
-    g_return_val_if_fail (scm_is_exact (arg), -1);
-
-    return scm_to_int (arg);
-}
-
-/*#################################################################################*/
-/*#################################################################################*/
-
-/************************************************************/
-/*                     Command callbacks                    */
-/************************************************************/
-
-static void
-gnc_plugin_page_register2_cmd_print_check (GtkAction *action,
-        GncPluginPageRegister2 *plugin_page) // this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-    GncTreeModelSplitReg *model;
-    Split         * split;
-    Transaction   * trans;
-    GList         * splits = NULL, *item;
-    GNCLedgerDisplay2Type ledger_type;
-
-    ENTER("(action %p, plugin_page %p)", action, plugin_page);
-
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (plugin_page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-    model = gnc_ledger_display2_get_split_model_register (priv->ledger);
-    ledger_type = gnc_ledger_display2_type (priv->ledger);
-
-    if (ledger_type == LD2_SINGLE || ledger_type == LD2_SUBACCOUNT)
-    {
-        split = gnc_tree_view_split_reg_get_current_split (view);
-        trans = xaccSplitGetParent (split);
-
-        if (trans == NULL)
-        {
-            LEAVE("trans is NULL");
-            return;
-        }
-
-        /* See if we were asked to print a blank trans. */
-        if (trans == gnc_tree_control_split_reg_get_blank_trans (view))
-        {
-            LEAVE("Asked to print a blank trans");
-            return;
-        }
-
-        /* See if we are being edited in another register */
-        if (gnc_tree_control_split_reg_trans_test_for_edit (view, trans))
-        {
-            LEAVE("trans being edited in another register");
-            return;
-        }
-
-        /* Make sure we ask to commit any changes before we proceed */
-        if (gnc_tree_control_split_reg_trans_open_and_warn (view, trans))
-        {
-            LEAVE("trans being edited");
-            return;
-        }
-
-        if (split && trans)
-        {
-            splits = g_list_append (splits, split);
-            gnc_ui_print_check_dialog_create2 (plugin_page, splits);
-            g_list_free (splits);
-        }
-    }
-    else if (ledger_type == LD2_GL && model->type == SEARCH_LEDGER2)
-    {
-        Account *common_acct = NULL, *account;
-        splits = qof_query_run (gnc_ledger_display2_get_query (priv->ledger));
-        /* Make sure each split is from the same account */
-        for (item = splits; item; item = g_list_next (item))
-        {
-            split = (Split *) item->data;
-            if (common_acct == NULL)
-            {
-                common_acct = xaccSplitGetAccount (split);
-            }
-            else
-            {
-                if (xaccSplitGetAccount (split) != common_acct)
-                {
-                    GtkWidget *dialog, *window;
-                    gint response;
-                    const gchar *title = _("Print checks from multiple accounts?");
-                    const gchar *message =
-                        _("This search result contains splits from more than one account. "
-                          "Do you want to print the checks even though they are not all "
-                          "from the same account?");
-                    window = gnc_plugin_page_get_window (GNC_PLUGIN_PAGE (plugin_page));
-                    dialog = gtk_message_dialog_new (GTK_WINDOW (window),
-                                                    GTK_DIALOG_DESTROY_WITH_PARENT,
-                                                    GTK_MESSAGE_WARNING,
-                                                    GTK_BUTTONS_CANCEL,
-                                                    "%s", title);
-                    gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-                            "%s", message);
-                    gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Print checks"),
-                                          GTK_RESPONSE_YES);
-                    response = gnc_dialog_run (GTK_DIALOG (dialog),
-                                               GNC_PREF_WARN_CHECKPRINTING_MULTI_ACCT);
-                    gtk_widget_destroy (dialog);
-                    if (response != GTK_RESPONSE_YES)
-                    {
-                        LEAVE("Multiple accounts");
-                        return;
-                    }
-                    break;
-                }
-            }
-        }
-        gnc_ui_print_check_dialog_create2 (plugin_page, splits);
-    }
-    else
-    {
-        gnc_error_dialog (gnc_plugin_page_get_window (GNC_PLUGIN_PAGE (plugin_page)), "%s",
-                         _("You can only print checks from a bank account register or search results."));
-        LEAVE("Unsupported ledger type");
-        return;
-    }
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_cut (GtkAction *action,
-                                  GncPluginPageRegister2 *page) //this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-    GtkWidget *window, *widget;
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
-
-    ENTER("(action %p, page %p)", action, page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-
-    window = gnc_plugin_page_get_window (GNC_PLUGIN_PAGE (page));
-    widget = gtk_window_get_focus (GTK_WINDOW (window));
-
-    DEBUG("(widget name is %s)", gtk_widget_get_name (widget));
-
-    if (GTK_IS_ENTRY(widget))
-        g_signal_emit_by_name(widget, "cut-clipboard", NULL);
-
-    LEAVE("");
-}
-
-static void
-gnc_plugin_page_register2_cmd_copy (GtkAction *action,
-                                   GncPluginPageRegister2 *page) //this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-    GtkWidget *window, *widget;
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
-
-    ENTER("(action %p, page %p)", action, page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-
-    window = gnc_plugin_page_get_window (GNC_PLUGIN_PAGE (page));
-    widget = gtk_window_get_focus (GTK_WINDOW (window));
-
-    DEBUG("(widget name is %s)", gtk_widget_get_name (widget));
-
-    if (GTK_IS_ENTRY(widget))
-        g_signal_emit_by_name (widget, "copy-clipboard", NULL);
-
-    LEAVE("");
-}
-
-static void
-gnc_plugin_page_register2_cmd_paste (GtkAction *action,
-                                    GncPluginPageRegister2 *page) //this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-    GtkWidget *window, *widget;
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
-
-    ENTER("(action %p, page %p)", action, page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-
-    window = gnc_plugin_page_get_window (GNC_PLUGIN_PAGE (page));
-    widget = gtk_window_get_focus (GTK_WINDOW (window));
-
-    DEBUG("(widget name is %s)", gtk_widget_get_name (widget));
-
-    if (GTK_IS_ENTRY(widget))
-        g_signal_emit_by_name (widget, "paste-clipboard", NULL);
-
-    LEAVE("");
-}
-
-static void
-gnc_plugin_page_register2_cmd_edit_account (GtkAction *action,
-        GncPluginPageRegister2 *page) //this works
-{
-    Account *account;
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2(page));
-
-    ENTER("(action %p, page %p)", action, page);
-    account = gnc_plugin_page_register2_get_account (page);
-    if (account)
-        gnc_ui_edit_account_window (account);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_find_transactions (GtkAction *action,
-        GncPluginPageRegister2 *page) // this works
-{
-    GncPluginPageRegister2Private *priv;
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2(page));
-
-    ENTER("(action %p, page %p)", action, page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(page);
-
-    gnc_ui_find_transactions_dialog_create2 (priv->ledger);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_cut_transaction (GtkAction *action,
-        GncPluginPageRegister2 *page) // this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2(page));
-
-    ENTER("(action %p, page %p)", action, page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-    gnc_tree_control_split_reg_cut_trans (view);
-
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_copy_transaction (GtkAction *action,
-        GncPluginPageRegister2 *page) // this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2(page));
-
-    ENTER("(action %p, page %p)", action, page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-    gnc_tree_control_split_reg_copy_trans (view);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_paste_transaction (GtkAction *action,
-        GncPluginPageRegister2 *page) //this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2(page));
-
-    ENTER("(action %p, page %p)", action, page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-    gnc_tree_control_split_reg_paste_trans (view);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_void_transaction (GtkAction *action,
-        GncPluginPageRegister2 *page) //this works
-{
-    GncPluginPageRegister2Private *priv;
-    GtkWidget *dialog, *entry;
-    GncTreeViewSplitReg *view;
-    Transaction *trans;
-    GtkBuilder *builder;
-    const char *reason;
-    gint result;
-
-    ENTER("(action %p, page %p)", action, page);
-
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-    trans = gnc_tree_view_split_reg_get_current_trans (view);
-    if (trans == NULL)
-    {
-        LEAVE("trans is NULL");
-        return;
-    }
-    if (xaccTransHasSplitsInState (trans, VREC))
-    {
-        LEAVE("trans has split in VREC state");
-        return;
-    }
-    if (xaccTransHasReconciledSplits (trans) || xaccTransHasSplitsInState (trans, CREC))
-    {
-        gnc_error_dialog (NULL, "%s", _("You cannot void a transaction with reconciled or cleared splits."));
-        LEAVE("trans with reconciled splits");
-        return;
-    }
-
-    if (!gnc_plugin_page_register2_finish_pending (GNC_PLUGIN_PAGE (page)))
-    {
-        LEAVE("finish pending");
-        return;
-    }
-
-    builder = gtk_builder_new();
-    gnc_builder_add_from_file  (builder , "gnc-plugin-page-register2.glade", "Void Transaction");
-    dialog = GTK_WIDGET (gtk_builder_get_object (builder, "Void Transaction"));
-    entry = GTK_WIDGET (gtk_builder_get_object (builder, "reason"));
-
-    result = gtk_dialog_run (GTK_DIALOG (dialog));
-    if (result == GTK_RESPONSE_OK)
-    {
-        reason = gtk_entry_get_text (GTK_ENTRY (entry));
-        if (reason == NULL)
-            reason = "";
-        gnc_tree_control_split_reg_void_current_trans (view, reason);
-    }
-
-    /* All done. Get rid of it. */
-    gtk_widget_destroy (dialog);
-    g_object_unref (G_OBJECT(builder));
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_unvoid_transaction (GtkAction *action,
-        GncPluginPageRegister2 *page) //this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-    Transaction *trans;
-
-    ENTER("(action %p, page %p)", action, page);
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-    trans = gnc_tree_view_split_reg_get_current_trans (view);
-    if (!xaccTransHasSplitsInState (trans, VREC))
-    {
-        LEAVE("trans has split in VREC state");
-        return;
-    }
-    gnc_tree_control_split_reg_unvoid_current_trans (view);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_reverse_transaction (GtkAction *action,
-        GncPluginPageRegister2 *page) //this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-
-    ENTER("(action %p, page %p)", action, page);
-
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-
-    gnc_tree_control_split_reg_reverse_current (view);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_entryUp (GtkAction *action,
-                                       GncPluginPageRegister2 *plugin_page)
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2(plugin_page));
-
-    ENTER("(action %p, plugin_page %p)", action, plugin_page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(plugin_page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-    g_return_if_fail(view);
-    gnc_tree_control_split_reg_move_current_entry_updown(view, TRUE);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_entryDown (GtkAction *action,
-                                         GncPluginPageRegister2 *plugin_page)
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2(plugin_page));
-
-    ENTER("(action %p, plugin_page %p)", action, plugin_page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(plugin_page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-    g_return_if_fail(view);
-    gnc_tree_control_split_reg_move_current_entry_updown(view, FALSE);
-    LEAVE(" ");
-}
-
-
-/*#################################################################################*/
-/*#################################################################################*/
-
-static void
-gnc_plugin_page_register2_cmd_view_filter_by (GtkAction *action,
-        GncPluginPageRegister2 *page) //this works
-{
-    GncPluginPageRegister2Private *priv;
-    GNCLedgerDisplay2Type ledger_type;
-    GtkWidget *dialog, *toggle, *button, *start_date, *end_date, *table, *hbox;
-    time64 start_time, end_time, time_val;
-    GtkBuilder *builder;
-    gboolean sensitive, value;
-    Query *query;
-    GList *split_list;
-    gchar *title;
-    int i;
-
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
-    ENTER("(action %p, page %p)", action, page);
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    if (priv->fd.dialog)
-    {
-        gtk_window_present (GTK_WINDOW (priv->fd.dialog));
-        LEAVE("existing dialog");
-        return;
-    }
-
-    /* Create the dialog */
-    builder = gtk_builder_new();
-    gnc_builder_add_from_file (builder, "gnc-plugin-page-register2.glade", "Filter By");
-    dialog = GTK_WIDGET (gtk_builder_get_object (builder, "Filter By"));
-    priv->fd.dialog = dialog;
-    gtk_window_set_transient_for (GTK_WINDOW (dialog),
-                                 gnc_window_get_gtk_window (GNC_WINDOW (GNC_PLUGIN_PAGE (page)->window)));
-
-    /* Translators: The %s is the name of the plugin page */
-    title = g_strdup_printf (_("Filter %s by..."),
-                            gnc_plugin_page_get_page_name (GNC_PLUGIN_PAGE (page)));
-    gtk_window_set_title (GTK_WINDOW (dialog), title);
-    g_free(title);
-
-    /* Set the check buttons for the current status */
-    for (i = 0; status_actions[i].action_name; i++)
-    {
-        toggle = GTK_WIDGET (gtk_builder_get_object (builder, status_actions[i].action_name));
-        value = priv->fd.cleared_match & status_actions[i].value;
-        status_actions[i].widget = toggle;
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), value);
-    }
-    priv->fd.original_cleared_match = priv->fd.cleared_match;
-
-    button = GTK_WIDGET (gtk_builder_get_object (builder, "filter_save"));
-    if (priv->fd.save_filter == TRUE)
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
-
-    // General Ledgers can not save filters so disable button.
-    ledger_type = gnc_ledger_display2_type (priv->ledger);
-    if (ledger_type == LD2_GL)
-       gtk_widget_set_sensitive (GTK_WIDGET (button), FALSE);
-
-    /* Set the date info */
-    button = GTK_WIDGET (gtk_builder_get_object (builder, "filter_show_range"));
-    query = gnc_ledger_display2_get_query (priv->ledger);
-    xaccQueryGetDateMatchTT (query, &start_time, &end_time);
-    priv->fd.original_start_time = start_time;
-    priv->fd.start_time = start_time;
-    priv->fd.original_end_time = end_time;
-    priv->fd.end_time = end_time;
-
-    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), start_time || end_time);
-    table = GTK_WIDGET (gtk_builder_get_object (builder, "select_range_table"));
-    priv->fd.table = table;
-    gtk_widget_set_sensitive (GTK_WIDGET (table), start_time || end_time);
-
-    priv->fd.start_date_choose = GTK_WIDGET (gtk_builder_get_object (builder, "start_date_choose"));
-    priv->fd.start_date_today = GTK_WIDGET (gtk_builder_get_object (builder, "start_date_today"));
-    priv->fd.end_date_choose = GTK_WIDGET (gtk_builder_get_object (builder, "end_date_choose"));
-    priv->fd.end_date_today = GTK_WIDGET (gtk_builder_get_object (builder, "end_date_today"));
-
-    {
-        /* Start date info */
-        if (start_time == 0)
-        {
-            button = GTK_WIDGET (gtk_builder_get_object (builder, "start_date_earliest"));
-            time_val = xaccQueryGetEarliestDateFound (query);
-            sensitive = FALSE;
-        }
-        else
-        {
-            time_val = start_time;
-            if ((start_time >= gnc_time64_get_today_start()) &&
-                    (start_time <= gnc_time64_get_today_end()))
-            {
-                button = priv->fd.start_date_today;
-                sensitive = FALSE;
-            }
-            else
-            {
-                button = priv->fd.start_date_choose;
-                sensitive = TRUE;
-            }
-        }
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
-        priv->fd.start_date = gnc_date_edit_new (gnc_time (NULL), FALSE, FALSE);
-        hbox = GTK_WIDGET (gtk_builder_get_object (builder, "start_date_hbox"));
-        gtk_box_pack_start (GTK_BOX (hbox), priv->fd.start_date, TRUE, TRUE, 0);
-        gtk_widget_show (priv->fd.start_date);
-        gtk_widget_set_sensitive (GTK_WIDGET (priv->fd.start_date), sensitive);
-        gnc_date_edit_set_time (GNC_DATE_EDIT (priv->fd.start_date), time_val);
-        g_signal_connect (G_OBJECT (priv->fd.start_date), "date-changed",
-                          G_CALLBACK (gnc_plugin_page_register2_filter_gde_changed_cb),
-                          page);
-    }
-
-    {
-        /* End date info */
-        if (end_time == 0)
-        {
-            button = GTK_WIDGET (gtk_builder_get_object (builder, "end_date_latest"));
-            time_val = xaccQueryGetLatestDateFound (query);
-            sensitive = FALSE;
-        }
-        else
-        {
-            time_val = end_time;
-            if ((end_time >= gnc_time64_get_today_start()) &&
-                    (end_time <= gnc_time64_get_today_end()))
-            {
-                button = priv->fd.end_date_today;
-                sensitive = FALSE;
-            }
-            else
-            {
-                button = priv->fd.end_date_choose;
-                sensitive = TRUE;
-            }
-        }
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
-        priv->fd.end_date = gnc_date_edit_new (gnc_time (NULL), FALSE, FALSE);
-        hbox = GTK_WIDGET (gtk_builder_get_object (builder, "end_date_hbox"));
-        gtk_box_pack_start (GTK_BOX (hbox), priv->fd.end_date, TRUE, TRUE, 0);
-        gtk_widget_show (priv->fd.end_date);
-        gtk_widget_set_sensitive (GTK_WIDGET (priv->fd.end_date), sensitive);
-        gnc_date_edit_set_time (GNC_DATE_EDIT (priv->fd.end_date), time_val);
-        g_signal_connect (G_OBJECT (priv->fd.end_date), "date-changed",
-                          G_CALLBACK (gnc_plugin_page_register2_filter_gde_changed_cb),
-                          page);
-    }
-
-    /* Wire it up */
-    gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, page);
-
-    /* Show it */
-    gtk_widget_show_all (dialog);
-    g_object_unref (G_OBJECT (builder));
-    LEAVE(" ");
-}
-
-
-static void
-gnc_plugin_page_register2_cmd_reload (GtkAction *action, GncPluginPageRegister2 *plugin_page) //this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-
-    Transaction *trans;
-
-    ENTER("(action %p, page %p)", action, plugin_page);
-
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (plugin_page);
-
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-
-    trans = gnc_tree_view_split_reg_get_current_trans (view);
-
-    /* Make sure we ask to commit any changes before we proceed */
-    if (gnc_tree_control_split_reg_trans_open_and_warn (view, trans))
-    {
-        LEAVE("trans being edited");
-        return;
-    }
-
-    /* give gtk+ a chance to handle pending events */
-    while (gtk_events_pending ())
-        gtk_main_iteration ();
-
-    gnc_ledger_display2_refresh (priv->ledger);
-
-    LEAVE(" ");
-}
-
-/*#################################################################################*/
-/*#################################################################################*/
-
-static void
-gnc_plugin_page_register2_cmd_style_changed (GtkAction *action,
-        GtkRadioAction *current,
-        GncPluginPageRegister2 *plugin_page) //this works
-{
-    GncPluginPageRegister2Private *priv;
-    SplitRegisterStyle2 value;
-
-    ENTER("(action %p, radio action %p, plugin_page %p)",
-          action, current, plugin_page);
-
-    g_return_if_fail (GTK_IS_ACTION (action));
-    g_return_if_fail (GTK_IS_RADIO_ACTION (current));
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (plugin_page);
-    value = gtk_radio_action_get_current_value (current);
-    gnc_split_reg2_change_style (priv->gsr, value);
-
-    gnc_plugin_page_register2_ui_update (NULL, plugin_page);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_style_double_line (GtkToggleAction *action,
-        GncPluginPageRegister2 *plugin_page) // this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeModelSplitReg *model;
-    GncTreeViewSplitReg *view;
-    gboolean use_double_line;
-
-    ENTER("(action %p, plugin_page %p)", action, plugin_page);
-
-    g_return_if_fail (GTK_IS_ACTION (action));
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (plugin_page);
-    model = gnc_ledger_display2_get_split_model_register (priv->ledger);
-
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-
-    use_double_line = gtk_toggle_action_get_active (action);
-    if (use_double_line != model->use_double_line)
-    {
-        gnc_tree_model_split_reg_config (model, model->type, model->style, use_double_line);
-
-        // This will re-display the view.
-        gnc_tree_view_split_reg_set_format (view);
-        gnc_ledger_display2_refresh (priv->ledger);
-    }
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_style_extra_dates (GtkToggleAction *action,
-        GncPluginPageRegister2 *plugin_page) // this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeModelSplitReg *model;
-    GncTreeViewSplitReg *view;
-    gboolean show_extra_dates;
-
-    ENTER("(action %p, plugin_page %p)", action, plugin_page);
-
-    g_return_if_fail (GTK_IS_ACTION (action));
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (plugin_page);
-    model = gnc_ledger_display2_get_split_model_register (priv->ledger);
-
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-
-    show_extra_dates = gtk_toggle_action_get_active (action);
-    if (show_extra_dates != view->show_extra_dates)
-    {
-        view->show_extra_dates = show_extra_dates;
-        gnc_ledger_display2_refresh (priv->ledger);
-    }
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_transfer (GtkAction *action,
-                                       GncPluginPageRegister2 *page) //this works
-{
-    Account *account;
-    GncWindow *gnc_window;
-    GtkWidget *window;
-
-    ENTER("(action %p, plugin_page %p)", action, page);
-
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
-
-    account = gnc_plugin_page_register2_get_account (page);
-    gnc_window = GNC_WINDOW (GNC_PLUGIN_PAGE (page)->window);
-    window = GTK_WIDGET (gnc_window_get_gtk_window (gnc_window));
-    gnc_xfer_dialog (window, account);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_reconcile (GtkAction *action,
-                                        GncPluginPageRegister2 *page) // this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-    Account *account;
-    Transaction *trans;
-    GtkWindow *window;
-    RecnWindow2 * recnData;
-
-    ENTER("(action %p, plugin_page %p)", action, page);
-
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-
-    account = gnc_plugin_page_register2_get_account (page);
-
-    trans = gnc_tree_view_split_reg_get_current_trans (view);
-
-    /* Make sure we ask to commit any changes before we proceed */
-    if (gnc_tree_control_split_reg_trans_open_and_warn (view, trans))
-    {
-        LEAVE("trans being edited");
-        return;
-    }
-
-    window = gnc_window_get_gtk_window (GNC_WINDOW (GNC_PLUGIN_PAGE (page)->window));
-    recnData = recnWindow2 (GTK_WIDGET (window), account);
-    gnc_ui_reconcile_window2_raise (recnData);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_autoclear (GtkAction *action,
-                                        GncPluginPageRegister2 *page)
-{
-    Account *account;
-    GtkWindow *window;
-    AutoClearWindow * autoClearData;
-
-    ENTER("(action %p, plugin_page %p)", action, page);
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2(page));
-
-    account = gnc_plugin_page_register2_get_account (page);
-
-    window = gnc_window_get_gtk_window(GNC_WINDOW(GNC_PLUGIN_PAGE (page)->window));
-    autoClearData = autoClearWindow (GTK_WIDGET(window), account);
-    gnc_ui_autoclear_window_raise (autoClearData);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_stock_split (GtkAction *action,
-        GncPluginPageRegister2 *page) // this works
-{
-    Account *account;
-
-    ENTER("(action %p, plugin_page %p)", action, page);
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2(page));
-
-    account = gnc_plugin_page_register2_get_account (page);
-    gnc_stock_split_dialog (NULL, account);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_lots (GtkAction *action,
-                                   GncPluginPageRegister2 *page) // this works
-{
-    Account *account;
-
-    ENTER("(action %p, plugin_page %p)", action, page);
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2(page));
-
-    account = gnc_plugin_page_register2_get_account (page);
-    gnc_lot_viewer_dialog (account);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_enter_transaction (GtkAction *action,
-        GncPluginPageRegister2 *plugin_page) //this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-
-    ENTER("(action %p, plugin_page %p)", action, plugin_page);
-
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (plugin_page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-    gnc_tree_control_split_reg_enter (view);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_cancel_transaction (GtkAction *action,
-        GncPluginPageRegister2 *plugin_page) //this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-
-    ENTER("(action %p, plugin_page %p)", action, plugin_page);
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (plugin_page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-    gnc_tree_control_split_reg_cancel_edit (view, FALSE);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_delete_transaction (GtkAction *action,
-        GncPluginPageRegister2 *plugin_page) //this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-
-    ENTER("(action %p, plugin_page %p)", action, plugin_page);
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (plugin_page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-    gnc_tree_control_split_reg_delete (view, NULL);
-    LEAVE(" ");
-
-}
-
-static void
-gnc_plugin_page_register2_cmd_blank_transaction (GtkAction *action,
-        GncPluginPageRegister2 *plugin_page) //this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-
-    ENTER("(action %p, plugin_page %p)", action, plugin_page);
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (plugin_page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-    gnc_tree_control_split_reg_jump_to_blank (view);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_duplicate_transaction (GtkAction *action,
-        GncPluginPageRegister2 *plugin_page) //this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-
-    ENTER("(action %p, plugin_page %p)", action, plugin_page);
-
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (plugin_page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-    gnc_tree_control_split_reg_duplicate_current (view);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_reinitialize_transaction (GtkAction *action,
-        GncPluginPageRegister2 *plugin_page) //this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-
-    ENTER("(action %p, plugin_page %p)", action, plugin_page);
-
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (plugin_page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-    gnc_tree_control_split_reg_reinit (view, NULL);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_expand_transaction (GtkToggleAction *action,
-        GncPluginPageRegister2 *plugin_page) // this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-    gboolean expand;
-
-    ENTER("(action %p, plugin_page %p)", action, plugin_page);
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (plugin_page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-    expand = gtk_toggle_action_get_active (action);
-    if (expand)
-        gnc_tree_view_split_reg_expand_trans (view, NULL);
-    else
-        gnc_tree_view_split_reg_collapse_trans (view, NULL);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_exchange_rate (GtkAction *action,
-        GncPluginPageRegister2 *plugin_page) //this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-
-    ENTER("(action %p, plugin_page %p)", action, plugin_page);
-
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (plugin_page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-    gnc_tree_control_split_reg_exchange_rate (view);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_jump (GtkAction *action,
-        GncPluginPageRegister2 *plugin_page) //this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncPluginPage *new_page;
-    GncPluginPageRegister2 *new_reg_page;
-    GtkWidget *window;
-    GNCLedgerDisplay2 *ld;
-    GncTreeViewSplitReg *view, *new_view;
-    GncTreeModelSplitReg *new_model;
-    Account *account;
-    Account *leader;
-    Split *split;
-    RowDepth depth;
-
-    ENTER("(action %p, plugin_page %p)", action, plugin_page);
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (plugin_page);
-    window = GNC_PLUGIN_PAGE (plugin_page)->window;
-    if (window == NULL)
-    {
-        LEAVE("no window");
-        return;
-    }
-
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-    split = gnc_tree_view_split_reg_get_current_split (view);
-    if (split == NULL)
-    {
-        split = gnc_tree_control_split_reg_get_current_trans_split (view);
-        if (split == NULL)
-        {
-            LEAVE("split is NULL");
-            return;
-        }
-    }
-
-    if (!gnc_tree_view_split_reg_trans_expanded (view, NULL))
-    {
-        Transaction *trans = xaccSplitGetParent (split);
-        if (xaccTransCountSplits (trans) > 2)
-        {
-            LEAVE("more than 2 splits");
-            return;
-        }
-    }
-
-    depth = gnc_tree_view_reg_get_selected_row_depth (view);
-    if (gnc_tree_view_split_reg_trans_expanded (view, NULL) && depth != SPLIT3)
-    {
-        LEAVE("expanded but no split selected");
-        return;
-    }
-
-    account = xaccSplitGetAccount (split);
-    if (account == NULL)
-    {
-        LEAVE("account is NULL");
-        return;
-    }
-
-    leader = gnc_ledger_display2_leader (priv->ledger);
-    if (account == leader)
-    {
-        split = xaccSplitGetOtherSplit (split);
-        if (split == NULL)
-        {
-            LEAVE("no other split");
-            return;
-        }
-
-        account = xaccSplitGetAccount (split);
-        if (account == NULL)
-        {
-            LEAVE("no other account");
-            return;
-        }
-
-        if (account == leader)
-        {
-            LEAVE("register open for account");
-            return;
-        }
-    }
-
-    new_page = gnc_plugin_page_register2_new (account, FALSE);
-    if (new_page == NULL)
-    {
-        LEAVE("couldn't create new page");
-        return;
-    }
-
-    gnc_main_window_open_page (GNC_MAIN_WINDOW (window), new_page);
-
-    ld = gnc_plugin_page_register2_get_ledger (new_page);
-    new_view = gnc_ledger_display2_get_split_view_register (ld);
-    new_model = gnc_ledger_display2_get_split_model_register (ld);
-
-    new_model->current_trans = xaccSplitGetParent (split);
-
-    if (!gnc_tree_model_split_reg_trans_is_in_view (new_model, xaccSplitGetParent (split)))
-        g_signal_emit_by_name (new_model, "refresh_trans");
-
-    gnc_tree_control_split_reg_jump_to (new_view, NULL, split, FALSE);
-    LEAVE(" ");
-}
-
-
-/**
- * Schedules the current transaction for recurring-entry.
- * If the selected transaction was created from a scheduled transaction,
- * opens the editor for that Scheduled Transaction.
- **/
-static void
-gnc_plugin_page_register2_cmd_schedule (GtkAction *action,
-                                       GncPluginPageRegister2 *plugin_page) // this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-    Transaction *trans;
-
-    ENTER("(action %p, plugin_page %p)", action, plugin_page);
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2(plugin_page));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(plugin_page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-
-    trans = gnc_tree_view_split_reg_get_current_trans (view);
-
-    if (trans == NULL)
-    {
-        LEAVE("trans is NULL");
-        return;
-    }
-
-    /* See if we were asked to schedule a blank trans. */
-    if (trans == gnc_tree_control_split_reg_get_blank_trans (view))
-    {
-        LEAVE("Asked to schedule a blank trans");
-        return;
-    }
-
-    /* See if we are being edited in another register */
-    if (gnc_tree_control_split_reg_trans_test_for_edit (view, trans))
-    {
-        LEAVE("trans being edited in another register");
-        return;
-    }
-
-    /* Make sure we ask to commit any changes before we proceed */
-    if (gnc_tree_control_split_reg_trans_open_and_warn (view, trans))
-    {
-        LEAVE("trans being edited");
-        return;
-    }
-
-    /* If the transaction has a sched-xact KVP frame, then go to the editor
-     * for the existing SX; otherwise, do the sx-from-trans dialog. */
-    {
-        kvp_frame *txn_frame;
-        kvp_value *kvp_val;
-        /* set a kvp-frame element in the transaction indicating and
-         * pointing-to the SX this was created from. */
-        txn_frame = xaccTransGetSlots (trans);
-        if ( txn_frame != NULL )
-        {
-            kvp_val = kvp_frame_get_slot (txn_frame, "from-sched-xaction");
-            if (kvp_val)
-            {
-                GncGUID *fromSXId = kvp_value_get_guid (kvp_val);
-                SchedXaction *theSX = NULL;
-                GList *sxElts;
-
-                /* Get the correct SX */
-                for ( sxElts = gnc_book_get_schedxactions (gnc_get_current_book())->sx_list;
-                        (!theSX) && sxElts;
-                        sxElts = sxElts->next )
-                {
-                    SchedXaction *sx = (SchedXaction*)sxElts->data;
-                    theSX =
-                        ((guid_equal (xaccSchedXactionGetGUID (sx), fromSXId))
-                          ? sx : NULL);
-                }
-
-                if (theSX)
-                {
-                    gnc_ui_scheduled_xaction_editor_dialog_create2 (theSX, FALSE);
-                    LEAVE(" ");
-                    return;
-                }
-            }
-        }
-    }
-    gnc_sx_create_from_trans (trans);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_scrub_current (GtkAction *action,
-        GncPluginPageRegister2 *plugin_page) // this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-    Query *query;
-    Account *root;
-    Transaction *trans;
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page));
-
-    ENTER("(action %p, plugin_page %p)", action, plugin_page);
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (plugin_page);
-    query = gnc_ledger_display2_get_query (priv->ledger);
-    if (query == NULL)
-    {
-        LEAVE("no query found");
-        return;
-    }
-
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-    trans = gnc_tree_view_split_reg_get_current_trans (view);
-    if (trans == NULL)
-    {
-        LEAVE("no trans found");
-        return;
-    }
-
-    gnc_suspend_gui_refresh();
-    root = gnc_get_current_root_account ();
-    xaccTransScrubOrphans (trans);
-    xaccTransScrubImbalance (trans, root, NULL);
-    gnc_resume_gui_refresh ();
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_scrub_all (GtkAction *action,
-                                        GncPluginPageRegister2 *plugin_page) // this works
-{
-    GncPluginPageRegister2Private *priv;
-    Query *query;
-    Account *root;
-    Transaction *trans;
-    Split *split;
-    GList *node;
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2(plugin_page));
-
-    ENTER("(action %p, plugin_page %p)", action, plugin_page);
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(plugin_page);
-    query = gnc_ledger_display2_get_query( priv->ledger );
-    if (!query)
-    {
-        LEAVE("no query found");
-        return;
-    }
-
-    gnc_suspend_gui_refresh();
-    root = gnc_get_current_root_account();
-
-    for (node = qof_query_run(query); node; node = node->next)
-    {
-        split = node->data;
-        trans = xaccSplitGetParent(split);
-
-        xaccTransScrubOrphans(trans);
-        xaccTransScrubImbalance(trans, root, NULL);
-    }
-
-    gnc_resume_gui_refresh();
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_account_report (GtkAction *action,
-        GncPluginPageRegister2 *plugin_page) // this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncMainWindow *window;
-    int id;
-
-    ENTER("(action %p, plugin_page %p)", action, plugin_page);
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2(plugin_page));
-
-    window = GNC_MAIN_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(plugin_page);
-    id = report_helper (priv->ledger, NULL, NULL);
-    if (id >= 0)
-        gnc_main_window_open_report(id, window);
-    LEAVE(" ");
-}
-
-static void
-gnc_plugin_page_register2_cmd_transaction_report (GtkAction *action,
-        GncPluginPageRegister2 *plugin_page) // this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncMainWindow *window;
-    GncTreeViewSplitReg *view;
-    Split *split;
-    Query *query;
-    int id;
-
-    ENTER("(action %p, plugin_page %p)", action, plugin_page);
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (plugin_page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-
-    split = gnc_tree_view_split_reg_get_current_split (view);
-    if (!split)
-    {
-        LEAVE("split is NULL");
-        return;
-    }
-
-    query = qof_query_create_for(GNC_ID_SPLIT);
-
-    qof_query_set_book (query, gnc_get_current_book ());
-
-    xaccQueryAddGUIDMatch (query, xaccSplitGetGUID (split),
-                           GNC_ID_SPLIT, QOF_QUERY_AND);
-
-    window = GNC_MAIN_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window);
-    id = report_helper (priv->ledger, split, query);
-    if (id >= 0)
-        gnc_main_window_open_report(id, window);
-    LEAVE(" ");
-}
-
-/*#################################################################################*/
-/*#################################################################################*/
-
-/************************************************************/
-/*                    Auxiliary functions                   */
-/************************************************************/
-
-void
-gnc_plugin_page_register2_set_options (GncPluginPage *plugin_page,
-                                      gint lines_default,
-                                      gboolean read_only)
-{
-    GncPluginPageRegister2 *page;
-    GncPluginPageRegister2Private *priv;
-
-    g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2(plugin_page));
-
-    page = GNC_PLUGIN_PAGE_REGISTER2 (plugin_page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(page);
-    priv->lines_default     = lines_default;
-    priv->read_only         = read_only;
-}
-
-GNCSplitReg2 *
-gnc_plugin_page_register2_get_gsr (GncPluginPage *plugin_page)
-{
-    GncPluginPageRegister2 *page;
-    GncPluginPageRegister2Private *priv;
-
-    g_return_val_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2(plugin_page), NULL);
-
-    page = GNC_PLUGIN_PAGE_REGISTER2 (plugin_page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(page);
-
-    return priv->gsr;
-}
-
-
-GNCLedgerDisplay2 *
-gnc_plugin_page_register2_get_ledger (GncPluginPage *plugin_page)
-{
-    GncPluginPageRegister2 *page;
-    GncPluginPageRegister2Private *priv;
-
-    g_return_val_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2(plugin_page), NULL);
-
-    page = GNC_PLUGIN_PAGE_REGISTER2 (plugin_page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(page);
-
-    return priv->ledger;
-}
-static void
-gnc_plugin_page_help_changed_cb (GNCSplitReg2 *gsr, GncPluginPageRegister2 *register_page) //this works
-{
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-    GncWindow *window;
-    char *help;
-
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (register_page));
-
-    window = GNC_WINDOW (GNC_PLUGIN_PAGE (register_page)->window);
-    if (!window)
-    {
-        // This routine can be called before the page is added to a
-        // window.
-        return;
-    }
-    /* Get the text from the view */
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (register_page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-    help = g_strdup (view->help_text);
-    gnc_window_set_status (window, GNC_PLUGIN_PAGE (register_page), help);
-    g_free (help);
-}
-
-static void
-gnc_plugin_page_register2_refresh_cb (GHashTable *changes, gpointer user_data) //this works
-{
-    GncPluginPageRegister2 *page = user_data;
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
-
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
-
-    if (changes)
-    {
-        const EventInfo* ei;
-
-        ei = gnc_gui_get_entity_events (changes, &priv->key);
-        if (ei)
-        {
-            if (ei->event_mask & QOF_EVENT_DESTROY)
-            {
-                gnc_main_window_close_page (GNC_PLUGIN_PAGE (page));
-                return;
-            }
-            if (ei->event_mask & QOF_EVENT_MODIFY)
-            {
-            }
-        }
-    }
-    else
-    {
-        /* Force updates */
-        gnc_tree_view_split_reg_refresh_from_prefs (view);
-    }
-    gnc_plugin_page_register2_ui_update (NULL, page);
-}
-
-static void
-gnc_plugin_page_register2_close_cb (gpointer user_data)
-{
-    GncPluginPage *plugin_page = GNC_PLUGIN_PAGE(user_data);
-    gnc_main_window_close_page (plugin_page);
-}
-
-/** This function is called when an account has been edited and an
- *  "extreme" change has been made to it.  (E.G. Changing from a
- *  credit card account to an expense account.  This rouine is
- *  responsible for finding all open registers containing the account
- *  and closing them.
- *
- *  @param account A pointer to the account that was changed.
- */
-static void
-gppr_account_destroy_cb (Account *account)
-{
-    GncPluginPageRegister2 *page;
-    GncPluginPageRegister2Private *priv;
-    GNCLedgerDisplay2Type ledger_type;
-    const GncGUID *acct_guid;
-    const GList *citem;
-    GList *item, *kill = NULL;
-
-    acct_guid = xaccAccountGetGUID(account);
-
-    /* Find all windows that need to be killed.  Don't kill them yet, as
-     * that would affect the list being walked.*/
-    citem = gnc_gobject_tracking_get_list(GNC_PLUGIN_PAGE_REGISTER2_NAME);
-    for ( ; citem; citem = g_list_next(citem))
-    {
-        page = (GncPluginPageRegister2 *)citem->data;
-        priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(page);
-        ledger_type = gnc_ledger_display2_type (priv->ledger);
-        if (ledger_type == LD2_GL)
-        {
-            kill = g_list_append(kill, page);
-            /* kill it */
-        }
-        else if ((ledger_type == LD2_SINGLE) || (ledger_type == LD2_SUBACCOUNT))
-        {
-            if (guid_compare(acct_guid, &priv->key) == 0)
-            {
-                kill = g_list_append(kill, page);
-            }
-        }
-    }
-
-    /* Now kill them. */
-    for (item = kill; item; item = g_list_next(item))
-    {
-        page = (GncPluginPageRegister2 *)item->data;
-        gnc_main_window_close_page(GNC_PLUGIN_PAGE(page));
-    }
-}
-
-/** This function is the handler for all event messages from the
- *  engine.  Its purpose is to update the register page any time
- *  an account or transaction is changed.
- *
- *  @internal
- *
- *  @param entity A pointer to the affected item.
- *
- *  @param event_type The type of the affected item.
- *
- *  @param page A pointer to the register page.
- *
- *  @param ed
- */
-static void
-gnc_plugin_page_register2_event_handler (QofInstance *entity,
-                                        QofEventId event_type,
-                                        GncPluginPageRegister2 *page,
-                                        GncEventData *ed)
-{
-    Transaction *trans;
-    QofBook *book;
-    GncPluginPage *visible_page;
-    GtkWidget *window;
-    gchar *label, *color;
-
-    g_return_if_fail(page);	/* Required */
-    if (!GNC_IS_TRANS(entity) && !GNC_IS_ACCOUNT(entity))
-        return;
-
-    ENTER("entity %p of type %d, page %p, event data %p",
-          entity, event_type, page, ed);
-
-    window = gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(page));
-
-    if (GNC_IS_ACCOUNT(entity))
-    {
-        if (GNC_IS_MAIN_WINDOW(window))
-        {
-            label = gnc_plugin_page_register2_get_tab_name(GNC_PLUGIN_PAGE(page));
-            main_window_update_page_name(GNC_PLUGIN_PAGE(page), label);
-            color = gnc_plugin_page_register2_get_tab_color(GNC_PLUGIN_PAGE(page));
-            main_window_update_page_color(GNC_PLUGIN_PAGE(page), color);
-            g_free(color);
-            g_free(label);
-        }
-        LEAVE("tab name updated");
-        return;
-    }
-
-    if (!(event_type & (QOF_EVENT_MODIFY | QOF_EVENT_DESTROY)))
-    {
-        LEAVE("not a modify");
-        return;
-    }
-    trans = GNC_TRANS(entity);
-    book = qof_instance_get_book(QOF_INSTANCE(trans));
-    if (!gnc_plugin_page_has_book(GNC_PLUGIN_PAGE(page), book))
-    {
-        LEAVE("not in this book");
-        return;
-    }
-
-    if (GNC_IS_MAIN_WINDOW(window))
-    {
-        visible_page = gnc_main_window_get_current_page(GNC_MAIN_WINDOW(window));
-        if (visible_page != GNC_PLUGIN_PAGE(page))
-        {
-            LEAVE("page not visible");
-            return;
-        }
-    }
-
-    gnc_plugin_page_register2_ui_update(NULL, page);
-    LEAVE(" ");
-    return;
-}
-
-
-/** @} */
-/** @} */

Deleted: gnucash/trunk/src/gnome/gnc-plugin-page-register2.h
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-register2.h	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-register2.h	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,159 +0,0 @@
-/**********************************************************************
- * gnc-plugin-page-register2.h -- register page functions              *
- *                                                                    *
- * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>       *
- * Copyright (C) 2003,2005,2006 David Hampton <hampton at employees.org> *
- *                                                                    *
- * This program is free software; you can redistribute it and/or      *
- * modify it under the terms of the GNU General Public License as     *
- * published by the Free Software Foundation; either version 2 of     *
- * the License, or (at your option) any later version.                *
- *                                                                    *
- * This program is distributed in the hope that it will be useful,    *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of     *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      *
- * GNU General Public License for more details.                       *
- *                                                                    *
- * You should have received a copy of the GNU General Public License  *
- * along with this program; if not, contact:                          *
- *                                                                    *
- * Free Software Foundation           Voice:  +1-617-542-5942         *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652         *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                     *
- **********************************************************************/
-
-/** @addtogroup ContentPlugins
-    @{ */
-/** @addtogroup Register2Plugin Register2 Page
-    @{ */
-/** @file gnc-plugin-page-register.h
-    @brief  Functions providing a register page for the GnuCash UI
-    @author Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
-    @author Copyright (C) 2003 David Hampton <hampton at employees.org>
-*/
-
-#ifndef __GNC_PLUGIN_PAGE_REGISTER2_H
-#define __GNC_PLUGIN_PAGE_REGISTER2_H
-
-#include <gtk/gtk.h>
-
-#include "Account.h"
-#include "gnc-ledger-display2.h"
-#include "gnc-plugin-page.h"
-#include "gnc-split-reg2.h"
-
-G_BEGIN_DECLS
-
-/* type macros */
-#define GNC_TYPE_PLUGIN_PAGE_REGISTER2            (gnc_plugin_page_register2_get_type ())
-#define GNC_PLUGIN_PAGE_REGISTER2(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_PAGE_REGISTER2, GncPluginPageRegister2))
-#define GNC_PLUGIN_PAGE_REGISTER2_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_PAGE_REGISTER2, GncPluginPageRegister2Class))
-#define GNC_IS_PLUGIN_PAGE_REGISTER2(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_PAGE_REGISTER2))
-#define GNC_IS_PLUGIN_PAGE_REGISTER2_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_PAGE_REGISTER2))
-#define GNC_PLUGIN_PAGE_REGISTER2_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_PAGE_REGISTER2, GncPluginPageRegister2Class))
-#define GNC_PLUGIN_PAGE_REGISTER2_NAME "GncPluginPageRegister2"
-
-/* typedefs & structures */
-typedef struct
-{
-    GncPluginPage gnc_plugin_page;
-} GncPluginPageRegister2;
-
-typedef struct
-{
-    GncPluginPageClass gnc_plugin_page;
-} GncPluginPageRegister2Class;
-
-/* function prototypes */
-
-/** Retrieve the type number for the plugin page.
- *
- *  @return The type number.
- */
-GType gnc_plugin_page_register2_get_type (void);
-
-
-/** Create a new "register" plugin page, given a pointer to an
- *  account.
- *
- *  @param account The pointer to the account to embed in the
- *  register.
- *
- *  @param subaccounts TRUE if all the sub-accounts of the specified
- *  account should be included in the register.
- *
- *  @return The newly created plugin page.
- */
-GncPluginPage *
-gnc_plugin_page_register2_new (Account *account, gboolean subaccounts);
-
-
-/** Create a new "register" plugin page, given a pointer to an already
- *  created ledger.  This function should be used when the ledger
- *  already exists.  (E.G.  From the "find transaction" code, or from
- *  the scheduled transaction code.)
- *
- *  @param ledger The pointer to the ledger to embed into the
- *  register.
- *
- *  @return The newly created plugin page.
- */
-GncPluginPage *
-gnc_plugin_page_register2_new_ledger (GNCLedgerDisplay2 *ledger);
-
-
-/** Create a new "register" plugin page containing a general ledger.
- *
- *  @return The newly created plugin page.
- */
-GncPluginPage *
-gnc_plugin_page_register2_new_gl (void);
-
-
-/** Set various register options on a newly created "register" plugin page.
- *
- *  @param plugin_page The "register" page to modify.
- *
- *  @param lines_default Used to calculate the minimum preferred height of
- *                       the plugin page.
- *
- *  @param read_only True if the register should be read-only.
- */
-void
-gnc_plugin_page_register2_set_options (GncPluginPage *plugin_page,
-                                      gint lines_default,
-                                      gboolean read_only);
-
-
-/** Get the GNCSplitReg data structure associated with this register page.
- *
- *  @param plugin_page A "register" page.
- */
-GNCSplitReg2 *
-gnc_plugin_page_register2_get_gsr (GncPluginPage *plugin_page);
-
-
-/** Get the GNCLedgerDisplay data structure associated with this register page.
- *
- *  @param plugin_page A "register" page.
- */
-GNCLedgerDisplay2 *
-gnc_plugin_page_register2_get_ledger (GncPluginPage *plugin_page);
-
-
-/** Get the Account associated with this register page.
- *
- *  @param page A "register" page.
- *
- *  @return The account if the register contains only a single
- *  account, or an account and its sub-accounts.  NULL otherwise.
- */
-Account *
-gnc_plugin_page_register2_get_account (GncPluginPageRegister2 *page);
-
-G_END_DECLS
-/** @} */
-/** @} */
-
-#endif /* __GNC_PLUGIN_PAGE_REGISTER2_H */
-

Modified: gnucash/trunk/src/gnome/gnc-plugin-page-sx-list.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-sx-list.c	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-sx-list.c	2013-10-22 18:26:55 UTC (rev 23314)
@@ -52,9 +52,6 @@
 #include "Split.h"
 #include "Transaction.h"
 #include "dialog-sx-editor.h"
-/*################## Added for Reg2 #################*/
-#include "dialog-sx-editor2.h"
-/*################## Added for Reg2 #################*/
 #include "dialog-utils.h"
 #include "gnc-commodity.h"
 #include "gnc-component-manager.h"
@@ -119,10 +116,6 @@
 
 static void gnc_plugin_page_sx_list_cmd_new(GtkAction *action, GncPluginPageSxList *page);
 static void gnc_plugin_page_sx_list_cmd_edit(GtkAction *action, GncPluginPageSxList *page);
-/*################## Added for Reg2 #################*/
-static void gnc_plugin_page_sx_list_cmd_new2(GtkAction *action, GncPluginPageSxList *page);
-static void gnc_plugin_page_sx_list_cmd_edit2(GtkAction *action, GncPluginPageSxList *page);
-/*################## Added for Reg2 #################*/
 static void gnc_plugin_page_sx_list_cmd_delete(GtkAction *action, GncPluginPageSxList *page);
 
 /* Command callbacks */
@@ -133,23 +126,11 @@
         "SxListNewAction", GNC_STOCK_NEW_ACCOUNT, N_("_New"), NULL,
         N_("Create a new scheduled transaction"), G_CALLBACK(gnc_plugin_page_sx_list_cmd_new)
     },
-/*################## Added for Reg2 #################*/
     {
-        "SxListNewAction2", GNC_STOCK_NEW_ACCOUNT, N_("_New 2"), NULL,
-        N_("Create a new scheduled transaction 2"), G_CALLBACK(gnc_plugin_page_sx_list_cmd_new2)
-    },
-/*################## Added for Reg2 #################*/
-    {
         "SxListEditAction", GNC_STOCK_EDIT_ACCOUNT, N_("_Edit"), NULL,
         N_("Edit the selected scheduled transaction"), G_CALLBACK(gnc_plugin_page_sx_list_cmd_edit)
     },
-/*################## Added for Reg2 #################*/
     {
-        "SxListEditAction2", GNC_STOCK_EDIT_ACCOUNT, N_("_Edit 2"), NULL,
-        N_("Edit the selected scheduled transaction 2"), G_CALLBACK(gnc_plugin_page_sx_list_cmd_edit2)
-    },
-/*################## Added for Reg2 #################*/
-    {
         "SxListDeleteAction", GNC_STOCK_DELETE_ACCOUNT, N_("_Delete"), NULL,
         N_("Delete the selected scheduled transaction"), G_CALLBACK(gnc_plugin_page_sx_list_cmd_delete)
     },
@@ -581,43 +562,13 @@
     gnc_ui_scheduled_xaction_editor_dialog_create(new_sx, new_sx_flag);
 }
 
-/*################## Added for Reg2 #################*/
-static void
-gnc_plugin_page_sx_list_cmd_new2 (GtkAction *action, GncPluginPageSxList *page)
-{
-    SchedXaction *new_sx;
-    gboolean new_sx_flag = TRUE;
 
-    new_sx = xaccSchedXactionMalloc (gnc_get_current_book());
-    {
-        GDate now;
-        Recurrence *r = g_new0 (Recurrence, 1);
-        GList *schedule;
-
-        g_date_clear (&now, 1);
-        gnc_gdate_set_today (&now);
-        recurrenceSet(r, 1, PERIOD_MONTH, &now, WEEKEND_ADJ_NONE);
-        schedule = gnc_sx_get_schedule (new_sx);
-        schedule = g_list_append (schedule, r);
-        gnc_sx_set_schedule (new_sx, schedule);
-    }
-    gnc_ui_scheduled_xaction_editor_dialog_create2 (new_sx, new_sx_flag);
-}
-/*################## Added for Reg2 #################*/
-
 static void
 _edit_sx(gpointer data, gpointer user_data)
 {
     gnc_ui_scheduled_xaction_editor_dialog_create((SchedXaction*)data, FALSE);
 }
 
-/*################## Added for Reg2 #################*/
-static void
-_edit_sx2 (gpointer data, gpointer user_data)
-{
-    gnc_ui_scheduled_xaction_editor_dialog_create2 ((SchedXaction*)data, FALSE);
-}
-/*################## Added for Reg2 #################*/
 
 static SchedXaction*
 _argument_reorder_fn(GtkTreePath* list_path_data, GncTreeViewSxList* user_tree_view)
@@ -651,34 +602,7 @@
     g_list_free(selected_paths);
 }
 
-/*################## Added for Reg2 #################*/
-static void
-gnc_plugin_page_sx_list_cmd_edit2 (GtkAction *action, GncPluginPageSxList *page)
-{
-    GncPluginPageSxListPrivate *priv = GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE (page);
-    GtkTreeSelection *selection;
-    GList *selected_paths, *to_edit;
-    GtkTreeModel *model;
 
-    selection = gtk_tree_view_get_selection (priv->tree_view);
-    selected_paths = gtk_tree_selection_get_selected_rows (selection, &model);
-    if (g_list_length (selected_paths) == 0)
-    {
-        g_warning ("no selection edit.");
-        return;
-    }
-
-    to_edit = gnc_g_list_map (selected_paths,
-                             (GncGMapFunc)_argument_reorder_fn,
-                             priv->tree_view);
-    g_list_foreach(to_edit, (GFunc)_edit_sx2, NULL);
-    g_list_free (to_edit);
-    g_list_foreach (selected_paths, (GFunc)gtk_tree_path_free, NULL);
-    g_list_free (selected_paths);
-}
-/*################## Added for Reg2 #################*/
-
-
 static void
 gppsl_row_activated_cb(GtkTreeView *tree_view,
                        GtkTreePath *path,

Modified: gnucash/trunk/src/gnome/gnc-plugin-register.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-register.c	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/gnc-plugin-register.c	2013-10-22 18:26:55 UTC (rev 23314)
@@ -50,8 +50,8 @@
 static GtkActionEntry gnc_plugin_actions [] =
 {
     {
-        "ToolsGeneralLedgerAction", NULL, N_("Old St_yle General Ledger"), NULL,
-        N_("Open an old style general ledger window"),
+        "ToolsGeneralLedgerAction", NULL, N_("_General Ledger"), NULL,
+        N_("Open general ledger window"),
         G_CALLBACK (gnc_plugin_register_cmd_general_ledger)
     },
 };

Deleted: gnucash/trunk/src/gnome/gnc-plugin-register2.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-register2.c	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/gnc-plugin-register2.c	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,250 +0,0 @@
-/*
- * gnc-plugin-register2.c --
- *
- * Copyright (C) 2003 Jan Arne Petersen
- * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
- *
- * 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 <string.h>
-
-#include "gnc-component-manager.h"
-#include "gnc-plugin-register2.h"
-#include "gnc-plugin-page-register2.h"
-#include "gnc-prefs.h"
-
-static void gnc_plugin_register2_class_init (GncPluginRegister2Class *klass);
-static void gnc_plugin_register2_init (GncPluginRegister2 *plugin);
-static void gnc_plugin_register2_finalize (GObject *object);
-
-static void gnc_plugin_register2_add_to_window (GncPlugin *plugin, GncMainWindow *window, GQuark type);
-static void gnc_plugin_register2_remove_from_window (GncPlugin *plugin, GncMainWindow *window, GQuark type);
-
-/* Command callbacks */
-static void gnc_plugin_register2_cmd_general_ledger (GtkAction *action, GncMainWindowActionData *data);
-
-#define PLUGIN_ACTIONS_NAME "gnc-plugin-register2-actions"
-#define PLUGIN_UI_FILENAME  "gnc-plugin-register2-ui.xml"
-
-static GtkActionEntry gnc_plugin_actions [] =
-{
-    {
-        "ToolsGeneralLedger2Action", NULL, N_("_General Ledger"), NULL,
-        N_("Open a general ledger window"),
-        G_CALLBACK (gnc_plugin_register2_cmd_general_ledger)
-    },
-};
-static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
-
-typedef struct GncPluginRegister2Private
-{
-    gpointer dummy;
-} GncPluginRegister2Private;
-
-#define GNC_PLUGIN_REGISTER2_GET_PRIVATE(o)  \
-   (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_REGISTER2, GncPluginRegister2Private))
-
-static GObjectClass *parent_class = NULL;
-static QofLogModule log_module = GNC_MOD_GUI;
-
-/************************************************************
- *                     Other Functions                      *
- ************************************************************/
-
-/** This function is called whenever an entry in the general register
- *  preferences group is changed.  It does nothing more than kick off a
- *  gui refresh which should be delivered to any open register page.
- *  The register pages will then reread their preferences and
- *  update the screen.
- *
- *  @prefs Unused.
- *
- *  @pref Unused.
- *
- *  @user_data Unused.
- */
-static void
-gnc_plugin_register2_pref_changed (gpointer prefs, gchar *pref,
-                                   gpointer user_data)
-{
-    ENTER("");
-    gnc_gui_refresh_all ();
-    LEAVE("");
-}
-
-/************************************************************
- *                  Object Implementation                   *
- ************************************************************/
-
-GType
-gnc_plugin_register2_get_type (void)
-{
-    static GType gnc_plugin_register2_type = 0;
-
-    if (gnc_plugin_register2_type == 0)
-    {
-        static const GTypeInfo our_info =
-        {
-            sizeof (GncPluginRegister2Class),
-            NULL,		/* base_init */
-            NULL,		/* base_finalize */
-            (GClassInitFunc) gnc_plugin_register2_class_init,
-            NULL,		/* class_finalize */
-            NULL,		/* class_data */
-            sizeof (GncPluginRegister2),
-            0,		/* n_preallocs */
-            (GInstanceInitFunc) gnc_plugin_register2_init
-        };
-
-        gnc_plugin_register2_type = g_type_register_static (GNC_TYPE_PLUGIN,
-                                   "GncPluginRegister2",
-                                   &our_info, 0);
-    }
-
-    return gnc_plugin_register2_type;
-}
-
-GncPlugin *
-gnc_plugin_register2_new (void)
-{
-    GncPluginRegister2 *plugin;
-
-    /* Reference the register page plugin to ensure it exists in
-     * the gtk type system. */
-    GNC_TYPE_PLUGIN_PAGE_REGISTER2;
-
-    plugin = g_object_new (GNC_TYPE_PLUGIN_REGISTER2,
-                           NULL);
-
-    return GNC_PLUGIN (plugin);
-}
-
-static void
-gnc_plugin_register2_class_init (GncPluginRegister2Class *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_register2_finalize;
-
-    /* plugin info */
-    plugin_class->plugin_name  = GNC_PLUGIN_REGISTER2_NAME;
-
-    /* function overrides */
-    plugin_class->add_to_window = gnc_plugin_register2_add_to_window;
-    plugin_class->remove_from_window =
-        gnc_plugin_register2_remove_from_window;
-
-    /* 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(GncPluginRegister2Private));
-}
-
-static void
-gnc_plugin_register2_init (GncPluginRegister2 *plugin)
-{
-}
-
-static void
-gnc_plugin_register2_finalize (GObject *object)
-{
-    GncPluginRegister2 *plugin;
-    GncPluginRegister2Private *priv;
-
-    g_return_if_fail (GNC_IS_PLUGIN_REGISTER2 (object));
-
-    plugin = GNC_PLUGIN_REGISTER2 (object);
-    priv = GNC_PLUGIN_REGISTER2_GET_PRIVATE(plugin);
-
-    G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-/************************************************************
- *              Plugin Function Implementation              *
- ************************************************************/
-
-/** Initialize the registeru for a window.  This function is
- *  called as part of the initialization of a window, after all the
- *  plugin menu items have been added to the menu structure.  Its job
- *  is to correctly initialize the register.  It does this by
- *  installing a function that listens for preference changes. Each
- *  time a preference changes, it kicks off a gui refresh.
- *
- *  @param plugin A pointer to the gnc-plugin object responsible for
- *  adding/removing the register.
- *
- *  @param window A pointer to the gnc-main-window that is being initialized.
- *
- *  @param type Unused
- */
-static void
-gnc_plugin_register2_add_to_window (GncPlugin *plugin,
-                                   GncMainWindow *window,
-                                   GQuark type)
-{
-    gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL_REGISTER, NULL,
-                           gnc_plugin_register2_pref_changed, window);
-}
-
-
-/** Finalize the register for this window.  This function is
- *  called as part of the destruction of a window.
- *
- *  @param plugin A pointer to the gnc-plugin object responsible for
- *  adding/removing the register.  It stops listening for
- *  changes in the register preferences.
- *
- *  @param window A pointer the gnc-main-window that is being destroyed.
- *
- *  @param type Unused
- */
-static void
-gnc_plugin_register2_remove_from_window (GncPlugin *plugin,
-                                        GncMainWindow *window,
-                                        GQuark type)
-{
-    gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL_REGISTER, NULL,
-                                 gnc_plugin_register2_pref_changed, window);
-}
-
-/************************************************************
- *                    Command Callbacks                     *
- ************************************************************/
-
-static void
-gnc_plugin_register2_cmd_general_ledger (GtkAction *action,
-                                        GncMainWindowActionData *data)
-{
-    GncPluginPage *page;
-
-    g_return_if_fail (data != NULL);
-
-    page = gnc_plugin_page_register2_new_gl ();
-    gnc_main_window_open_page (data->window, page);
-}

Deleted: gnucash/trunk/src/gnome/gnc-plugin-register2.h
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-register2.h	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/gnc-plugin-register2.h	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,60 +0,0 @@
-/*
- * gnc-plugin-register2.h --
- *
- * Copyright (C) 2003 Jan Arne Petersen
- * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
- *
- * 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_REGISTER2_H
-#define __GNC_PLUGIN_REGISTER2_H
-
-#include "gnc-plugin.h"
-
-G_BEGIN_DECLS
-
-/* type macros */
-#define GNC_TYPE_PLUGIN_REGISTER2            (gnc_plugin_register2_get_type ())
-#define GNC_PLUGIN_REGISTER2(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_REGISTER2, GncPluginRegister2))
-#define GNC_PLUGIN_REGISTER2_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_REGISTER2, GncPluginRegister2Class))
-#define GNC_IS_PLUGIN_REGISTER2(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_REGISTER2))
-#define GNC_IS_PLUGIN_REGISTER2_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_REGISTER2))
-#define GNC_PLUGIN_REGISTER2_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_REGISTER2, GncPluginRegister2Class))
-
-#define GNC_PLUGIN_REGISTER2_NAME "gnc-plugin-register2"
-
-/* typedefs & structures */
-typedef struct
-{
-    GncPlugin gnc_plugin;
-} GncPluginRegister2;
-
-typedef struct
-{
-    GncPluginClass gnc_plugin;
-} GncPluginRegister2Class;
-
-/* function prototypes */
-GType      gnc_plugin_register2_get_type (void);
-
-GncPlugin *gnc_plugin_register2_new      (void);
-
-G_END_DECLS
-
-#endif /* __GNC_PLUGIN_REGISTER2_H */

Deleted: gnucash/trunk/src/gnome/gnc-split-reg2.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-split-reg2.c	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/gnc-split-reg2.c	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,1249 +0,0 @@
-/********************************************************************\
- * gnc-split-reg2.c -- A widget for the common register look-n-feel *
- * Copyright (C) 1997 Robin D. Clark                                *
- * Copyright (C) 1997-1998 Linas Vepstas <linas at linas.org>          *
- * Copyright (C) 1998 Rob Browning <rlb at cs.utexas.edu>              *
- * Copyright (C) 1999-2000 Dave Peticolas <dave at krondo.com>         *
- * Copyright (C) 2001 Gnumatic, Inc.                                *
- * Copyright (C) 2002,2006 Joshua Sled <jsled at asynchronous.org>     *
- * Copyright (C) 2012 Robert Fewell                                 *
- *                                                                  *
- * 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-split-reg2.h"
-#include "gnc-tree-view-split-reg.h"
-#include "gnc-tree-control-split-reg.h"
-#include "gnc-ledger-display2.h"
-
-#include "gnc-euro.h"
-#include "gnome-utils/gnc-warnings.h"
-#include "dialog-utils.h"
-
-#define STATE_SECTION_PREFIX "window/pages/register2/"
-
-static QofLogModule log_module = GNC_MOD_GUI;
-
-/***** PROTOTYPES ***************************************************/
-void gnc_split_reg2_raise (GNCSplitReg2 *gsr);
-
-static GtkWidget* add_summary_label (GtkWidget *summarybar,
-                                     const char *label_str);
-
-static void gnc_split_reg2_determine_read_only (GNCSplitReg2 *gsr);
-
-static void gnc_split_reg2_determine_account_pr (GNCSplitReg2 *gsr);
-
-static GNCPlaceholderType gnc_split_reg2_get_placeholder (GNCSplitReg2 *gsr);
-static GtkWidget *gnc_split_reg2_get_parent (GNCLedgerDisplay2 *ledger);
-
-static void gsr2_create_table (GNCSplitReg2 *gsr);
-static void gsr2_setup_table (GNCSplitReg2 *gsr);
-
-static void gsr2_setup_status_widgets (GNCSplitReg2 *gsr);
-
-static void gsr2_update_summary_label (GtkWidget *label,
-                                      xaccGetBalanceFn getter,
-                                      Account *leader,
-                                      GNCPrintAmountInfo print_info,
-                                      gnc_commodity *cmdty,
-                                      gboolean reverse,
-                                      gboolean euroFlag );
-
-static void gsr2_redraw_all_cb (GncTreeViewSplitReg *view, gpointer data);
-
-static void gnc_split_reg2_ld_destroy (GNCLedgerDisplay2 *ledger);
-
-static Transaction* gsr2_create_balancing_transaction (QofBook *book, Account *account,
-        time64 statement_date, gnc_numeric balancing_amount);
-
-static void gsr2_emit_simple_signal (GNCSplitReg2 *gsr, const char *sigName);
-static void gsr2_emit_help_changed (GncTreeViewSplitReg *view, gpointer user_data);
-static void gsr2_scroll_value_changed_cb (GtkAdjustment *adj, gpointer user_data);
-static gboolean gsr2_scroll_button_event_cb (GtkWidget *widget, GdkEventButton *event, gpointer user_data);
-static void gsr2_scroll_sync_cb (GncTreeModelSplitReg *model, gpointer user_data);
-
-void gnc_split_reg2_style_ledger_cb (GtkWidget *w, gpointer data);
-void gnc_split_reg2_style_auto_ledger_cb (GtkWidget *w, gpointer data);
-void gnc_split_reg2_style_journal_cb (GtkWidget *w, gpointer data);
-void gnc_split_reg2_double_line_cb (GtkWidget *w, gpointer data);
-
-void gnc_split_reg2_destroy_cb (GtkWidget *widget, gpointer data);
-
-static void gnc_split_reg2_class_init (GNCSplitReg2Class *klass);
-static void gnc_split_reg2_init (GNCSplitReg2 *gsr);
-static void gnc_split_reg2_init2 (GNCSplitReg2 *gsr);
-
-static void gnc_split_reg2_sort_changed_cb (GtkTreeSortable *sortable, gpointer user_data);
-
-
-GType
-gnc_split_reg2_get_type (void)
-{
-    static GType gnc_split_reg2_type = 0;
-
-    if (!gnc_split_reg2_type)
-    {
-        GTypeInfo type_info =
-        {
-            sizeof(GNCSplitReg2Class),          /* class_size */
-            NULL,   			        /* base_init */
-            NULL,				/* base_finalize */
-            (GClassInitFunc)gnc_split_reg2_class_init,
-            NULL,				/* class_finalize */
-            NULL,				/* class_data */
-            sizeof(GNCSplitReg2),		/* */
-            0,				        /* n_preallocs */
-            (GInstanceInitFunc)gnc_split_reg2_init,
-        };
-
-        gnc_split_reg2_type = g_type_register_static (GTK_TYPE_VBOX,
-                             "GNCSplitReg2",
-                             &type_info, 0 );
-    }
-
-    return gnc_split_reg2_type;
-}
-
-/* SIGNALS */
-enum
-{
-    HELP_CHANGED,
-    LAST_SIGNAL
-};
-
-static guint gnc_split_reg2_signals[LAST_SIGNAL] = { 0 };
-
-static void
-gnc_split_reg2_class_init (GNCSplitReg2Class *klass)
-{
-    GtkObjectClass *object_class;
-
-    object_class = (GtkObjectClass*) klass;
-
-    gnc_split_reg2_signals[HELP_CHANGED] =
-        g_signal_new("help-changed",
-                     G_TYPE_FROM_CLASS (object_class),
-                     G_SIGNAL_RUN_LAST,
-                     G_STRUCT_OFFSET (GNCSplitReg2Class, help_changed),
-                     NULL, NULL,
-                     g_cclosure_marshal_VOID__VOID,
-                     G_TYPE_NONE, 0);
-
-    /* Setup the default handlers. */
-    klass->help_changed = NULL;
-
-}
-
-GtkWidget*
-gnc_split_reg2_new (GNCLedgerDisplay2 *ld,
-                   GtkWindow *parent,
-                   gint numberOfLines,
-                   gboolean read_only )
-{
-    GNCSplitReg2 *gsrToRet;
-
-    ENTER("ld=%p, parent=%p, numberOfLines=%d, read_only=%s",
-          ld, parent, numberOfLines, read_only ? "TRUE" : "FALSE");
-
-    gsrToRet = g_object_new (gnc_split_reg2_get_type(), NULL);
-
-    gsrToRet->numRows = numberOfLines;
-    gsrToRet->read_only = read_only;
-
-    gsrToRet->ledger = ld;
-    gsrToRet->window = GTK_WIDGET (parent);
-
-    gnc_split_reg2_init2 (gsrToRet);
-
-    LEAVE("%p", gsrToRet);
-    return GTK_WIDGET (gsrToRet);
-}
-
-static void
-gnc_split_reg2_init (GNCSplitReg2 *gsr)
-{
-    gsr->numRows = 10;
-    gsr->read_only = FALSE;
-
-    g_signal_connect (gsr, "destroy",
-                      G_CALLBACK (gnc_split_reg2_destroy_cb), gsr );
-}
-
-static void
-gnc_split_reg2_init2 (GNCSplitReg2 *gsr)
-{
-    if (!gsr) return;
-
-    gnc_split_reg2_determine_read_only (gsr);
-
-    gnc_split_reg2_determine_account_pr (gsr);
-
-    gsr2_setup_status_widgets (gsr);
-    /* ordering is important here... setup_status before create_table */
-
-    gsr2_create_table (gsr);
-    gsr2_setup_table (gsr);
-
-}
-
-static
-void
-gsr2_setup_table (GNCSplitReg2 *gsr)
-{
-    GncTreeModelSplitReg *model;
-
-    ENTER("gsr=%p", gsr);
-
-    model = gnc_ledger_display2_get_split_model_register (gsr->ledger);
-
-    LEAVE(" ");
-}
-
-static
-void
-gsr2_create_table (GNCSplitReg2 *gsr)
-{
-    GtkWidget *register_widget;
-    GncTreeViewSplitReg *view;
-    GncTreeModelSplitReg *model;
-    GtkTreeModel *s_model;
-    GtkWidget *scrolled_window;
-    GtkTreeViewColumn *col;
-    GNCLedgerDisplay2Type ledger_type;
-    GtkWidget *hbox;
-    gdouble num_of_trans;
-
-    gchar *state_key;
-    const GncGUID * guid;
-    Account * account;
-    const gchar *sort_string;
-    
-    account = gnc_ledger_display2_leader (gsr->ledger);
-    guid = xaccAccountGetGUID (account);
-
-    ENTER("create table gsr=%p", gsr);
-
-    gnc_ledger_display2_set_user_data (gsr->ledger, (gpointer)gsr);
-    gnc_ledger_display2_set_handlers (gsr->ledger,
-                                     gnc_split_reg2_ld_destroy,
-                                     gnc_split_reg2_get_parent);
-
-    ledger_type = gnc_ledger_display2_type (gsr->ledger);
-    model = gnc_ledger_display2_get_split_model_register (gsr->ledger);
-
-    /* Used for saving different register column widths under separate keys */
-    // We need to give the General Ledger a Key other than all zeros which the search register gets.
-    if (ledger_type == LD2_GL && model->type == GENERAL_LEDGER2)
-        state_key = g_strconcat (STATE_SECTION_PREFIX, "00000000000000000000000000000001", NULL);
-    else if (ledger_type == LD2_SUBACCOUNT)
-        state_key = g_strconcat (STATE_SECTION_PREFIX, (gchar*)guid_to_string (guid), "_sub", NULL);
-    else
-        state_key = g_strconcat (STATE_SECTION_PREFIX, (gchar*)guid_to_string (guid), NULL);
-
-    gnc_tree_model_split_reg_set_display (model, ((ledger_type == LD2_SUBACCOUNT)?TRUE:FALSE), ((ledger_type == LD2_GL)?TRUE:FALSE));
-    view = gnc_tree_view_split_reg_new_with_model (model);
-    g_object_unref (G_OBJECT (model));
-
-    // Create a hbox for treeview and scrollbar.
-    hbox = gtk_hbox_new (FALSE, 0);
-    gtk_widget_show (hbox);
-
-    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_widget_show (scrolled_window);
-
-    gtk_box_pack_start (GTK_BOX (gsr), hbox, TRUE, TRUE, 0);
-
-    num_of_trans = model->number_of_trans_in_full_tlist - 1;
-
-    gsr->scroll_adj = GTK_ADJUSTMENT (gtk_adjustment_new (model->position_of_trans_in_full_tlist, 0.0, num_of_trans + 10, 1.0, 10.0, 10.0));
-
-    gsr->scroll_bar = gtk_vscrollbar_new (GTK_ADJUSTMENT (gsr->scroll_adj));
-    gtk_widget_show (gsr->scroll_bar);
-
-    gtk_box_pack_start (GTK_BOX (hbox), gsr->scroll_bar, FALSE, FALSE, 2);
-    gtk_box_pack_start (GTK_BOX (hbox), scrolled_window, TRUE, TRUE, 0);
-
-    gnc_ledger_display2_set_split_view_register (gsr->ledger, view);
-
-    /* Restore the sort depth from saved state */
-    /* Restore the sort order from saved state */
-    // FIXME currently not implemented
-
-    sort_string = NULL;
-    if (g_strcmp0 ("descending", sort_string) == 0)
-        view->sort_direction = -1;
-    else
-        view->sort_direction = 1;
-
-    /* Restore the sort column from saved state */
-    view->sort_col = model->sort_col;
-
-    g_object_set (G_OBJECT (view), "state-section", state_key,
-                 "show-column-menu", FALSE, NULL);
-
-    gnc_tree_view_configure_columns (GNC_TREE_VIEW (view));
-
-    if (ledger_type == LD2_GL && model->type == GENERAL_LEDGER2)
-        gnc_tree_view_set_show_column_menu (GNC_TREE_VIEW (view), TRUE);
-    else
-        gnc_tree_view_set_show_column_menu (GNC_TREE_VIEW (view), FALSE);
-
-    /* This column gets all the free space */
-    gnc_tree_view_expand_columns (GNC_TREE_VIEW (view), "descnotes", NULL);
-
-    /* This sets the status color column, 4 is the minimum */
-    col = gnc_tree_view_find_column_by_name (GNC_TREE_VIEW (view), "status");
-    if (col != NULL)
-        g_object_set (G_OBJECT(col),
-                     "resizable", FALSE,
-                     "sizing", GTK_TREE_VIEW_COLUMN_FIXED,
-                     "fixed-width", 4,
-                      NULL);
-
-    gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (view), TRUE);
-    gtk_widget_show (GTK_WIDGET (view));
-
-    gtk_container_add (GTK_CONTAINER (scrolled_window), GTK_WIDGET (view));
-    gtk_widget_show (GTK_WIDGET (gsr));
-
-    /* Should this be read only */
-    gnc_tree_view_split_reg_set_read_only (view, gsr->read_only);
-
-    /* This tells the ledger that we have a valid tree view */
-    gnc_ledger_display2_set_split_view_refresh (gsr->ledger, TRUE);
-
-    /* This triggers the update of the summary bar */
-    g_signal_connect_after (model, "refresh_status_bar",
-                      G_CALLBACK (gsr2_redraw_all_cb), gsr); //this works
-
-    // This will keep scrollbar in sync.
-    g_signal_connect (model, "scroll_sync",
-                      G_CALLBACK (gsr2_scroll_sync_cb), gsr);
-
-    /* This triggers the update of the help text */
-    g_signal_connect (view, "help_signal",
-                      G_CALLBACK (gsr2_emit_help_changed), gsr); // this works
-
-    gsr2_scroll_value_changed_cb (GTK_ADJUSTMENT (gsr->scroll_adj), gsr);
-
-    /* This triggers the tooltip to change when scrolling */
-    g_signal_connect (gsr->scroll_adj, "value-changed",
-                      G_CALLBACK (gsr2_scroll_value_changed_cb), gsr); // this works
-
-    /* This triggers the model update when mouse button released */
-    g_signal_connect (gsr->scroll_bar, "button-release-event",
-                      G_CALLBACK (gsr2_scroll_button_event_cb), gsr);
-
-    s_model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
-
-    // Connect a call back to update the sort settings.
-    g_signal_connect (GTK_TREE_SORTABLE (s_model), "sort-column-changed",
-          G_CALLBACK (gnc_split_reg2_sort_changed_cb), gsr);
-
-    LEAVE(" ");
-}
-
-static
-void
-gsr2_setup_status_widgets (GNCSplitReg2 *gsr)
-{
-    GncTreeModelSplitReg *model;
-    gboolean use_double_line;
-
-    model = gnc_ledger_display2_get_split_model_register (gsr->ledger);
-    use_double_line = gnc_ledger_display2_default_double_line (gsr->ledger);
-
-    /* be sure to initialize the gui elements */
-    gnc_tree_model_split_reg_config (model, model->type, model->style, use_double_line);
-}
-
-void
-gnc_split_reg2_destroy_cb (GtkWidget *widget, gpointer data)
-{
-}
-
-/**
- * Jump to split.
- **/
-void
-gnc_split_reg2_jump_to_split (GNCSplitReg2 *gsr, Split *split)
-{
-    GncTreeViewSplitReg *view;
-
-    if (gsr == NULL)
-        return;
-
-    if (split == NULL)
-        return;
-
-    view = gnc_ledger_display2_get_split_view_register (gsr->ledger);
-
-    gnc_tree_control_split_reg_jump_to (view, NULL, split, FALSE);
-}
-
-
-/**
- * Move the cursor to the split in the non-blank amount column.
- **/
-void
-gnc_split_reg2_jump_to_split_amount (GNCSplitReg2 *gsr, Split *split)
-{
-    GncTreeViewSplitReg *view;
-
-    if (gsr == NULL)
-        return;
-
-    if (split == NULL)
-        return;
-
-    view = gnc_ledger_display2_get_split_view_register (gsr->ledger);
-
-    gnc_tree_control_split_reg_jump_to (view, NULL, split, TRUE);
-}
-
-/**
- * Raise an existing register window to the front.
- **/
-void
-gnc_split_reg2_raise (GNCSplitReg2 *gsr)
-{
-    if (gsr == NULL)
-        return;
-
-    if (gsr->window == NULL)
-        return;
-
-    gtk_window_present (GTK_WINDOW (gsr->window));
-}
-
-
-/**
- * Duplicate-code reduction function; retreives, formats and updates the
- * GtkLabel with the given amount.
- **/
-static
-void
-gsr2_update_summary_label (GtkWidget *label,
-                          xaccGetBalanceFn getter,
-                          Account *leader,
-                          GNCPrintAmountInfo print_info,
-                          gnc_commodity *cmdty,
-                          gboolean reverse,
-                          gboolean euroFlag)
-{
-    gnc_numeric amount;
-    char string[256];
-
-    if ( label == NULL )
-        return;
-
-    amount = (*getter)( leader );
-
-    if ( reverse )
-    {
-        amount = gnc_numeric_neg( amount );
-    }
-
-    xaccSPrintAmount( string, amount, print_info );
-
-    if ( euroFlag )
-    {
-        strcat( string, " / " );
-        xaccSPrintAmount( string + strlen( string ),
-                          gnc_convert_to_euro( cmdty, amount ),
-                          gnc_commodity_print_info( gnc_get_euro(), TRUE ) );
-    }
-
-    gnc_set_label_color( label, amount );
-    gtk_label_set_text( GTK_LABEL(label), string );
-}
-
-static GNCPrice *
-account_latest_price (Account *account)
-{
-    QofBook *book;
-    GNCPriceDB *pdb;
-    gnc_commodity *commodity;
-    gnc_commodity *currency;
-
-    if (!account) return NULL;
-    commodity = xaccAccountGetCommodity (account);
-    currency = gnc_default_currency ();
-
-    book = gnc_account_get_book (account);
-    pdb = gnc_pricedb_get_db (book);
-
-    return gnc_pricedb_lookup_latest (pdb, commodity, currency);
-}
-
-static GNCPrice *
-account_latest_price_any_currency (Account *account)
-{
-    QofBook *book;
-    GNCPriceDB *pdb;
-    gnc_commodity *commodity;
-    GList *price_list;
-    GNCPrice *result;
-
-    if (!account) return NULL;
-    commodity = xaccAccountGetCommodity (account);
-
-    book = gnc_account_get_book (account);
-    pdb = gnc_pricedb_get_db (book);
-
-    price_list = gnc_pricedb_lookup_latest_any_currency (pdb, commodity);
-    if (!price_list) return NULL;
-
-    result = gnc_price_clone ((GNCPrice *)(price_list->data), book);
-
-    gnc_price_list_destroy (price_list);
-
-    return result;
-}
-
-static
-void
-gsr2_redraw_all_cb (GncTreeViewSplitReg *view, gpointer user_data)
-{
-    GNCSplitReg2 *gsr = user_data;
-    gnc_commodity * commodity;
-    GNCPrintAmountInfo print_info;
-    gnc_numeric amount;
-    char string[256];
-    Account *leader;
-    gboolean reverse;
-    gboolean euro;
-
-    if ( gsr->summarybar == NULL )
-        return;
-
-    leader = gnc_ledger_display2_leader( gsr->ledger );
-
-    commodity = xaccAccountGetCommodity( leader );
-
-    /* no EURO converson, if account is already EURO or no EURO currency */
-    if (commodity != NULL)
-        euro = (gnc_is_euro_currency( commodity ) &&
-                (strncasecmp(gnc_commodity_get_mnemonic(commodity), "EUR", 3)));
-    else
-        euro = FALSE;
-
-    print_info = gnc_account_print_info( leader, TRUE );
-    reverse = gnc_reverse_balance( leader );
-
-    gsr2_update_summary_label( gsr->balance_label,
-                              xaccAccountGetPresentBalance,
-                              leader, print_info, commodity, reverse, euro );
-    gsr2_update_summary_label( gsr->cleared_label,
-                              xaccAccountGetClearedBalance,
-                              leader, print_info, commodity, reverse, euro );
-    gsr2_update_summary_label( gsr->reconciled_label,
-                              xaccAccountGetReconciledBalance,
-                              leader, print_info, commodity, reverse, euro );
-    gsr2_update_summary_label( gsr->future_label,
-                              xaccAccountGetBalance,
-                              leader, print_info, commodity, reverse, euro );
-    gsr2_update_summary_label( gsr->projectedminimum_label,
-                              xaccAccountGetProjectedMinimumBalance,
-                              leader, print_info, commodity, reverse, euro );
-
-    /* Print the summary share amount */
-    if (gsr->shares_label != NULL)
-    {
-        print_info = gnc_account_print_info( leader, TRUE );
-
-        amount = xaccAccountGetBalance( leader );
-        if (reverse)
-            amount = gnc_numeric_neg( amount );
-
-        xaccSPrintAmount( string, amount, print_info );
-
-        gnc_set_label_color( gsr->shares_label, amount );
-        gtk_label_set_text( GTK_LABEL(gsr->shares_label), string );
-    }
-
-    /* Print the summary share value */
-    if (gsr->value_label != NULL)
-    {
-        GNCPrice *price;
-
-        amount = xaccAccountGetBalance (leader);
-        if (reverse) amount = gnc_numeric_neg (amount);
-
-        price = account_latest_price (leader);
-        if (!price)
-        {
-            /* If the balance is zero, then print zero. */
-            if (gnc_numeric_equal(amount, gnc_numeric_zero()))
-            {
-                gnc_commodity *currency = gnc_default_currency ();
-                print_info = gnc_commodity_print_info (currency, TRUE);
-                amount = gnc_numeric_zero ();
-
-                xaccSPrintAmount (string, amount, print_info);
-
-                gnc_set_label_color (gsr->value_label, amount);
-                gtk_label_set_text (GTK_LABEL (gsr->value_label), string);
-            }
-            else
-            {
-                /* else try to do a double-price-conversion :-( */
-                price = account_latest_price_any_currency (leader);
-                if (!price)
-                {
-                    gnc_set_label_color (gsr->value_label, gnc_numeric_zero ());
-                    gtk_label_set_text (GTK_LABEL (gsr->value_label),
-                                        _("<No information>"));
-                }
-                else
-                {
-                    gnc_commodity *currency = gnc_price_get_currency (price);
-                    gnc_commodity *default_currency = gnc_default_currency ();
-                    gnc_numeric currency_amount;
-                    gnc_numeric default_currency_amount;
-
-                    print_info = gnc_commodity_print_info (currency, TRUE);
-
-                    currency_amount =
-                        xaccAccountConvertBalanceToCurrency(leader, amount,
-                                                            commodity, currency);
-                    xaccSPrintAmount (string, currency_amount, print_info);
-
-                    default_currency_amount =
-                        xaccAccountConvertBalanceToCurrency(leader, amount,
-                                                            commodity,
-                                                            default_currency);
-                    if (!gnc_numeric_zero_p(default_currency_amount))
-                    {
-                        strcat( string, " / " );
-                        print_info = gnc_commodity_print_info (default_currency, TRUE);
-                        xaccSPrintAmount( string + strlen( string ), default_currency_amount,
-                                          print_info);
-                    }
-
-                    gnc_set_label_color (gsr->value_label, amount);
-                    gtk_label_set_text (GTK_LABEL (gsr->value_label), string);
-
-                    gnc_price_unref (price);
-                }
-            }
-        }
-        else
-        {
-            gnc_commodity *currency = gnc_price_get_currency (price);
-
-            print_info = gnc_commodity_print_info (currency, TRUE);
-
-            amount = gnc_numeric_mul (amount, gnc_price_get_value (price),
-                                      gnc_commodity_get_fraction (currency),
-                                      GNC_HOW_RND_ROUND_HALF_UP);
-
-            xaccSPrintAmount (string, amount, print_info);
-
-            gnc_set_label_color (gsr->value_label, amount);
-            gtk_label_set_text (GTK_LABEL (gsr->value_label), string);
-
-            gnc_price_unref (price);
-        }
-    }
-}
-
-static void
-gnc_split_reg2_ld_destroy (GNCLedgerDisplay2 *ledger)
-{
-    GNCSplitReg2 *gsr = gnc_ledger_display2_get_user_data (ledger);
-    
-    gchar *state_key;
-    const GncGUID * guid;
-    Account * account;
-    
-    account = gnc_ledger_display2_leader (ledger);
-    guid = xaccAccountGetGUID (account);
-    state_key = (gchar*)guid_to_string (guid);
-    
-    if (gsr)
-    {
-        GncTreeModelSplitReg *model;
-
-        model = gnc_ledger_display2_get_split_model_register (ledger);
-
-/*FIXME This may not be required
-        if (model && model->table)
-            gnc_table_save_state (model->table, state_key);
-*/
-        /*
-         * Don't destroy the window here any more.  The register no longer
-         * owns it.
-         */
-    }
-    gnc_ledger_display2_set_user_data (ledger, NULL);
-}
-
-
-/* ########################### Handlers ############################### */
-
-void
-gnc_split_reg2_balancing_entry (GNCSplitReg2 *gsr, Account *account,
-                              time64 statement_date, gnc_numeric balancing_amount) // this works
-{
-    GncTreeViewSplitReg *view;
-    Transaction *transaction;
-    Split *split;
-
-    view = gnc_ledger_display2_get_split_view_register (gsr->ledger);
-
-    // create transaction
-    transaction = gsr2_create_balancing_transaction (gnc_get_current_book(),
-                  account, statement_date, balancing_amount);
-
-    // jump to transaction
-    split = xaccTransFindSplitByAccount (transaction, account);
-    if (split == NULL)
-    {
-        // default behaviour: jump to blank split
-        g_warning("gsr2_create_balancing_transaction failed");
-        gnc_tree_control_split_reg_jump_to_blank (view);
-    }
-    else
-    {
-        // goto balancing transaction
-        gnc_tree_control_split_reg_jump_to (view, NULL, split, FALSE);
-    }
-}
-
-static Transaction*
-gsr2_create_balancing_transaction (QofBook *book, Account *account,
-                             time64 statement_date, gnc_numeric balancing_amount)
-{
-    Transaction *trans;
-    Split *split;
-
-    if (!account)
-        return NULL;
-    if (gnc_numeric_zero_p (balancing_amount))
-        return NULL;
-
-    xaccAccountBeginEdit (account);
-
-    trans = xaccMallocTransaction (book);
-
-    xaccTransBeginEdit (trans);
-
-    // fill Transaction
-    xaccTransSetCurrency (trans, gnc_account_or_default_currency (account, NULL));
-    xaccTransSetDatePostedSecsNormalized (trans, statement_date);
-    xaccTransSetDescription (trans, _("Balancing entry from reconcilation"));
-
-    // 1. Split
-    split = xaccMallocSplit (book);
-    xaccTransAppendSplit (trans, split);
-    xaccAccountInsertSplit  (account, split);
-    xaccSplitSetAmount (split, balancing_amount);
-    xaccSplitSetValue (split, balancing_amount);
-
-    // 2. Split (no account is defined: split goes to orphan account)
-    split = xaccMallocSplit (book);
-    xaccTransAppendSplit (trans, split);
-
-    balancing_amount = gnc_numeric_neg (balancing_amount);
-    xaccSplitSetAmount (split, balancing_amount);
-    xaccSplitSetValue (split, balancing_amount);
-
-    xaccTransCommitEdit (trans);
-    xaccAccountCommitEdit (account);
-    return trans;
-}
-
-
-/* Sort changed callback */
-static void
-gnc_split_reg2_sort_changed_cb (GtkTreeSortable *sortable, gpointer user_data)
-{
-    Query *query;
-    GNCSplitReg2 *gsr = user_data;
-    GncTreeViewSplitReg *view;
-    GncTreeModelSplitReg *model; 
-    GtkSortType   type;
-    gint          sortcol;
-    gint          sort_depth;
-    const gchar  *state_section;
-
-    gtk_tree_sortable_get_sort_column_id (sortable, &sortcol, &type);
-    ENTER("sortcol is %d", sortcol);
-
-    view = gnc_ledger_display2_get_split_view_register (gsr->ledger);
-    model = gnc_ledger_display2_get_split_model_register (gsr->ledger);
-
-    query = gnc_ledger_display2_get_query (gsr->ledger);
-
-    sort_depth = gnc_tree_view_reg_get_selected_row_depth (view);
-    if (sort_depth != 0)
-        view->sort_depth = sort_depth;
-
-    view->sort_col = sortcol;
-    model->sort_col = sortcol;
-
-    if (type == GTK_SORT_DESCENDING)
-    {
-        view->sort_direction = -1;
-        model->sort_direction = -1;
-    }
-    else
-    {
-        view->sort_direction = 1;
-        model->sort_direction = 1;
-    }
-
-    /* Save the sort depth state */
-    state_section = gnc_tree_view_get_state_section (GNC_TREE_VIEW (view));
-    // FIXME currently not implemented
-
-    LEAVE("v_sort_col %d, v_sort_direction is %d  v_sort_depth is %d", view->sort_col, view->sort_direction, view->sort_depth);
-
-    if (sortcol != -1)
-        gnc_ledger_display2_refresh (gsr->ledger);
-}
-/* ############################## End Handlers ############################ */
-
-void
-gnc_split_reg2_change_style (GNCSplitReg2 *gsr, SplitRegisterStyle2 style)
-{
-    GncTreeModelSplitReg *model = gnc_ledger_display2_get_split_model_register (gsr->ledger);
-
-    if (style == model->style)
-        return;
-
-    gnc_tree_model_split_reg_config (model, model->type, style, model->use_double_line);
-
-    // This will re-display the view.
-    gnc_tree_view_split_reg_set_format (gnc_ledger_display2_get_split_view_register (gsr->ledger));
-}
-
-void
-gnc_split_reg2_style_ledger_cb (GtkWidget *w, gpointer data)
-{
-    GNCSplitReg2 *gsr = data;
-
-    if (!GTK_CHECK_MENU_ITEM (w)->active)
-        return;
-
-    gnc_split_reg2_change_style (gsr, REG2_STYLE_LEDGER);
-}
-
-void
-gnc_split_reg2_style_auto_ledger_cb (GtkWidget *w, gpointer data)
-{
-    GNCSplitReg2 *gsr = data;
-
-    if (!GTK_CHECK_MENU_ITEM (w)->active)
-        return;
-
-    gnc_split_reg2_change_style (gsr, REG2_STYLE_AUTO_LEDGER);
-}
-
-void
-gnc_split_reg2_style_journal_cb (GtkWidget *w, gpointer data)
-{
-    GNCSplitReg2 *gsr = data;
-
-    if (!GTK_CHECK_MENU_ITEM (w)->active)
-        return;
-
-    gnc_split_reg2_change_style (gsr, REG2_STYLE_JOURNAL);
-}
-
-void
-gnc_split_reg2_double_line_cb (GtkWidget *w, gpointer data)
-{
-    GNCSplitReg2 *gsr = data;
-    GncTreeModelSplitReg *model = gnc_ledger_display2_get_split_model_register (gsr->ledger);
-    gboolean use_double_line;
-
-    use_double_line = GTK_CHECK_MENU_ITEM (w)->active;
-    if (use_double_line == model->use_double_line)
-        return;
-
-    gnc_tree_model_split_reg_config (model, model->type, model->style, use_double_line);
-
-    // This will re-display the view.
-    gnc_tree_view_split_reg_set_format (gnc_ledger_display2_get_split_view_register (gsr->ledger));
-}
-
-static
-GtkWidget*
-add_summary_label (GtkWidget *summarybar, const char *label_str)
-{
-    GtkWidget *hbox;
-    GtkWidget *label;
-
-    hbox = gtk_hbox_new (FALSE, 2);
-    gtk_box_pack_start (GTK_BOX (summarybar), hbox, FALSE, FALSE, 5);
-
-    label = gtk_label_new (label_str);
-    gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
-    gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
-
-    label = gtk_label_new ("");
-    gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
-    gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
-
-    return label;
-}
-
-GtkWidget *
-gnc_split_reg2_create_summary_bar (GNCSplitReg2 *gsr)
-{
-    GtkWidget *summarybar;
-
-    gsr->cleared_label    = NULL;
-    gsr->balance_label    = NULL;
-    gsr->reconciled_label = NULL;
-    gsr->future_label     = NULL;
-    gsr->projectedminimum_label = NULL;
-    gsr->shares_label     = NULL;
-    gsr->value_label      = NULL;
-
-    if (gnc_ledger_display2_type (gsr->ledger) >= LD2_SUBACCOUNT)
-    {
-        gsr->summarybar = NULL;
-        return NULL;
-    }
-
-    summarybar = gtk_hbox_new (FALSE, 4);
-
-    if (!xaccAccountIsPriced(gnc_ledger_display2_leader(gsr->ledger)))
-    {
-        gsr->balance_label    = add_summary_label (summarybar, _("Present:"));
-        gsr->future_label     = add_summary_label (summarybar, _("Future:"));
-        gsr->cleared_label    = add_summary_label (summarybar, _("Cleared:"));
-        gsr->reconciled_label = add_summary_label (summarybar, _("Reconciled:"));
-        gsr->projectedminimum_label  = add_summary_label (summarybar, _("Projected Minimum:"));
-    }
-    else
-    {
-        gsr->shares_label     = add_summary_label (summarybar, _("Shares:"));
-        gsr->value_label      = add_summary_label (summarybar, _("Current Value:"));
-    }
-
-    gsr->summarybar = summarybar;
-
-    /* Force the first update */
-    gsr2_redraw_all_cb (NULL, gsr);
-    return gsr->summarybar;
-}
-
-/**
- * Opens up a register window for a group of Accounts.
- * @param gsr the register window instance
- * @return A GNCPlaceholderType indicating presence and type of placeholder
- * accounts
- **/
-static
-GNCPlaceholderType
-gnc_split_reg2_get_placeholder (GNCSplitReg2 *gsr)
-{
-    Account *leader;
-    GncTreeModelSplitReg *model;
-    gboolean single_account;
-
-    if (gsr == NULL)
-        return PLACEHOLDER_NONE;
-
-    model = gnc_ledger_display2_get_split_model_register (gsr->ledger);
-
-    switch (model->type)
-    {
-    case GENERAL_LEDGER2:
-    case INCOME_LEDGER2:
-    case PORTFOLIO_LEDGER2:
-    case SEARCH_LEDGER2:
-        single_account = FALSE;
-        break;
-    default:
-        single_account = TRUE;
-        break;
-    }
-
-    leader = gnc_ledger_display2_leader (gsr->ledger);
-
-    if (leader == NULL)
-        return PLACEHOLDER_NONE;
-    if (single_account)
-    {
-        if (xaccAccountGetPlaceholder (leader))
-            return PLACEHOLDER_THIS;
-        return PLACEHOLDER_NONE;
-    }
-    return xaccAccountGetDescendantPlaceholder (leader);
-}
-
-
-
-/**
- * @see gtk_callback_bug_workaround
- **/
-typedef struct dialog_args
-{
-    GNCSplitReg2 *gsr;
-    gchar *string;
-} dialog_args;
-
-
-/* This Register is an Account Payable / Receivable one */
-static
-gboolean
-gsr2_determine_account_pr_dialog (gpointer argp)
-{
-    dialog_args *args = argp;
-    GtkWidget *dialog;
-
-    const char *title = _("Account Payable / Receivable Register");
-    const char *message =
-            _("The register displayed is for Account Payable or Account Receivable. "
-              "Changing the entries may cause harm, please use the business "
-              "options to change the entries.");
-
-    dialog = gtk_message_dialog_new (GTK_WINDOW (args->gsr->window),
-                                     GTK_DIALOG_DESTROY_WITH_PARENT,
-                                     GTK_MESSAGE_WARNING,
-                                     GTK_BUTTONS_CLOSE,
-                                     "%s", title);
-    gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-                                              "%s", message);
-
-    gnc_dialog_run (GTK_DIALOG (dialog), GNC_PREF_WARN_REG_IS_ACCT_PAY_REC);
-    gtk_widget_destroy (dialog);
-    g_free (args);
-    return FALSE;
-}
-
-
-/* This Register is an Account Payable / Receivable one */
-static void
-gnc_split_reg2_determine_account_pr (GNCSplitReg2 *gsr)
-{
-    dialog_args *args = g_malloc (sizeof (dialog_args));
-    GncTreeModelSplitReg *model;
-
-    model = gnc_ledger_display2_get_split_model_register (gsr->ledger);
-
-    if (model->type != PAYABLE_REGISTER2 && model->type != RECEIVABLE_REGISTER2)
-        return;
-
-    /* Put up a warning dialog */
-    args->gsr = gsr;
-    g_timeout_add (250, gsr2_determine_account_pr_dialog, args); /* 0.25 seconds */
-}
-
-
-/**
- * Gtk has occasional problems with performing function as part of a
- * callback.  This routine gets called via a timer callback to get it out of
- * the data path with the problem.
- **/
-static
-gboolean
-gtk_callback_bug_workaround (gpointer argp)
-{
-    dialog_args *args = argp;
-    const gchar *read_only = _("This account register is read-only.");
-    GtkWidget *dialog;
-
-    dialog = gtk_message_dialog_new (GTK_WINDOW(args->gsr->window),
-                                    GTK_DIALOG_DESTROY_WITH_PARENT,
-                                    GTK_MESSAGE_WARNING,
-                                    GTK_BUTTONS_CLOSE,
-                                    "%s", read_only);
-    gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-            "%s", args->string);
-    gnc_dialog_run (GTK_DIALOG (dialog), GNC_PREF_WARN_REG_IS_READ_ONLY);
-    gtk_widget_destroy (dialog);
-    g_free (args);
-    return FALSE;
-}
-
-/**
- * Determines whether this register window should be read-only.
- **/
-static
-void
-gnc_split_reg2_determine_read_only (GNCSplitReg2 *gsr) //this works
-{
-    dialog_args *args = g_malloc (sizeof (dialog_args));
-    GncTreeViewSplitReg *view;
-
-    if (qof_book_is_readonly (gnc_get_current_book()))
-    {
-        /* Is the book read-only? Then for sure also make this register
-        read-only. */
-        gsr->read_only = TRUE;
-    }
-
-    if (!gsr->read_only)
-    {
-
-        switch (gnc_split_reg2_get_placeholder (gsr))
-        {
-        case PLACEHOLDER_NONE:
-            /* stay as false. */
-            return;
-
-        case PLACEHOLDER_THIS:
-            args->string = _("This account may not be edited. If you want "
-                             "to edit transactions in this register, please "
-                             "open the account options and turn off the "
-                             "placeholder checkbox.");
-            break;
-
-        default:
-            args->string = _("One of the sub-accounts selected may not be "
-                             "edited. If you want to edit transactions in "
-                             "this register, please open the sub-account "
-                             "options and turn off the placeholder checkbox. "
-                             "You may also open an individual account instead "
-                             "of a set of accounts.");
-            break;
-        }
-        gsr->read_only = TRUE;
-        /* Put up a warning dialog */
-        args->gsr = gsr;
-        g_timeout_add (250, gtk_callback_bug_workaround, args); /* 0.25 seconds */
-    }
-}
-
-static
-GtkWidget *
-gnc_split_reg2_get_parent (GNCLedgerDisplay2 *ledger)
-{
-    GNCSplitReg2 *gsr =
-        GNC_SPLIT_REG2 (gnc_ledger_display2_get_user_data (ledger));
-
-    if (gsr == NULL)
-        return NULL;
-
-    return gsr->window;
-}
-
-static void
-gsr2_emit_help_changed (GncTreeViewSplitReg *view, gpointer user_data)
-{
-    gsr2_emit_simple_signal ((GNCSplitReg2*)user_data, "help-changed" );
-}
-
-/* Callback to keep vertical scroll bar in sync */
-static void
-gsr2_scroll_sync_cb (GncTreeModelSplitReg *model, gpointer user_data)
-{
-    GNCSplitReg2 *gsr = user_data;
-    gint trans_position;
-
-    trans_position = model->position_of_trans_in_full_tlist;
-
-    gtk_adjustment_set_value (gsr->scroll_adj, trans_position);
-
-    gtk_adjustment_set_upper (gsr->scroll_adj, model->number_of_trans_in_full_tlist + 9);
-}
-
-static void
-gsr2_scroll_value_changed_cb (GtkAdjustment *adj, gpointer user_data)
-{
-    GNCSplitReg2 *gsr = user_data;
-    GncTreeModelSplitReg *model;
-    gchar *text;
-    gint  trans_position;
-
-    model = gnc_ledger_display2_get_split_model_register (gsr->ledger);
-
-    trans_position = gtk_adjustment_get_value (adj);
-
-    text = gnc_tree_model_split_reg_get_tooltip (model, trans_position);
-
-    g_object_set (gtk_widget_get_settings (gsr->scroll_bar), "gtk-tooltip-timeout", 2, NULL);
-
-    gtk_widget_set_tooltip_text (gsr->scroll_bar, text);
-
-    g_free (text);
-}
-
-static
-gboolean
-gsr2_scroll_button_event_cb (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
-{
-    GNCSplitReg2 *gsr = user_data;
-    GncTreeModelSplitReg *model;
-    gint trans_position;
-
-    model = gnc_ledger_display2_get_split_model_register (gsr->ledger);
-
-    trans_position = gtk_adjustment_get_value (gsr->scroll_adj);
-
-    gnc_tree_model_split_reg_set_current_trans_by_position (model, trans_position);
-
-//FIXME should we store what it was...
-    g_object_set (gtk_widget_get_settings (gsr->scroll_bar), "gtk-tooltip-timeout", 500, NULL);
-
-    g_signal_emit_by_name (model, "refresh_trans");
-
-    return FALSE;
-}
-
-static
-void
-gsr2_emit_simple_signal (GNCSplitReg2 *gsr, const char *sigName)
-{
-    g_signal_emit_by_name( gsr, sigName, NULL );
-}
-
-GncTreeViewSplitReg *
-gnc_split_reg2_get_register (GNCSplitReg2 *gsr )
-{
-    if ( !gsr )
-        return NULL;
-
-    return gnc_ledger_display2_get_split_view_register (gsr->ledger);
-}
-
-GtkWidget*
-gnc_split_reg2_get_summarybar (GNCSplitReg2 *gsr)
-{
-    if (!gsr) return NULL;
-    return gsr->summarybar;
-}
-
-gboolean
-gnc_split_reg2_get_read_only (GNCSplitReg2 *gsr)
-{
-    g_assert (gsr);
-    return gsr->read_only;
-}
-
-void
-gnc_split_reg2_set_moved_cb (GNCSplitReg2 *gsr, GFunc cb, gpointer cb_data ) //this works
-{
-    gnc_tree_view_split_reg_set_uiupdate_cb (gnc_ledger_display2_get_split_view_register (gsr->ledger), cb, cb_data);
-}

Deleted: gnucash/trunk/src/gnome/gnc-split-reg2.h
===================================================================
--- gnucash/trunk/src/gnome/gnc-split-reg2.h	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/gnc-split-reg2.h	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,158 +0,0 @@
-/********************************************************************\
- * gnc-split-reg2.h -- A widget for the common register look-n-feel.*
- * Copyright (C) 1997 Robin D. Clark                                *
- * Copyright (C) 1997-1998 Linas Vepstas <linas at linas.org>          *
- * Copyright (C) 1998 Rob Browning <rlb at cs.utexas.edu>              *
- * Copyright (C) 1999-2000 Dave Peticolas <dave at krondo.com>         *
- * Copyright (C) 2001 Gnumatic, Inc.                                *
- * Copyright (C) 2002,2006 Joshua Sled <jsled at asynchronous.org>     *
- * Copyright (C) 2012 Robert Fewell                                 *
- *                                                                  *
- * 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_SPLIT_REG2_H
-#define GNC_SPLIT_REG2_H
-
-#include "gnc-ledger-display2.h"
-#include "gnc-split-reg.h"
-#include "gnc-tree-view-split-reg.h"
-
-#define GNC_SPLIT_REG2(obj)         G_TYPE_CHECK_INSTANCE_CAST( obj, gnc_split_reg2_get_type(), GNCSplitReg2 )
-#define GNC_SPLIT_REG2_CLASS(klass) G_TYPE_CHECK_CLASS_CAST( klass, gnc_split_reg2_get_type(), GNCSplitReg2Class )
-#define IS_GNC_SPLIT_REG2(obj)      G_TYPE_CHECK_INSTANCE_TYPE( obj, gnc_split_reg2_get_type() )
-
-typedef struct _GNCSplitReg2 GNCSplitReg2;
-typedef struct _GNCSplitReg2Class GNCSplitReg2Class;
-
-struct _GNCSplitReg2
-{
-    /* The "parent" widget. */
-    GtkVBox vbox;
-
-    /* The containing window. */
-    GtkWidget *window;
-    GtkWidget *scroll_bar;
-    GtkAdjustment *scroll_adj;
-
-    GtkWidget *toolbar;
-    GtkWidget *summarybar;
-
-    /* Summary Bar Labels */
-    GtkWidget *balance_label;
-    GtkWidget *cleared_label;
-    GtkWidget *reconciled_label;
-    GtkWidget *future_label;
-    GtkWidget *projectedminimum_label;
-    GtkWidget *shares_label;
-    GtkWidget *value_label;
-
-    /** The current ledger display. **/
-    GNCLedgerDisplay2 *ledger;
-
-    gint numRows;
-
-    gboolean read_only;
-};
-
-struct _GNCSplitReg2Class
-{
-    GtkVBoxClass parent_class;
-
-    /* Signal defaults */
-    void (*help_changed) (GNCSplitReg2 *w, gpointer user_data);
-};
-
-/*FIXME Note sure about this == Coming from original gnc-split-reg.h */
-typedef GNC_SPLIT_REG_ITEM GNC_SPLIT_REG2_ITEM;
-
-/**
- * GTK-related; gets an identifier for the class of GNCSplitRegs.
- **/
-GType gnc_split_reg2_get_type (void);
-
-/**
- * Creates and returns a GNCSplitReg.
- * @param ld            The GNCLedgerDisplay to use for display.
- * @param parent        The containing window.
- * @param numberOfLines The initial number of lines for the register.
- * @param read_only      If the contained register should be setup read-only.
- **/
-GtkWidget* gnc_split_reg2_new (GNCLedgerDisplay2 *ld,
-                              GtkWindow *parent,
-                              gint numberOfLines,
-                              gboolean read_only);
-
-/**
- * Returns the GncTreeView Split Register in effect for this GNCSplitReg.
- **/
-GncTreeViewSplitReg *gnc_split_reg2_get_register (GNCSplitReg2 *gsr);
-
-/**
- * Create and returns a summarybar for this GNCSplitReg.
- **/
-GtkWidget *gnc_split_reg2_create_summary_bar (GNCSplitReg2 *gsr);
-
-/**
- * Gets/sets the style of the GNCSplitReg.
- **/
-void gnc_split_reg2_change_style (GNCSplitReg2 *gsr, SplitRegisterStyle2 style);
-
-/**
- * Can return NULL if the indicated subwidget was not created.
- **/
-GtkWidget *gnc_split_reg2_get_summarybar (GNCSplitReg2 *gsr);
-
-/**
- * Jump to split.
- **/
-void gnc_split_reg2_jump_to_split (GNCSplitReg2 *gsr, Split *split);
-
-/**
- * Move the cursor to the split in the non-blank amount column.
- **/
-void gnc_split_reg2_jump_to_split_amount (GNCSplitReg2 *gsr, Split *split);
-
-
-/**
- * Raise an existing register window to the front.
- **/
-void gnc_split_reg2_raise (GNCSplitReg2 *gsr);
-
-/**
- * Callers can use this to determine if they need to reflect some "read-only"
- * status in the window which contains the GNCSplitReg.
- * @return TRUE if the register is read-only, FALSE if not.
- **/
-gboolean gnc_split_reg2_get_read_only (GNCSplitReg2 *gsr);
-
-/*
- * Create a transaction entry with given amount and date. One account is
- * specified, the other is undefined i.e. it defaults to orphan account.
- * Jump to the transaction entry in the register.
- * The purpose of this function to create an adjustment entry from the reconcile
- * window.
- */
-void gnc_split_reg2_balancing_entry (GNCSplitReg2 *gsr, Account *account,
-                                    time64 statement_date, gnc_numeric balancing_amount);
-
-
-void gnc_split_reg2_set_moved_cb (GNCSplitReg2 *gsr, GFunc cb, gpointer cb_data);
-
-#endif /* GNC_SPLIT_REG2_H */

Modified: gnucash/trunk/src/gnome/gschemas/org.gnucash.gschema.xml.in
===================================================================
--- gnucash/trunk/src/gnome/gschemas/org.gnucash.gschema.xml.in	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/gschemas/org.gnucash.gschema.xml.in	2013-10-22 18:26:55 UTC (rev 23314)
@@ -275,36 +275,11 @@
       <summary>Only display leaf account names.</summary>
       <description>Show only the names of the leaf accounts in the register and in the account selection popup. The default behaviour is to display the full name, including the path in the account tree. Activating this option implies that you use unique leaf names.</description>
     </key>
-    <key name="show-extra-dates" type="b">
-      <default>false</default>
-      <summary>Show the entered and reconcile dates</summary>
-      <description>Show the date when the transaction was entered below the posted date and reconciled date on split row.</description>
-    </key>
-    <key name="show-extra-dates-on-selection" type="b">
-      <default>false</default>
-      <summary>Show entered and reconciled dates on selection</summary>
-      <description>Show the entered date and reconciled date on transaction selection.</description>
-    </key>
-    <key name="show-calendar-buttons" type="b">
-      <default>false</default>
-      <summary>Show the calendar buttons</summary>
-      <description>Show the calendar buttons Cancel, Today and Select.</description>
-    </key>
-    <key name="selection-to-blank-on-expand" type="b">
-      <default>false</default>
-      <summary>Move the selection to the blank split on expand</summary>
-      <description>This will move the selection to the blank split when the transaction is expanded.</description>
-    </key>
     <key name="max-transactions" type="d">
       <default>0.0</default>
       <summary>Number of transactions to show in a register.</summary>
       <description>Show this many transactions in a register. A value of zero means show all transactions.</description>
     </key>
-    <key name="key-length" type="d">
-      <default>2.0</default>
-      <summary>Number of characters for auto complete.</summary>
-      <description>This sets the number of characters before auto complete starts for description, notes and memo fields.</description>
-    </key>
   </schema>
   
   <schema id="org.gnucash.general.report" path="/org/gnucash/general/report/">

Modified: gnucash/trunk/src/gnome/gtkbuilder/Makefile.am
===================================================================
--- gnucash/trunk/src/gnome/gtkbuilder/Makefile.am	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/gtkbuilder/Makefile.am	2013-10-22 18:26:55 UTC (rev 23314)
@@ -15,7 +15,6 @@
 	dialog-tax-info.glade \
 	gnc-plugin-page-budget.glade \
 	gnc-plugin-page-register.glade \
-	gnc-plugin-page-register2.glade \
 	window-autoclear.glade \
 	window-reconcile.glade
 

Deleted: gnucash/trunk/src/gnome/gtkbuilder/gnc-plugin-page-register2.glade
===================================================================
--- gnucash/trunk/src/gnome/gtkbuilder/gnc-plugin-page-register2.glade	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/gtkbuilder/gnc-plugin-page-register2.glade	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,861 +0,0 @@
-<?xml version="1.0"?>
-<interface>
-  <requires lib="gtk+" version="2.16"/>
-  <!-- interface-naming-policy toplevel-contextual -->
-  <object class="GtkDialog" id="Duplicate Transaction Dialog">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="border_width">6</property>
-    <property name="title" translatable="yes">Duplicate Transaction</property>
-    <property name="resizable">False</property>
-    <property name="modal">True</property>
-    <property name="type_hint">dialog</property>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox15">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="spacing">6</property>
-        <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area15">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="button76">
-                <property name="label">gtk-cancel</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_action_appearance">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="button77">
-                <property name="label">gtk-ok</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="has_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_action_appearance">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel" id="duplicate_title_label">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="xalign">0</property>
-            <property name="label" translatable="yes"><b>New Transaction Information</b></property>
-            <property name="use_markup">True</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">2</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkAlignment" id="alignment1">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="left_padding">12</property>
-            <child>
-              <object class="GtkTable" id="duplicate_table">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="n_rows">2</property>
-                <property name="n_columns">2</property>
-                <property name="column_spacing">12</property>
-                <property name="row_spacing">6</property>
-                <child>
-                  <object class="GtkLabel" id="date_label">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">_Date:</property>
-                    <property name="use_underline">True</property>
-                    <property name="justify">center</property>
-                  </object>
-                  <packing>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="num_label">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">_Number:</property>
-                    <property name="use_underline">True</property>
-                    <property name="justify">center</property>
-                    <property name="mnemonic_widget">num_spin</property>
-                  </object>
-                  <packing>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"></property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkSpinButton" id="num_spin">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="has_focus">True</property>
-                    <property name="primary_icon_activatable">False</property>
-                    <property name="secondary_icon_activatable">False</property>
-                    <property name="primary_icon_sensitive">True</property>
-                    <property name="secondary_icon_sensitive">True</property>
-                    <property name="adjustment">adjustment1</property>
-                    <property name="climb_rate">1</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
-                    <property name="y_options"></property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkHBox" id="date_hbox">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <child>
-                      <placeholder/>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options">GTK_FILL</property>
-                  </packing>
-                </child>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">True</property>
-            <property name="fill">True</property>
-            <property name="position">3</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="-6">button76</action-widget>
-      <action-widget response="-5">button77</action-widget>
-    </action-widgets>
-  </object>
-  <object class="GtkDialog" id="Filter By">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="border_width">6</property>
-    <property name="title" translatable="yes">Filter register by...</property>
-    <property name="resizable">False</property>
-    <property name="destroy_with_parent">True</property>
-    <property name="type_hint">dialog</property>
-    <signal name="response" handler="gnc_plugin_page_register2_filter_response_cb" swapped="no"/>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox19">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="spacing">6</property>
-        <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area21">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="cancelbutton4">
-                <property name="label">gtk-cancel</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_action_appearance">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="okbutton4">
-                <property name="label">gtk-ok</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="has_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_action_appearance">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkNotebook" id="notebook1">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <child>
-              <object class="GtkVBox" id="vbox103">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="border_width">12</property>
-                <child>
-                  <object class="GtkRadioButton" id="filter_show_all">
-                    <property name="label" translatable="yes">Show _All</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_action_appearance">False</property>
-                    <property name="use_underline">True</property>
-                    <property name="draw_indicator">True</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="label847680">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="xalign">0</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkRadioButton" id="filter_show_range">
-                    <property name="label" translatable="yes">Select Range:</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_action_appearance">False</property>
-                    <property name="use_underline">True</property>
-                    <property name="draw_indicator">True</property>
-                    <property name="group">filter_show_all</property>
-                    <signal name="toggled" handler="gnc_plugin_page_register2_filter_select_range_cb" swapped="no"/>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkTable" id="select_range_table">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="n_rows">7</property>
-                    <property name="n_columns">3</property>
-                    <property name="column_spacing">6</property>
-                    <child>
-                      <object class="GtkLabel" id="label847682">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Start:</property>
-                      </object>
-                      <packing>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                        <property name="x_padding">12</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkRadioButton" id="start_date_earliest">
-                        <property name="label" translatable="yes">_Earliest</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_action_appearance">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                        <signal name="clicked" handler="gnc_plugin_page_register2_filter_start_cb" swapped="no"/>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkRadioButton" id="end_date_choose">
-                        <property name="label" translatable="yes">Choo_se Date:</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_action_appearance">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                        <signal name="clicked" handler="gnc_plugin_page_register2_filter_end_cb" swapped="no"/>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">6</property>
-                        <property name="bottom_attach">7</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkRadioButton" id="end_date_today">
-                        <property name="label" translatable="yes">Toda_y</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_action_appearance">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                        <property name="group">end_date_choose</property>
-                        <signal name="clicked" handler="gnc_plugin_page_register2_filter_end_cb" swapped="no"/>
-                      </object>
-                      <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">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkRadioButton" id="end_date_latest">
-                        <property name="label" translatable="yes">_Latest</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_action_appearance">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                        <property name="group">end_date_choose</property>
-                        <signal name="clicked" handler="gnc_plugin_page_register2_filter_end_cb" swapped="no"/>
-                      </object>
-                      <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">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label847683">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                      </object>
-                      <packing>
-                        <property name="top_attach">3</property>
-                        <property name="bottom_attach">4</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label847684">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">End:</property>
-                      </object>
-                      <packing>
-                        <property name="top_attach">4</property>
-                        <property name="bottom_attach">5</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                        <property name="x_padding">12</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkRadioButton" id="start_date_choose">
-                        <property name="label" translatable="yes">C_hoose Date:</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_action_appearance">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                        <property name="group">start_date_earliest</property>
-                        <signal name="clicked" handler="gnc_plugin_page_register2_filter_start_cb" swapped="no"/>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkRadioButton" id="start_date_today">
-                        <property name="label" translatable="yes">_Today</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_action_appearance">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                        <property name="group">start_date_earliest</property>
-                        <signal name="clicked" handler="gnc_plugin_page_register2_filter_start_cb" swapped="no"/>
-                      </object>
-                      <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">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkHBox" id="start_date_hbox">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <child>
-                          <placeholder/>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="left_attach">2</property>
-                        <property name="right_attach">3</property>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkHBox" id="end_date_hbox">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <child>
-                          <placeholder/>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="left_attach">2</property>
-                        <property name="right_attach">3</property>
-                        <property name="top_attach">6</property>
-                        <property name="bottom_attach">7</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
-                    <property name="position">3</property>
-                  </packing>
-                </child>
-              </object>
-            </child>
-            <child type="tab">
-              <object class="GtkLabel" id="label847678">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Date</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="tab_fill">False</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkVBox" id="vbox104">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <child>
-                  <object class="GtkTable" id="table1">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="border_width">12</property>
-                    <property name="n_rows">7</property>
-                    <property name="n_columns">3</property>
-                    <child>
-                      <object class="GtkCheckButton" id="filter_status_unreconciled">
-                        <property name="label" translatable="yes">_Unreconciled</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_action_appearance">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                        <signal name="toggled" handler="gnc_plugin_page_register2_filter_status_one_cb" swapped="no"/>
-                      </object>
-                      <packing>
-                        <property name="right_attach">3</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkCheckButton" id="filter_status_reconciled">
-                        <property name="label" translatable="yes">_Reconciled</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_action_appearance">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                        <signal name="toggled" handler="gnc_plugin_page_register2_filter_status_one_cb" swapped="no"/>
-                      </object>
-                      <packing>
-                        <property name="right_attach">3</property>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkCheckButton" id="filter_status_cleared">
-                        <property name="label" translatable="yes">C_leared</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_action_appearance">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                        <signal name="toggled" handler="gnc_plugin_page_register2_filter_status_one_cb" swapped="no"/>
-                      </object>
-                      <packing>
-                        <property name="right_attach">3</property>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkCheckButton" id="filter_status_voided">
-                        <property name="label" translatable="yes">_Voided</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_action_appearance">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                        <signal name="toggled" handler="gnc_plugin_page_register2_filter_status_one_cb" swapped="no"/>
-                      </object>
-                      <packing>
-                        <property name="right_attach">3</property>
-                        <property name="top_attach">3</property>
-                        <property name="bottom_attach">4</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkCheckButton" id="filter_status_frozen">
-                        <property name="label" translatable="yes">_Frozen</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_action_appearance">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                        <signal name="toggled" handler="gnc_plugin_page_register2_filter_status_one_cb" swapped="no"/>
-                      </object>
-                      <packing>
-                        <property name="right_attach">3</property>
-                        <property name="top_attach">4</property>
-                        <property name="bottom_attach">5</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkButton" id="button84">
-                        <property name="label" translatable="yes">Select _All</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
-                        <property name="use_action_appearance">False</property>
-                        <property name="use_underline">True</property>
-                        <signal name="clicked" handler="gnc_plugin_page_register2_filter_status_all_cb" swapped="no"/>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">6</property>
-                        <property name="bottom_attach">7</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkHSeparator" id="hseparator1">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                      </object>
-                      <packing>
-                        <property name="right_attach">3</property>
-                        <property name="top_attach">5</property>
-                        <property name="bottom_attach">6</property>
-                        <property name="y_options">GTK_EXPAND</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                    <child>
-                      <placeholder/>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-              </object>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child type="tab">
-              <object class="GtkLabel" id="label847679">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Status</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="position">1</property>
-                <property name="tab_fill">False</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">True</property>
-            <property name="fill">True</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkHBox" id="hbox1">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <child>
-              <object class="GtkCheckButton" id="filter_save">
-                <property name="label" translatable="yes">Sa_ve Filter</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_action_appearance">False</property>
-                <property name="use_underline">True</property>
-                <property name="xalign">1</property>
-                <property name="draw_indicator">True</property>
-                <signal name="toggled" handler="gnc_plugin_page_register2_filter_save_cb" swapped="no"/>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="padding">6</property>
-                <property name="pack_type">end</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">True</property>
-            <property name="fill">False</property>
-            <property name="position">2</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="-6">cancelbutton4</action-widget>
-      <action-widget response="-5">okbutton4</action-widget>
-    </action-widgets>
-  </object>
-  <object class="GtkDialog" id="Void Transaction">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="border_width">6</property>
-    <property name="title" translatable="yes">Void Transaction</property>
-    <property name="resizable">False</property>
-    <property name="modal">True</property>
-    <property name="window_position">center-on-parent</property>
-    <property name="type_hint">dialog</property>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox16">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="spacing">6</property>
-        <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area18">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="cancelbutton1">
-                <property name="label">gtk-cancel</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_action_appearance">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="okbutton1">
-                <property name="label">gtk-ok</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="has_default">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_action_appearance">False</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkVBox" id="vbox100">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <child>
-              <object class="GtkLabel" id="label847671">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Reason for voiding transaction:</property>
-                <property name="justify">center</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkEntry" id="reason">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="has_focus">True</property>
-                <property name="activates_default">True</property>
-                <property name="primary_icon_activatable">False</property>
-                <property name="secondary_icon_activatable">False</property>
-                <property name="primary_icon_sensitive">True</property>
-                <property name="secondary_icon_sensitive">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">True</property>
-            <property name="fill">True</property>
-            <property name="position">2</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="-6">cancelbutton1</action-widget>
-      <action-widget response="-5">okbutton1</action-widget>
-    </action-widgets>
-  </object>
-  <object class="GtkAdjustment" id="adjustment1">
-    <property name="upper">1000000000</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
-</interface>

Modified: gnucash/trunk/src/gnome/top-level.c
===================================================================
--- gnucash/trunk/src/gnome/top-level.c	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/top-level.c	2013-10-22 18:26:55 UTC (rev 23314)
@@ -50,10 +50,8 @@
 #include "gnc-plugin-basic-commands.h" /* FIXME Remove this line*/
 #include "gnc-plugin-file-history.h" /* FIXME Remove this line*/
 #include "gnc-plugin-register.h" /* FIXME Remove this line*/
-#include "gnc-plugin-register2.h" /* FIXME Remove this line*/
 #include "gnc-plugin-budget.h"
 #include "gnc-plugin-page-register.h"
-#include "gnc-plugin-page-register2.h"
 #include "gnc-plugin-manager.h" /* FIXME Remove this line*/
 #include "gnc-html.h"
 #include "gnc-gnome-utils.h"
@@ -418,8 +416,6 @@
         gnc_plugin_manager_get (), gnc_plugin_menu_additions_new ());
     gnc_plugin_manager_add_plugin (
         gnc_plugin_manager_get (), gnc_plugin_register_new ());
-    gnc_plugin_manager_add_plugin (
-        gnc_plugin_manager_get (), gnc_plugin_register2_new ());
     /* I'm not sure why the FIXME note says to remove this.  Maybe
        each module should be adding its own plugin to the manager?
        Anyway... Oh, maybe... nah */

Modified: gnucash/trunk/src/gnome/ui/Makefile.am
===================================================================
--- gnucash/trunk/src/gnome/ui/Makefile.am	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/ui/Makefile.am	2013-10-22 18:26:55 UTC (rev 23314)
@@ -5,12 +5,9 @@
 	gnc-plugin-account-tree-ui.xml \
 	gnc-plugin-basic-commands-ui.xml \
 	gnc-plugin-page-account-tree-ui.xml \
-	gnc-plugin-page-account-tree2-ui.xml \
 	gnc-plugin-file-history-ui.xml \
 	gnc-plugin-register-ui.xml \
-	gnc-plugin-register2-ui.xml \
 	gnc-plugin-page-register-ui.xml \
-	gnc-plugin-page-register2-ui.xml \
         gnc-plugin-page-sx-list-ui.xml \
 	gnc-plugin-page-sxregister-ui.xml \
 	gnc-sxed-to-create-window-ui.xml \

Deleted: gnucash/trunk/src/gnome/ui/gnc-plugin-page-account-tree2-ui.xml
===================================================================
--- gnucash/trunk/src/gnome/ui/gnc-plugin-page-account-tree2-ui.xml	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/ui/gnc-plugin-page-account-tree2-ui.xml	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,74 +0,0 @@
-<ui>
-  <menubar>
-    <menu name="Edit" action="EditAction">
-      <placeholder name="EditSelectedPlaceholder">
-        <menuitem name="EditEditAccount" action="EditEditAccountAction"/>
-	<menuitem name="EditDeleteAccount" action="EditDeleteAccountAction"/>
-	<menuitem name="EditRenumberSubaccounts" action="EditRenumberSubaccountsAction"/>
-        <separator name="EditSep2"/>
-        <menuitem name="FileOpenAccount2" action="FileOpenAccount2Action"/>
-        <menuitem name="FileOpenAccount" action="FileOpenAccountAction"/>
-        <menuitem name="FileOpenSubaccounts2" action="FileOpenSubaccounts2Action"/>
-        <menuitem name="FileOpenSubaccounts" action="FileOpenSubaccountsAction"/>
-      </placeholder>
-    </menu>
-    <menu name="Actions" action="ActionsAction">
-      <placeholder name="ActionsPlaceholder">
-	<separator name="ActionsSep1"/>
-        <menuitem name="FileNewAccount" action="FileNewAccountAction"/>
-        <menuitem name="FileAddAccountHierarchyAssistant" action="FileAddAccountHierarchyAssistantAction"/>
-        <separator name="ActionsSep2"/>
-	<menuitem name="ActionsTransfer" action="ActionsTransferAction"/>
-	<menuitem name="ActionsReconcile" action="ActionsReconcileAction"/>
-	<menuitem name="ActionsAutoClear" action="ActionsAutoClearAction"/>
-	<menuitem name="ActionsStockSplit" action="ActionsStockSplitAction"/>
-	<menuitem name="ActionLots" action="ActionsLotsAction"/>
-	<separator name="ActionsSep3"/>
-	<menu name="ScrubMenu" action="ScrubMenuAction">
-	  <menuitem name="Scrub" action="ScrubAction"/>
-	  <menuitem name="ScrubSub" action="ScrubSubAction"/>
-	  <menuitem name="ScrubAll" action="ScrubAllAction"/>
-	</menu>
-      </placeholder>
-    </menu>
-  </menubar>
-
-  <popup name="MainPopup" action="FakeToplevel">
-    <placeholder name="PopupPlaceholder2">
-      <menuitem name="AccountOpenAccount2" action="FileOpenAccount2Action"/>
-      <menuitem name="AccountOpenAccount" action="FileOpenAccountAction"/>
-      <menuitem name="AccountOpenSubaccounts2" action="FileOpenSubaccounts2Action"/>
-      <menuitem name="AccountOpenSubaccounts" action="FileOpenSubaccountsAction"/>
-      <menuitem name="AccountEditAccount" action="EditEditAccountAction"/>
-      <separator name="AccountSep1"/>
-      <menuitem name="AccountReconcile" action="ActionsReconcileAction"/>
-      <menuitem name="AccountAutoClear" action="ActionsAutoClearAction"/>
-      <menuitem name="AccountTransfer" action="ActionsTransferAction"/>
-      <menuitem name="AccountStockSplit" action="ActionsStockSplitAction"/>
-      <menuitem name="AccountLots" action="ActionsLotsAction"/>
-      <separator name="AccountSep2"/>
-      <menuitem name="AccountNewAccount" action="FileNewAccountAction"/>
-      <menuitem name="AccountDeleteAccount" action="EditDeleteAccountAction"/>
-      <separator name="AccountSep3"/>
-    </placeholder>
-    <placeholder name="PopupBottomPlaceholder">
-      <menu name="ScrubMenu" action="ScrubMenuAction">
-        <menuitem name="Scrub" action="ScrubAction"/>
-        <menuitem name="ScrubSub" action="ScrubSubAction"/>
-        <menuitem name="ScrubAll" action="ScrubAllAction"/>
-      </menu>
-    </placeholder>
-  </popup>
-
-  <toolbar name="DefaultToolbar">
-    <placeholder name="DefaultToolbarPlaceholder">
-      <separator name="ToolbarSep2"/>
-      <toolitem name="ToolbarOpenAccount" action="FileOpenAccountAction"/>
-      <toolitem name="ToolbarOpenAccount2" action="FileOpenAccount2Action"/>
-      <toolitem name="ToolbarEditAccount" action="EditEditAccountAction"/>
-      <separator name="ToolbarSep3"/>
-      <toolitem name="ToolbarNewAccount" action="FileNewAccountAction"/>
-      <toolitem name="ToolbarDeleteAccount" action="EditDeleteAccountAction"/>
-    </placeholder>
-  </toolbar>
-</ui>

Deleted: gnucash/trunk/src/gnome/ui/gnc-plugin-page-register2-ui.xml
===================================================================
--- gnucash/trunk/src/gnome/ui/gnc-plugin-page-register2-ui.xml	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/ui/gnc-plugin-page-register2-ui.xml	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,110 +0,0 @@
-<ui>
-  <menubar>
-    <menu name="Edit" action="EditAction">
-      <placeholder name="EditAllSelectedPlaceholder">
-        <menuitem name="EditEditAccount"        action="EditEditAccountAction"/>
-      </placeholder>
-    </menu>
-
-    <menu name="Transaction" action="TransactionAction">
-      <menuitem name="CutTransaction"     	action="CutTransactionAction"/>
-      <menuitem name="CopyTransaction"    	action="CopyTransactionAction"/>
-      <menuitem name="PasteTransaction"   	action="PasteTransactionAction"/>
-      <menuitem name="TransactionUp"            action="TransactionUpAction"/> 
-      <menuitem name="TransactionDown"          action="TransactionDownAction"/> 
-      <menuitem name="DuplicateTransaction"    	action="DuplicateTransactionAction"/>
-      <menuitem name="DeleteTransaction"       	action="DeleteTransactionAction"/>
-      <menuitem name="RemoveTransactionSplits" 	action="RemoveTransactionSplitsAction"/>
-      <!--menuitem name="ShiftTransactionForward" 	action="ShiftTransactionForwardAction"/-->
-      <separator name="TransactionSep1"/>
-      <menuitem name="RecordTransaction"        action="RecordTransactionAction"/>
-      <menuitem name="CancelTransaction"        action="CancelTransactionAction"/>
-      <separator name="TransactionSep2"/>
-      <menuitem name="VoidTransaction"    	action="VoidTransactionAction"/>
-      <menuitem name="UnvoidTransaction"  	action="UnvoidTransactionAction"/>
-      <menuitem name="ReverseTransaction" 	action="ReverseTransactionAction"/>
-    </menu>
-
-    <menu name="View" action="ViewAction">
-      <placeholder name="ViewContentPlaceholder">
-        <menuitem name="ViewStyleBasic"        	action="ViewStyleBasicAction"/>
-        <menuitem name="ViewStyleAutoSplit"    	action="ViewStyleAutoSplitAction"/>
-        <menuitem name="ViewStyleJournal"      	action="ViewStyleJournalAction"/>
-        <separator name="ViewSep44"/>
-        <menuitem name="ViewStyleDoubleLine"   	action="ViewStyleDoubleLineAction"/>
-        <menuitem name="ViewStyleExtraDates"   	action="ViewStyleExtraDatesAction"/>
-      </placeholder>
-    </menu>
-
-    <menu name="Actions" action="ActionsAction">
-      <placeholder name="ActionsPlaceholder">
-        <separator name="ActionsSep1"/>
-	<menuitem name="ActionsTransfer"         action="ActionsTransferAction"/>
-	<menuitem name="ActionsReconcile"        action="ActionsReconcileAction"/>
-	<menuitem name="ActionsStockSplit"       action="ActionsStockSplitAction"/>
-	<menuitem name="ActionLots"              action="ActionsLotsAction"/>
-        <separator name="ActionsSep4"/>
-        <menuitem name="BlankTransaction"        action="BlankTransactionAction"/>
-        <menuitem name="SplitTransaction"        action="SplitTransactionAction"/>
-        <menuitem name="EditExchangeRate"        action="EditExchangeRateAction"/>
-        <menuitem name="ScheduleTransaction"     action="ScheduleTransactionAction"/>
-        <menuitem name="JumpTransaction"         action="JumpTransactionAction"/>
-	<separator name="ActionsSep5"/>
-      </placeholder>
-      <menu name="ScrubMenu" action="ScrubMenuAction">
-	<menuitem name="ScrubAll" action="ScrubAllAction"/>
-	<menuitem name="ScrubCurrent" action="ScrubCurrentAction"/>
-      </menu>
-    </menu>
-
-    <menu name="Reports" action="ReportsAction">
-      <placeholder name="AccountReports">
-        <menuitem name="ReportsAccountReport"      action="ReportsAccountReportAction"/>
-        <menuitem name="ReportsAcctTransReport"    action="ReportsAcctTransReportAction"/>
-      </placeholder>
-    </menu>
-  </menubar>
-
-  <toolbar name="DefaultToolbar">
-    <placeholder name="DefaultToolbarPlaceholder">
-      <toolitem name="ToolbarTransactionUp"        action="TransactionUpAction"/> 
-      <toolitem name="ToolbarTransactionDown"      action="TransactionDownAction"/> 
-      <toolitem name="ToolbarDuplicateTransaction" action="DuplicateTransactionAction"/>
-      <toolitem name="ToolbarDeleteTransaction"    action="DeleteTransactionAction"/>
-      <separator name="ToolbarSep66"/>
-      <toolitem name="ToolbarRecordTransaction"    action="RecordTransactionAction"/>
-      <toolitem name="ToolbarCancelTransaction"    action="CancelTransactionAction"/>
-      <separator name="ToolbarSep67"/>
-      <toolitem name="ToolbarBlankTransaction"     action="BlankTransactionAction"/>
-      <toolitem name="ToolbarSplitTransaction"     action="SplitTransactionAction"/>
-      <toolitem name="ToolbarJumpTransaction"      action="JumpTransactionAction"/>
-      <toolitem name="ToolbarScheduleTransaction"  action="ScheduleTransactionAction"/>
-      <separator name="ToolbarSep68"/>
-      <toolitem name="ToolbarTransfer"             action="ActionsTransferAction"/>
-      <toolitem name="ActionsReconcile"            action="ActionsReconcileAction"/>
-    </placeholder>
-  </toolbar>
-
-  <popup name="MainPopup"                    action="FakeToplevel">
-    <placeholder name="PopupPlaceholder1">
-      <menuitem name="ViewFilterBy"            action="ViewFilterByAction"/>
-    </placeholder>
-    <placeholder name="PopupPlaceholder2">
-      <menuitem name="TransactionUp"           action="TransactionUpAction"/> 
-      <menuitem name="TransactionDown"         action="TransactionDownAction"/> 
-      <menuitem name="DuplicateTransaction"    action="DuplicateTransactionAction"/>
-      <menuitem name="DeleteTransaction"       action="DeleteTransactionAction"/>
-      <menuitem name="RemoveTransactionSplits" action="RemoveTransactionSplitsAction"/>
-      <!--menuitem name="ShiftTransactionForward" 	action="ShiftTransactionForwardAction"/-->
-      <separator name="PopupSep2"/>
-      <menuitem name="RecordTransaction"       action="RecordTransactionAction"/>
-      <menuitem name="CancelTransaction"       action="CancelTransactionAction"/>
-      <separator name="PopupSep3"/>
-      <menuitem name="BlankTransaction"        action="BlankTransactionAction"/>
-      <menuitem name="SplitTransaction"        action="SplitTransactionAction"/>
-      <menuitem name="EditExchangeRate"        action="EditExchangeRateAction"/>
-      <menuitem name="ScheduleTransaction"     action="ScheduleTransactionAction"/>
-      <menuitem name="JumpTransaction"         action="JumpTransactionAction"/>
-    </placeholder>
-  </popup>
-</ui>

Modified: gnucash/trunk/src/gnome/ui/gnc-plugin-page-sx-list-ui.xml
===================================================================
--- gnucash/trunk/src/gnome/ui/gnc-plugin-page-sx-list-ui.xml	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/ui/gnc-plugin-page-sx-list-ui.xml	2013-10-22 18:26:55 UTC (rev 23314)
@@ -3,9 +3,7 @@
     <placeholder name="AdditionalMenusPlaceholder">
       <menu action="SxListAction">
         <menuitem name="SxListNew" action="SxListNewAction"/>
-        <menuitem name="SxListNew2" action="SxListNewAction2"/>
         <menuitem name="SxListEdit" action="SxListEditAction"/>
-        <menuitem name="SxListEdit2" action="SxListEditAction2"/>
         <menuitem name="SxListDelete" action="SxListDeleteAction"/>
       </menu>
     </placeholder>

Deleted: gnucash/trunk/src/gnome/ui/gnc-plugin-register2-ui.xml
===================================================================
--- gnucash/trunk/src/gnome/ui/gnc-plugin-register2-ui.xml	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/ui/gnc-plugin-register2-ui.xml	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,9 +0,0 @@
-<ui>
-  <menubar>
-    <menu name="Tools" action="ToolsAction">
-      <placeholder name="ToolsPlaceholder">
-        <menuitem name="ToolsGeneralLedger2" action="ToolsGeneralLedger2Action"/>
-      </placeholder>
-    </menu>
-  </menubar>
-</ui>

Deleted: gnucash/trunk/src/gnome/window-reconcile2.c
===================================================================
--- gnucash/trunk/src/gnome/window-reconcile2.c	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/window-reconcile2.c	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,2233 +0,0 @@
-/********************************************************************\
- * window-reconcile2.c -- the reconcile window                      *
- * Copyright (C) 1997 Robin D. Clark                                *
- * Copyright (C) 1998-2000 Linas Vepstas                            *
- * Copyright (C) 2002 Christian Stimming                            *
- * Copyright (C) 2006 David Hampton                                 *
- *                                                                  *
- * 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                   *
- *                                                                  *
- *   Author: Rob Clark                                              *
- * Internet: rclark at cs.hmc.edu                                      *
- *  Address: 609 8th Street                                         *
- *           Huntington Beach, CA 92648-4632                        *
-\********************************************************************/
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#ifdef __G_IR_SCANNER__
-#undef __G_IR_SCANNER__
-#endif
-#include <gdk/gdkkeysyms.h>
-
-#include "Scrub.h"
-#include "Scrub3.h"
-#include "dialog-account.h"
-#include "dialog-transfer.h"
-#include "dialog-utils.h"
-#include "gnc-amount-edit.h"
-#include "gnc-component-manager.h"
-#include "gnc-date-edit.h"
-#include "gnc-event.h"
-#include "gnc-filepath-utils.h"
-#include <gnc-gdate-utils.h>
-#include "gnc-gnome-utils.h"
-#include "gnc-main-window.h"
-#include "gnc-plugin-page-register2.h"
-#include "gnc-prefs.h"
-#include "gnc-ui.h"
-#include "gnc-ui-balances.h"
-#include "guile-util.h"
-#include "reconcile-view.h"
-#include "window-reconcile2.h"
-
-#define WINDOW_RECONCILE_CM_CLASS "window-reconcile"
-#define GNC_PREF_AUTO_INTEREST_TRANSFER "auto-interest-transfer"
-#define GNC_PREF_AUTO_CC_PAYMENT        "auto-cc-payment"
-#define GNC_PREF_ALWAYS_REC_TO_TODAY    "always-reconcile-to-today"
-
-
-/** STRUCTS *********************************************************/
-struct _RecnWindow2
-{
-    GncGUID account;             /* The account that we are reconciling  */
-    gnc_numeric new_ending;      /* The new ending balance               */
-    time64 statement_date;       /* The statement date                   */
-
-    gint component_id;           /* id of component                      */
-
-    GtkWidget *window;           /* The reconcile window                 */
-
-    GtkUIManager *ui_merge;
-    GtkActionGroup *action_group;
-
-    GtkWidget *starting;         /* The starting balance                 */
-    GtkWidget *ending;           /* The ending balance                   */
-    GtkWidget *recn_date;        /* The statement date                   */
-    GtkWidget *reconciled;       /* The reconciled balance               */
-    GtkWidget *difference;       /* Text field, amount left to reconcile */
-
-    GtkWidget *total_debit;      /* Text field, total debit reconciled   */
-    GtkWidget *total_credit;     /* Text field, total credit reconciled  */
-
-    GtkWidget *debit;            /* Debit matrix show unreconciled debit */
-    GtkWidget *credit;           /* Credit matrix, shows credits...      */
-
-    GtkWidget *debit_frame;      /* Frame around debit matrix            */
-    GtkWidget *credit_frame;     /* Frame around credit matrix           */
-
-    gboolean   delete_refresh;   /* do a refresh upon a window deletion  */
-};
-
-
-/* This structure doesn't contain everything involved in the
- * startRecnWindow, just pointers that have to be passed in to
- * callbacks that need more than one piece of data to operate on.
- * This is also used by the interest transfer dialog code.
- */
-typedef struct _startRecnWindowData
-{
-    Account       *account;         /* the account being reconciled            */
-    GNCAccountType account_type;    /* the type of the account                 */
-
-    GtkWidget     *startRecnWindow; /* the startRecnWindow dialog              */
-    GtkWidget     *xfer_button;     /* the dialog's interest transfer button   */
-    GtkWidget     *date_value;      /* the dialog's ending date field          */
-    GNCAmountEdit *end_value;       /* the dialog's ending balance amount edit */
-    gnc_numeric    original_value;  /* the dialog's original ending balance    */
-    gboolean       user_set_value;  /* the user changed the ending value       */
-
-    XferDialog    *xferData;        /* the interest xfer dialog (if it exists) */
-    gboolean       include_children;
-
-    time64         date;            /* the interest xfer reconcile date        */
-} startRecnWindowData;
-
-
-/* Note: make sure to update the help text for this in prefs.scm if these
- * 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) == ACCT_TYPE_CREDIT) || \
-                                                      ((type) == ACCT_TYPE_LIABILITY) ||\
-						      ((type) == ACCT_TYPE_PAYABLE))
-
-#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) || \
-    account_type_has_auto_interest_payment(type) )
-
-/** PROTOTYPES ******************************************************/
-static gnc_numeric recnRecalculateBalance (RecnWindow2 *recnData);
-
-static void   recn_destroy_cb (GtkWidget *w, gpointer data);
-static void   recn_cancel (RecnWindow2 *recnData);
-static gboolean recn_delete_cb (GtkWidget *widget, GdkEvent *event, gpointer data);
-static gboolean recn_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer data);
-static void   recnFinishCB (GtkAction *action, RecnWindow2 *recnData);
-static void   recnPostponeCB (GtkAction *action, gpointer data);
-static void   recnCancelCB (GtkAction *action, gpointer data);
-
-void gnc_start_recn2_children_changed (GtkWidget *widget, startRecnWindowData *data);
-void gnc_start_recn2_interest_clicked_cb (GtkButton *button, startRecnWindowData *data);
-
-static void   gnc_reconcile_window_set_sensitivity (RecnWindow2 *recnData);
-static char * gnc_recn_make_window_name (Account *account);
-static void   gnc_recn_set_window_name (RecnWindow2 *recnData);
-static gboolean find_by_account (gpointer find_data, gpointer user_data);
-
-
-/** GLOBALS ************************************************************/
-/* This static indicates the debugging module that this .o belongs to. */
-G_GNUC_UNUSED static QofLogModule log_module = GNC_MOD_GUI;
-
-static time64 gnc_reconcile_last_statement_date = 0;
-
-
-/** IMPLEMENTATIONS *************************************************/
-
-/** An array of all of the actions provided by the main window code.
- *  This includes some placeholder actions for the menus that are
- *  visible in the menu bar but have no action associated with
- *  them. */
-static GtkActionEntry recnWindow2_actions [];
-/** The number of actions provided by the main window. */
-static guint recnWindow2_n_actions;
-
-/********************************************************************\
- * recnRefresh                                                      *
- *   refreshes the transactions in the reconcile window             *
- *                                                                  *
- * Args:   account - the account of the reconcile window to refresh *
- * Return: none                                                     *
-\********************************************************************/
-static void
-recnRefresh (RecnWindow2 *recnData)
-{
-    if (recnData == NULL)
-        return;
-
-    gnc_reconcile_view_refresh (GNC_RECONCILE_VIEW (recnData->debit));
-    gnc_reconcile_view_refresh (GNC_RECONCILE_VIEW (recnData->credit));
-
-    gnc_reconcile_window_set_sensitivity (recnData);
-
-    gnc_recn_set_window_name (recnData);
-
-    recnRecalculateBalance (recnData);
-
-    gtk_widget_queue_resize (recnData->window);
-}
-
-
-static Account *
-recn_get_account (RecnWindow2 *recnData)
-{
-    if (!recnData)
-        return NULL;
-
-    return xaccAccountLookup (&recnData->account, gnc_get_current_book ());
-}
-
-
-/********************************************************************\
- * recnRecalculateBalance                                           *
- *   refreshes the balances in the reconcile window                 *
- *                                                                  *
- * Args:   recnData -- the reconcile window to refresh              *
- * Return: the difference between the nominal ending balance        *
- *         and the 'effective' ending balance.                      *
-\********************************************************************/
-static gnc_numeric
-recnRecalculateBalance (RecnWindow2 *recnData)
-{
-    Account *account;
-    const char *amount;
-    gnc_numeric debit;
-    gnc_numeric credit;
-    gnc_numeric starting;
-    gnc_numeric ending;
-    gnc_numeric reconciled;
-    gnc_numeric diff;
-    GNCPrintAmountInfo print_info;
-    gboolean reverse_balance, include_children;
-    GtkAction *action;
-
-    account = recn_get_account (recnData);
-    if (!account)
-        return gnc_numeric_zero ();
-
-    reverse_balance = gnc_reverse_balance (account);
-
-    /* update the starting balance */
-    include_children = xaccAccountGetReconcileChildrenStatus (account);
-    starting = gnc_ui_account_get_reconciled_balance (account, include_children);
-    print_info = gnc_account_print_info (account, TRUE);
-
-    /*
-     * Do not reverse the balance here. It messes up the math in the
-     * reconciliation window. Also, the balance should show up as a
-     * positive number in the reconciliation window to match the positive
-     * number that shows in the register window.
-     */
-
-    amount = xaccPrintAmount (starting, print_info);
-    gnc_set_label_color (recnData->starting, starting);
-    gtk_label_set_text (GTK_LABEL (recnData->starting), amount);
-    if (reverse_balance)
-        starting = gnc_numeric_neg (starting);
-
-    /* update the statement date */
-    amount = qof_print_date (recnData->statement_date);
-    gtk_label_set_text (GTK_LABEL (recnData->recn_date), amount);
-
-    /* update the ending balance */
-    ending = recnData->new_ending;
-    if (reverse_balance)
-        ending = gnc_numeric_neg (ending);
-    amount = xaccPrintAmount (ending, print_info);
-    gnc_set_label_color (recnData->ending, ending);
-    gtk_label_set_text (GTK_LABEL (recnData->ending), amount);
-    if (reverse_balance)
-        ending = gnc_numeric_neg (ending);
-
-    debit = gnc_reconcile_view_reconciled_balance
-            (GNC_RECONCILE_VIEW (recnData->debit));
-
-    credit = gnc_reconcile_view_reconciled_balance
-             (GNC_RECONCILE_VIEW (recnData->credit));
-
-    /* Update the total debit and credit fields */
-    amount = xaccPrintAmount (debit, print_info);
-    gtk_label_set_text (GTK_LABEL (recnData->total_debit), amount);
-
-    amount = xaccPrintAmount (credit, print_info);
-
-    gtk_label_set_text (GTK_LABEL (recnData->total_credit), amount);
-
-    /* update the reconciled balance */
-    reconciled = gnc_numeric_add_fixed (starting,
-                                        gnc_numeric_sub_fixed (debit, credit));
-    if (reverse_balance)
-        reconciled = gnc_numeric_neg (reconciled);
-    amount = xaccPrintAmount (reconciled, print_info);
-    gnc_set_label_color (recnData->reconciled, reconciled);
-    gtk_label_set_text (GTK_LABEL (recnData->reconciled), amount);
-    if (reverse_balance)
-        reconciled = gnc_numeric_neg (reconciled);
-
-    /* update the difference */
-    diff = gnc_numeric_sub_fixed (ending, reconciled);
-    if (reverse_balance)
-        diff = gnc_numeric_neg (diff);
-    amount = xaccPrintAmount (diff, print_info);
-    gnc_set_label_color (recnData->difference, diff);
-    gtk_label_set_text (GTK_LABEL (recnData->difference), amount);
-    if (reverse_balance)
-        diff = gnc_numeric_neg (diff);
-
-    action = gtk_action_group_get_action (recnData->action_group,
-                                          "RecnFinishAction");
-    gtk_action_set_sensitive (action, gnc_numeric_zero_p (diff));
-
-    action = gtk_action_group_get_action (recnData->action_group,
-                                          "TransBalanceAction");
-    gtk_action_set_sensitive (action, !gnc_numeric_zero_p (diff));
-
-    return diff;
-}
-
-
-static gboolean
-gnc_start_recn2_update_cb (GtkWidget *widget, GdkEventFocus *event,
-                         startRecnWindowData *data)
-{
-    gnc_numeric value;
-
-    gnc_amount_edit_evaluate (GNC_AMOUNT_EDIT (data->end_value));
-
-    value = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (data->end_value));
-    data->user_set_value = !gnc_numeric_equal (value, data->original_value);
-    return FALSE;
-}
-
-
-/* If the user changed the date edit widget, update the
- * ending balance to reflect the ending balance of the account
- * on the date that the date edit was changed to.
- */
-static void
-gnc_start_recn2_date_changed (GtkWidget *widget, startRecnWindowData *data)
-{
-    GNCDateEdit *gde = GNC_DATE_EDIT (widget);
-    gnc_numeric new_balance;
-    time64 new_date;
-
-    if (data->user_set_value)
-        return;
-    new_date = gnc_date_edit_get_date_end (gde);
-    /* get the balance for the account as of the new date */
-    new_balance = gnc_ui_account_get_balance_as_of_date (data->account, new_date,
-                  data->include_children);
-    /* update the amount edit with the amount */
-    gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (data->end_value),
-                                new_balance);
-}
-
-
-void
-gnc_start_recn2_children_changed (GtkWidget *widget, startRecnWindowData *data)
-{
-    data->include_children =
-        gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
-
-    /* Force an update of the ending balance */
-    gnc_start_recn2_date_changed (data->date_value, data);
-}
-
-
-/* For a given account, determine if an auto interest xfer dialog should be
- * shown, based on both the per-account flag as well as the global reconcile
- * option.  The global option is the default that is used if there is no
- * per-account option.
- */
-static gboolean
-gnc_recn_interest_xfer_get_auto_interest_xfer_allowed (Account *account)
-{
-    gboolean auto_xfer;
-
-    auto_xfer = gnc_prefs_get_bool (GNC_PREFS_GROUP_RECONCILE, GNC_PREF_AUTO_INTEREST_TRANSFER);
-    return xaccAccountGetAutoInterestXfer (account, auto_xfer);
-}
-
-
-/********************************************************************\
- * recnInterestXferWindow                                           *
- *   opens up a window to prompt the user to enter an interest      *
- *   charge or payment for an account prior to reconciling it.      *
- *   Only to be called for some types of accounts, as defined       *
- *   in the macros at the top of this file.                         *
- *                                                                  *
- * NOTE: This function does not return until the user presses "Ok"  *
- *       or "Cancel", which means that the transaction must be      *
- *       resolved before the startRecnWindow will work.             *
- *                                                                  *
- * Args:   data           - jumbo structure containing info         *
- *                          about the start of the reconcile        *
- *                          process needed by this function.        *
- * Returns:  none.                                                  *
-\********************************************************************/
-
-/* helper function */
-static char *
-gnc_recn_make_interest_window_name (Account *account, char *text)
-{
-    char *fullname;
-    char *title;
-
-    fullname = gnc_account_get_full_name (account);
-    title = g_strconcat (fullname, " - ", text && *text ? _(text) : "", NULL);
-
-    g_free (fullname);
-
-    return title;
-}
-
-
-/* user clicked button in the interest xfer dialog entitled
- * "No Auto Interest Payments for this Account".
- */
-static void
-gnc_recn_interest_xfer_no_auto_clicked_cb (GtkButton *button,
-        startRecnWindowData *data)
-{
-    /* Indicate that the user doesn't want
-     * an auto interest xfer for this account.
-     */
-    xaccAccountSetAutoInterestXfer (data->account, FALSE);
-
-    /* shut down the interest xfer dialog */
-    gnc_xfer_dialog_close (data->xferData);
-
-    /* make the button clickable again */
-    if (data->xfer_button)
-        gtk_widget_set_sensitive (GTK_WIDGET (data->xfer_button), TRUE);
-}
-
-
-static void
-recnInterestXferWindow (startRecnWindowData *data)
-{
-    gchar *title;
-
-    if (!account_type_has_auto_interest_xfer (data->account_type)) return;
-
-    /* get a normal transfer dialog... */
-    data->xferData = gnc_xfer_dialog (GTK_WIDGET(data->startRecnWindow),
-                                      data->account);
-
-    /* ...and start changing things: */
-
-    /* change title */
-    if ( account_type_has_auto_interest_payment (data->account_type))
-        title = gnc_recn_make_interest_window_name (data->account,
-                _("Interest Payment"));
-    else
-        title = gnc_recn_make_interest_window_name (data->account,
-                _("Interest Charge"));
-
-    gnc_xfer_dialog_set_title (data->xferData, title);
-    g_free (title);
-
-
-    /* change frame labels */
-    gnc_xfer_dialog_set_information_label (data->xferData,
-                                           _("Payment Information"));
-
-    /* Interest accrued is a transaction from an income account
-     * to a bank account.  Interest charged is a transaction from
-     * a credit account to an expense account.  The user isn't allowed
-     * to change the account (bank or credit) being reconciled.
-     */
-    if (account_type_has_auto_interest_payment (data->account_type))
-    {
-        gnc_xfer_dialog_set_from_account_label (data->xferData,
-                                                _("Payment From"));
-        gnc_xfer_dialog_set_from_show_button_active( data->xferData, TRUE);
-
-        // XXX: Set "from" account from previous interest payment.
-
-        gnc_xfer_dialog_set_to_account_label (data->xferData,
-                                              _("Reconcile Account"));
-        gnc_xfer_dialog_select_to_account (data->xferData, data->account);
-        gnc_xfer_dialog_lock_to_account_tree (data->xferData );
-
-        /* Quickfill based on the reconcile account, which is the "To" acct. */
-        gnc_xfer_dialog_quickfill_to_account (data->xferData, TRUE);
-    }
-    else  /* interest charged to account rather than paid to it */
-    {
-        gnc_xfer_dialog_set_from_account_label (data->xferData,
-                                                _("Reconcile Account"));
-        gnc_xfer_dialog_select_from_account (data->xferData, data->account);
-        gnc_xfer_dialog_lock_from_account_tree (data->xferData);
-
-        gnc_xfer_dialog_set_to_account_label (data->xferData,
-                                              _("Payment To"));
-        gnc_xfer_dialog_set_to_show_button_active (data->xferData, TRUE);
-
-        // XXX: Set "to" account from previous interest payment.
-
-        /* Quickfill based on the reconcile account, which is the "From" acct. */
-        gnc_xfer_dialog_quickfill_to_account (data->xferData, FALSE);
-    }
-
-
-    /* add a button to disable auto interest payments for this account */
-    gnc_xfer_dialog_add_user_specified_button (data->xferData,
-            ( account_type_has_auto_interest_payment (data->account_type) ?
-              _("No Auto Interest Payments for this Account")
-              : _("No Auto Interest Charges for this Account")),
-            G_CALLBACK (gnc_recn_interest_xfer_no_auto_clicked_cb),
-            (gpointer) data );
-
-    /* no currency frame */
-    gnc_xfer_dialog_toggle_currency_table (data->xferData, FALSE);
-
-    /* set the reconcile date for the transaction date */
-    gnc_xfer_dialog_set_date (data->xferData, data->date);
-
-    /* Now run the transfer dialog.  This blocks until done.
-     * If the user hit Cancel, make the button clickable so that
-     * the user can retry if they want.  We don't make the button
-     * clickable if they successfully entered a transaction, since
-     * the fact that the button was clickable again might make
-     * the user think that the transaction didn't actually go through.
-     */
-    if (!gnc_xfer_dialog_run_until_done (data->xferData))
-        if (data->xfer_button)
-            gtk_widget_set_sensitive (GTK_WIDGET (data->xfer_button), TRUE);
-
-    /* done with the XferDialog */
-    data->xferData = NULL;
-}
-
-
-/* Set up for the interest xfer window, run the window, and update
- * the startRecnWindow if the interest xfer changed anything that matters.
- */
-static void
-gnc_reconcile_interest_xfer_run (startRecnWindowData *data)
-{
-    GtkWidget *entry = gnc_amount_edit_gtk_entry (
-                           GNC_AMOUNT_EDIT(data->end_value));
-    gnc_numeric before = gnc_amount_edit_get_amount (
-                             GNC_AMOUNT_EDIT(data->end_value));
-    gnc_numeric after = gnc_numeric_zero();
-
-    recnInterestXferWindow (data);
-
-    /* recompute the ending balance */
-    after = xaccAccountGetBalanceAsOfDate (data->account, data->date);
-
-    /* update the ending balance in the startRecnWindow if it has changed. */
-    if ( gnc_numeric_compare (before, after))
-    {
-        if (gnc_reverse_balance (data->account))
-            after = gnc_numeric_neg (after);
-
-        gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (data->end_value), after);
-        gtk_widget_grab_focus (GTK_WIDGET (entry));
-        gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
-        data->original_value = after;
-        data->user_set_value = FALSE;
-    }
-}
-
-
-void
-gnc_start_recn2_interest_clicked_cb (GtkButton *button, startRecnWindowData *data)
-{
-    /* indicate in account that user wants
-     * an auto interest xfer for this account */
-    xaccAccountSetAutoInterestXfer (data->account, TRUE);
-
-    /* make the button unclickable since we're popping up the window */
-    if (data->xfer_button)
-        gtk_widget_set_sensitive (GTK_WIDGET (data->xfer_button), FALSE);
-
-    /* run the account window */
-    gnc_reconcile_interest_xfer_run (data);
-}
-
-
-static void
-gnc_save_reconcile_interval (Account *account, time64 statement_date)
-{
-    time64 prev_statement_date;
-    int days = 0, months = 0;
-    double seconds;
-
-    if (!xaccAccountGetReconcileLastDate (account, &prev_statement_date))
-        return;
-
-    /*
-     * Compute the number of days difference.
-     */
-    seconds = gnc_difftime (statement_date, prev_statement_date);
-    days = (int)(seconds / 60 / 60 / 24);
-
-    /*
-     * See if we need to remember days(weeks) or months.  The only trick
-     * value is 28 days which could be wither 4 weeks or 1 month.
-     */
-    if (days == 28)
-    {
-        int prev_days = 0, prev_months = 1;
-
-        /* What was it last time? */
-        xaccAccountGetReconcileLastInterval (account, &prev_months, &prev_days);
-        if (prev_months == 1)
-        {
-            months = 1;
-            days = 0;
-        }
-    }
-    else if (days > 28)
-    {
-        struct tm current, prev;
-
-        gnc_localtime_r (&statement_date, &current);
-        gnc_localtime_r (&prev_statement_date, &prev);
-        months = ((12 * current.tm_year + current.tm_mon) -
-                  (12 * prev.tm_year + prev.tm_mon));
-        days = 0;
-    }
-
-    /*
-     * Remember for next time unless it is negative.
-     */
-    if (months >= 0 && days >= 0)
-        xaccAccountSetReconcileLastInterval (account, months, days);
-}
-
-
-/********************************************************************\
- * startRecnWindow                                                  *
- *   opens up the window to prompt the user to enter the ending     *
- *   balance from bank statement                                    *
- *                                                                  *
- * NOTE: This function does not return until the user presses "Ok"  *
- *       or "Cancel"                                                *
- *                                                                  *
- * Args:   parent         - the parent of this window               *
- *         account        - the account to reconcile                *
- *         new_ending     - returns the amount for ending balance   *
- *         statement_date - returns date of the statement :)        *
- * Return: True, if the user presses "Ok", else False               *
-\********************************************************************/
-static gboolean
-startRecnWindow (GtkWidget *parent, Account *account,
-                gnc_numeric *new_ending, time64 *statement_date,
-                gboolean enable_subaccount)
-{
-    GtkWidget *dialog, *end_value, *date_value, *include_children_button;
-    GtkBuilder *builder;
-    startRecnWindowData data = { NULL };
-    gboolean auto_interest_xfer_option;
-    GNCPrintAmountInfo print_info;
-    gnc_numeric ending;
-    char *title;
-    int result;
-
-    /* Initialize the data structure that will be used for several callbacks
-     * throughout this file with the relevant info.  Some initialization is
-     * done below as well.  Note that local storage should be OK for this,
-     * since any callbacks using it will only work while the startRecnWindow
-     * is running.
-     */
-    data.account = account;
-    data.account_type = xaccAccountGetType (account);
-    data.date = *statement_date;
-
-    /* whether to have an automatic interest xfer dialog or not */
-    auto_interest_xfer_option =
-        gnc_recn_interest_xfer_get_auto_interest_xfer_allowed (account);
-
-    data.include_children = xaccAccountGetReconcileChildrenStatus (account);
-
-    ending = gnc_ui_account_get_reconciled_balance (account,
-             data.include_children);
-    print_info = gnc_account_print_info (account, TRUE);
-
-    /*
-     * Do not reverse the balance here.  It messes up the math in the
-     * reconciliation window.  Also, the balance should show up as a
-     * positive number in the reconciliation window to match the positive
-     * number that shows in the register window.
-     */
-
-    /* Create the dialog box */
-    builder = gtk_builder_new();
-    gnc_builder_add_from_file (builder, "window-reconcile.glade", "Reconcile Start Dialog");
-
-    dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Reconcile Start Dialog"));
-
-    title = gnc_recn_make_window_name (account);
-    gtk_window_set_title (GTK_WINDOW (dialog), title);
-    g_free (title);
-
-    data.startRecnWindow = GTK_WIDGET (dialog);
-
-    if (parent != NULL)
-        gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
-
-    {
-        GtkWidget *start_value, *box;
-        GtkWidget *entry, *label;
-        GtkWidget *interest = NULL;
-
-        start_value = GTK_WIDGET (gtk_builder_get_object (builder, "start_value"));
-        gtk_label_set_text (GTK_LABEL(start_value), xaccPrintAmount (ending, print_info));
-
-        include_children_button = GTK_WIDGET (gtk_builder_get_object (builder, "subaccount_check"));
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (include_children_button),
-                                     data.include_children);
-        gtk_widget_set_sensitive (include_children_button, enable_subaccount);
-
-        date_value = gnc_date_edit_new (*statement_date, FALSE, FALSE);
-        data.date_value = date_value;
-        box = GTK_WIDGET (gtk_builder_get_object (builder, "date_value_box"));
-        gtk_box_pack_start (GTK_BOX (box), date_value, TRUE, TRUE, 0);
-        label = GTK_WIDGET (gtk_builder_get_object (builder, "date_label"));
-        gnc_date_make_mnemonic_target (GNC_DATE_EDIT (date_value), label);
-
-        end_value = gnc_amount_edit_new ();
-        data.end_value = GNC_AMOUNT_EDIT (end_value);
-        data.original_value = *new_ending;
-        data.user_set_value = FALSE;
-        box = GTK_WIDGET (gtk_builder_get_object (builder, "ending_value_box"));
-        gtk_box_pack_start (GTK_BOX (box), end_value, TRUE, TRUE, 0);
-        label = GTK_WIDGET (gtk_builder_get_object (builder, "end_label"));
-        gtk_label_set_mnemonic_widget (GTK_LABEL (label), end_value);
-
-        gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, &data);
-
-        gnc_date_activates_default (GNC_DATE_EDIT (date_value), TRUE);
-
-        /* need to get a callback on date changes to update the recn balance */
-        g_signal_connect ( G_OBJECT (date_value), "date_changed",
-                           G_CALLBACK (gnc_start_recn2_date_changed), (gpointer) &data );
-
-        print_info.use_symbol = 0;
-        gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (end_value), print_info);
-        gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (end_value),
-                                      xaccAccountGetCommoditySCU (account));
-
-        gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (end_value), *new_ending);
-
-        entry = gnc_amount_edit_gtk_entry (GNC_AMOUNT_EDIT (end_value));
-        gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
-        g_signal_connect (G_OBJECT (entry), "focus-out-event",
-                         G_CALLBACK (gnc_start_recn2_update_cb), (gpointer) &data);
-        gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
-
-        /* if it's possible to enter an interest payment or charge for this
-         * account, add a button so that the user can pop up the appropriate
-         * dialog if it isn't automatically popping up.
-         */
-        interest = GTK_WIDGET(gtk_builder_get_object (builder, "interest_button"));
-        if ( account_type_has_auto_interest_payment( data.account_type ) )
-            gtk_button_set_label (GTK_BUTTON (interest), _("Enter _Interest Payment...") );
-        else if ( account_type_has_auto_interest_charge( data.account_type ) )
-            gtk_button_set_label (GTK_BUTTON (interest), _("Enter _Interest Charge...") );
-        else
-        {
-            gtk_widget_destroy (interest);
-            interest = NULL;
-        }
-
-        if ( interest )
-        {
-            data.xfer_button = interest;
-            if ( auto_interest_xfer_option )
-                gtk_widget_set_sensitive (GTK_WIDGET (interest), FALSE);
-        }
-
-        gtk_widget_show_all (dialog);
-
-        gtk_widget_grab_focus(gnc_amount_edit_gtk_entry
-                              (GNC_AMOUNT_EDIT (end_value)));
-    }
-
-    /* Allow the user to enter an interest payment
-     * or charge prior to reconciling */
-    if (account_type_has_auto_interest_xfer (data.account_type)
-            && auto_interest_xfer_option)
-    {
-        gnc_reconcile_interest_xfer_run (&data);
-    }
-
-    result = gtk_dialog_run (GTK_DIALOG (dialog));
-    if (result == GTK_RESPONSE_OK)
-    {
-        *new_ending = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (end_value));
-        *statement_date = gnc_date_edit_get_date_end (GNC_DATE_EDIT (date_value));
-
-        if (gnc_reverse_balance (account))
-            *new_ending = gnc_numeric_neg (*new_ending);
-
-        xaccAccountSetReconcileChildrenStatus (account, data.include_children);
-
-        gnc_save_reconcile_interval (account, *statement_date);
-    }
-    gtk_widget_destroy (dialog);
-    g_object_unref (G_OBJECT (builder));
-
-    return (result == GTK_RESPONSE_OK);
-}
-
-
-static void
-gnc_reconcile_window_set_sensitivity (RecnWindow2 *recnData)
-{
-    gboolean sensitive = FALSE;
-    GNCReconcileView *view;
-    GtkAction *action;
-
-    view = GNC_RECONCILE_VIEW (recnData->debit);
-    if (gnc_reconcile_view_num_selected (view) == 1)
-        sensitive = TRUE;
-
-    view = GNC_RECONCILE_VIEW (recnData->credit);
-    if (gnc_reconcile_view_num_selected (view) == 1)
-        sensitive = TRUE;
-
-    action = gtk_action_group_get_action (recnData->action_group,
-                                          "TransEditAction");
-    gtk_action_set_sensitive (action, sensitive);
-    action = gtk_action_group_get_action (recnData->action_group,
-                                          "TransDeleteAction");
-    gtk_action_set_sensitive (action, sensitive);
-
-    sensitive = FALSE;
-
-    view = GNC_RECONCILE_VIEW (recnData->debit);
-    if (gnc_reconcile_view_num_selected (view) > 0)
-        sensitive = TRUE;
-
-    view = GNC_RECONCILE_VIEW (recnData->credit);
-    if (gnc_reconcile_view_num_selected (view) > 0)
-        sensitive = TRUE;
-
-    action = gtk_action_group_get_action (recnData->action_group,
-                                          "TransRecAction");
-    gtk_action_set_sensitive (action, sensitive);
-    action = gtk_action_group_get_action (recnData->action_group,
-                                          "TransUnRecAction");
-    gtk_action_set_sensitive (action, sensitive);
-}
-
-
-static void
-gnc_reconcile_window_toggled_cb (GNCReconcileView *view, Split *split,
-                             gpointer data)
-{
-    RecnWindow2 *recnData = data;
-    gnc_reconcile_window_set_sensitivity (recnData);
-    recnRecalculateBalance (recnData);
-}
-
-
-static void
-gnc_reconcile_window_row_cb (GNCReconcileView *view, gpointer item,
-                             gpointer data)
-{
-    RecnWindow2 *recnData = data;
-    gnc_reconcile_window_set_sensitivity (recnData);
-}
-
-
-/** Popup a contextual menu.  This function ends up being called when
- *  the user right-clicks in the context of a window, or uses the
- *  keyboard context-menu request key combination (Shift-F10 by
- *  default).
- *
- *  @param recnData This is a data structure describing the
- *  Reconciliation Window.
- *
- *  @param event The event parameter passed to the "button-press"
- *  callback.  May be null if there was no event (aka keyboard
- *  request).
- */
-static void
-do_popup_menu (RecnWindow2 *recnData, GdkEventButton *event)
-{
-    GtkWidget *menu;
-    int button, event_time;
-
-    menu = gtk_ui_manager_get_widget (recnData->ui_merge, "/MainPopup");
-    if (!menu)
-    {
-        return;
-    }
-
-    if (event)
-    {
-        button = event->button;
-        event_time = event->time;
-    }
-    else
-    {
-        button = 0;
-        event_time = gtk_get_current_event_time ();
-    }
-
-    gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, button, event_time);
-}
-
-
-/** Callback function invoked when the user requests that Gnucash
- *  popup the contextual menu via the keyboard context-menu request
- *  key combination (Shift-F10 by default).
- *
- *  @param recnData This is a data structure describing the
- *  Reconciliation Window.
- *
- *  @param widget Whatever widget had focus when the user issued the
- *  keyboard context-menu request.
- *
- *  @return Always returns TRUE to indicate that the menu request was
- *  handled.
- */
-static gboolean
-gnc_reconcile_window_popup_menu_cb (GtkWidget *widget,
-                                    RecnWindow2 *recnData)
-{
-    do_popup_menu (recnData, NULL);
-    return TRUE;
-}
-
-
-/*  Callback function invoked when the user clicks in the content of
- *  any Gnucash window.  If this was a "right-click" then Gnucash will
- *  popup the contextual menu.
- */
-static gboolean
-gnc_reconcile_window_button_press_cb (GtkWidget *widget,
-                                      GdkEventButton *event,
-                                      RecnWindow2 *recnData)
-{
-    GNCQueryView      *qview = GNC_QUERY_VIEW (widget);
-    GtkTreeModel      *model;
-    GtkTreeSelection  *selection;
-    GtkTreePath       *path;
-
-    model = gtk_tree_view_get_model (GTK_TREE_VIEW (qview));
-
-    if (event->button == 3 && event->type == GDK_BUTTON_PRESS)
-    {
-
-        /* Get tree path for row that was clicked */
-        gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (qview),
-                                             (gint) event->x, 
-                                             (gint) event->y,
-                                             &path, NULL, NULL, NULL);
-
-        selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (qview));
-        gtk_tree_selection_select_path (selection, path);
-        gtk_tree_path_free (path);
-        do_popup_menu (recnData, event);
-        return TRUE;
-    }
-    return FALSE;
-}
-
-
-static GNCSplitReg2 *
-gnc_reconcile_window_open_register (RecnWindow2 *recnData)
-{
-    Account *account = recn_get_account (recnData);
-    GncPluginPage *page;
-    GNCSplitReg2 *gsr;
-    gboolean include_children;
-
-    if (!account)
-        return(NULL);
-
-    include_children = xaccAccountGetReconcileChildrenStatus (account);
-    page = gnc_plugin_page_register2_new (account, include_children);
-    gnc_main_window_open_page (NULL, page);
-    gsr = gnc_plugin_page_register2_get_gsr (page);
-    gnc_split_reg2_raise (gsr);
-    return gsr;
-}
-
-
-static void
-gnc_reconcile_window_double_click_cb (GNCReconcileView *view, Split *split,
-                                     gpointer data)
-{
-    RecnWindow2 *recnData = data;
-    GNCSplitReg2 *gsr;
-
-    /* This should never be true, but be paranoid */
-    if (split == NULL)
-        return;
-
-    gsr = gnc_reconcile_window_open_register (recnData);
-    if (gsr == NULL)
-        return;
-    gnc_split_reg2_jump_to_split (gsr, split);
-}
-
-
-static void
-gnc_reconcile_window_focus_cb (GtkWidget *widget, GdkEventFocus *event,
-                              gpointer data)
-{
-    RecnWindow2 *recnData = data;
-    GNCReconcileView *this_view, *other_view;
-    GNCReconcileView *debit, *credit;
-
-    this_view = GNC_RECONCILE_VIEW (widget);
-
-    debit  = GNC_RECONCILE_VIEW (recnData->debit);
-    credit = GNC_RECONCILE_VIEW (recnData->credit);
-
-    other_view = GNC_RECONCILE_VIEW (this_view == debit ? credit : debit);
-
-    /* clear the *other* list so we always have no more than one selection */
-    gnc_reconcile_view_unselect_all (other_view);
-}
-
-
-static gboolean
-gnc_reconcile_key_press_cb (GtkWidget *widget, GdkEventKey *event,
-                            gpointer data)
-{
-    RecnWindow2 *recnData = data;
-    GtkWidget *this_view, *other_view;
-    GtkWidget *debit, *credit;
-
-    switch (event->keyval)
-    {
-    case GDK_Tab:
-    case GDK_ISO_Left_Tab:
-        break;
-
-    default:
-        return FALSE;
-    }
-
-    g_signal_stop_emission_by_name (widget, "key_press_event");
-
-    this_view = widget;
-
-    debit  = recnData->debit;
-    credit = recnData->credit;
-
-    other_view = (this_view == debit ? credit : debit);
-
-    gtk_widget_grab_focus (other_view);
-
-    return TRUE;
-}
-
-
-static void
-gnc_reconcile_window_set_titles (RecnWindow2 *recnData)
-{
-    gboolean formal;
-    gchar *title;
-
-    formal = gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_ACCOUNTING_LABELS);
-
-    if (formal)
-        title = _("Debits");
-    else
-        title = gnc_get_debit_string (ACCT_TYPE_NONE);
-
-    gtk_frame_set_label (GTK_FRAME (recnData->debit_frame), title);
-
-    if (!formal)
-        g_free(title);
-
-    if (formal)
-        title = _("Credits");
-    else
-        title = gnc_get_credit_string (ACCT_TYPE_NONE);
-
-    gtk_frame_set_label (GTK_FRAME (recnData->credit_frame), title);
-
-    if (!formal)
-        g_free(title);
-}
-
-
-static GtkWidget *
-gnc_reconcile_window_create_view_box (Account *account,
-                                     GNCReconcileViewType type,
-                                     RecnWindow2 *recnData,
-                                     GtkWidget **list_save,
-                                     GtkWidget **total_save)
-{
-    GtkWidget *frame, *scrollWin, *view, *vbox, *label, *hbox;
-
-    frame = gtk_frame_new (NULL);
-
-    if (type == RECLIST_DEBIT)
-        recnData->debit_frame = frame;
-    else
-        recnData->credit_frame = frame;
-
-    vbox = gtk_vbox_new (FALSE, 5);
-
-    view = gnc_reconcile_view_new(account, type, recnData->statement_date);
-    *list_save = view;
-
-    g_signal_connect (view, "toggle_reconciled",
-                     G_CALLBACK (gnc_reconcile_window_toggled_cb),
-                     recnData);
-    g_signal_connect (view, "line_selected",
-                     G_CALLBACK (gnc_reconcile_window_row_cb),
-                     recnData);
-    g_signal_connect (view, "button_press_event",
-                     G_CALLBACK (gnc_reconcile_window_button_press_cb),
-                     recnData);
-    g_signal_connect (view, "double_click_split",
-                     G_CALLBACK (gnc_reconcile_window_double_click_cb),
-                     recnData);
-    g_signal_connect (view, "focus_in_event",
-                     G_CALLBACK (gnc_reconcile_window_focus_cb),
-                     recnData);
-    g_signal_connect (view, "key_press_event",
-                     G_CALLBACK (gnc_reconcile_key_press_cb),
-                     recnData);
-
-    scrollWin = gtk_scrolled_window_new (NULL, NULL);
-    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrollWin),
-                                   GTK_POLICY_AUTOMATIC,
-                                   GTK_POLICY_AUTOMATIC);
-    gtk_container_set_border_width (GTK_CONTAINER (scrollWin), 5);
-
-    gtk_container_add (GTK_CONTAINER (frame), scrollWin);
-    gtk_container_add (GTK_CONTAINER (scrollWin), view);
-    gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
-
-    hbox = gtk_hbox_new (FALSE, 5);
-    gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
-
-    label = gtk_label_new (_("Total:"));
-    gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
-    gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
-
-    label = gtk_label_new("");
-    gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
-    *total_save = label;
-
-    return vbox;
-}
-
-
-static Split *
-gnc_reconcile_window_get_current_split (RecnWindow2 *recnData)
-{
-    GNCReconcileView *view;
-    Split *split;
-
-    view = GNC_RECONCILE_VIEW (recnData->debit);
-    split = gnc_reconcile_view_get_current_split (view);
-    if (split != NULL)
-        return split;
-
-    view = GNC_RECONCILE_VIEW (recnData->credit);
-    split = gnc_reconcile_view_get_current_split (view);
-
-    return split;
-}
-
-
-static void
-gnc_ui_reconcile_window_help_cb (GtkWidget *widget, gpointer data)
-{
-    gnc_gnome_help (HF_HELP, HL_RECNWIN);
-}
-
-
-static void
-gnc_ui_reconcile_window_change_cb (GtkAction *action, gpointer data)
-{
-    RecnWindow2 *recnData = data;
-    Account *account = recn_get_account (recnData);
-    gnc_numeric new_ending = recnData->new_ending;
-    time64 statement_date = recnData->statement_date;
-
-    if (gnc_reverse_balance (account))
-        new_ending = gnc_numeric_neg (new_ending);
-    if (startRecnWindow (recnData->window, account, &new_ending, &statement_date,
-                         FALSE))
-    {
-        recnData->new_ending = new_ending;
-        recnData->statement_date = statement_date;
-        recnRecalculateBalance (recnData);
-    }
-}
-
-
-static void
-gnc_ui_reconcile_window_balance_cb (GtkButton *button, gpointer data)
-{
-    RecnWindow2 *recnData = data;
-    GNCSplitReg2 *gsr;
-    Account *account;
-    gnc_numeric balancing_amount;
-    time64 statement_date;
-
-
-    gsr = gnc_reconcile_window_open_register (recnData);
-    if (gsr == NULL)
-        return;
-
-    account = recn_get_account (recnData);
-    if (account == NULL)
-        return;
-
-    balancing_amount = recnRecalculateBalance (recnData);
-    if (gnc_numeric_zero_p (balancing_amount))
-        return;
-
-    statement_date = recnData->statement_date;
-    if (statement_date == 0)
-        statement_date = gnc_time (NULL); // default to 'now'
-
-    gnc_split_reg2_balancing_entry (gsr, account, statement_date, balancing_amount);
-}
-
-
-static void
-gnc_ui_reconcile_window_rec_cb (GtkButton *button, gpointer data)
-{
-    RecnWindow2 *recnData = data;
-    GNCReconcileView *debit, *credit;
-
-    debit  = GNC_RECONCILE_VIEW (recnData->debit);
-    credit = GNC_RECONCILE_VIEW (recnData->credit);
-
-    gnc_reconcile_view_set_list (debit, TRUE);
-    gnc_reconcile_view_set_list (credit, TRUE);
-}
-
-
-static void
-gnc_ui_reconcile_window_unrec_cb(GtkButton *button, gpointer data)
-{
-    RecnWindow2 *recnData = data;
-    GNCReconcileView *debit, *credit;
-
-    debit  = GNC_RECONCILE_VIEW (recnData->debit);
-    credit = GNC_RECONCILE_VIEW (recnData->credit);
-
-    gnc_reconcile_view_set_list (debit, FALSE);
-    gnc_reconcile_view_set_list (credit, FALSE);
-}
-
-
-static void
-gnc_ui_reconcile_window_delete_cb (GtkButton *button, gpointer data)
-{
-    RecnWindow2 *recnData = data;
-    Transaction *trans;
-    Split *split;
-
-    split = gnc_reconcile_window_get_current_split (recnData);
-    /* This should never be true, but be paranoid */
-    if (split == NULL)
-        return;
-
-    {
-        const char *message = _("Are you sure you want to delete the selected "
-                                "transaction?");
-        gboolean result;
-
-        result = gnc_verify_dialog (recnData->window, FALSE, "%s", message);
-
-        if (!result)
-            return;
-    }
-
-    gnc_suspend_gui_refresh ();
-
-    trans = xaccSplitGetParent (split);
-    xaccTransDestroy (trans);
-
-    gnc_resume_gui_refresh ();
-}
-
-
-static void
-gnc_ui_reconcile_window_edit_cb (GtkButton *button, gpointer data)
-{
-    RecnWindow2 *recnData = data;
-    GNCSplitReg2 *gsr;
-    Split *split;
-
-    split = gnc_reconcile_window_get_current_split (recnData);
-    /* This should never be true, but be paranoid */
-    if (split == NULL)
-        return;
-
-    gsr = gnc_reconcile_window_open_register (recnData);
-    if (gsr == NULL)
-        return;
-    gnc_split_reg2_jump_to_split_amount (gsr, split);
-}
-
-
-static char *
-gnc_recn_make_window_name (Account *account)
-{
-    char *fullname;
-    char *title;
-
-    fullname = gnc_account_get_full_name (account);
-    title = g_strconcat (fullname, " - ", _("Reconcile"), NULL);
-
-    g_free (fullname);
-
-    return title;
-}
-
-
-static void
-gnc_recn_set_window_name (RecnWindow2 *recnData)
-{
-    char *title;
-
-    title = gnc_recn_make_window_name (recn_get_account (recnData));
-
-    gtk_window_set_title (GTK_WINDOW (recnData->window), title);
-
-    g_free (title);
-}
-
-
-static void
-gnc_recn_edit_account_cb (GtkAction *action, gpointer data)
-{
-    RecnWindow2 *recnData = data;
-    Account *account = recn_get_account (recnData);
-
-    if (account == NULL)
-        return;
-
-    gnc_ui_edit_account_window (account);
-}
-
-
-static void
-gnc_recn_xfer_cb (GtkAction *action, gpointer data)
-{
-    RecnWindow2 *recnData = data;
-    Account *account = recn_get_account (recnData);
-
-    if (account == NULL)
-        return;
-
-    gnc_xfer_dialog (recnData->window, account);
-}
-
-
-static void
-gnc_recn_scrub_cb (GtkAction *action, gpointer data)
-{
-    RecnWindow2 *recnData = data;
-    Account *account = recn_get_account (recnData);
-
-    if (account == NULL)
-        return;
-
-    gnc_suspend_gui_refresh ();
-
-    xaccAccountTreeScrubOrphans (account);
-    xaccAccountTreeScrubImbalance (account);
-
-    // XXX: Lots are disabled.
-    if (g_getenv("GNC_AUTO_SCRUB_LOTS") != NULL)
-        xaccAccountTreeScrubLots(account);
-
-    gnc_resume_gui_refresh ();
-}
-
-
-static void
-gnc_recn_open_cb (GtkAction *action, gpointer data)
-{
-    RecnWindow2 *recnData = data;
-
-    gnc_reconcile_window_open_register (recnData);
-}
-
-
-static void
-gnc_get_reconcile_info (Account *account,
-                        gnc_numeric *new_ending,
-                        time64 *statement_date)
-{
-    gboolean always_today;
-    GDate date;
-    time64 today;
-    struct tm tm;
-
-    g_date_clear(&date, 1);
-
-    always_today = gnc_prefs_get_bool (GNC_PREFS_GROUP_RECONCILE, GNC_PREF_ALWAYS_REC_TO_TODAY);
-
-    if (!always_today &&
-            xaccAccountGetReconcileLastDate (account, statement_date))
-    {
-        int months = 1, days = 0;
-
-        gnc_gdate_set_time64 (&date, *statement_date);
-
-        xaccAccountGetReconcileLastInterval (account, &months, &days);
-
-        if (months)
-        {
-            gboolean was_last_day_of_month = g_date_is_last_of_month (&date);
-
-            g_date_add_months (&date, months);
-
-            /* Track last day of the month, i.e. 1/31 -> 2/28 -> 3/31 */
-            if (was_last_day_of_month)
-            {
-                g_date_set_day (&date, g_date_get_days_in_month (g_date_get_month (&date),
-                               g_date_get_year (&date)));
-            }
-        }
-        else
-        {
-            g_date_add_days (&date, days);
-        }
-
-	*statement_date = gnc_time64_get_day_end_gdate (&date);
-
-        today = gnc_time64_get_day_end (gnc_time (NULL));
-        if (*statement_date > today)
-            *statement_date = today;
-    }
-
-    xaccAccountGetReconcilePostponeDate (account, statement_date);
-
-    if (xaccAccountGetReconcilePostponeBalance (account, new_ending))
-    {
-        if (gnc_reverse_balance (account))
-            *new_ending = gnc_numeric_neg (*new_ending);
-    }
-    else
-    {
-        /* if the account wasn't previously postponed, try to predict
-         * the statement balance based on the statement date.
-         */
-        *new_ending =
-            gnc_ui_account_get_balance_as_of_date
-            (account, *statement_date,
-             xaccAccountGetReconcileChildrenStatus (account));
-    }
-}
-
-
-static gboolean
-find_by_account (gpointer find_data, gpointer user_data)
-{
-    Account *account = find_data;
-    RecnWindow2 *recnData = user_data;
-
-    if (!recnData)
-        return FALSE;
-
-    return guid_equal (&recnData->account, xaccAccountGetGUID (account));
-}
-
-
-static void
-recn_set_watches_one_account (gpointer data, gpointer user_data)
-{
-    Account *account = (Account *)data;
-    RecnWindow2 *recnData = (RecnWindow2 *)user_data;
-    GList *node;
-
-    for (node = xaccAccountGetSplitList (account); node; node = node->next)
-    {
-        Split *split = node->data;
-        Transaction *trans;
-        char recn;
-
-        recn = xaccSplitGetReconcile (split);
-        switch (recn)
-        {
-        case NREC:
-        case CREC:
-            trans = xaccSplitGetParent (split);
-
-            gnc_gui_component_watch_entity (recnData->component_id,
-                                            xaccTransGetGUID (trans),
-                                            QOF_EVENT_MODIFY
-                                            | QOF_EVENT_DESTROY
-                                            | GNC_EVENT_ITEM_CHANGED);
-            break;
-
-        default:
-            break;
-        }
-    }
-}
-
-
-static void
-recn_set_watches (RecnWindow2 *recnData)
-{
-    gboolean include_children;
-    Account *account;
-    GList *accounts = NULL;
-
-    gnc_gui_component_clear_watches (recnData->component_id);
-
-    gnc_gui_component_watch_entity (recnData->component_id,
-                                    &recnData->account,
-                                    QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
-
-    account = recn_get_account (recnData);
-
-    include_children = xaccAccountGetReconcileChildrenStatus (account);
-    if (include_children)
-        accounts = gnc_account_get_descendants (account);
-
-    /* match the account */
-    accounts = g_list_prepend (accounts, account);
-
-    g_list_foreach (accounts, recn_set_watches_one_account, recnData);
-
-    g_list_free (accounts);
-}
-
-
-static void
-refresh_handler (GHashTable *changes, gpointer user_data)
-{
-    RecnWindow2 *recnData = user_data;
-    const EventInfo *info;
-    Account *account;
-
-    account = recn_get_account (recnData);
-    if (!account)
-    {
-        gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
-        return;
-    }
-
-    if (changes)
-    {
-        info = gnc_gui_get_entity_events (changes, &recnData->account);
-        if (info && (info->event_mask & QOF_EVENT_DESTROY))
-        {
-            gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
-            return;
-        }
-    }
-
-    gnc_reconcile_window_set_titles (recnData);
-    recn_set_watches (recnData);
-
-    recnRefresh (recnData);
-}
-
-
-static void
-close_handler (gpointer user_data)
-{
-    RecnWindow2 *recnData = user_data;
-
-    gnc_save_window_size (GNC_PREFS_GROUP_RECONCILE, GTK_WINDOW (recnData->window));
-    gtk_widget_destroy (recnData->window);
-}
-
-
-/********************************************************************\
- * recnWindow2                                                       *
- *   opens up the window to reconcile an account                    *
- *                                                                  *
- * Args:   parent  - the parent of this window                      *
- *         account - the account to reconcile                       *
- * Return: recnData - the instance of this RecnWindow2               *
-\********************************************************************/
-RecnWindow2 *
-recnWindow2 (GtkWidget *parent, Account *account)
-{
-    gnc_numeric new_ending;
-    time64 statement_date;
-
-    if (account == NULL)
-        return NULL;
-
-    /* The last time reconciliation was attempted during the current
-     * execution of gnucash, the date was stored. Use that date if
-     * possible. This helps with balancing multiple accounts for which
-     * statements are issued at the same time, like multiple bank
-     * accounts on a single statement. */
-    if (!gnc_reconcile_last_statement_date)
-        statement_date = gnc_time (NULL);
-    else
-        statement_date = gnc_reconcile_last_statement_date;
-
-    gnc_get_reconcile_info (account, &new_ending, &statement_date);
-
-    /* Popup a little window to prompt the user to enter the
-     * ending balance for his/her bank statement */
-    if (!startRecnWindow (parent, account, &new_ending, &statement_date, TRUE))
-        return NULL;
-
-    return recnWindow2WithBalance (parent, account, new_ending, statement_date);
-}
-
-
-static void
-recnWindow2_add_widget (GtkUIManager *merge,
-                       GtkWidget *widget,
-                       GtkVBox *dock)
-{
-    gtk_box_pack_start (GTK_BOX (dock), widget, FALSE, FALSE, 0);
-    gtk_widget_show (widget);
-}
-
-
-/********************************************************************\
- * recnWindow2WithBalance
- *
- *   Opens up the window to reconcile an account, but with ending
- *   balance and statement date already given.
- *
- * Args:   parent         - The parent widget of the new window
- *         account        - The account to reconcile
- *         new_ending     - The amount for ending balance
- *         statement_date - The date of the statement
- * Return: recnData - the instance of this RecnWindow2
-\********************************************************************/
-RecnWindow2 *
-recnWindow2WithBalance (GtkWidget *parent, Account *account,
-                       gnc_numeric new_ending, time64 statement_date)
-{
-    RecnWindow2 *recnData;
-    GtkWidget *statusbar;
-    GtkWidget *vbox;
-    GtkWidget *dock;
-
-    if (account == NULL)
-        return NULL;
-
-    recnData = gnc_find_first_gui_component (WINDOW_RECONCILE_CM_CLASS,
-               find_by_account, account);
-    if (recnData)
-        return recnData;
-
-    recnData = g_new0 (RecnWindow2, 1);
-
-    recnData->account = *xaccAccountGetGUID (account);
-
-
-    recnData->component_id =
-        gnc_register_gui_component (WINDOW_RECONCILE_CM_CLASS,
-                                    refresh_handler, close_handler,
-                                    recnData);
-
-    recn_set_watches (recnData);
-
-    gnc_reconcile_last_statement_date = statement_date;
-
-    recnData->new_ending = new_ending;
-    recnData->statement_date = statement_date;
-    recnData->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-    recnData->delete_refresh = FALSE;
-
-    gnc_recn_set_window_name (recnData);
-
-    vbox = gtk_vbox_new (FALSE, 0);
-    gtk_container_add (GTK_CONTAINER(recnData->window), vbox);
-
-    dock = gtk_vbox_new (FALSE, 0);
-    gtk_widget_show (dock);
-    gtk_box_pack_start (GTK_BOX (vbox), dock, FALSE, TRUE, 0);
-
-    {
-        gchar *filename;
-        gint merge_id;
-        GtkAction *action;
-        GtkActionGroup *action_group;
-        GError *error = NULL;
-
-        recnData->ui_merge = gtk_ui_manager_new ();
-        g_signal_connect (recnData->ui_merge, "add_widget",
-                          G_CALLBACK (recnWindow2_add_widget), dock);
-
-        action_group = gtk_action_group_new ("ReconcileWindowActions");
-        recnData->action_group = action_group;
-        gnc_gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE);
-        gtk_action_group_add_actions (action_group, recnWindow2_actions,
-                                      recnWindow2_n_actions, recnData);
-        action =
-            gtk_action_group_get_action (action_group, "AccountOpenAccountAction");
-        g_object_set (G_OBJECT (action), "short_label", _("Open"), NULL);
-
-        gtk_ui_manager_insert_action_group (recnData->ui_merge, action_group, 0);
-
-        filename = gnc_filepath_locate_ui_file("gnc-reconcile-window-ui.xml");
-        /* Can't do much without a ui. */
-        g_assert (filename);
-
-        merge_id = gtk_ui_manager_add_ui_from_file (recnData->ui_merge,
-                   filename, &error);
-        g_assert(merge_id || error);
-        if (merge_id)
-        {
-            gtk_window_add_accel_group (GTK_WINDOW (recnData->window),
-                                        gtk_ui_manager_get_accel_group (recnData->ui_merge));
-            gtk_ui_manager_ensure_update (recnData->ui_merge);
-        }
-        else
-        {
-            g_critical("Failed to load ui file.\n  Filename %s\n  Error %s",
-                       filename, error->message);
-            g_error_free (error);
-            g_assert (merge_id != 0);
-        }
-        g_free (filename);
-    }
-
-    g_signal_connect (recnData->window, "popup-menu",
-                     G_CALLBACK (gnc_reconcile_window_popup_menu_cb), recnData);
-
-    statusbar = gtk_statusbar_new ();
-    gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (statusbar), TRUE);
-    gtk_box_pack_end (GTK_BOX (vbox), statusbar, FALSE, FALSE, 0);
-
-    g_signal_connect (recnData->window, "destroy",
-                      G_CALLBACK (recn_destroy_cb), recnData);
-    g_signal_connect (recnData->window, "delete_event",
-                      G_CALLBACK (recn_delete_cb), recnData);
-    g_signal_connect (recnData->window, "key_press_event",
-                      G_CALLBACK (recn_key_press_cb), recnData);
-
-    /* The main area */
-    {
-        GtkWidget *frame = gtk_frame_new (NULL);
-        GtkWidget *main_area = gtk_vbox_new (FALSE, 10);
-        GtkWidget *debcred_area = gtk_table_new (1, 2, TRUE);
-        GtkWidget *debits_box;
-        GtkWidget *credits_box;
-
-        gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 10);
-
-        /* Force a reasonable starting size */
-        gtk_window_set_default_size (GTK_WINDOW (recnData->window), 800, 600);
-        gnc_restore_window_size (GNC_PREFS_GROUP_RECONCILE, GTK_WINDOW (recnData->window));
-
-        gtk_container_add(GTK_CONTAINER(frame), main_area);
-        gtk_container_set_border_width(GTK_CONTAINER(main_area), 10);
-
-        debits_box = gnc_reconcile_window_create_view_box
-                     (account, RECLIST_DEBIT, recnData,
-                      &recnData->debit, &recnData->total_debit);
-
-        credits_box = gnc_reconcile_window_create_view_box
-                      (account, RECLIST_CREDIT, recnData,
-                       &recnData->credit, &recnData->total_credit);
-
-        GNC_RECONCILE_VIEW (recnData->debit)->sibling = GNC_RECONCILE_VIEW (recnData->credit);
-        GNC_RECONCILE_VIEW (recnData->credit)->sibling = GNC_RECONCILE_VIEW (recnData->debit);
-
-        gtk_box_pack_start (GTK_BOX (main_area), debcred_area, 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;
-            GtkWidget *totals_hbox, *frame, *title, *value;
-
-            /* lower horizontal bar below reconcile lists */
-            hbox = gtk_hbox_new (FALSE, 5);
-            gtk_box_pack_start (GTK_BOX (main_area), hbox, FALSE, FALSE, 0);
-
-            /* frame to hold totals */
-            frame = gtk_frame_new (NULL);
-            gtk_box_pack_end (GTK_BOX (hbox), frame, FALSE, FALSE, 0);
-
-            /* hbox to hold title/value vboxes */
-            totals_hbox = gtk_hbox_new (FALSE, 3);
-            gtk_container_add (GTK_CONTAINER (frame), totals_hbox);
-            gtk_container_set_border_width (GTK_CONTAINER (totals_hbox), 5);
-
-            /* vbox to hold titles */
-            title_vbox = gtk_vbox_new (FALSE, 3);
-            gtk_box_pack_start (GTK_BOX (totals_hbox), title_vbox, FALSE, FALSE, 0);
-
-            /* vbox to hold values */
-            value_vbox = gtk_vbox_new (FALSE, 3);
-            gtk_box_pack_start (GTK_BOX (totals_hbox), value_vbox, TRUE, TRUE, 0);
-
-            /* statement date title/value */
-            title = gtk_label_new (_("Statement Date:"));
-            gtk_misc_set_alignment (GTK_MISC (title), 1.0, 0.5);
-            gtk_box_pack_start (GTK_BOX (title_vbox), title, FALSE, FALSE, 0);
-
-            value = gtk_label_new ("");
-            recnData->recn_date = value;
-            gtk_misc_set_alignment (GTK_MISC (value), 1.0, 0.5);
-            gtk_box_pack_start (GTK_BOX (value_vbox), value, FALSE, FALSE, 0);
-
-            /* starting balance title/value */
-            title = gtk_label_new(_("Starting Balance:"));
-            gtk_misc_set_alignment (GTK_MISC (title), 1.0, 0.5);
-            gtk_box_pack_start (GTK_BOX (title_vbox), title, FALSE, FALSE, 3);
-
-            value = gtk_label_new ("");
-            recnData->starting = value;
-            gtk_misc_set_alignment (GTK_MISC (value), 1.0, 0.5);
-            gtk_box_pack_start (GTK_BOX (value_vbox), value, FALSE, FALSE, 3);
-
-            /* ending balance title/value */
-            title = gtk_label_new (_("Ending Balance:"));
-            gtk_misc_set_alignment (GTK_MISC (title), 1.0, 0.5);
-            gtk_box_pack_start (GTK_BOX (title_vbox), title, FALSE, FALSE, 0);
-
-            value = gtk_label_new ("");
-            recnData->ending = value;
-            gtk_misc_set_alignment (GTK_MISC (value), 1.0, 0.5);
-            gtk_box_pack_start (GTK_BOX (value_vbox), value, FALSE, FALSE, 0);
-
-            /* reconciled balance title/value */
-            title = gtk_label_new (_("Reconciled Balance:"));
-            gtk_misc_set_alignment (GTK_MISC (title), 1.0, 0.5);
-            gtk_box_pack_start (GTK_BOX (title_vbox), title, FALSE, FALSE, 0);
-
-            value = gtk_label_new ("");
-            recnData->reconciled = value;
-            gtk_misc_set_alignment (GTK_MISC (value), 1.0, 0.5);
-            gtk_box_pack_start (GTK_BOX (value_vbox), value, FALSE, FALSE, 0);
-
-            /* difference title/value */
-            title = gtk_label_new (_("Difference:"));
-            gtk_misc_set_alignment(GTK_MISC (title), 1.0, 0.5);
-            gtk_box_pack_start (GTK_BOX (title_vbox), title, FALSE, FALSE, 0);
-
-            value = gtk_label_new ("");
-            recnData->difference = value;
-            gtk_misc_set_alignment (GTK_MISC (value), 1.0, 0.5);
-            gtk_box_pack_start (GTK_BOX (value_vbox), value, FALSE, FALSE, 0);
-        }
-
-        /* Set up the data */
-        recnRefresh (recnData);
-    }
-
-    /* Allow resize */
-    gtk_window_set_resizable (GTK_WINDOW (recnData->window), TRUE);
-
-    gtk_widget_show_all (recnData->window);
-
-    gnc_reconcile_window_set_titles (recnData);
-
-    recnRecalculateBalance (recnData);
-
-    gnc_window_adjust_for_screen (GTK_WINDOW (recnData->window));
-
-    /* Set the sort orders of the debit and credit tree views */
-    gnc_query_sort_order (GNC_QUERY_VIEW (recnData->debit), 1, GTK_SORT_ASCENDING);
-    gnc_query_sort_order (GNC_QUERY_VIEW (recnData->credit), 1, GTK_SORT_ASCENDING);
-
-    gtk_widget_grab_focus (recnData->debit);
-
-    return recnData;
-}
-
-
-/********************************************************************\
- * gnc_ui_reconile_window2_raise                                     *
- *   shows and raises an account editing window                     *
- *                                                                  *
- * Args:   editAccData - the edit window structure                  *
-\********************************************************************/
-void
-gnc_ui_reconcile_window2_raise (RecnWindow2 * recnData)
-{
-    if (recnData == NULL)
-        return;
-
-    if (recnData->window == NULL)
-        return;
-
-    gtk_window_present (GTK_WINDOW (recnData->window));
-}
-
-
-/********************************************************************\
- * recn_destroy_cb                                                  *
- *   frees memory allocated for an recnWindow2, and other cleanup    *
- *   stuff                                                          *
- *                                                                  *
- * Args:   w    - the widget that called us                         *
- *         data - the data struct for this window                   *
- * Return: none                                                     *
-\********************************************************************/
-static void
-recn_destroy_cb (GtkWidget *w, gpointer data)
-{
-    RecnWindow2 *recnData = data;
-
-    gnc_unregister_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
-
-    if (recnData->delete_refresh)
-        gnc_resume_gui_refresh ();
-
-    g_free (recnData);
-}
-
-
-static void
-recn_cancel (RecnWindow2 *recnData)
-{
-    gboolean changed = FALSE;
-
-    if (gnc_reconcile_view_changed (GNC_RECONCILE_VIEW (recnData->credit)))
-        changed = TRUE;
-    if (gnc_reconcile_view_changed (GNC_RECONCILE_VIEW (recnData->debit)))
-        changed = TRUE;
-
-    if (changed)
-    {
-        const char *message = _("You have made changes to this reconcile "
-                                "window. Are you sure you want to cancel?");
-        if (!gnc_verify_dialog(recnData->window, FALSE, "%s", message))
-            return;
-    }
-
-    gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
-}
-
-
-static gboolean
-recn_delete_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
-{
-    RecnWindow2 *recnData = data;
-
-    recn_cancel (recnData);
-    return TRUE;
-}
-
-
-static gboolean
-recn_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer data)
-{
-    RecnWindow2 *recnData = data;
-
-    if (event->keyval == GDK_Escape)
-    {
-        recn_cancel (recnData);
-        return TRUE;
-    }
-    else
-    {
-        return FALSE;
-    }
-}
-
-
-/********************************************************************\
- * find_payment_account                                             *
- *   find an account that 'looks like' a payment account for the    *
- *   given account. This really only makes sense for credit card    *
- *   accounts.                                                      *
- *                                                                  *
- * Args:   account - the account to look in                         *
- * Return: a candidate payment account or NULL if none was found    *
-\********************************************************************/
-static Account *
-find_payment_account (Account *account)
-{
-    GList *list;
-    GList *node;
-
-    if (account == NULL)
-        return NULL;
-
-    list = xaccAccountGetSplitList (account);
-
-    /* Search backwards to find the latest payment */
-    for (node = g_list_last (list); node; node = node->prev)
-    {
-        Transaction *trans;
-        Split *split;
-        GList *n;
-
-        split = node->data;
-        if (split == NULL)
-            continue;
-
-        /* ignore 'purchases' */
-        if (!gnc_numeric_positive_p (xaccSplitGetAmount (split)))
-            continue;
-
-        trans = xaccSplitGetParent(split);
-        if (trans == NULL)
-            continue;
-
-        for (n = xaccTransGetSplitList (trans); n; n = n->next)
-        {
-            GNCAccountType type;
-            Account *a;
-            Split *s;
-
-            s = n->data;
-            if ((s == NULL) || (s == split))
-                continue;
-
-            a = xaccSplitGetAccount(s);
-            if ((a == NULL) || (a == account))
-                continue;
-
-            type = xaccAccountGetType(a);
-            if ((type == ACCT_TYPE_BANK) || (type == ACCT_TYPE_CASH) ||
-                    (type == ACCT_TYPE_ASSET))
-                return a;
-        }
-    }
-
-    return NULL;
-}
-
-
-/********************************************************************\
- * recnFinishCB                                                     *
- *   saves reconcile information                                    *
- *                                                                  *
- * Args:   w    - the widget that called us                         *
- *         data - the data struct for this window                   *
- * Return: none                                                     *
-\********************************************************************/
-static void
-recnFinishCB (GtkAction *action, RecnWindow2 *recnData)
-{
-    gboolean auto_payment;
-    Account *account;
-    time64 date;
-
-    if (!gnc_numeric_zero_p (recnRecalculateBalance (recnData)))
-    {
-        const char *message = _("The account is not balanced. "
-                                "Are you sure you want to finish?");
-        if (!gnc_verify_dialog (recnData->window, FALSE, "%s", message))
-            return;
-    }
-
-    date = recnData->statement_date;
-
-    gnc_suspend_gui_refresh ();
-
-    recnData->delete_refresh = TRUE;
-
-    gnc_reconcile_view_commit (GNC_RECONCILE_VIEW (recnData->credit), date);
-    gnc_reconcile_view_commit (GNC_RECONCILE_VIEW (recnData->debit), date);
-
-    auto_payment = gnc_prefs_get_bool (GNC_PREFS_GROUP_RECONCILE, GNC_PREF_AUTO_CC_PAYMENT);
-
-    account = recn_get_account (recnData);
-
-    xaccAccountClearReconcilePostpone (account);
-    xaccAccountSetReconcileLastDate (account, date);
-
-    if (auto_payment &&
-            (xaccAccountGetType (account) == ACCT_TYPE_CREDIT) &&
-            (gnc_numeric_negative_p (recnData->new_ending)))
-    {
-        Account *payment_account;
-        XferDialog *xfer;
-
-        xfer = gnc_xfer_dialog (NULL, account);
-
-        gnc_xfer_dialog_set_amount (xfer, gnc_numeric_neg (recnData->new_ending));
-
-        payment_account = find_payment_account (account);
-        if (payment_account != NULL)
-            gnc_xfer_dialog_select_from_account (xfer, payment_account);
-    }
-
-    gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
-}
-
-
-/********************************************************************\
- * recnPostponeCB                                                   *
- *   saves reconcile information for later use                      *
- *                                                                  *
- * Args:   w    - the widget that called us                         *
- *         data - the data struct for this window                   *
- * Return: none                                                     *
-\********************************************************************/
-static void
-recnPostponeCB (GtkAction *action, gpointer data)
-{
-    RecnWindow2 *recnData = data;
-    Account *account;
-
-    {
-        const char *message = _("Do you want to postpone this reconciliation "
-                                "and finish it later?");
-        if (!gnc_verify_dialog (recnData->window, FALSE, "%s", message))
-            return;
-    }
-
-    gnc_suspend_gui_refresh ();
-
-    recnData->delete_refresh = TRUE;
-
-    gnc_reconcile_view_postpone (GNC_RECONCILE_VIEW (recnData->credit));
-    gnc_reconcile_view_postpone (GNC_RECONCILE_VIEW (recnData->debit));
-
-    account = recn_get_account (recnData);
-
-    xaccAccountSetReconcilePostponeDate (account, recnData->statement_date);
-    xaccAccountSetReconcilePostponeBalance (account, recnData->new_ending);
-
-    gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
-}
-
-
-static void
-recnCancelCB (GtkAction *action, gpointer data)
-{
-    RecnWindow2 *recnData = data;
-    recn_cancel (recnData);
-}
-
-
-/** An array of all of the actions provided by the main window code.
- *  This includes some placeholder actions for the menus that are
- *  visible in the menu bar but have no action associated with
- *  them. */
-static GtkActionEntry recnWindow2_actions [] =
-{
-    /* Toplevel */
-
-    { "ReconcileMenuAction",   NULL, N_("_Reconcile"), NULL, NULL, NULL, },
-    { "AccountMenuAction",     NULL, N_("_Account"), NULL, NULL, NULL, },
-    { "TransactionMenuAction", NULL, N_("_Transaction"), NULL, NULL, NULL, },
-    { "HelpMenuAction",        NULL, N_("_Help"), NULL, NULL, NULL, },
-
-    /* Reconcile menu */
-
-    {
-        "RecnChangeInfoAction", NULL, N_("_Reconcile Information..."),  NULL,
-        N_("Change the reconcile information "
-        "including statement date and ending balance."),
-        G_CALLBACK (gnc_ui_reconcile_window_change_cb)
-    },
-    {
-        "RecnFinishAction", GTK_STOCK_YES, N_("_Finish"), "<control>w",
-        N_("Finish the reconciliation of this account"),
-        G_CALLBACK(recnFinishCB)
-    },
-    {
-        "RecnPostponeAction", GTK_STOCK_GO_BACK, N_("_Postpone"), "<control>p",
-        N_("Postpone the reconciliation of this account"),
-        G_CALLBACK(recnPostponeCB)
-    },
-    {
-        "RecnCancelAction", GTK_STOCK_CANCEL, N_("_Cancel"), NULL,
-        N_("Cancel the reconciliation of this account"),
-        G_CALLBACK(recnCancelCB)
-    },
-
-    /* Account menu */
-
-    {
-        "AccountOpenAccountAction", GTK_STOCK_JUMP_TO, N_("_Open Account"), NULL,
-        N_("Open the account"),
-        G_CALLBACK(gnc_recn_open_cb)
-    },
-    {
-        "AccountEditAccountAction", NULL, N_("_Edit Account"), NULL,
-        N_("Edit the main account for this register"),
-        G_CALLBACK(gnc_recn_edit_account_cb)
-    },
-    {
-        "AccountTransferAction", NULL, N_("_Transfer..."), NULL,
-        N_("Transfer funds from one account to another"),
-        G_CALLBACK(gnc_recn_xfer_cb)
-    },
-    {
-        "AccountCheckRepairAction", NULL, N_("_Check & Repair"), NULL,
-        N_("Check for and repair unbalanced transactions and orphan splits "
-        "in this account"),
-        G_CALLBACK(gnc_recn_scrub_cb)
-    },
-
-    /* Transaction menu */
-
-    {
-        "TransBalanceAction", GTK_STOCK_NEW, N_("_Balance"), "<control>b",
-        N_("Add a new balancing entry to the account"),
-        G_CALLBACK(gnc_ui_reconcile_window_balance_cb)
-    },
-    {
-        "TransEditAction", GTK_STOCK_PROPERTIES, N_("_Edit"),  "<control>e",
-        N_("Edit the current transaction"),
-        G_CALLBACK(gnc_ui_reconcile_window_edit_cb)
-    },
-    {
-        "TransDeleteAction", GTK_STOCK_DELETE, N_("_Delete"),  "<control>d",
-        N_("Delete the selected transaction"),
-        G_CALLBACK(gnc_ui_reconcile_window_delete_cb)
-    },
-    {
-        "TransRecAction", GTK_STOCK_APPLY, N_("_Reconcile Selection"), "<control>r",
-        N_("Reconcile the selected transactions"),
-        G_CALLBACK(gnc_ui_reconcile_window_rec_cb)
-    },
-    {
-        "TransUnRecAction", GTK_STOCK_CLEAR, N_("_Unreconcile Selection"), "<control>u",
-        N_("Unreconcile the selected transactions"),
-        G_CALLBACK(gnc_ui_reconcile_window_unrec_cb)
-    },
-
-    /* Help menu */
-
-    {
-        "HelpHelpAction", NULL, N_("_Help"), NULL,
-        N_("Open the GnuCash help window"),
-        G_CALLBACK(gnc_ui_reconcile_window_help_cb)
-    },
-};
-
-/** The number of actions provided by the main window. */
-static guint recnWindow2_n_actions = G_N_ELEMENTS (recnWindow2_actions);

Deleted: gnucash/trunk/src/gnome/window-reconcile2.h
===================================================================
--- gnucash/trunk/src/gnome/window-reconcile2.h	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome/window-reconcile2.h	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,68 +0,0 @@
-/********************************************************************\
- * window-reconcile2.h -- the reconcile window                      *
- * Copyright (C) 1997 Robin D. Clark                                *
- * Copyright (C) 1998-2000 Linas Vepstas                            *
- *                                                                  *
- * 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 WINDOW_RECONCILE2_H
-#define WINDOW_RECONCILE2_H
-
-#include "Account.h"
-#include <gtk/gtk.h>
-
-
-/** STRUCTS *********************************************************/
-typedef struct _RecnWindow2 RecnWindow2;
-
-
-/** PROTOTYPES ******************************************************/
-
-/********************************************************************\
- * recnWindow2                                                       *
- *   opens up the window to reconcile an account                    *
- *                                                                  *
- * Args:   parent  - the parent of this window                      *
- *         account - the account to reconcile                       *
- *
- * Return: recnData - the instance of this RecnWindow2, or NULL if the
- * user pressed Cancel in the initial date query.
-\********************************************************************/
-RecnWindow2 *recnWindow2 (GtkWidget *parent, Account *account);
-
-/********************************************************************\
- * recnWindow2WithBalance
- *
- *   Opens up the window to reconcile an account, but with ending
- *   balance and statement date already given.
- *
- * Args:   parent         - The parent widget of the new window
- *         account        - The account to reconcile
- *         new_ending     - The amount for ending balance
- *         statement_date - The date of the statement
- * Return: recnData - the instance of this RecnWindow2
-\********************************************************************/
-RecnWindow2 *recnWindow2WithBalance (GtkWidget *parent,
-                                   Account *account,
-                                   gnc_numeric new_ending,
-                                   time64 statement_date);
-
-void gnc_ui_reconcile_window2_raise (RecnWindow2 * recnData);
-
-#endif /* WINDOW_RECONCILE2_H */

Modified: gnucash/trunk/src/gnome-utils/Makefile.am
===================================================================
--- gnucash/trunk/src/gnome-utils/Makefile.am	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome-utils/Makefile.am	2013-10-22 18:26:55 UTC (rev 23314)
@@ -81,7 +81,6 @@
   gnc-splash.c \
   gnc-sx-instance-dense-cal-adapter.c \
   gnc-sx-list-tree-model-adapter.c \
-  gnc-tree-control-split-reg.c \
   gnc-tree-model.c \
   gnc-tree-model-account-types.c \
   gnc-tree-model-account.c \
@@ -89,13 +88,10 @@
   gnc-tree-model-owner.c \
   gnc-tree-model-commodity.c \
   gnc-tree-model-price.c \
-  gnc-tree-model-split-reg.c \
-  gnc-tree-util-split-reg.c \
   gnc-tree-view-account.c \
   gnc-tree-view-commodity.c \
   gnc-tree-view-owner.c \
   gnc-tree-view-price.c \
-  gnc-tree-view-split-reg.c \
   gnc-tree-view-sx-list.c \
   gnc-tree-view.c \
   gnc-warnings.c \
@@ -160,7 +156,6 @@
   gnc-splash.h \
   gnc-sx-instance-dense-cal-adapter.h \
   gnc-sx-list-tree-model-adapter.h \
-  gnc-tree-control-split-reg.h \
   gnc-tree-model.h \
   gnc-tree-model-account-types.h \
   gnc-tree-model-account.h \
@@ -168,13 +163,10 @@
   gnc-tree-model-owner.h \
   gnc-tree-model-commodity.h \
   gnc-tree-model-price.h \
-  gnc-tree-model-split-reg.h \
-  gnc-tree-util-split-reg.h \
   gnc-tree-view-account.h \
   gnc-tree-view-commodity.h \
   gnc-tree-view-owner.h \
   gnc-tree-view-price.h \
-  gnc-tree-view-split-reg.h \
   gnc-tree-view-sx-list.h \
   gnc-tree-view.h \
   gnc-ui.h \

Deleted: gnucash/trunk/src/gnome-utils/gnc-tree-control-split-reg.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-control-split-reg.c	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-control-split-reg.c	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,2179 +0,0 @@
-/********************************************************************\
- * gnc-tree-control-split-reg.c -- GtkTreeView implementation       *
- *                     to display registers in a GtkTreeView.       *
- *                                                                  *
- * Copyright (C) 2006-2007 Chris Shoemaker <c.shoemaker at cox.net>    *
- * Copyright (C) 2012 Robert Fewell                                 *
- *                                                                  *
- * 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 <stdlib.h>
-#include <string.h>
-
-#include "gnc-tree-control-split-reg.h"
-#include "gnc-tree-model-split-reg.h"
-#include "gnc-tree-util-split-reg.h"
-#include "gnc-tree-view-split-reg.h"
-#include "gnc-component-manager.h"
-#include "gnc-ui.h"
-#include "gnc-prefs.h"
-#include "gnc-gdate-utils.h"
-#include "gnome-utils/gnc-warnings.h"
-#include "dialog-utils.h"
-#include "dialog-dup-trans.h"
-#include "dialog-account.h"
-
-#include "Transaction.h"
-#include "engine-helpers.h"
-#include "gnc-event.h"
-#include "Scrub.h"
-
-/** Static Globals *******************************************************/
-static QofLogModule log_module = GNC_MOD_LEDGER;
-
-/*****************************************************************************/
-/*****************************************************************************/
-
-/* Read only dialog */
-static gboolean
-gtc_sr_is_trans_readonly_and_warn (GncTreeViewSplitReg *view, Transaction *trans)
-{
-    GncTreeModelSplitReg *model;
-    GtkWidget *window;
-    GtkWidget *dialog;
-    const gchar *reason;
-    const gchar *title = _("Cannot modify or delete this transaction.");
-    const gchar *message_reason =
-        _("This transaction is marked read-only with the comment: '%s'");
-
-    if (!trans) return FALSE;
-
-    window = gnc_tree_view_split_reg_get_parent (view);
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    if (xaccTransIsReadonlyByPostedDate (trans))
-    {
-        dialog = gtk_message_dialog_new (GTK_WINDOW (window),
-                                        0,
-                                        GTK_MESSAGE_ERROR,
-                                        GTK_BUTTONS_OK,
-                                        "%s", title);
-        gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-                "%s", _("The date of this transaction is older than the \"Read-Only Threshold\" set for this book. "
-                        "This setting can be changed in File -> Properties -> Accounts."));
-        gtk_dialog_run (GTK_DIALOG (dialog));
-        gtk_widget_destroy (dialog);
-        return TRUE;
-    }
-
-    reason = xaccTransGetReadOnly (trans);
-    if (reason)
-    {
-        dialog = gtk_message_dialog_new (GTK_WINDOW (window),
-                                        0,
-                                        GTK_MESSAGE_ERROR,
-                                        GTK_BUTTONS_OK,
-                                        "%s", title);
-        gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-                message_reason, reason);
-        gtk_dialog_run (GTK_DIALOG (dialog));
-        gtk_widget_destroy (dialog);
-        return TRUE;
-    }
-
-    if (gnc_tree_model_split_reg_get_read_only (model, trans))
-    {
-        dialog = gtk_message_dialog_new (GTK_WINDOW (window),
-                                        0,
-                                        GTK_MESSAGE_ERROR,
-                                        GTK_BUTTONS_OK,
-                                        "%s", title);
-        gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-                "%s", _("You can not change this transaction, the Book or Register is set to Read Only."));
-        gtk_dialog_run (GTK_DIALOG (dialog));
-        gtk_widget_destroy (dialog);
-        return TRUE;
-    }
-    return FALSE;
-}
-
-
-/* Transaction is being edited dialog */
-#define gtc_sr_trans_open_and_warn gnc_tree_control_split_reg_trans_open_and_warn
-gboolean
-gnc_tree_control_split_reg_trans_open_and_warn (GncTreeViewSplitReg *view, Transaction *trans)
-{
-    Transaction *dirty_trans;
-    GtkWidget *window;
-    GtkWidget *dialog;
-    gint response;
-    const char *title = _("Save Transaction before proceeding?");
-    const char *message =
-            _("The current transaction has been changed. Would you like to "
-              "record the changes before proceeding, or cancel?");
-
-    window = gnc_tree_view_split_reg_get_parent (view);
-    dirty_trans = gnc_tree_view_split_reg_get_dirty_trans (view);
-
-    if (trans == dirty_trans)
-    {
-        dialog = gtk_message_dialog_new (GTK_WINDOW (window),
-                                        GTK_DIALOG_DESTROY_WITH_PARENT,
-                                        GTK_MESSAGE_QUESTION,
-                                        GTK_BUTTONS_CANCEL,
-                                        "%s", title);
-        gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-                "%s", message);
-        gtk_dialog_add_button (GTK_DIALOG (dialog),
-                              _("_Record"), GTK_RESPONSE_ACCEPT);
-        response = gnc_dialog_run (GTK_DIALOG (dialog), GNC_PREF_WARN_REG_TRANS_MOD);
-        gtk_widget_destroy (dialog);
-
-        if (response != GTK_RESPONSE_ACCEPT)
-            return TRUE;
-
-        xaccTransCommitEdit (trans);
-        gnc_tree_view_split_reg_set_dirty_trans (view, NULL);
-
-        return FALSE;
-    }
-    else
-        return FALSE;
-}
-
-
-#define gtc_sr_trans_test_for_edit gnc_tree_control_split_reg_trans_test_for_edit
-gboolean
-gtc_sr_trans_test_for_edit (GncTreeViewSplitReg *view, Transaction *trans)
-{
-    GtkWidget *window;
-    Transaction *dirty_trans;
-
-    /* Make sure we have stopped editing */
-    gnc_tree_view_split_reg_finish_edit (view);
-
-    window = gnc_tree_view_split_reg_get_parent (view);
-
-    /* Get dirty_trans */
-    dirty_trans = gnc_tree_view_split_reg_get_dirty_trans (view);
-
-    /* We are being edited in a different register */
-    if (xaccTransIsOpen (trans) && (dirty_trans != trans))
-    {
-        gnc_error_dialog (window, "%s",
-                         _("This transaction is being edited in a different register."));
-        return TRUE;
-    }
-    return FALSE;
-}
-
-/*****************************************************************************/
-/*****************************************************************************/
-
-gboolean
-gnc_tree_control_split_reg_balance_trans (GncTreeViewSplitReg *view, Transaction *trans)
-{
-    GncTreeModelSplitReg *model;
-    GtkWidget *window;
-    int choice;
-    int default_value;
-    Account *default_account;
-    Account *other_account;
-    Account *root;
-    GList *radio_list = NULL;
-    const char *title   = _("Rebalance Transaction");
-    const char *message = _("The current transaction is not balanced.");
-    Split *split;
-    Split *other_split;
-    gboolean two_accounts;
-    gboolean multi_currency;
-
-
-    if (xaccTransIsBalanced (trans))
-        return FALSE;
-
-    window = gnc_tree_view_split_reg_get_parent (view);
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    if (xaccTransUseTradingAccounts (trans))
-    {
-        MonetaryList *imbal_list;
-        gnc_monetary *imbal_mon;
-        imbal_list = xaccTransGetImbalance (trans);
-
-        /* See if the imbalance is only in the transaction's currency */
-        if (!imbal_list)
-            /* Value imbalance, but not commodity imbalance.  This shouldn't
-               be something that scrubbing can cause to happen.  Perhaps someone
-               entered invalid splits.  */
-            multi_currency = TRUE;
-        else
-        {
-            imbal_mon = imbal_list->data;
-            if (!imbal_list->next &&
-                    gnc_commodity_equiv(gnc_monetary_commodity(*imbal_mon),
-                                        xaccTransGetCurrency(trans)))
-                multi_currency = FALSE;
-            else
-                multi_currency = TRUE;
-        }
-
-        /* We're done with the imbalance list, the real work will be done
-           by xaccTransScrubImbalance which will get it again. */
-        gnc_monetary_list_free(imbal_list);
-    }
-    else
-        multi_currency = FALSE;
-
-    split = xaccTransGetSplit (trans, 0);
-    other_split = xaccSplitGetOtherSplit (split);
-
-    if (other_split == NULL)
-    {
-        /* Attempt to handle the inverted many-to-one mapping */
-        split = xaccTransGetSplit (trans, 1);
-        if (split) other_split = xaccSplitGetOtherSplit (split);
-        else split = xaccTransGetSplit (trans, 0);
-    }
-    if (other_split == NULL || multi_currency)
-    {
-        two_accounts = FALSE;
-        other_account = NULL;
-    }
-    else
-    {
-        two_accounts = TRUE;
-        other_account = xaccSplitGetAccount (other_split);
-    }
-
-    default_account = gnc_tree_model_split_reg_get_anchor (model);
-
-    /* If the two pointers are the same, the account from other_split
-     * is actually the default account. We must make other_account
-     * the account from split instead.   */
-
-    if (default_account == other_account)
-        other_account = xaccSplitGetAccount (split);
-
-    /*  If the two pointers are still the same, we have two splits, but
-     *  they both refer to the same account. While non-sensical, we don't
-     *  object.   */
-
-    if (default_account == other_account)
-        two_accounts = FALSE;
-
-    radio_list = g_list_append (radio_list,
-                                _("Balance it _manually"));
-    radio_list = g_list_append (radio_list,
-                                _("Let GnuCash _add an adjusting split"));
-
-    if (model->type < NUM_SINGLE_REGISTER_TYPES2 && !multi_currency)
-    {
-        radio_list = g_list_append (radio_list,
-                                    _("Adjust current account _split total"));
-
-        default_value = 2;
-        if (two_accounts)
-        {
-            radio_list = g_list_append (radio_list,
-                                        _("Adjust _other account split total"));
-            default_value = 3;
-        }
-    }
-    else
-        default_value = 0;
-
-    choice = gnc_choose_radio_option_dialog
-             (window,
-              title,
-              message,
-              _("_Rebalance"),
-              default_value,
-              radio_list);
-
-    g_list_free (radio_list);
-
-    root = gnc_account_get_root(default_account);
-    switch (choice)
-    {
-    default:
-    case 0:
-        return TRUE;
-        break;
-
-    case 1:
-        xaccTransScrubImbalance (trans, root, NULL);
-        break;
-
-    case 2:
-        xaccTransScrubImbalance (trans, root, default_account);
-        break;
-
-    case 3:
-        xaccTransScrubImbalance (trans, root, other_account);
-        break;
-    }
-    return FALSE;
-}
-
-
-/* Cancel the edit and Rollback */
-void
-gnc_tree_control_split_reg_cancel_edit (GncTreeViewSplitReg *view, gboolean reg_closing)
-{
-    /* Make sure we have stopped editing */
-    gnc_tree_view_split_reg_finish_edit (view);
-
-    gnc_tree_view_split_reg_cancel_edit (view, reg_closing);
-}
-
-
-/* Amend the Exchange Rate of the transaction */
-void
-gnc_tree_control_split_reg_exchange_rate (GncTreeViewSplitReg *view)
-{
-    GncTreeModelSplitReg *model;
-    GtkWidget *window;
-    Account *anchor;
-    Transaction *trans;
-    Split *split = NULL;
-    Split *osplit = NULL;
-    gnc_numeric value;
-    gboolean expanded;
-    gint depth;
-    gint num_splits;
-    const char *message;
-    gnc_commodity *txn_com;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    trans = gnc_tree_view_split_reg_get_current_trans (view);
-    expanded = gnc_tree_view_split_reg_trans_expanded (view, NULL);
-    depth = gnc_tree_view_reg_get_selected_row_depth (view);
-    num_splits = xaccTransCountSplits (trans);
-    anchor = gnc_tree_model_split_reg_get_anchor (model);
-    txn_com = xaccTransGetCurrency (trans);
-
-    if (trans == NULL)
-        return;
-
-    /* See if we were asked to change a blank trans. */
-    if (trans == gnc_tree_control_split_reg_get_blank_trans (view))
-        return;
-
-    /* Test for read only */
-    if (gtc_sr_is_trans_readonly_and_warn (view, trans))
-        return;
-
-    /* See if we are being edited in another register */
-    if (gtc_sr_trans_test_for_edit (view, trans))
-        return;
-
-    /* Make sure we ask to commit any changes before we proceed */
-    if (gtc_sr_trans_open_and_warn (view, trans))
-        return;
-
-    if (num_splits < 2)
-        return;
-
-    window = gnc_tree_view_split_reg_get_parent (view);
-
-    /* Make sure we NEED this for this type of register */
-    if (!gnc_tree_util_split_reg_has_rate (view))
-    {
-        message = _("This register does not support editing exchange rates.");
-        gnc_error_dialog(window, "%s", message);
-        return;
-    }
-
-    /* If the anchor commodity is not a currency, cancel */
-    if (anchor && !gnc_commodity_is_currency (xaccAccountGetCommodity (anchor)))
-    {
-        message = _("This register does not support editing exchange rates.");
-        gnc_error_dialog (window, "%s", message);
-        return;
-    }
-
-    /* If we're not expanded AND number of splits greater than two, nothing to do */
-    if ((gnc_tree_util_split_reg_is_multi (xaccTransGetSplit (trans, 0))) && !expanded)
-    {
-        message = _("You need to expand the transaction in order to modify its "
-                    "exchange rates.");
-        gnc_error_dialog (window, "%s", message);
-        return;
-    }
-
-    if (!gnc_tree_util_split_reg_is_multi (xaccTransGetSplit (trans, 0)) && anchor != NULL && !expanded)
-    {
-        split = gnc_tree_control_split_reg_get_current_trans_split (view);
-
-        if (xaccAccountGetType (xaccSplitGetAccount (split)) == ACCT_TYPE_TRADING) // trading split
-            return;
-
-        osplit = xaccSplitGetOtherSplit (split);
-
-        value = xaccSplitGetValue (split);
-
-        gnc_tree_view_split_reg_set_dirty_trans (view, trans);
-        xaccTransBeginEdit (trans);
-
-        if (txn_com == xaccAccountGetCommodity (xaccSplitGetAccount(split)))
-           gnc_tree_util_split_reg_set_value_for (view, trans, osplit, gnc_numeric_neg (value), TRUE);
-        else
-           gnc_tree_util_split_reg_set_value_for (view, trans, split, value, TRUE);
-
-        xaccTransCommitEdit (trans);
-        gnc_tree_view_split_reg_set_dirty_trans (view, NULL);
-    }
-
-    if (num_splits > 1 && expanded && depth == 3)
-    {
-        split = gnc_tree_view_split_reg_get_current_split (view);
-
-        if (xaccAccountGetType (xaccSplitGetAccount (split)) == ACCT_TYPE_TRADING) // trading split
-            return;
-
-        value = xaccSplitGetValue (split);
-
-        if (txn_com == xaccAccountGetCommodity (xaccSplitGetAccount(split)))
-        {
-            message = _("The two currencies involved equal each other.");
-            gnc_error_dialog (window, "%s", message);
-            return;
-        }
-        else
-        {
-            gnc_tree_view_split_reg_set_dirty_trans (view, trans);
-            xaccTransBeginEdit (trans);
-
-            gnc_tree_util_split_reg_set_value_for (view, trans, split, value, TRUE);
-
-            xaccTransCommitEdit (trans);
-            gnc_tree_view_split_reg_set_dirty_trans (view, NULL);
-        }
-    }
-}
-
-
-/* Void current transaction */
-void
-gnc_tree_control_split_reg_void_current_trans (GncTreeViewSplitReg *view, const char *reason)
-{
-    Transaction *trans;
-    Split *blank_split;
-    Split *split;
-
-    if (!view) return;
-
-    blank_split = gnc_tree_control_split_reg_get_blank_split (view);
-
-    /* get the current split */
-    split = gnc_tree_view_split_reg_get_current_split (view);
-    if (split == NULL)
-        return;
-
-    /* Bail if trying to void the blank split. */
-    if (split == blank_split)
-        return;
-
-    /* already voided. */
-    if (xaccSplitGetReconcile (split) == VREC)
-        return;
-
-    trans = xaccSplitGetParent (split);
-
-    if (trans == NULL)
-        return;
-
-    /* See if we were asked to change a blank trans. */
-    if (trans == gnc_tree_control_split_reg_get_blank_trans (view))
-        return;
-
-    /* Test for read only */
-    if (gtc_sr_is_trans_readonly_and_warn (view, trans))
-        return;
-
-    /* See if we are being edited in another register */
-    if (gtc_sr_trans_test_for_edit (view, trans))
-        return;
-
-    /* Make sure we ask to commit any changes before we proceed */
-    if (gtc_sr_trans_open_and_warn (view, trans))
-        return;
-
-    gnc_tree_view_split_reg_set_dirty_trans (view, trans);
-
-    xaccTransVoid (trans, reason);
-
-    if (xaccTransIsOpen (trans))
-    {
-        PERR("We should not be voiding an open transaction.");
-        xaccTransCommitEdit (trans);
-    }
-    gnc_tree_view_split_reg_set_dirty_trans (view, NULL);
-}
-
-
-/* Unvoid current transaction */
-void
-gnc_tree_control_split_reg_unvoid_current_trans (GncTreeViewSplitReg *view)
-{
-    Transaction *trans;
-    Split *blank_split;
-    Split *split;
-
-    if (!view) return;
-
-    blank_split = gnc_tree_control_split_reg_get_blank_split (view);
-
-    /* get the current split based on cursor position */
-    split = gnc_tree_view_split_reg_get_current_split (view);
-    if (split == NULL)
-        return;
-
-    /* Bail if trying to unvoid the blank split. */
-    if (split == blank_split)
-        return;
-
-    /* not voided. */
-    if (xaccSplitGetReconcile (split) != VREC)
-        return;
-
-    trans = xaccSplitGetParent (split);
-
-    if (trans == NULL)
-        return;
-
-    /* See if we were asked to change a blank trans. */
-    if (trans == gnc_tree_control_split_reg_get_blank_trans (view))
-        return;
-
-    gnc_tree_view_split_reg_set_dirty_trans (view, trans);
-
-    xaccTransUnvoid (trans);
-
-    gnc_tree_view_split_reg_set_dirty_trans (view, NULL);
-}
-
-
-/* Jump to the Blank transaction */
-gboolean
-gnc_tree_control_split_reg_jump_to_blank (GncTreeViewSplitReg *view)
-{
-    GncTreeModelSplitReg *model;
-    GtkTreePath *mpath, *spath;
-    Transaction *btrans;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    btrans = gnc_tree_model_split_get_blank_trans (model);
-
-    model->current_trans = btrans;
-
-    if (!gnc_tree_model_split_reg_trans_is_in_view (model, btrans))
-        g_signal_emit_by_name (model, "refresh_trans");
-    else
-    {
-        mpath = gnc_tree_model_split_reg_get_path_to_split_and_trans (model, NULL, btrans);
-
-        spath = gnc_tree_view_split_reg_get_sort_path_from_model_path (view, mpath);
-
-        /* Set cursor to new spath */
-        gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), spath, NULL, FALSE);
-
-        gtk_tree_path_free (spath);
-        gtk_tree_path_free (mpath);
-
-        /* scroll when view idle */
-        g_idle_add ((GSourceFunc)gnc_tree_view_split_reg_scroll_to_cell, view );
-    }
-    return FALSE;
-}
-
-
-/* Jump to transaction or split */
-void
-gnc_tree_control_split_reg_jump_to (GncTreeViewSplitReg *view, Transaction *trans, Split *split, gboolean amount)
-{
-    GncTreeModelSplitReg *model;
-    GtkTreePath *mpath, *spath;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    if (split)
-        trans = NULL;
-
-    mpath = gnc_tree_model_split_reg_get_path_to_split_and_trans (model, split, trans);
-
-    spath = gnc_tree_view_split_reg_get_sort_path_from_model_path (view, mpath);
-
-    if (split)
-        gnc_tree_view_split_reg_expand_trans (view, xaccSplitGetParent (split));
-
-    /* Set cursor to new spath, if amount, cursor is set to correct column ready for editing */
-    if (amount)
-    {
-        GtkCellRenderer *cr0;
-        GList *renderers;
-        GList *columns;
-        GList  *column;
-        gint i;
-
-        columns = gtk_tree_view_get_columns (GTK_TREE_VIEW (view));
-
-        for (column = columns, i = 1; column; column = g_list_next (column), i++)
-        {
-            GtkTreeViewColumn *tvc;
-            ViewCol viewcol;
-
-            tvc = column->data;
-
-            // Get the first renderer, it has the view-column value.
-            renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (tvc));
-            cr0 = g_list_nth_data (renderers, 0);
-            g_list_free (renderers);
-
-            viewcol = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cr0), "view_column"));
-
-            if (viewcol == COL_DEBIT && gnc_numeric_positive_p (xaccSplitGetAmount (split)))
-                gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), spath, tvc, TRUE);
-
-            if (viewcol == COL_CREDIT && gnc_numeric_negative_p (xaccSplitGetAmount (split)))
-                gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), spath, tvc, TRUE);
-        }
-        g_list_free (columns);
-    }
-    else
-        gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), spath, NULL, FALSE);
-
-    /* Scroll to cell, mid view */
-    gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (view), spath, NULL, TRUE, 0.5, 0.0);
-
-    gtk_tree_path_free (spath);
-    gtk_tree_path_free (mpath);
-}
-
-
-/* Returns the Blank Transaction */
-Transaction *
-gnc_tree_control_split_reg_get_blank_trans (GncTreeViewSplitReg *view)
-{
-    GncTreeModelSplitReg *model;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    return gnc_tree_model_split_get_blank_trans (model);
-}
-
-
-/* Return the Split for the current Transaction */
-Split *
-gnc_tree_control_split_reg_get_current_trans_split (GncTreeViewSplitReg *view)
-{
-    GncTreeModelSplitReg *model;
-    GtkTreePath *mpath;
-    GtkTreeIter m_iter;
-    Split *split = NULL;
-    Transaction *trans = NULL;
-    Account *anchor;
-    gboolean is_trow1, is_trow2, is_split, is_blank;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    mpath = gnc_tree_view_split_reg_get_current_path (view);
-
-    gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &m_iter, mpath);
-
-    gnc_tree_model_split_reg_get_split_and_trans (
-            GNC_TREE_MODEL_SPLIT_REG (model), &m_iter, &is_trow1, &is_trow2, &is_split, &is_blank, &split, &trans);
-
-    anchor = gnc_tree_model_split_reg_get_anchor (model);
-
-    split = gnc_tree_model_split_reg_trans_get_split_equal_to_ancestor (trans, anchor);
-
-    gtk_tree_path_free (mpath);
-
-    return split;
-}
-
-
-/* Returns the Blank Split */
-Split *
-gnc_tree_control_split_reg_get_blank_split (GncTreeViewSplitReg *view)
-{
-    GncTreeModelSplitReg *model;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    return gnc_tree_model_split_get_blank_split (model);
-}
-
-
-/* Move to the relative transaction */
-void
-gnc_tree_control_split_reg_goto_rel_trans_row (GncTreeViewSplitReg *view, gint relative)
-{
-    GncTreeModelSplitReg *model;
-    GtkTreePath *mpath, *spath;
-    GtkTreePath  *new_mpath, *new_spath;
-    gint *indices;
-    gchar *sstring;
-
-    ENTER("Move relative, view is %p, relative is %d", view, relative);
-
-//FIXME Do we need to do some checks on relative maybe  -1,0,1 ??
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    mpath = gnc_tree_view_split_reg_get_current_path (view);
-
-    spath = gnc_tree_view_split_reg_get_sort_path_from_model_path (view, mpath);
-
-    indices = gtk_tree_path_get_indices (spath);
-
-    new_spath = gtk_tree_path_new_from_indices (indices[0] + (relative * view->sort_direction), -1);
-
-    // if relative == 0 we block all selection changes
-    gnc_tree_view_split_reg_block_selection (view, TRUE);
-    gtk_tree_selection_unselect_path (gtk_tree_view_get_selection (GTK_TREE_VIEW (view)), spath);
-
-    if (relative != 0)
-        gnc_tree_view_split_reg_block_selection (view, FALSE);
-
-    /* Set cursor to new spath */
-    gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), new_spath, NULL, FALSE);
-
-    if (relative == 0)
-    {
-        gnc_tree_view_split_reg_block_selection (view, FALSE);
-
-        /* Get the new model path we are pointing at */
-        new_mpath = gnc_tree_view_split_reg_get_model_path_from_sort_path (view, new_spath);
-
-        /* As we are not emitting selection change, we need to save the current path ref */
-        gnc_tree_view_split_reg_set_current_path (view, new_mpath);
-        gtk_tree_path_free (new_mpath);
-    }
-
-    sstring = gtk_tree_path_to_string (new_spath);
-    LEAVE("new_spath is %s", sstring);
-    g_free (sstring);
-
-    gtk_tree_path_free (new_spath);
-    gtk_tree_path_free (mpath);
-    gtk_tree_path_free (spath);
-}
-
-
-/* Enter the transaction */
-void
-gnc_tree_control_split_reg_enter (GncTreeViewSplitReg *view)
-{
-    GncTreeModelSplitReg *model;
-    Transaction *btrans, *ctrans;
-    gboolean goto_blank = FALSE;
-    gboolean next_trans = TRUE;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    goto_blank = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER,
-                                     GNC_PREF_ENTER_MOVES_TO_END);
-
-    ENTER("view=%p, goto_blank = %s", view, goto_blank ? "TRUE" : "FALSE");
-
-    btrans = gnc_tree_model_split_get_blank_trans (model);
-
-    ctrans = gnc_tree_view_split_reg_get_current_trans (view);
-
-    /* Are we on the blank transaction */
-    if (btrans == ctrans)
-        next_trans = FALSE;
-
-    /* First record the transaction */
-    if (gnc_tree_view_split_reg_enter (view))
-    {
-        /* Now move. */
-        if (goto_blank)
-            gnc_tree_control_split_reg_jump_to_blank (view);
-        else if (next_trans)
-            gnc_tree_control_split_reg_goto_rel_trans_row (view, 1);
-    }
-    LEAVE(" ");
-}
-
-
-/* Reinit the transaction */
-void
-gnc_tree_control_split_reg_reinit (GncTreeViewSplitReg *view, gpointer data)
-{
-    Transaction *trans;
-    Split *split;
-    GtkWidget *dialog, *window;
-    gint response;
-    const gchar *warning;
-
-    const char *title = _("Remove the splits from this transaction?");
-    const char *recn_warn = _("This transaction contains reconciled splits. "
-                              "Modifying it is not a good idea because that will "
-                              "cause your reconciled balance to be off.");
-
-    trans = gnc_tree_view_split_reg_get_current_trans (view);
-
-    if (trans == NULL)
-        return;
-
-    /* See if we were asked to change a blank trans. */
-    if (trans == gnc_tree_control_split_reg_get_blank_trans (view))
-        return;
-
-    /* Test for read only */
-    if (gtc_sr_is_trans_readonly_and_warn (view, trans))
-        return;
-
-    /* See if we are being edited in another register */
-    if (gtc_sr_trans_test_for_edit (view, trans))
-        return;
-
-    /* Make sure we ask to commit any changes before we proceed */
-    if (gtc_sr_trans_open_and_warn (view, trans))
-        return;
-
-    window = gnc_tree_view_split_reg_get_parent (view);
-
-    dialog = gtk_message_dialog_new (GTK_WINDOW (window),
-                                    GTK_DIALOG_DESTROY_WITH_PARENT,
-                                    GTK_MESSAGE_WARNING,
-                                    GTK_BUTTONS_NONE,
-                                    "%s", title);
-
-    if (xaccTransHasReconciledSplits (trans))
-    {
-        gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-                "%s", recn_warn);
-        warning = GNC_PREF_WARN_REG_SPLIT_DEL_ALL_RECD;
-    }
-    else
-    {
-        warning = GNC_PREF_WARN_REG_SPLIT_DEL_ALL;
-    }
-
-    gtk_dialog_add_button (GTK_DIALOG (dialog),
-                          GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
-    gnc_gtk_dialog_add_button(dialog, _("_Remove Splits"),
-                              GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT);
-    response = gnc_dialog_run (GTK_DIALOG(dialog), warning);
-    gtk_widget_destroy (dialog);
-    if (response != GTK_RESPONSE_ACCEPT)
-        return;
-
-    gnc_tree_view_split_reg_reinit_trans (view);
-}
-
-
-/* Delete the currently selected item */
-void
-gnc_tree_control_split_reg_delete (GncTreeViewSplitReg *view, gpointer data)
-{
-    GncTreeModelSplitReg *model;
-    Account *anchor;
-    RowDepth depth;
-    Transaction *trans;
-    Split *split;
-    GtkWidget *dialog, *window;
-    gint response;
-    const gchar *warning;
-
-    /* get the current split based on cursor position */
-    split = gnc_tree_view_split_reg_get_current_split (view);
-    if (split == NULL)
-    {
-        split = gnc_tree_control_split_reg_get_current_trans_split (view);
-        if (split == NULL)
-        {
-            LEAVE("split is NULL");
-            return;
-        }
-    }
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    anchor = gnc_tree_model_split_reg_get_anchor (model);
-
-    trans = xaccSplitGetParent (split);
-
-    if (trans == NULL)
-        return;
-
-    /* Test for read only */
-    if (gtc_sr_is_trans_readonly_and_warn (view, trans))
-        return;
-
-    /* See if we are being edited in another register */
-    if (gtc_sr_trans_test_for_edit (view, trans))
-        return;
-
-    depth = gnc_tree_view_reg_get_selected_row_depth (view);
-
-    /* Deleting the blank split just cancels */
-    {
-        Split *blank_split = gnc_tree_control_split_reg_get_blank_split (view);
-
-        if (split == blank_split)
-            return;
-    }
-
-    /* Deleting the blank trans just cancels */
-    {
-        Transaction *blank_trans = gnc_tree_control_split_reg_get_blank_trans (view);
-
-        if (trans == blank_trans)
-            return;
-    }
-
-    window = gnc_tree_view_split_reg_get_parent (view);
-
-    /* On a split cursor, just delete the one split. */
-    if (depth == SPLIT3)
-    {
-        const char *format = _("Delete the split '%s' from the transaction '%s'?");
-        const char *recn_warn = _("You would be deleting a reconciled split! "
-                                  "This is not a good idea as it will cause your "
-                                  "reconciled balance to be off.");
-        const char *anchor_error = _("You cannot delete this split.");
-        const char *anchor_split = _("This is the split anchoring this transaction "
-                                     "to the register. You may not delete it from "
-                                     "this register window. You may delete the "
-                                     "entire transaction from this window, or you "
-                                     "may navigate to a register that shows "
-                                     "another side of this same transaction and "
-                                     "delete the split from that register.");
-        char *buf = NULL;
-        const char *memo;
-        const char *desc;
-        char recn;
-        if ((split == gnc_tree_control_split_reg_get_current_trans_split (view)) ||
-            (split == gnc_tree_model_split_reg_trans_get_split_equal_to_ancestor (trans, anchor)))
-        {
-            dialog = gtk_message_dialog_new (GTK_WINDOW (window),
-                                            GTK_DIALOG_MODAL
-                                            | GTK_DIALOG_DESTROY_WITH_PARENT,
-                                            GTK_MESSAGE_ERROR,
-                                            GTK_BUTTONS_OK,
-                                            "%s", anchor_error);
-            gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-                    "%s", anchor_split);
-            gtk_dialog_run (GTK_DIALOG (dialog));
-            gtk_widget_destroy (dialog);
-            return;
-        }
-
-        memo = xaccSplitGetMemo (split);
-        memo = (memo && *memo) ? memo : _("(no memo)");
-
-        desc = xaccTransGetDescription (trans);
-        desc = (desc && *desc) ? desc : _("(no description)");
-
-        /* ask for user confirmation before performing permanent damage */
-        buf = g_strdup_printf (format, memo, desc);
-        dialog = gtk_message_dialog_new (GTK_WINDOW (window),
-                                        GTK_DIALOG_MODAL
-                                        | GTK_DIALOG_DESTROY_WITH_PARENT,
-                                        GTK_MESSAGE_QUESTION,
-                                        GTK_BUTTONS_NONE,
-                                        "%s", buf);
-        g_free(buf);
-        recn = xaccSplitGetReconcile (split);
-        if (recn == YREC || recn == FREC)
-        {
-            gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-                    "%s", recn_warn);
-            warning = GNC_PREF_WARN_REG_SPLIT_DEL_RECD;
-        }
-        else
-        {
-            warning = GNC_PREF_WARN_REG_SPLIT_DEL;
-        }
-
-        gtk_dialog_add_button (GTK_DIALOG (dialog),
-                              GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
-        gnc_gtk_dialog_add_button (dialog, _("_Delete Split"),
-                                  GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT);
-        response = gnc_dialog_run (GTK_DIALOG (dialog), warning);
-        gtk_widget_destroy (dialog);
-        if (response != GTK_RESPONSE_ACCEPT)
-            return;
-
-        gnc_tree_view_split_reg_delete_current_split (view);
-        return;
-    }
-
-    g_return_if_fail (depth == TRANS1 || depth == TRANS2);
-
-    /* On a transaction cursor with 2 or fewer splits in single or double
-     * mode, we just delete the whole transaction, kerblooie */
-    {
-        const char *title = _("Delete the current transaction?");
-        const char *recn_warn = _("You would be deleting a transaction "
-                                  "with reconciled splits! "
-                                  "This is not a good idea as it will cause your "
-                                  "reconciled balance to be off.");
-
-        dialog = gtk_message_dialog_new (GTK_WINDOW (window),
-                                        GTK_DIALOG_MODAL
-                                        | GTK_DIALOG_DESTROY_WITH_PARENT,
-                                        GTK_MESSAGE_WARNING,
-                                        GTK_BUTTONS_NONE,
-                                        "%s", title);
-        if (xaccTransHasReconciledSplits (trans))
-        {
-            gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-                    "%s", recn_warn);
-            warning = GNC_PREF_WARN_REG_TRANS_DEL_RECD;
-        }
-        else
-        {
-            warning = GNC_PREF_WARN_REG_TRANS_DEL;
-        }
-        gtk_dialog_add_button (GTK_DIALOG (dialog),
-                              GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
-        gnc_gtk_dialog_add_button (dialog, _("_Delete Transaction"),
-                                  GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT);
-        response =  gnc_dialog_run (GTK_DIALOG (dialog), warning);
-        gtk_widget_destroy (dialog);
-        if (response != GTK_RESPONSE_ACCEPT)
-            return;
-
-        gnc_tree_view_split_reg_delete_current_trans (view);
-        return;
-    }
-}
-
-
-/* Add Reverse Transaction */
-void
-gnc_tree_control_split_reg_reverse_current (GncTreeViewSplitReg *view)
-{
-    GtkWidget *window;
-    Transaction *trans = NULL, *new_trans = NULL;
-    GList *snode = NULL;
-    gboolean changed = FALSE;
-
-    ENTER(" ");
-
-    trans = gnc_tree_view_split_reg_get_current_trans (view);
-
-    if (trans == NULL)
-    {
-        LEAVE("Trans is Null");
-        return;
-    }
-
-    /* See if we were asked to reverse a blank trans. */
-    if (trans == gnc_tree_control_split_reg_get_blank_trans (view))
-    {
-        LEAVE("Skip blank trans");
-        return;
-    }
-
-    /* Test for read only */
-    if (gtc_sr_is_trans_readonly_and_warn (view, trans))
-    {
-        LEAVE("Read only");
-        return;
-    }
-
-    /* See if we are being edited in another register */
-    if (gtc_sr_trans_test_for_edit (view, trans))
-    {
-        LEAVE("Open in different register");
-        return;
-    }
-
-    window = gnc_tree_view_split_reg_get_parent (view);
-
-    if (xaccTransGetReversedBy (trans))
-    {
-        gnc_error_dialog (window, "%s",
-                         _("A reversing entry has already been created for this transaction."));
-        LEAVE("Already have reversing transaction");
-        return;
-    }
-
-    /* Make sure we ask to commit any changes before we add reverse transaction */
-    if (gtc_sr_trans_open_and_warn (view, trans))
-    {
-        LEAVE("save cancelled");
-        return;
-    }
-
-    /* Create reverse transaction */
-    new_trans = xaccTransReverse (trans);
-
-    xaccTransBeginEdit (new_trans);
-
-    /* Clear transaction level info */
-    xaccTransSetDatePostedSecsNormalized (new_trans, gnc_time (NULL));
-    xaccTransSetDateEnteredSecs (new_trans, gnc_time (NULL));
-
-    xaccTransCommitEdit (new_trans);
-
-    // We need to loop through the splits and send an event to update the register.
-    for (snode = xaccTransGetSplitList (new_trans); snode; snode = snode->next)
-    {
-        if (xaccTransStillHasSplit (new_trans, snode->data))
-        {
-           /* Send an event based on the split account */
-           qof_event_gen (QOF_INSTANCE (xaccSplitGetAccount(snode->data)), GNC_EVENT_ITEM_ADDED, snode->data);
-        }
-    }
-
-    /* give gtk+ a chance to handle pending events */
-    while (gtk_events_pending ())
-        gtk_main_iteration ();
-
-    /* Now jump to new trans */
-    gnc_tree_control_split_reg_jump_to (view, NULL, xaccTransGetSplit (new_trans, 0), FALSE);
-
-    LEAVE("Reverse transaction created");
-}
-
-
-/* Duplicate the current selection */
-gboolean
-gnc_tree_control_split_reg_duplicate_current (GncTreeViewSplitReg *view)
-{
-    GncTreeModelSplitReg *model;
-    GtkWidget *window;
-    RowDepth depth;
-    Transaction *trans;
-    Split *blank_split;
-    Split *split, *trans_split;
-    gboolean changed = FALSE;
-    gboolean use_split_action_for_num_field = FALSE;
-
-    ENTER("");
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    blank_split = gnc_tree_control_split_reg_get_blank_split (view);
-    split = gnc_tree_view_split_reg_get_current_split (view);
-    trans_split = gnc_tree_control_split_reg_get_current_trans_split (view);
-
-
-    depth = gnc_tree_view_reg_get_selected_row_depth (view);
-
-    use_split_action_for_num_field = qof_book_use_split_action_for_num_field (gnc_get_current_book());
-
-    trans = gnc_tree_view_split_reg_get_current_trans (view);
-
-    /* This shouldn't happen, but be paranoid. */
-    if (trans == NULL)
-        return FALSE;
-
-    /* See if we were asked to change a blank trans. */
-    if (trans == gnc_tree_control_split_reg_get_blank_trans (view))
-    {
-        LEAVE("Skip blank trans");
-        return FALSE;
-    }
-
-    /* See if we were asked to change a blank split. */
-    if (split == blank_split)
-    {
-        LEAVE("Skip blank split");
-        return FALSE;
-    }
-
-    /* Test for read only */
-    if (gtc_sr_is_trans_readonly_and_warn (view, trans))
-    {
-        LEAVE("Read only");
-        return FALSE;
-    }
-
-    /* See if we are being edited in another register */
-    if (gtc_sr_trans_test_for_edit (view, trans))
-    {
-        LEAVE("Open in different register");
-        return FALSE;
-    }
-
-    /* Make sure we ask to commit any changes before we proceed */
-    if (gtc_sr_trans_open_and_warn (view, trans))
-    {
-        LEAVE("save cancelled");
-        return FALSE;
-    }
-
-    window = gnc_tree_view_split_reg_get_parent (view);
-
-    /* Ok, we are now ready to make the copy. */
-    if (depth == SPLIT3)
-    {
-        Split *new_split;
-        gboolean new_act_num = FALSE;
-        char *out_num;
-        time64 date;
-
-        /* We are on a split in an expanded transaction.
-         * Just copy the split and add it to the transaction.
-         * However, if the split-action field is being used as the register 
-         * number, and the action field is a number, request a new value or
-         * cancel. Need to get next number and update account last num from
-         * split account not register account, which may be the same or not */
-
-        if (split != trans_split)
-        {
-            if (use_split_action_for_num_field && gnc_strisnum (gnc_get_num_action (NULL, split)))
-            {
-                Account *account = xaccSplitGetAccount (split);
-                const char* title = _("New Split Information");
-                const char *in_num = NULL;
-                date = time (0);
-
-                if (account)
-                    in_num = xaccAccountGetLastNum (account);
-                else
-                    in_num = gnc_get_num_action (NULL, split);
-
-                if (!gnc_dup_trans_dialog (window, title, FALSE,
-                                           &date, in_num, &out_num, NULL, NULL))
-                {
-                    LEAVE("dup cancelled");
-                    return FALSE;
-                }
-                new_act_num = TRUE;
-            }
-
-            new_split = xaccMallocSplit (gnc_get_current_book ());
-
-            // Remove the blank split
-            gnc_tree_model_split_reg_set_blank_split_parent (model, trans, TRUE);
-
-            if (!xaccTransIsOpen (trans))
-                xaccTransBeginEdit (trans);
-            gnc_tree_view_split_reg_set_dirty_trans (view, trans);
-
-            xaccSplitCopyOnto (split, new_split);
-            xaccSplitSetParent (new_split, trans);
-
-            // Add the blank split
-            gnc_tree_model_split_reg_set_blank_split_parent (model, trans, FALSE);
-
-            if (new_act_num) /* if new number supplied by user dialog */
-                gnc_set_num_action (NULL, new_split, out_num, NULL);
-
-            if (new_act_num && gnc_strisnum (out_num))
-            {
-                Account *account = xaccSplitGetAccount (new_split);
-
-                /* If current register is for account, set last num */
-                if (account == gnc_tree_model_split_reg_get_anchor (model))
-                    xaccAccountSetLastNum (account, out_num);
-            }
-            if (new_act_num)
-                g_free (out_num);
-        }
-        else
-        {
-            gnc_error_dialog (window, "%s",
-                         _("This is the split anchoring this transaction to the register."
-                           " You can not duplicate it from this register window."));
-            LEAVE("split anchoring this transaction");
-            return FALSE;
-        }
-    }
-    else
-    {
-        Transaction *new_trans;
-        int trans_split_index;
-        int split_index;
-        const char *in_num = NULL;
-        const char *in_tnum = NULL;
-        char *out_num;
-        char *out_tnum;
-        time64 date;
-        gboolean use_autoreadonly = qof_book_uses_autoreadonly (gnc_get_current_book());
-
-        /* We are on a transaction row. Copy the whole transaction. */
-
-        date = time (0);
-        if (gnc_strisnum (gnc_get_num_action (trans, trans_split)))
-        {
-            Account *account = gnc_tree_model_split_reg_get_anchor (model);
-
-            if (account)
-                in_num = xaccAccountGetLastNum (account);
-            else
-                in_num = gnc_get_num_action (trans, trans_split);
-        }
-
-        in_tnum = (use_split_action_for_num_field
-                                        ? gnc_get_num_action (trans, NULL)
-                                        : NULL);
-
-        if (!gnc_dup_trans_dialog (window, NULL, TRUE,
-                                   &date, in_num, &out_num, in_tnum, &out_tnum))
-        {
-            LEAVE("dup cancelled");
-            return FALSE;
-        }
-
-        if (use_autoreadonly)
-        {
-            GDate d;
-            GDate *readonly_threshold = qof_book_get_autoreadonly_gdate (gnc_get_current_book());
-            gnc_gdate_set_time64 (&d, date);
-            if (g_date_compare (&d, readonly_threshold) < 0)
-            {
-                GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW (window),
-                                    0,
-                                    GTK_MESSAGE_ERROR,
-                                    GTK_BUTTONS_OK,
-                                    "%s", _("Cannot store a transaction at this date"));
-                gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-                        "%s", _("The entered date of the duplicated transaction is older than the \"Read-Only Threshold\" set for this book. "
-                                "This setting can be changed in File -> Properties -> Accounts."));
-                gtk_dialog_run (GTK_DIALOG (dialog));
-                gtk_widget_destroy (dialog);
-
-                g_date_free (readonly_threshold);
-                LEAVE("entered date older than read-only threshold");
-                return FALSE;
-            }
-            g_date_free (readonly_threshold);
-        }
-
-        trans_split_index = xaccTransGetSplitIndex (trans, trans_split);
-
-        new_trans = xaccMallocTransaction (gnc_get_current_book ());
-
-        xaccTransBeginEdit (new_trans);
-
-        xaccTransCopyOnto (trans, new_trans);
-
-        xaccTransSetDatePostedSecsNormalized (new_trans, date);
-
-        /* We also must set a new DateEntered on the new entry
-         * because otherwise the ordering is not deterministic */
-        xaccTransSetDateEnteredSecs(new_trans, gnc_time(NULL));
-
-        /* set per book option */
-        gnc_set_num_action (new_trans, NULL, out_num, out_tnum);
-
-        if (gnc_strisnum (out_num))
-        {
-            Account *account = gnc_tree_model_split_reg_get_anchor (model);
-
-            /* If current register is for account, set last num */
-            if (account)
-                xaccAccountSetLastNum (account, out_num);
-        }
-
-        if (use_split_action_for_num_field)
-        {
-            /* find split in new_trans that equals trans_split and set
-             * split_action to out_num */
-            gnc_set_num_action (NULL,
-                                xaccTransGetSplit (new_trans, trans_split_index),
-                                out_num, NULL);
-            /* note that if the transaction has multiple splits to the register
-             * account, only the anchor split will be set with user input. The
-             * user will have to adjust other splits manually. */
-        }
-
-        xaccTransCommitEdit (new_trans);
-
-        if (out_num != NULL)
-           g_free (out_num);
-
-        if (use_split_action_for_num_field && out_tnum != NULL)
-            g_free (out_tnum);
-    }
-    LEAVE(" ");
-    return TRUE;
-}
-
-
-static gboolean gtcsr_move_current_entry_updown(GncTreeViewSplitReg *view,
-                                                gboolean move_up, gboolean really_do_it)
-{
-    GncTreeModelSplitReg *model;
-    GtkTreePath *mpath = NULL, *spath = NULL, *spath_target = NULL, *mpath_target = NULL;
-    GtkTreeIter m_iter, m_iter_target;
-    gboolean resultvalue = FALSE;
-    g_return_val_if_fail(view, FALSE);
-
-    ENTER("");
-
-    if (view->sort_col != COL_DATE)
-    {
-        LEAVE("Not sorted by date - no up/down move available");
-        return FALSE;
-    }
-
-    // The allocated memory references will all be cleaned up in the
-    // updown_finish: label.
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-    g_return_val_if_fail(model, FALSE);
-
-    mpath = gnc_tree_view_split_reg_get_current_path (view);
-    if (!mpath)
-    {
-        LEAVE("No current path available - probably on the blank split.");
-        goto updown_finish;
-    }
-
-    spath = gnc_tree_view_split_reg_get_sort_path_from_model_path (view, mpath);
-    g_return_val_if_fail(spath, FALSE);
-
-    spath_target = gtk_tree_path_copy(spath);
-    if (move_up)
-    {
-        gboolean move_was_made = gtk_tree_path_prev(spath_target);
-        if (!move_was_made)
-        {
-            LEAVE("huh, no path_prev() possible");
-            goto updown_finish;
-        }
-    }
-    else
-    {
-        gtk_tree_path_next(spath_target);
-        // The path_next() function does not give a return value, see
-        // https://mail.gnome.org/archives/gtk-list/2010-January/msg00171.html
-    }
-
-    if (gtk_tree_path_compare(spath, spath_target) == 0)
-    {
-        LEAVE("oops, paths are equal");
-        goto updown_finish;
-    }
-
-    mpath_target = gnc_tree_view_split_reg_get_model_path_from_sort_path (view, spath_target);
-    if (!mpath_target)
-    {
-        LEAVE("no path to target row");
-        goto updown_finish;
-    }
-
-    if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &m_iter, mpath))
-    {
-        LEAVE("No iter for current row");
-        goto updown_finish;
-    }
-    if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &m_iter_target, mpath_target))
-    {
-        LEAVE("No iter for target row");
-        goto updown_finish;
-    }
-
-    {
-        gboolean is_blank, is_blank_target;
-        Split *current_split, *target_split;
-        Transaction *current_trans, *target_trans;
-        gnc_tree_model_split_reg_get_split_and_trans (GNC_TREE_MODEL_SPLIT_REG (model), &m_iter,
-                                                      NULL, NULL, NULL, &is_blank,
-                                                      &current_split, &current_trans);
-        gnc_tree_model_split_reg_get_split_and_trans (GNC_TREE_MODEL_SPLIT_REG (model), &m_iter_target,
-                                                      NULL, NULL, NULL, &is_blank_target,
-                                                      &target_split, &target_trans);
-        if (is_blank || is_blank_target)
-        {
-            LEAVE("blank split involved, ignored.");
-            goto updown_finish;
-        }
-        if (xaccTransEqual(current_trans, target_trans, TRUE, FALSE, FALSE, FALSE))
-        {
-            LEAVE("two times the same txn, ignored.");
-            goto updown_finish;
-        }
-        if (xaccTransGetIsClosingTxn(current_trans)
-                || xaccTransGetIsClosingTxn(target_trans))
-        {
-            LEAVE("One of the txn is book-closing - no re-ordering allowed.");
-            goto updown_finish;
-        }
-
-        /* Only continue if both have the same date and num, because the
-         * "standard ordering" is tied to the date anyway. */
-        {
-            Timespec t1, t2;
-            GDate d1 = xaccTransGetDatePostedGDate(current_trans),
-                  d2 = xaccTransGetDatePostedGDate(target_trans);
-            if (g_date_compare(&d1, &d2) != 0)
-            {
-                LEAVE("unequal DatePosted, ignoring");
-                goto updown_finish;
-            }
-            if (g_strcmp0(xaccTransGetNum(current_trans),
-                          xaccTransGetNum(target_trans)) != 0)
-            {
-                LEAVE("unequal Num, ignoring");
-                goto updown_finish;
-            }
-
-            /* Special treatment if the equality doesn't hold if we access the
-            dates as timespec. See the comment in gncEntrySetDateGDate() for the
-            reason: Some code used the timespec at noon for the EntryDate, other
-            code used the timespec at the start of day. */
-            t1 = xaccTransRetDatePostedTS(current_trans);
-            t2 = xaccTransRetDatePostedTS(target_trans);
-            if (really_do_it && !timespec_equal(&t1, &t2))
-            {
-                /* Timespecs are not equal, even though the GDates were equal? Then
-                we set the GDates again. This will force the timespecs to be equal
-                as well. */
-                xaccTransSetDatePostedGDate(current_trans, d1);
-                xaccTransSetDatePostedGDate(target_trans, d2);
-            }
-        }
-
-        // Check whether any of the two splits are frozen
-        if (xaccSplitGetReconcile(current_split) == FREC
-                || xaccSplitGetReconcile(target_split) == FREC)
-        {
-            LEAVE("either current or target split is frozen. No modification allowed.");
-            goto updown_finish;
-        }
-
-        // If really_do_it is FALSE, we are only in query mode and shouldn't
-        // modify anything. But if it is TRUE, please go ahead and do the move.
-        if (really_do_it)
-        {
-            // Check whether any of the two splits are reconciled
-            if (xaccSplitGetReconcile(current_split) == YREC
-                    && !gnc_tree_control_split_reg_recn_test(view, spath))
-            {
-                LEAVE("current split is reconciled and user chose not to modify it");
-                goto updown_finish;
-            }
-            if (xaccSplitGetReconcile(target_split) == YREC
-                    && !gnc_tree_control_split_reg_recn_test(view, spath_target))
-            {
-                LEAVE("target split is reconciled and user chose not to modify it");
-                goto updown_finish;
-            }
-
-            PINFO("Ok, about to switch ordering for current desc='%s' target desc='%s'",
-                  xaccTransGetDescription(current_trans),
-                  xaccTransGetDescription(target_trans));
-
-            gnc_suspend_gui_refresh ();
-
-            /* Swap the date-entered of both entries. That's already
-             * sufficient! */
-            {
-                Timespec time_current = xaccTransRetDateEnteredTS(current_trans);
-                Timespec time_target = xaccTransRetDateEnteredTS(target_trans);
-
-                /* Special treatment for identical times (potentially caused
-                 * by the "duplicate entry" command) */
-                if (timespec_equal(&time_current, &time_target))
-                {
-                    g_warning("Surprise - both DateEntered are equal.");
-                    /* We just increment the DateEntered of the previously
-                     * lower of the two by one second. This might still cause
-                     * issues if multiple entries had this problem, but
-                     * whatever. */
-                    if (move_up)
-                        time_current.tv_sec++;
-                    else
-                        time_target.tv_sec++;
-                }
-
-                /* Write the new DateEntered. */
-                xaccTransSetDateEnteredTS(current_trans, &time_target);
-                xaccTransSetDateEnteredTS(target_trans, &time_current);
-
-                /* FIXME: Do we need to notify anyone about the changed ordering? */
-            }
-
-            gnc_resume_gui_refresh ();
-
-            LEAVE("two txn switched, done.");
-        }
-        resultvalue = TRUE;
-        goto updown_finish;
-    }
-updown_finish:
-    // memory cleanup
-    //gtk_tree_path_free (mpath); // Should this be freed??
-    gtk_tree_path_free(spath);
-    gtk_tree_path_free(spath_target);
-    gtk_tree_path_free(mpath_target);
-    return resultvalue;
-}
-
-gboolean gnc_tree_control_split_reg_move_current_entry_updown (GncTreeViewSplitReg *view,
-                                                            gboolean move_up)
-{
-    return gtcsr_move_current_entry_updown(view, move_up, TRUE);
-}
-
-gboolean gnc_tree_control_split_reg_is_current_movable_updown (GncTreeViewSplitReg *view,
-                                                               gboolean move_up)
-{
-    return gtcsr_move_current_entry_updown(view, move_up, FALSE);
-}
-
-
-/* Save any open edited transactions on closing register */
-gboolean
-gnc_tree_control_split_reg_save (GncTreeViewSplitReg *view, gboolean reg_closing)
-{
-    GncTreeModelSplitReg *model;
-    RowDepth depth;
-    Transaction *dirty_trans;
-    Transaction *blank_trans;
-    Transaction *trans;
-    Account *account;
-    Split *blank_split;
-    const char *memo;
-    const char *desc;
-    Split *split, *current_trans_split;
-
-    ENTER("view=%p, reg_closing=%s", view, reg_closing ? "TRUE" : "FALSE");
-
-    if (!view)
-    {
-        LEAVE("no view");
-        return FALSE;
-    }
-
-    /* Make sure we have stopped editing */
-    gnc_tree_view_split_reg_finish_edit (view);
-
-    if (reg_closing)
-        view->reg_closing = TRUE;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    blank_split = gnc_tree_control_split_reg_get_blank_split (view);
-    dirty_trans = gnc_tree_view_split_reg_get_dirty_trans (view);
-    blank_trans = gnc_tree_control_split_reg_get_blank_trans (view);
-
-    /* get the handle to the current split and transaction */
-    split = gnc_tree_view_split_reg_get_current_split (view);
-    trans = gnc_tree_view_split_reg_get_current_trans (view);
-
-    current_trans_split = gnc_tree_control_split_reg_get_current_trans_split (view);
-
-    if (trans == NULL)
-    {
-        LEAVE("no transaction");
-        return FALSE;
-    }
-
-    if (!xaccTransIsOpen (trans))
-    {
-        LEAVE("transaction not open");
-        return FALSE;
-    }
-
-    if (trans == dirty_trans )
-    {
-        if (trans != blank_trans)
-        {
-           /* Existing Transaction, we are going to commit. */
-
-            PINFO("committing trans (%p)", trans);
-            xaccTransCommitEdit (trans);
-            gnc_tree_view_split_reg_set_dirty_trans (view, NULL);
-
-            LEAVE("Existing Transaction committed");
-            return TRUE;
-        }
-        else
-        {
-           /* Blank Transaction, we are going to commit. */
-
-            PINFO("start committing blank trans (%p)", trans);
-//FIXME More stuff ?
-
-            if (xaccTransCountSplits (trans) == 0)
-            {
-                GtkWidget *dialog, *window;
-                gint response;
-                const char *title = _("Not enough information for Blank Transaction?");
-                const char *message =
-                    _("The blank transaction does not have enough information to save it. Would you like to "
-                      "return to the transaction to update, or cancel the save?");
-                window = gnc_tree_view_split_reg_get_parent (view);
-                dialog = gtk_message_dialog_new (GTK_WINDOW (window),
-                                        GTK_DIALOG_DESTROY_WITH_PARENT,
-                                        GTK_MESSAGE_QUESTION,
-                                        GTK_BUTTONS_CANCEL,
-                                        "%s", title);
-                gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-                        "%s", message);
-                gtk_dialog_add_button (GTK_DIALOG (dialog),
-                              _("_Return"), GTK_RESPONSE_ACCEPT);
-
-                gtk_widget_grab_focus (gtk_dialog_get_widget_for_response (GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT));
-
-                response = gtk_dialog_run (GTK_DIALOG (dialog));
-//                response = gnc_dialog_run (GTK_DIALOG (dialog), "transaction_incomplete");
-                gtk_widget_destroy (dialog);
-
-                if (response != GTK_RESPONSE_ACCEPT)
-                {
-                    LEAVE("save cancelled");
-                    return TRUE;
-                }
-                LEAVE("return to transaction");
-                return FALSE;
-            }
-
-            xaccTransCommitEdit (trans);
-            gnc_tree_view_split_reg_set_dirty_trans (view, NULL);
-
-            LEAVE("Blank Transaction committed");
-            return TRUE;
-        }
-    }
-
-    LEAVE(" ");
-    return TRUE;
-}
-
-
-/* Allow the reconcile flag to be changed */
-gboolean
-gnc_tree_control_split_reg_recn_change (GncTreeViewSplitReg *view, GtkTreePath *spath)
-{
-    GtkWidget *dialog, *window;
-    GncTreeModelSplitReg *model;
-    GtkTreePath *mpath;
-    GtkTreeIter m_iter;
-    Split *split = NULL;
-    Transaction *trans = NULL;
-    gboolean is_trow1, is_trow2, is_split, is_blank;
-    Account *anchor;
-    char rec;
-    const gchar *title = _("Mark split as unreconciled?");
-    const gchar *message =
-        _("You are about to mark a reconciled split as unreconciled. Doing "
-          "so might make future reconciliation difficult! Continue "
-          "with this change?");
-    gint response;
-
-    ENTER(" ");
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    anchor = gnc_tree_model_split_reg_get_anchor (model);
-
-    mpath = gnc_tree_view_split_reg_get_model_path_from_sort_path (view, spath);
-
-    if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &m_iter, mpath))
-    {
-        gtk_tree_path_free (mpath);
-        return FALSE;
-    }
-
-    gnc_tree_model_split_reg_get_split_and_trans (GNC_TREE_MODEL_SPLIT_REG (model), &m_iter,
-                                 &is_trow1, &is_trow2, &is_split, &is_blank, &split, &trans);
-
-    if (is_trow1 || is_trow2)
-        split = xaccTransFindSplitByAccount (trans, anchor);
-
-    rec = xaccSplitGetReconcile (split);
-
-    if (rec != YREC)
-    {
-        gtk_tree_path_free (mpath);
-        LEAVE("Not reconciled");
-        return TRUE;
-    }
-
-    /* Does the user want to be warned? */
-    window = gnc_tree_view_split_reg_get_parent (view);
-    dialog =
-        gtk_message_dialog_new (GTK_WINDOW (window),
-                               GTK_DIALOG_DESTROY_WITH_PARENT,
-                               GTK_MESSAGE_WARNING,
-                               GTK_BUTTONS_CANCEL,
-                               "%s", title);
-    gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-            "%s", message);
-    gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Unreconcile"),
-                          GTK_RESPONSE_YES);
-    response = gnc_dialog_run (GTK_DIALOG (dialog), GNC_PREF_WARN_REG_RECD_SPLIT_UNREC);
-    gtk_widget_destroy (dialog);
-
-    if (response == GTK_RESPONSE_YES)
-    {
-        char rec = 'n';
-        trans = xaccSplitGetParent (split);
-
-        gnc_tree_view_split_reg_set_dirty_trans (view, trans);
-        if (!xaccTransIsOpen (trans))
-            xaccTransBeginEdit (trans);
-
-        xaccSplitSetReconcile (split, rec);
-
-        gtk_tree_path_free (mpath);
-        LEAVE("mark split unreconciled");
-        return TRUE;
-    }
-    gtk_tree_path_free (mpath);
-    LEAVE("Canceled split unreconciled");
-    return FALSE;
-}
-
-
-/* Test for splits being reconciled and decide to allow changes */
-gboolean
-gnc_tree_control_split_reg_recn_test (GncTreeViewSplitReg *view, GtkTreePath *spath)
-{
-    GncTreeModelSplitReg *model;
-    GtkTreePath *mpath;
-    GtkTreeIter m_iter;
-    Split *split = NULL;
-    Transaction *trans = NULL;
-    gboolean is_trow1, is_trow2, is_split, is_blank;
-    Account *anchor;
-    char recn;
-
-    ENTER(" ");
-
-    /* This assumes we reset the flag whenever we change splits. */
-    if (view->change_allowed)
-    {
-        LEAVE("change allowed is set");
-        return TRUE;
-    }
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    anchor = gnc_tree_model_split_reg_get_anchor (model);
-
-    mpath = gnc_tree_view_split_reg_get_model_path_from_sort_path (view, spath);
-
-    if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &m_iter, mpath))
-    {
-        gtk_tree_path_free (mpath);
-        LEAVE("No path");
-        return TRUE;
-    }
-
-    gnc_tree_model_split_reg_get_split_and_trans (GNC_TREE_MODEL_SPLIT_REG (model), &m_iter,
-                                 &is_trow1, &is_trow2, &is_split, &is_blank, &split, &trans);
-
-    if (is_trow1 || is_trow2)
-        split = xaccTransFindSplitByAccount (trans, anchor);
-
-    if (!split)
-    {
-        gtk_tree_path_free (mpath);
-        LEAVE("No split");
-        return TRUE;
-    }
-
-    recn = xaccSplitGetReconcile (split);
-
-    if (recn == YREC || xaccTransHasReconciledSplits (trans))
-    {
-        GtkWidget *dialog, *window;
-        gint response;
-        const gchar *title;
-        const gchar *message;
-
-        if(recn == YREC)
-        {
-            title = _("Change reconciled split?");
-            message =
-             _("You are about to change a reconciled split. Doing so might make "
-               "future reconciliation difficult! Continue with this change?");
-        }
-        else
-        {
-            title = _("Change split linked to a reconciled split?");
-            message =
-            _("You are about to change a split that is linked to a reconciled split. "
-              "Doing so might make future reconciliation difficult! Continue with this change?");
-        }
-
-        /* Does the user want to be warned? */
-        window = gnc_tree_view_split_reg_get_parent (view);
-        dialog =
-            gtk_message_dialog_new (GTK_WINDOW (window),
-                                   GTK_DIALOG_DESTROY_WITH_PARENT,
-                                   GTK_MESSAGE_WARNING,
-                                   GTK_BUTTONS_CANCEL,
-                                   "%s", title);
-        gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-                "%s", message);
-        gtk_dialog_add_button (GTK_DIALOG (dialog), _("Chan_ge Split"),
-                              GTK_RESPONSE_YES);
-        response = gnc_dialog_run (GTK_DIALOG (dialog), GNC_PREF_WARN_REG_RECD_SPLIT_MOD);
-        gtk_widget_destroy (dialog);
-
-        if (response != GTK_RESPONSE_YES)
-        {
-            gtk_tree_path_free (mpath);
-            LEAVE("cancel reconciled split");
-            return FALSE;
-        }
-    }
-    view->change_allowed = TRUE;
-    gtk_tree_path_free (mpath);
-    LEAVE(" ");
-    return TRUE;
-}
-
-
-/* Return the account for name given or create it */ 
-Account *
-gnc_tree_control_split_reg_get_account_by_name (GncTreeViewSplitReg *view, const char *name)
-{
-    GtkWidget *window;
-    const char *placeholder = _("The account %s does not allow transactions.");
-    const char *missing = _("The account %s does not exist. "
-                            "Would you like to create it?");
-    char *account_name;
-    Account *account;
-
-    if (!name || (strlen(name) == 0))
-        return NULL;
-
-    /* Find the account */
-    if (gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_SHOW_LEAF_ACCT_NAMES))
-        account = gnc_account_lookup_by_name (gnc_get_current_root_account(), name);
-    else
-        account = gnc_account_lookup_by_full_name (gnc_get_current_root_account(), name);
-
-    if (!account)
-        account = gnc_account_lookup_by_code (gnc_get_current_root_account(), name);
-
-    window = gnc_tree_view_split_reg_get_parent (view);
-
-    if (!account)
-    {
-        /* Ask if they want to create a new one. */
-        if (!gnc_verify_dialog (window, TRUE, missing, name))
-            return NULL;
-
-        /* User said yes, they want to create a new account. */
-        account = gnc_ui_new_accounts_from_name_window (name);
-        if (!account)
-            return NULL;
-    }
-    /* Now have the account. */
-
-    /* See if the account (either old or new) is a placeholder. */
-    if (xaccAccountGetPlaceholder (account))
-        gnc_error_dialog (window, placeholder, name);
-
-    /* Be seeing you. */
-    return account;
-}
-
-/*****************************************************************************
- *                         ClipBoard Functions                               *
- *****************************************************************************/
-static Transaction *clipboard_trans = NULL;
-/* Must never dereference. */
-static const Account *clipboard_acct = NULL;
-
-
-/* Return the split account for which ancestor is it's parent */
-static Account *
-gtc_sr_get_account_for_trans_ancestor (const Transaction *trans, const Account *ancestor)
-{
-    GList *node;
-
-    for (node = xaccTransGetSplitList (trans); node; node = node->next)
-    {
-        Split *split = node->data;
-        Account *split_acc = xaccSplitGetAccount (split);
-
-        if (!xaccTransStillHasSplit (trans, split))
-            continue;
-
-        if (ancestor == split_acc)
-            return split_acc;
-
-        if (ancestor && xaccAccountHasAncestor (split_acc, ancestor))
-            return split_acc;
-    }
-    return NULL;
-}
-
-
-void
-gnc_tree_control_split_reg_cut_trans (GncTreeViewSplitReg *view)
-{
-    GncTreeModelSplitReg *model;
-    Transaction *from_trans;
-    Account *anchor;
-
-    g_return_if_fail (GNC_IS_TREE_VIEW_SPLIT_REG (view));
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    anchor = gnc_tree_model_split_reg_get_anchor (model);
-
-    from_trans = gnc_tree_view_split_reg_get_current_trans (view);
-    if (!from_trans)
-        return;
-
-    /* Test for read only */
-    if (gtc_sr_is_trans_readonly_and_warn (view, from_trans))
-        return;
-
-    if (!xaccTransIsOpen (clipboard_trans))
-        xaccTransBeginEdit (clipboard_trans);
-    if (clipboard_trans)
-        xaccTransDestroy (clipboard_trans);
-
-    clipboard_trans = xaccTransCopyToClipBoard (from_trans);
-    clipboard_acct = gtc_sr_get_account_for_trans_ancestor (from_trans, anchor);
-
-    gnc_tree_view_split_reg_delete_current_trans (view);
-}
-
-
-void
-gnc_tree_control_split_reg_copy_trans (GncTreeViewSplitReg *view)
-{
-    GncTreeModelSplitReg *model;
-    Transaction *from_trans;
-    Account *from_acc, *anchor;
-
-    g_return_if_fail (GNC_IS_TREE_VIEW_SPLIT_REG (view));
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    from_trans = gnc_tree_view_split_reg_get_current_trans (view);
-    if (!from_trans)
-        return;
-
-    anchor = gnc_tree_model_split_reg_get_anchor (model);
-
-    clipboard_acct = gtc_sr_get_account_for_trans_ancestor (from_trans, anchor);
-
-    if (!xaccTransIsOpen (clipboard_trans))
-        xaccTransBeginEdit (clipboard_trans);
-    if (clipboard_trans)
-        xaccTransDestroy (clipboard_trans);
-
-    clipboard_trans = xaccTransCopyToClipBoard (from_trans);
-}
-
-void
-gnc_tree_control_split_reg_paste_trans (GncTreeViewSplitReg *view)
-{
-    GncTreeModelSplitReg *model;
-    Account *anchor_acct;
-    Transaction *to_trans;
-
-    g_return_if_fail (GNC_IS_TREE_VIEW_SPLIT_REG (view));
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-    anchor_acct = gnc_tree_model_split_reg_get_anchor (model);
-
-    to_trans = gnc_tree_view_split_reg_get_current_trans (view);
-    if (!to_trans || !clipboard_trans)
-        return;
-
-    /* See if we are being edited in another register */
-    if (gtc_sr_trans_test_for_edit (view, to_trans))
-        return;
-
-    /* Test for read only */
-    if (gtc_sr_is_trans_readonly_and_warn (view, to_trans))
-        return;
-
-    //FIXME You can not paste from gl to a register, is this too simplistic
-    if (clipboard_acct == NULL && anchor_acct != NULL)
-    {
-        GtkWidget *window;
-
-        window = gnc_tree_view_split_reg_get_parent (view);
-        gnc_error_dialog (window, "%s",
-                         _("You can not paste from the general ledger to a register."));
-        return;
-    }
-
-    gnc_tree_view_split_reg_set_dirty_trans (view, to_trans);
-    if (!xaccTransIsOpen (to_trans))
-        xaccTransBeginEdit (to_trans);
-
-    // Remove the blank split
-    gnc_tree_model_split_reg_set_blank_split_parent (model, to_trans, TRUE);
-
-    xaccTransCopyFromClipBoard (clipboard_trans, to_trans, clipboard_acct, anchor_acct, FALSE);
-
-    // Add the blank split back
-    gnc_tree_model_split_reg_set_blank_split_parent (model, to_trans, FALSE);
-
-    // Refresh the view
-    g_signal_emit_by_name (model, "refresh_trans", NULL);
-}
-
-void
-gnc_tree_control_auto_complete (GncTreeViewSplitReg *view, Transaction *trans,  const gchar *new_text)
-{
-    GncTreeModelSplitReg *model;
-    Transaction          *btrans, *dirty_trans;
-    GtkListStore         *desc_list;
-    GtkTreeIter           iter;
-    gboolean              valid;
-
-    g_return_if_fail (GNC_IS_TREE_VIEW_SPLIT_REG (view));
-    DEBUG("auto_complete - trans %p and description '%s'", trans, new_text);
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    btrans = gnc_tree_model_split_get_blank_trans (model);
-
-    // if we are not looking at the blank trans, return.
-    if (trans != btrans)
-       return;
-
-    desc_list = gnc_tree_model_split_reg_get_description_list (model);
-
-    valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (desc_list), &iter);
-    while (valid)
-    {
-        Transaction *trans_from;
-        gchar *text;
-        // Walk through the list, reading each row
-        gtk_tree_model_get (GTK_TREE_MODEL (desc_list), &iter, 0, &text, 1, &trans_from, -1);
-
-        if (g_strcmp0 (text, new_text) == 0)
-        {
-            xaccTransCopyOnto (trans_from, trans);
-            g_free (text);
-            break;
-        }
-        g_free (text);
-
-        valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (desc_list), &iter);
-    }
-}
-

Deleted: gnucash/trunk/src/gnome-utils/gnc-tree-control-split-reg.h
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-control-split-reg.h	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-control-split-reg.h	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,126 +0,0 @@
-/********************************************************************\
- * gnc-tree-control-split-reg.h -- GtkTreeView implementation       *
- *                     to display registers   in a GtkTreeView.     *
- *                                                                  *
- * Copyright (C) 2006-2007 Chris Shoemaker <c.shoemaker at cox.net>    *
- * Copyright (C) 2012 Robert Fewell                                 *
- *                                                                  *
- * 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_TREE_CONTROL_SPLIT_REG_H
-#define __GNC_TREE_CONTROL_SPLIT_REG_H
-
-#include "gnc-tree-model-split-reg.h"
-#include "gnc-tree-view-split-reg.h"
-
-G_BEGIN_DECLS
-
-/*****************************************************************************/
-
-gboolean gnc_tree_control_split_reg_trans_open_and_warn (GncTreeViewSplitReg *view, Transaction *trans);
-
-gboolean gnc_tree_control_split_reg_trans_test_for_edit (GncTreeViewSplitReg *view, Transaction *trans);
-
-/*****************************************************************************/
-
-void gnc_tree_control_split_reg_exchange_rate (GncTreeViewSplitReg *view);
-
-void gnc_tree_control_split_reg_schedule_current_trans (GncTreeViewSplitReg *view);
-
-void gnc_tree_control_split_reg_void_current_trans (GncTreeViewSplitReg *view, const char *reason);
-
-void gnc_tree_control_split_reg_unvoid_current_trans (GncTreeViewSplitReg *view);
-
-gboolean gnc_tree_control_split_reg_jump_to_blank (GncTreeViewSplitReg *view);
-
-void gnc_tree_control_split_reg_jump_to (GncTreeViewSplitReg *view, Transaction *trans, Split *split, gboolean amount);
-
-void gnc_tree_control_split_reg_cancel_edit (GncTreeViewSplitReg *view, gboolean reg_closing);
-
-void gnc_tree_control_split_reg_goto_rel_trans_row (GncTreeViewSplitReg *view, gint relative);
-
-void gnc_tree_control_split_reg_enter (GncTreeViewSplitReg *view);
-
-void gnc_tree_control_split_reg_reinit (GncTreeViewSplitReg *view, gpointer data);
-
-void gnc_tree_control_split_reg_reverse_current (GncTreeViewSplitReg *view);
-
-void gnc_tree_control_split_reg_delete (GncTreeViewSplitReg *view, gpointer data);
-
-Transaction * gnc_tree_control_split_reg_get_blank_trans (GncTreeViewSplitReg *view);
-
-Split * gnc_tree_control_split_reg_get_current_trans_split (GncTreeViewSplitReg *view);
-
-Split * gnc_tree_control_split_reg_get_blank_split (GncTreeViewSplitReg *view);
-
-gboolean gnc_tree_control_split_reg_duplicate_current (GncTreeViewSplitReg *view);
-
-/** This implements the command of moving the current entry (where the
- * cursor is currently located) one row upwards or downwards (depending on the move_up parameter),
- * effectively swapping this row and the other row. If the other row
- * is empty (or it is the blank entry), nothing will happen.
- *
- * \param move_up If TRUE, the current entry is moved upwards,
- * otherwise downwards.
- * \return Whether the current entry has been moved into the queried direction
- */
-gboolean gnc_tree_control_split_reg_move_current_entry_updown (GncTreeViewSplitReg *reg,
-                                                            gboolean move_up);
-
-/** Query whether the current entry (where the cursor is currently located)
- * can be moved one row upwards or downwards (depending on the move_up parameter).
- *
- * \param move_up If TRUE, it is asked whether the current entry can be moved upwards,
- * otherwise downwards.
- * \return Whether the current entry can be moved into the queried direction
- */
-gboolean gnc_tree_control_split_reg_is_current_movable_updown (GncTreeViewSplitReg *view,
-                                                               gboolean move_up);
-
-
-gboolean gnc_tree_control_split_reg_save (GncTreeViewSplitReg *view, gboolean reg_closing);
-
-gboolean gnc_tree_control_split_reg_recn_change (GncTreeViewSplitReg *view, GtkTreePath *spath);
-
-gboolean gnc_tree_control_split_reg_recn_test (GncTreeViewSplitReg *view, GtkTreePath *spath);
-
-gboolean gnc_tree_control_split_reg_balance_trans (GncTreeViewSplitReg *view, Transaction *trans);
-
-Account * gnc_tree_control_split_reg_get_account_by_name (GncTreeViewSplitReg *view, const char *name);
-
-/*****************************************************************************/
-
-/* Cut transaction and copy to clipboard */
-void gnc_tree_control_split_reg_cut_trans (GncTreeViewSplitReg *view);
-
-/* Copy transaction to clipboard */
-void gnc_tree_control_split_reg_copy_trans (GncTreeViewSplitReg *view);
-
-/* Paste transaction from clipboard */
-void gnc_tree_control_split_reg_paste_trans (GncTreeViewSplitReg *view);
-
-/* Copy the last transaction with given description to the blank transaction */
-void gnc_tree_control_auto_complete (GncTreeViewSplitReg *view, Transaction *trans,  const gchar *new_text);
-
-/*****************************************************************************/
-
-G_END_DECLS
-
-#endif /* __GNC_TREE_CONTROL_SPLIT_REG_H */

Deleted: gnucash/trunk/src/gnome-utils/gnc-tree-model-split-reg.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-model-split-reg.c	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-model-split-reg.c	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,3381 +0,0 @@
-/********************************************************************\
- * gnc-tree-model-split-reg.c -- GtkTreeView implementation to      *
- *                       display registers in a GtkTreeView.        *
- *                                                                  *
- * Copyright (C) 2006-2007 Chris Shoemaker <c.shoemaker at cox.net>    *
- * Copyright (C) 2012 Robert Fewell                                 *
- *                                                                  *
- * 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 <string.h>
-
-#include "gnc-tree-model-split-reg.h"
-#include "gnc-component-manager.h"
-#include "gnc-commodity.h"
-#include "gnc-prefs.h"
-#include "gnc-engine.h"
-#include "gnc-event.h"
-#include "gnc-gobject-utils.h"
-#include "Query.h"
-#include "Transaction.h"
-#include "Scrub.h"
-
-#include "gnc-ui-util.h"
-#include "engine-helpers.h"
-
-#define TREE_MODEL_SPLIT_REG_CM_CLASS "tree-model-split-reg"
-
-#define STATE_SECTION_PREFIX "window/pages/register2/"
-
-/* Signal codes */
-enum
-{
-    REFRESH_TRANS,
-    REFRESH_STATUS_BAR,
-    REFRESH_VIEW,
-    SCROLL_SYNC,
-    SELECTION_MOVE_DELETE,
-    LAST_SIGNAL
-};
-
-
-/** Static Globals *******************************************************/
-static QofLogModule log_module = GNC_MOD_LEDGER;
-
-/** Declarations *********************************************************/
-static void gnc_tree_model_split_reg_class_init (GncTreeModelSplitRegClass *klass);
-static void gnc_tree_model_split_reg_init (GncTreeModelSplitReg *model);
-static void gnc_tree_model_split_reg_finalize (GObject *object);
-static void gnc_tree_model_split_reg_dispose (GObject *object);
-
-static guint gnc_tree_model_split_reg_signals[LAST_SIGNAL] = {0};
-
-static const gchar *iter_to_string (GtkTreeIter *iter);
-
-/** Implementation of GtkTreeModel  **************************************/
-static void gnc_tree_model_split_reg_tree_model_init (GtkTreeModelIface *iface);
-
-static GtkTreeModelFlags gnc_tree_model_split_reg_get_flags (GtkTreeModel *tree_model);
-static int gnc_tree_model_split_reg_get_n_columns (GtkTreeModel *tree_model);
-static GType gnc_tree_model_split_reg_get_column_type (GtkTreeModel *tree_model, int index);
-static gboolean gnc_tree_model_split_reg_get_iter (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath *path);
-static GtkTreePath *gnc_tree_model_split_reg_get_path (GtkTreeModel *tree_model, GtkTreeIter *iter);
-static void gnc_tree_model_split_reg_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, int column, GValue *value);
-static gboolean	gnc_tree_model_split_reg_iter_next (GtkTreeModel *tree_model, GtkTreeIter *iter);
-static gboolean	gnc_tree_model_split_reg_iter_children (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *parent);
-static gboolean	gnc_tree_model_split_reg_iter_has_child (GtkTreeModel *tree_model, GtkTreeIter *iter);
-static int gnc_tree_model_split_reg_iter_n_children (GtkTreeModel *tree_model, GtkTreeIter *iter);
-static gboolean	gnc_tree_model_split_reg_iter_nth_child (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *parent, int n);
-static gboolean	gnc_tree_model_split_reg_iter_parent (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *child);
-static void gtm_sr_increment_stamp (GncTreeModelSplitReg *model);
-
-
-static void gtm_sr_insert_trans (GncTreeModelSplitReg *model, Transaction *trans, gboolean before);
-static void gtm_sr_delete_trans (GncTreeModelSplitReg *model, Transaction *trans);
-
-/** Component Manager Callback ******************************************/
-static void gnc_tree_model_split_reg_event_handler (QofInstance *entity, QofEventId event_type, GncTreeModelSplitReg *model, GncEventData *ed);
-
-/** The instance private data for the split register tree model. */
-struct GncTreeModelSplitRegPrivate
-{
-    QofBook *book;                   // GNC Book
-    Account *anchor;                 // Account of register
-
-    GList *full_tlist;               // List of unique transactions derived from the query slist in same order
-    GList *tlist;                    // List of unique transactions derived from the full_tlist to display in same order
-    gint   tlist_start;              // The position of the first transaction in tlist in the full_tlist
-
-    Transaction *btrans;             // The Blank transaction
-
-    Split *bsplit;                   // The Blank split
-    GList *bsplit_node;              // never added to any list, just for representation of the iter
-    GList *bsplit_parent_node;       // this equals the tnode of the transaction with the blank split
-
-    gboolean display_subacc;         // Are we displaying subaccounts
-    gboolean display_gl;             // Is this the General ledger
-
-    const GncGUID *template_account; // The template account which template transaction should belong to
-
-    gpointer             user_data;  // User data for users of SplitRegisters, used to get parent window
-    SRGetParentCallback2 get_parent; // hook to get parent widget, used to get parent window
-
-    GtkListStore *description_list;  // description field autocomplete list
-    GtkListStore *notes_list;        // notes field autocomplete list
-    GtkListStore *memo_list;         // memo field autocomplete list
-    GtkListStore *action_list;       // action combo list
-    GtkListStore *account_list;      // Account combo list
-
-    gint event_handler_id;
-};
-
-
-/* Define some background colors for the rows */
-#define GREENROW "#BFDEB9"
-#define TANROW "#F6FFDA"
-#define SPLITROW "#EDE7D3"
-#define YELLOWROW "#FFEF98"
-
-#define TROW1 0x1 // Transaction row 1 depth 1
-#define TROW2 0x2 // Transaction row 2 depth 2
-#define SPLIT 0x4 // Split row         depth 3
-#define BLANK 0x8 // Blank row
-#define IS_TROW1(x) (GPOINTER_TO_INT((x)->user_data) & TROW1)
-#define IS_TROW2(x) (GPOINTER_TO_INT((x)->user_data) & TROW2)
-#define IS_BLANK(x) (GPOINTER_TO_INT((x)->user_data) & BLANK)
-#define IS_SPLIT(x) (GPOINTER_TO_INT((x)->user_data) & SPLIT)
-#define IS_BLANK_SPLIT(x) (IS_BLANK(x) && IS_SPLIT(x))
-#define IS_BLANK_TRANS(x) (IS_BLANK(x) && !IS_SPLIT(x))
-/* Meaning of user_data fields in iter struct:
- *
- * user_data:  a bitfield for TROW1, TROW2, SPLIT, BLANK
- * user_data2: a pointer to a node in a GList of Transactions               
- * user_data3: a pointer to a node in a GList of Splits.
- *            
- */
-
-
-/*FIXME This is the original define 
-#define VALID_ITER(model, iter) \
-    (GNC_IS_TREE_MODEL_TRANSACTION(model) &&                            \
-     ((iter) && (iter)->user_data2) &&                                  \
-     ((iter)->stamp == (model)->stamp) &&                               \
-     (!IS_SPLIT(iter) ^ ((iter)->user_data3 != NULL)) &&                \
-     (!IS_BLANK_SPLIT(iter) ||                                          \
-      ((iter)->user_data2 == (model)->priv->bsplit_parent_node))        \
-     )
-*/
-
-/*FIXME I thought this would work, it does not ????????? */
-/* Do we need to test for a valid iter every where, is it enougth to test on make iter ? */
-#define VALID_ITER (model, iter) \
- (GNC_IS_TREE_MODEL_SPLIT_REG (model) && \
- ((iter).user_data != NULL) && ((iter).user_data2 != NULL) && (model->stamp == (gint)(iter).stamp) && \
- ( (IS_SPLIT (iter) && (iter).user_data3) || (IS_BLANK_SPLIT (iter) && ((GList *)(iter).user_data2 == model->priv->bsplit_parent_node)) || \
-   (!IS_SPLIT (iter) && (iter).user_data2) || (IS_BLANK_TRANS (iter) && (iter).user_data3 == NULL)))
-
-
-/* Used in the sort functions */
-gboolean
-gnc_tree_model_split_reg_is_blank_trans (GncTreeModelSplitReg *model, GtkTreeIter *iter)
-{
-    return IS_BLANK_TRANS (iter);
-}
-
-
-/* Validate the iter */
-static gboolean
-gtm_sr_valid_iter (GncTreeModelSplitReg *model, GtkTreeIter *iter)
-{
-    if (GNC_IS_TREE_MODEL_SPLIT_REG (model) && (iter->user_data != NULL) && (iter->user_data2 != NULL) && (model->stamp == (gint)iter->stamp)
-          && ( (IS_SPLIT (iter) && iter->user_data3) || (IS_BLANK_SPLIT (iter) && ((GList *)iter->user_data2 == model->priv->bsplit_parent_node))
-          ||  (!IS_SPLIT (iter) && iter->user_data2) || (IS_BLANK_TRANS (iter) && iter->user_data3 == NULL)))
-        return TRUE;
-    else
-        return FALSE;
-}
-
-
-/* Make an iter from the given parameters */
-static GtkTreeIter
-gtm_sr_make_iter (GncTreeModelSplitReg *model, gint f, GList *tnode, GList *snode)
-{
-    GtkTreeIter iter, *iter_p;
-    iter_p = &iter;
-    iter.stamp = model->stamp;
-    iter.user_data = GINT_TO_POINTER(f);
-    iter.user_data2 = tnode;
-    iter.user_data3 = snode;
-
-//FIXME If I use this in place of 'if' below it works ??????
-//    if (!(GNC_IS_TREE_MODEL_SPLIT_REG (model) && (iter_p->user_data != NULL) && (iter_p->user_data2 != NULL) && (model->stamp == (gint)iter_p->stamp)
-//          && ( (IS_SPLIT (iter_p) && iter_p->user_data3) || (IS_BLANK_SPLIT (iter_p) && ((GList *)iter_p->user_data2 == model->priv->bsplit_parent_node))
-//          ||  (!IS_SPLIT (iter_p) && iter_p->user_data2) || (IS_BLANK_TRANS (iter_p) && iter_p->user_data3 == NULL) )))
-
-//    if (!VALID_ITER (model, &iter))
-
-    if (!(gtm_sr_valid_iter (model, iter_p)))
-        PERR ("Making invalid iter %s", iter_to_string (iter_p));
-    return iter;
-}
-
-
-#define GNC_TREE_MODEL_SPLIT_REG_GET_PRIVATE(o)  \
-   (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_TREE_MODEL_SPLIT_REG, GncTreeModelSplitRegPrivate))
-
-/************************************************************/
-/*               g_object required functions                */
-/************************************************************/
-
-/** A pointer to the parent class of the split register tree model. */
-static GtkObjectClass *parent_class = NULL;
-
-GType
-gnc_tree_model_split_reg_get_type (void)
-{
-    static GType gnc_tree_model_split_reg_type = 0;
-
-    if (gnc_tree_model_split_reg_type == 0)
-    {
-        static const GTypeInfo our_info =
-        {
-            sizeof (GncTreeModelSplitRegClass),                 /* class_size */
-            NULL,                                               /* base_init */
-            NULL,                                               /* base_finalize */
-            (GClassInitFunc) gnc_tree_model_split_reg_class_init,
-            NULL,                                               /* class_finalize */
-            NULL,                                               /* class_data */
-            sizeof (GncTreeModelSplitReg),                      /* */
-            0,                                                  /* n_preallocs */
-            (GInstanceInitFunc) gnc_tree_model_split_reg_init
-        };
-
-        static const GInterfaceInfo tree_model_info =
-        {
-            (GInterfaceInitFunc) gnc_tree_model_split_reg_tree_model_init,
-            NULL,
-            NULL
-        };
-
-        gnc_tree_model_split_reg_type = g_type_register_static (GNC_TYPE_TREE_MODEL,
-                                      GNC_TREE_MODEL_SPLIT_REG_NAME,
-                                      &our_info, 0);
-
-        g_type_add_interface_static (gnc_tree_model_split_reg_type,
-                                     GTK_TYPE_TREE_MODEL,
-                                     &tree_model_info);
-    }
-    return gnc_tree_model_split_reg_type;
-}
-
-
-static void
-gnc_tree_model_split_reg_class_init (GncTreeModelSplitRegClass *klass)
-{
-    GObjectClass *o_class;
-
-    parent_class = g_type_class_peek_parent (klass);
-
-    o_class = G_OBJECT_CLASS (klass);
-
-    /* GObject signals */
-    o_class->finalize = gnc_tree_model_split_reg_finalize;
-    o_class->dispose = gnc_tree_model_split_reg_dispose;
-
-    gnc_tree_model_split_reg_signals[REFRESH_TRANS] =
-        g_signal_new("refresh_trans",
-                     G_TYPE_FROM_CLASS (o_class),
-                     G_SIGNAL_RUN_FIRST,
-                     G_STRUCT_OFFSET (GncTreeModelSplitRegClass, refresh_trans),
-                     NULL, NULL,
-                     g_cclosure_marshal_VOID__POINTER,
-                     G_TYPE_NONE,
-                     1,
-                     G_TYPE_POINTER);
-
-    gnc_tree_model_split_reg_signals[REFRESH_STATUS_BAR] =
-        g_signal_new("refresh_status_bar",
-                     G_TYPE_FROM_CLASS (o_class),
-                     G_SIGNAL_RUN_LAST,
-                     G_STRUCT_OFFSET (GncTreeModelSplitRegClass, refresh_status_bar),
-                     NULL, NULL,
-                     g_cclosure_marshal_VOID__VOID,
-                     G_TYPE_NONE, 0);
-
-    gnc_tree_model_split_reg_signals[REFRESH_VIEW] =
-        g_signal_new("refresh_view",
-                     G_TYPE_FROM_CLASS (o_class),
-                     G_SIGNAL_RUN_LAST,
-                     G_STRUCT_OFFSET (GncTreeModelSplitRegClass, refresh_view),
-                     NULL, NULL,
-                     g_cclosure_marshal_VOID__VOID,
-                     G_TYPE_NONE, 0);
-
-    gnc_tree_model_split_reg_signals[SCROLL_SYNC] =
-        g_signal_new("scroll_sync",
-                     G_TYPE_FROM_CLASS (o_class),
-                     G_SIGNAL_RUN_LAST,
-                     G_STRUCT_OFFSET (GncTreeModelSplitRegClass, scroll_sync),
-                     NULL, NULL,
-                     g_cclosure_marshal_VOID__VOID,
-                     G_TYPE_NONE, 0);
-
-    gnc_tree_model_split_reg_signals[SELECTION_MOVE_DELETE] =
-        g_signal_new("selection_move_delete",
-                     G_TYPE_FROM_CLASS (o_class),
-                     G_SIGNAL_RUN_FIRST,
-                     G_STRUCT_OFFSET (GncTreeModelSplitRegClass, selection_move_delete),
-                     NULL, NULL,
-                     g_cclosure_marshal_VOID__POINTER,
-                     G_TYPE_NONE,
-                     1,
-                     G_TYPE_POINTER);
-
-    klass->refresh_trans = NULL;
-    klass->refresh_status_bar = NULL;
-    klass->refresh_view = NULL;
-    klass->scroll_sync = NULL;
-    klass->selection_move_delete = NULL;
-}
-
-
-static void
-gnc_tree_model_split_reg_prefs_changed (gpointer prefs, gchar *pref, gpointer user_data)
-{
-    GncTreeModelSplitReg *model = user_data;
-
-    g_return_if_fail (pref);
-
-    if (model == NULL)
-        return;
-
-    if (g_str_has_suffix (pref, GNC_PREF_ACCOUNTING_LABELS))
-    {
-        model->use_accounting_labels = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_ACCOUNTING_LABELS);
-    }
-    else if (g_str_has_suffix (pref, GNC_PREF_ACCOUNT_SEPARATOR))
-    {
-        model->separator_changed = TRUE;
-    }
-    else
-    {
-        g_warning("gnc_tree_model_split_reg_prefs_changed: Unknown preference %s", pref);
-    }
-}
-
-
-static void
-gnc_tree_model_split_reg_init (GncTreeModelSplitReg *model)
-{
-    GncTreeModelSplitRegPrivate *priv;
-
-    ENTER("model %p", model);
-    while (model->stamp == 0)
-    {
-        model->stamp = g_random_int ();
-    }
-
-    model->priv = g_new0 (GncTreeModelSplitRegPrivate, 1);
-
-    gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL,
-                           GNC_PREF_ACCOUNTING_LABELS,
-                           gnc_tree_model_split_reg_prefs_changed,
-                           model);
-    gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL,
-                           GNC_PREF_ACCOUNT_SEPARATOR,
-                           gnc_tree_model_split_reg_prefs_changed,
-                           model);
-    LEAVE(" ");
-}
-
-
-static void
-gnc_tree_model_split_reg_finalize (GObject *object)
-{
-    GncTreeModelSplitReg *model;
-
-    ENTER("model split reg %p", object);
-    g_return_if_fail (object != NULL);
-    g_return_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (object));
-
-    model = GNC_TREE_MODEL_SPLIT_REG (object);
-
-    if (G_OBJECT_CLASS (parent_class)->finalize)
-        G_OBJECT_CLASS (parent_class)->finalize (object);
-    LEAVE(" ");
-}
-
-
-static void
-gnc_tree_model_split_reg_dispose (GObject *object)
-{
-    GncTreeModelSplitRegPrivate *priv;
-    GncTreeModelSplitReg *model;
-
-    ENTER("model split reg %p", object);
-    g_return_if_fail (object != NULL);
-    g_return_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (object));
-
-    model = GNC_TREE_MODEL_SPLIT_REG (object);
-    priv = model->priv;
-
-    if (priv->event_handler_id)
-    {
-        qof_event_unregister_handler (priv->event_handler_id);
-        priv->event_handler_id = 0;
-    }
-
-    priv->book = NULL;
-
-    /* Free the tlist */
-    g_list_free (priv->tlist);
-    priv->tlist = NULL;
-
-    /* Free the full_tlist */
-    g_list_free (priv->full_tlist);
-    priv->full_tlist = NULL;
-
-    /* Free the blank split */
-    priv->bsplit = NULL;
-    priv->bsplit_node = NULL;
-
-    /* Free the blank transaction */
-    priv->btrans = NULL;
-
-/*FIXME Other stuff here */
-
-    g_free (priv);
-
-    if (G_OBJECT_CLASS (parent_class)->dispose)
-        G_OBJECT_CLASS (parent_class)->dispose (object);
-    LEAVE(" ");
-}
-
-
-/************************************************************/
-/*                   New Model Creation                     */
-/************************************************************/
-/* Create a new tree model */
-GncTreeModelSplitReg *
-gnc_tree_model_split_reg_new (SplitRegisterType2 reg_type, SplitRegisterStyle2 style,
-                        gboolean use_double_line, gboolean is_template)
-{
-    GncTreeModelSplitReg *model;
-    GncTreeModelSplitRegPrivate *priv;
-
-    ENTER("Create Model");
-
-    model = g_object_new (GNC_TYPE_TREE_MODEL_SPLIT_REG, NULL);
-
-    priv = model->priv;
-    priv->book = gnc_get_current_book();
-    priv->display_gl = FALSE;
-    priv->display_subacc = FALSE;
-
-    model->type = reg_type;
-    model->style = style;
-    model->use_double_line = use_double_line;
-    model->is_template = is_template;
-
-    model->sort_col = 1;
-    model->sort_depth = 1;
-    model->sort_direction = 1;
-
-    model->current_trans = NULL;
-    model->current_row = -1;
-
-    /* Setup the blank transaction */
-    priv->btrans = xaccMallocTransaction (priv->book);
-
-    /* Setup the blank split */
-    priv->bsplit = xaccMallocSplit (priv->book);
-    priv->bsplit_node = g_list_append (priv->bsplit_node, priv->bsplit);
-
-    /* Setup some config entries */
-    model->use_accounting_labels = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_ACCOUNTING_LABELS);
-    model->use_theme_colors = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_USE_THEME_COLORS);
-    model->alt_colors_by_txn = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_ALT_COLOR_BY_TRANS);
-    model->read_only = FALSE;
-
-    /* Create the ListStores for the auto completion / combo's */
-    priv->description_list = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER);
-    priv->notes_list = gtk_list_store_new (1, G_TYPE_STRING);
-    priv->memo_list = gtk_list_store_new (1, G_TYPE_STRING);
-    priv->action_list = gtk_list_store_new (1, G_TYPE_STRING);
-    priv->account_list = gtk_list_store_new (3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER);
-
-    priv->event_handler_id = qof_event_register_handler
-                             ((QofEventHandler)gnc_tree_model_split_reg_event_handler, model);
-
-    LEAVE("model %p", model);
-    return model;
-}
-
-/* ForEach function to walk the list of model entries */
-static gboolean
-gtm_sr_foreach_func (GtkTreeModel *model,
-              GtkTreePath  *path,
-              GtkTreeIter  *iter,
-              GList       **rowref_list)
-{
-    GtkTreeRowReference  *rowref;
-    g_assert ( rowref_list != NULL );
-
-    rowref = gtk_tree_row_reference_new (model, path);
-    *rowref_list = g_list_append (*rowref_list, rowref);
-
-    return FALSE; /* do not stop walking the store, call us with next row */
-}
-
-/* Remove all model entries */
-static void
-gtm_sr_remove_all_rows (GncTreeModelSplitReg *model)
-{
-    GList *rr_list = NULL;    /* list of GtkTreeRowReferences to remove */
-    GList *node;
-
-    gtk_tree_model_foreach (GTK_TREE_MODEL(model), (GtkTreeModelForeachFunc)gtm_sr_foreach_func, &rr_list);
-
-    rr_list = g_list_reverse (rr_list);
-
-    for ( node = rr_list;  node != NULL;  node = node->next )
-    {
-        GtkTreePath *path;
-        path = gtk_tree_row_reference_get_path ((GtkTreeRowReference*)node->data);
-
-        if (path)
-        {
-            gtk_tree_model_row_deleted (GTK_TREE_MODEL (model), path);
-            gtk_tree_path_free (path);
-        }
-    }
-    g_list_foreach (rr_list, (GFunc) gtk_tree_row_reference_free, NULL);
-    g_list_free (rr_list);
-}
-
-static void
-gtm_sr_reg_load (GncTreeModelSplitReg *model, GncTreeModelSplitRegUpdate model_update, gint num_of_rows)
-{
-    GncTreeModelSplitRegPrivate *priv;
-    GList *node;
-    gint rows = 0;
-
-    priv = model->priv;
-
-    if (model_update == VIEW_HOME)
-    {
-        priv->tlist_start = 0;
-
-        for (node = g_list_nth (priv->full_tlist, priv->tlist_start); node; node = node->next)
-        {
-            Transaction *trans = node->data;
-
-            priv->tlist = g_list_append (priv->tlist, trans);
-            rows++;
-
-            if (rows == num_of_rows)
-                break;
-        } 
-    }
-    
-    if (model_update == VIEW_END)
-    {
-        priv->tlist_start = g_list_length (priv->full_tlist) - num_of_rows;
-
-        for (node = g_list_nth (priv->full_tlist, priv->tlist_start); node; node = node->next)
-        {
-            Transaction *trans = node->data;
-
-            priv->tlist = g_list_append (priv->tlist, trans);
-            rows++;
-
-            if (rows == num_of_rows)
-                break;
-        } 
-    }
-
-    if (model_update == VIEW_GOTO)
-    {
-        priv->tlist_start = num_of_rows - NUM_OF_TRANS*1.5;
-
-        for (node = g_list_nth (priv->full_tlist, priv->tlist_start); node; node = node->next)
-        {
-            Transaction *trans = node->data;
-
-            priv->tlist = g_list_append (priv->tlist, trans);
-            rows++;
-
-            if (rows == (NUM_OF_TRANS*3))
-                break;
-        } 
-    }
-}
-
-
-/* Load the model with unique transactions based on a GList of splits */
-void
-gnc_tree_model_split_reg_load (GncTreeModelSplitReg *model, GList *slist, Account *default_account)
-{
-    GncTreeModelSplitRegPrivate *priv;
-    GList *node;
-    gint rows = 0;
-
-    ENTER("#### Load ModelSplitReg = %p and slist length is %d ####", model, g_list_length (slist));
-
-    priv = model->priv;
-
-    /* Clear the treeview */
-    gtm_sr_remove_all_rows (model);
-    priv->full_tlist = NULL;
-    priv->tlist = NULL;
-
-    if (model->current_trans == NULL)
-        model->current_trans = priv->btrans;
-
-    if (model->sort_direction == 1) // ascending
-    {
-        /* Get a list of Unique Transactions from an slist */
-        priv->full_tlist = xaccSplitListGetUniqueTransactions (slist);
-
-        /* Add the blank transaction to the full_tlist */
-        priv->full_tlist = g_list_append (priv->full_tlist, priv->btrans);
-    }
-    else
-    {
-        /* Get a list of Unique Transactions from an slist */
-        priv->full_tlist = xaccSplitListGetUniqueTransactions (slist);
-
-        /* Add the blank transaction to the full_tlist */
-        priv->full_tlist = g_list_append (priv->full_tlist, priv->btrans);
-
-        /* Reverse the full_tlist */
-        priv->full_tlist = g_list_reverse (priv->full_tlist);
-    }
-
-    // Update the scrollbar
-    gnc_tree_model_split_reg_sync_scrollbar (model);
-
-    model->number_of_trans_in_full_tlist = g_list_length (priv->full_tlist);
-
-    if (g_list_length (priv->full_tlist) < NUM_OF_TRANS*3)
-    {
-        // Copy the full_tlist to tlist
-        priv->tlist = g_list_copy (priv->full_tlist);
-    }
-    else
-    {
-        if (model->position_of_trans_in_full_tlist < (NUM_OF_TRANS*3))
-            gtm_sr_reg_load (model, VIEW_HOME, NUM_OF_TRANS*3);
-        else if (model->position_of_trans_in_full_tlist > g_list_length (priv->full_tlist) - (NUM_OF_TRANS*3))
-            gtm_sr_reg_load (model, VIEW_END, NUM_OF_TRANS*3);
-        else
-            gtm_sr_reg_load (model, VIEW_GOTO, model->position_of_trans_in_full_tlist);
-    }
-
-    PINFO("#### Register for Account '%s' has %d transactions and %d splits and tlist is %d ####",
-          default_account ? xaccAccountGetName (default_account) : "NULL", g_list_length (priv->full_tlist), g_list_length (slist), g_list_length (priv->tlist));
-
-    /* Update the completion model liststores */
-    g_idle_add ((GSourceFunc) gnc_tree_model_split_reg_update_completion, model);
-
-    priv->anchor = default_account;
-    priv->bsplit_parent_node = NULL;
-
-    LEAVE("#### Leave Model Load ####");
-}
-
-
-void
-gnc_tree_model_split_reg_move (GncTreeModelSplitReg *model, GncTreeModelSplitRegUpdate model_update)
-{
-    GncTreeModelSplitRegPrivate *priv;
-    GList *inode, *dnode;
-    gint rows = 0;
-    gint icount = 0;
-    gint dcount = 0;
-
-    priv = model->priv;
-
-    // if list is not long enougth, return
-    if (g_list_length (priv->full_tlist) < NUM_OF_TRANS*3)
-        return;
-
-    if ((model_update == VIEW_UP) && (model->current_row < NUM_OF_TRANS) && (priv->tlist_start > 0))
-    {
-        gint dblock_end = 0;
-        gint iblock_start = priv->tlist_start - NUM_OF_TRANS;
-        gint iblock_end = priv->tlist_start - 1;
-        gint dblock_start = priv->tlist_start + NUM_OF_TRANS*2;
-
-        if (iblock_start < 0)
-            iblock_start = 0;
-
-        icount = iblock_end - iblock_start + 1;
-
-        dcount = icount;
-        dblock_end = dblock_start + dcount - 1;
-
-        priv->tlist_start = iblock_start;
-
-        // Insert at the front end
-        for (inode = g_list_nth (priv->full_tlist, iblock_end); inode; inode = inode->prev)
-        {
-            Transaction *trans = inode->data;
-
-            gtm_sr_insert_trans (model, trans, TRUE);
-
-            rows++;
-
-            if (rows == icount)
-                break;
-        }
-        rows = 0;
-        // Delete at the back end
-        for (dnode = g_list_nth (priv->full_tlist, dblock_end); dnode; dnode = dnode->prev)
-        {
-            Transaction *trans = dnode->data;
-
-            gtm_sr_delete_trans (model, trans);
-
-            rows++;
-
-            if (rows == dcount)
-                break;
-        }
-        g_signal_emit_by_name (model, "refresh_view");
-    }
-
-    if ((model_update == VIEW_DOWN) && (model->current_row > NUM_OF_TRANS*2) && (priv->tlist_start < (g_list_length (priv->full_tlist) - NUM_OF_TRANS*3 )))
-    {
-        gint dblock_end = 0;
-        gint iblock_start = priv->tlist_start + NUM_OF_TRANS*3;
-        gint iblock_end = iblock_start + NUM_OF_TRANS - 1;
-        gint dblock_start = priv->tlist_start;
-
-        if (iblock_start < 0)
-            iblock_start = 0;
-
-        if (iblock_end > g_list_length (priv->full_tlist))
-            iblock_end = g_list_length (priv->full_tlist) - 1;
-
-        icount = iblock_end - iblock_start + 1;
-
-        dcount = icount;
-        dblock_end = dblock_start + dcount;
-
-        priv->tlist_start = dblock_end;
-
-        // Insert at the back end
-        for (inode = g_list_nth (priv->full_tlist, iblock_start); inode; inode = inode->next)
-        {
-            Transaction *trans = inode->data;
-
-            gtm_sr_insert_trans (model, trans, FALSE);
-
-            rows++;
-
-            if (rows == icount)
-                break;
-        }
-        rows = 0;
-        // Delete at the front end
-        for (dnode = g_list_nth (priv->full_tlist, dblock_start); dnode; dnode = dnode->next)
-        {
-            Transaction *trans = dnode->data;
-
-            gtm_sr_delete_trans (model, trans);
-
-            rows++;
-
-            if (rows == dcount)
-                break;
-        }
-        g_signal_emit_by_name (model, "refresh_view");
-    }
-}
-
-
-/* Return the first transaction, opposite to blank transaction in the full list. */
-Transaction *
-gnc_tree_model_split_reg_get_first_trans (GncTreeModelSplitReg *model)
-{
-    GncTreeModelSplitRegPrivate *priv;
-    GList *node;
-    Transaction *trans;
-
-    priv = model->priv;
-
-    node = g_list_first (priv->full_tlist);
-
-    trans = node->data;
-
-    if (trans == priv->btrans)
-    {
-        node = g_list_last (priv->full_tlist);
-        trans = node->data;
-    }
-    return trans;
-}
-
-
-/* Return TRUE if transaction is in the view list. */
-gboolean
-gnc_tree_model_split_reg_trans_is_in_view (GncTreeModelSplitReg *model, Transaction *trans)
-{
-    GncTreeModelSplitRegPrivate *priv;
-
-    priv = model->priv;
-
-    if (g_list_index (priv->tlist, trans) == -1)
-        return FALSE;
-    else
-        return TRUE;
-}
-
-
-/* Return the tooltip for transaction at position in full_tlist. */
-gchar * 
-gnc_tree_model_split_reg_get_tooltip (GncTreeModelSplitReg *model, gint position)
-{
-    GncTreeModelSplitRegPrivate *priv;
-    Transaction *trans;
-    const gchar *date_text;
-    const gchar *desc_text;
-    Timespec ts = {0,0};
-    GList *node;
-
-    priv = model->priv;
-
-    node = g_list_nth (priv->full_tlist, position);
-    if (node == NULL)
-       return g_strconcat ("Error", NULL);
-    else
-    {
-        trans = node->data;
-        if (trans == NULL)
-           return g_strconcat ("Error", NULL);
-        else if (trans == priv->btrans)
-           return g_strconcat ("Blank Transaction", NULL);
-        else
-        {
-            xaccTransGetDatePostedTS (trans, &ts);
-            date_text = gnc_print_date (ts);
-            desc_text = xaccTransGetDescription (trans);
-            model->current_trans = trans;
-            return g_strconcat (date_text, "\n", desc_text, NULL);
-        }
-    }
-}
-
-
-/* Set the current transaction to that at position in full_tlist */
-void
-gnc_tree_model_split_reg_set_current_trans_by_position (GncTreeModelSplitReg *model, gint position)
-{
-    GncTreeModelSplitRegPrivate *priv;
-    GList *node;
-
-    priv = model->priv;
-
-    node = g_list_nth (priv->full_tlist, position);
-    if (node == NULL)
-        node = g_list_last (priv->full_tlist);
-
-    model->current_trans = node->data;
-}
-
-
-/* Sync the vertical scrollbar to position in full_tlist. */
-void
-gnc_tree_model_split_reg_sync_scrollbar (GncTreeModelSplitReg *model)
-{
-    GncTreeModelSplitRegPrivate *priv;
-
-    priv = model->priv;
-
-    model->position_of_trans_in_full_tlist = g_list_index (priv->full_tlist, model->current_trans);
-
-    g_signal_emit_by_name (model, "scroll_sync");
-}
-
-
-/* Set the template account for this register. */
-void
-gnc_tree_model_split_reg_set_template_account (GncTreeModelSplitReg *model, Account *template_account)
-{
-    GncTreeModelSplitRegPrivate *priv;
-
-    priv = model->priv;
-    priv->template_account = xaccAccountGetGUID (template_account);
-}
-
-
-/* Return the template account for this register. */
-Account *
-gnc_tree_model_split_reg_get_template_account (GncTreeModelSplitReg *model)
-{
-    GncTreeModelSplitRegPrivate *priv;
-    Account *acct;
-
-    priv = model->priv;
-
-    acct = xaccAccountLookup (priv->template_account, priv->book);
-    return acct;
-}
-
-
-/* Return TRUE if this is a template register. */
-gboolean
-gnc_tree_model_split_reg_get_template (GncTreeModelSplitReg *model)
-{
-    return model->is_template;
-}
-
-
-/* Destroy the model */
-void
-gnc_tree_model_split_reg_destroy (GncTreeModelSplitReg *model)
-{
-    GncTreeModelSplitRegPrivate *priv;
-
-    ENTER("Model is %p", model);
-
-    priv = model->priv;
-
-    g_object_unref (priv->description_list);
-    g_object_unref (priv->notes_list);
-    g_object_unref (priv->memo_list);
-    g_object_unref (priv->action_list);
-    g_object_unref (priv->account_list);
-
-    gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL,
-                                 GNC_PREF_ACCOUNTING_LABELS,
-                                 gnc_tree_model_split_reg_prefs_changed,
-                                 model);
-    gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL,
-                                 GNC_PREF_ACCOUNT_SEPARATOR,
-                                 gnc_tree_model_split_reg_prefs_changed,
-                                 model);
-    LEAVE(" ");
-}
-
-
-/* Setup the data to obtain the parent window */
-void
-gnc_tree_model_split_reg_set_data (GncTreeModelSplitReg *model, gpointer user_data,
-                                  SRGetParentCallback2 get_parent)
-{
-    GncTreeModelSplitRegPrivate *priv;
-
-/*FIXME This is used to get the parent window, mabe move to view */
-    priv = model->priv;
-
-    priv->user_data = user_data;
-    priv->get_parent = get_parent;
-}
-
-
-/* Update the config of this model */
-void
-gnc_tree_model_split_reg_config (GncTreeModelSplitReg *model, SplitRegisterType2 newtype,
-                                 SplitRegisterStyle2 newstyle, gboolean use_double_line)
-{
-    model->type = newtype;
-
-    if (model->type >= NUM_SINGLE_REGISTER_TYPES2)
-        newstyle = REG2_STYLE_JOURNAL;
-
-    model->style = newstyle;
-    model->use_double_line = use_double_line;
-}
-
-
-/* Return TRUE if this is a sub account view */
-gboolean
-gnc_tree_model_split_reg_get_sub_account (GncTreeModelSplitReg *model)
-{
-    return model->priv->display_subacc;
-}
-
-
-void
-gnc_tree_model_split_reg_default_query (GncTreeModelSplitReg *model, Account *default_account, Query *query)
-{
-    gchar *state_key;
-    const GncGUID * guid;
-    const gchar *sort_string;
-    gint  depth, col;
-    
-    guid = xaccAccountGetGUID (default_account);
-
-    /* Used for saving different register column widths under seperate keys */
-    // We need to give the General Ledger a Key other than all zeros which the search register gets.
-    if (model->priv->display_gl == TRUE && model->type == GENERAL_LEDGER2)
-        state_key = g_strconcat (STATE_SECTION_PREFIX, "00000000000000000000000000000001", NULL);
-    else if (model->priv->display_subacc == TRUE)
-        state_key = g_strconcat (STATE_SECTION_PREFIX, (gchar*)guid_to_string (guid), "_sub", NULL);
-    else
-        state_key = g_strconcat (STATE_SECTION_PREFIX, (gchar*)guid_to_string (guid), NULL);
- 
-
-    /* Restore the sort column from saved state */
-    // FIXME currently not implemented
-    col = 0;
-    if (col == 0)    
-        model->sort_col = 1;
-    else
-        model->sort_col = col;
-
-    /* Restore the sort depth from saved state */
-    // FIXME currently not implemented
-    depth = 0;
-    if (depth == 0)
-        model->sort_depth = 1;
-    else
-        model->sort_depth = depth;
-
-    /* Restore the sort order from saved state */
-    // FIXME currently not implemented
-    sort_string = NULL;
-    if (g_strcmp0 ("descending", sort_string) == 0)
-        model->sort_direction = -1;
-    else
-        model->sort_direction = 1;
-
-    gnc_tree_model_split_reg_update_query (model, query);
-}
-
-
-void
-gnc_tree_model_split_reg_update_query (GncTreeModelSplitReg *model, Query *query)
-{
-    GSList *p1 = NULL, *p2 = NULL, *p3 = NULL, *standard;
-
-    time64 start;
-    struct tm tm;
-
-    standard = g_slist_prepend (NULL, QUERY_DEFAULT_SORT);
-
-    PINFO("## gnc_tree_model_split_reg_update_query - query is %p ##", query);
-
-    switch (model->sort_col)
-    {
-        case GNC_TREE_MODEL_SPLIT_REG_COL_DATE:
-            if (model->sort_depth == 1)
-            {
-                p1 = g_slist_prepend (p1, TRANS_DATE_POSTED);
-                p1 = g_slist_prepend (p1, SPLIT_TRANS);
-                p2 = standard;
-            }
-            else if (model->sort_depth == 2)
-            {
-                p1 = g_slist_prepend (p1, TRANS_DATE_ENTERED);
-                p1 = g_slist_prepend (p1, SPLIT_TRANS);
-                p2 = standard;
-            }
-            else if (model->sort_depth == 3)
-            {
-                p1 = g_slist_prepend (p1, SPLIT_RECONCILE);
-                p1 = g_slist_prepend (p2, SPLIT_DATE_RECONCILED);
-                p2 = standard;
-            }
-            break;
-
-        case GNC_TREE_MODEL_SPLIT_REG_COL_DESCNOTES:
-            if (model->sort_depth == 1)
-            {
-                p1 = g_slist_prepend (p1, TRANS_DESCRIPTION);
-                p1 = g_slist_prepend (p1, SPLIT_TRANS);
-                p2 = standard;
-            }
-            else if (model->sort_depth == 2)
-            {
-                p1 = g_slist_prepend (p1, TRANS_NOTES);
-                p1 = g_slist_prepend (p1, SPLIT_TRANS);
-                p2 = standard;
-            }
-            else if (model->sort_depth == 3)
-            {
-                p1 = g_slist_prepend (p1, SPLIT_MEMO);
-                p2 = standard;
-            }
-            break;
-
-        case GNC_TREE_MODEL_SPLIT_REG_COL_NUMACT:
-            if (model->sort_depth == 1)
-            {
-                p1 = g_slist_prepend (p1, TRANS_NUM);
-                p1 = g_slist_prepend (p1, SPLIT_TRANS);
-                p2 = standard;
-            }
-            else if ((model->sort_depth == 2) || (model->sort_depth == 3))
-            {
-                p1 = g_slist_prepend (p1, SPLIT_ACTION);
-                p2 = standard;
-            }
-            break;
-
-        case GNC_TREE_MODEL_SPLIT_REG_COL_RECN:
-            {
-                p1 = g_slist_prepend (p1, SPLIT_RECONCILE);
-                p1 = g_slist_prepend (p2, SPLIT_DATE_RECONCILED);
-                p2 = standard;
-            }
-            break;
-
-        case GNC_TREE_MODEL_SPLIT_REG_COL_DEBIT:
-        case GNC_TREE_MODEL_SPLIT_REG_COL_CREDIT:
-            {
-                p1 = g_slist_prepend (p1, SPLIT_VALUE);
-                p2 = standard;
-            }
-            break;
-
-        default:
-            p1 = standard;
-            break;
-    }
-
-    //FIXME Not sure why I need to do this, refresh / sort change segfaults on gl
-    if (model->priv->display_gl == TRUE && model->type == GENERAL_LEDGER2)
-    {
-        gnc_tm_get_today_start(&tm);
-        tm.tm_mon--; /* Default the register to the last month's worth of transactions. */
-        start = gnc_mktime (&tm);
-        xaccQueryAddDateMatchTT (query, TRUE, start, FALSE, 0, QOF_QUERY_AND);
-    }
-
-    qof_query_set_sort_order (query, p1, p2, p3);
-
-}
-
-/************************************************************/
-/*        Gnc Tree Model Debugging Utility Function         */
-/************************************************************/
-#define ITER_STRING_LEN 128
-
-static const gchar *
-iter_to_string (GtkTreeIter *iter)
-{
-#ifdef G_THREADS_ENABLED
-#ifndef HAVE_GLIB_2_32
-    static GStaticPrivate gtmits_buffer_key = G_STATIC_PRIVATE_INIT;
-    gchar *string;
-
-    string = g_static_private_get (&gtmits_buffer_key);
-    if (string == NULL)
-    {
-        string = g_malloc (ITER_STRING_LEN + 1);
-        g_static_private_set (&gtmits_buffer_key, string, g_free);
-    }
-#else
-    static GPrivate gtmits_buffer_key = G_PRIVATE_INIT (g_free);
-    gchar *string;
-
-    string = g_private_get (&gtmits_buffer_key);
-    if (string == NULL)
-    {
-        string = g_malloc (ITER_STRING_LEN + 1);
-        g_private_set (&gtmits_buffer_key, string);
-    }
-#endif
-#else
-    static char string[ITER_STRING_LEN + 1];
-#endif
-
-    if (iter)
-        snprintf(
-            string, ITER_STRING_LEN,
-            "[stamp:%x data:%d, %p (%p:%s), %p (%p:%s)]",
-            iter->stamp, GPOINTER_TO_INT (iter->user_data),
-            iter->user_data2,
-            iter->user_data2 ? ((GList *) iter->user_data2)->data : 0,
-            iter->user_data2 ?
-            (QOF_INSTANCE (((GList *) iter->user_data2)->data))->e_type : "",
-            iter->user_data3,
-            iter->user_data3 ? ((GList *) iter->user_data3)->data : 0,
-            iter->user_data3 ?
-            (QOF_INSTANCE (((GList *) iter->user_data3)->data))->e_type : "");
-    else
-        strcpy (string, "(null)");
-    return string;
-}
-
-
-/************************************************************/
-/*       Gtk Tree Model Required Interface Functions        */
-/************************************************************/
-static void
-gnc_tree_model_split_reg_tree_model_init (GtkTreeModelIface *iface)
-{
-    iface->get_flags       = gnc_tree_model_split_reg_get_flags;
-    iface->get_n_columns   = gnc_tree_model_split_reg_get_n_columns;
-    iface->get_column_type = gnc_tree_model_split_reg_get_column_type;
-    iface->get_iter        = gnc_tree_model_split_reg_get_iter;
-    iface->get_path        = gnc_tree_model_split_reg_get_path;
-    iface->get_value       = gnc_tree_model_split_reg_get_value;
-    iface->iter_next       = gnc_tree_model_split_reg_iter_next;
-    iface->iter_children   = gnc_tree_model_split_reg_iter_children;
-    iface->iter_has_child  = gnc_tree_model_split_reg_iter_has_child;
-    iface->iter_n_children = gnc_tree_model_split_reg_iter_n_children;
-    iface->iter_nth_child  = gnc_tree_model_split_reg_iter_nth_child;
-    iface->iter_parent     = gnc_tree_model_split_reg_iter_parent;
-}
-
-
-static GtkTreeModelFlags
-gnc_tree_model_split_reg_get_flags (GtkTreeModel *tree_model)
-{
-    /* Returns a set of flags supported by this interface. The flags
-       are a bitwise combination of GtkTreeModelFlags. The flags supported
-       should not change during the lifecycle of the tree_model. */
-    return 0;
-}
-
-
-static int
-gnc_tree_model_split_reg_get_n_columns (GtkTreeModel *tree_model)
-{
-    /* Returns the number of columns supported by tree_model. */
-    g_return_val_if_fail(GNC_IS_TREE_MODEL_SPLIT_REG(tree_model), -1);
-
-    return GNC_TREE_MODEL_SPLIT_REG_NUM_COLUMNS;
-}
-
-
-static GType
-gnc_tree_model_split_reg_get_column_type (GtkTreeModel *tree_model, int index)
-{
-    /* Returns the type of the column. */
-    g_return_val_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (tree_model), G_TYPE_INVALID);
-    g_return_val_if_fail ((index < GNC_TREE_MODEL_SPLIT_REG_NUM_COLUMNS) && (index >= 0), G_TYPE_INVALID);
-
-    switch (index)
-    {
-    case GNC_TREE_MODEL_SPLIT_REG_COL_GUID:
-        return G_TYPE_POINTER;
-
-    case GNC_TREE_MODEL_SPLIT_REG_COL_DATE:
-    case GNC_TREE_MODEL_SPLIT_REG_COL_DUEDATE:
-    case GNC_TREE_MODEL_SPLIT_REG_COL_NUMACT:
-    case GNC_TREE_MODEL_SPLIT_REG_COL_DESCNOTES:
-    case GNC_TREE_MODEL_SPLIT_REG_COL_TRANSFERVOID:
-    case GNC_TREE_MODEL_SPLIT_REG_COL_RECN:
-    case GNC_TREE_MODEL_SPLIT_REG_COL_DEBIT:
-    case GNC_TREE_MODEL_SPLIT_REG_COL_CREDIT:
-        return G_TYPE_STRING;
-
-    case GNC_TREE_MODEL_SPLIT_REG_COL_RO:
-    case GNC_TREE_MODEL_SPLIT_REG_COL_NUM_VIS:
-    case GNC_TREE_MODEL_SPLIT_REG_COL_ACT_VIS:
-        return G_TYPE_BOOLEAN;
-
-    default:
-        g_assert_not_reached ();
-        return G_TYPE_INVALID;
-    }
-}
-
-
-static gboolean
-gnc_tree_model_split_reg_get_iter (GtkTreeModel *tree_model,
-                                 GtkTreeIter *iter,
-                                 GtkTreePath *path)
-{
-    /* Sets iter to a valid iterator pointing to path. */
-    GncTreeModelSplitReg *model = GNC_TREE_MODEL_SPLIT_REG (tree_model);
-    GList *tnode;
-    SplitList *slist;
-    GList *snode;
-    Split *split;
-    gint depth, *indices, flags = 0;
-
-    g_return_val_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (tree_model), FALSE);
-
-    {
-        gchar *path_string = gtk_tree_path_to_string (path);
-        //ENTER("model %p, iter %p, path %s", tree_model, iter, path_string);
-        g_free (path_string);
-    }
-
-    depth = gtk_tree_path_get_depth (path);
-
-    indices = gtk_tree_path_get_indices (path);
-
-    tnode = g_list_nth (model->priv->tlist, indices[0]);
-
-    if (!tnode) {
-        DEBUG("path index off end of tlist");
-        goto fail;
-    }
-
-    slist = xaccTransGetSplitList (tnode->data);
-
-    if (depth == 1) {      /* Trans Row 1 */
-        flags = TROW1;
-        /* Check if this is the blank trans */
-        if (tnode->data == model->priv->btrans)
-        {
-            flags |= BLANK;
-
-            if (xaccTransCountSplits (tnode->data) == 0)
-            {
-                if (model->priv->bsplit_parent_node == tnode)
-                    snode = model->priv->bsplit_node; // blank split
-                else
-                    snode = NULL; // blank trans - not selected
-            }
-            else
-            {
-                split = xaccTransGetSplit (tnode->data, 0);
-                snode = g_list_find (slist, split); // else first split
-            }
-        }
-        else
-        {
-            split = xaccTransGetSplit (tnode->data, 0);
-            snode = g_list_find (slist, split); // else first split
-        }
-    }
-    else if (depth == 2) { /* Trans Row 2 */
-        flags = TROW2;
-        /* Check if this is the blank trans */
-        if (tnode->data == model->priv->btrans)
-        {
-            flags |= BLANK;
-
-            if (xaccTransCountSplits (tnode->data) == 0)
-            {
-                if (model->priv->bsplit_parent_node == tnode)
-                    snode = model->priv->bsplit_node; // blank split
-                else
-                    snode = NULL; // blank trans - not selected
-            }
-            else
-            {
-                split = xaccTransGetSplit (tnode->data, 0);
-                snode = g_list_find (slist, split); // else first split
-            }
-        }
-        else
-        {
-            split = xaccTransGetSplit (tnode->data, 0);
-            snode = g_list_find (slist, split); // else first split
-        }
-    }
-    else if (depth == 3) { /* Split */       
-        flags = SPLIT;
-
-        /* Check if this is the blank split */
-        if ((tnode == model->priv->bsplit_parent_node) && (xaccTransCountSplits (tnode->data) == indices[2]))
-        {
-            flags |= BLANK;
-            snode = model->priv->bsplit_node; // blank split = number of splits in list
-        }
-        else
-        {
-            split = xaccTransGetSplit (tnode->data, indices[2]);
-            snode = g_list_find (slist, split); // split = position in list
-        }
-
-        if (!snode) {
-            DEBUG("path index off end of slist");
-            goto fail;
-        }
-    }
-    else {
-        DEBUG("Invalid path depth");
-        goto fail;
-    }
-
-    *iter = gtm_sr_make_iter (model, flags, tnode, snode);
-/*    g_assert(VALID_ITER(model, iter)); */
-    //LEAVE("True");
-    return TRUE;
- fail:
-    iter->stamp = 0;
-    //LEAVE("False");
-    return FALSE;
-}
-
-
-static GtkTreePath *
-gnc_tree_model_split_reg_get_path (GtkTreeModel *tree_model, GtkTreeIter *iter)
-{
-    /* Returns a newly-created GtkTreePath referenced by iter. 
-       This path should be freed with gtk_tree_path_free(). */
-    GncTreeModelSplitReg *model = GNC_TREE_MODEL_SPLIT_REG (tree_model);
-    GtkTreePath *path;
-    gint tpos, spos;
-    GList *tnode, *snode;
-
-    g_return_val_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (model), NULL);
-
-    //ENTER("model %p, iter %s", model, iter_to_string (iter));
-/*    g_assert(VALID_ITER(model, iter)); */
-
-    path = gtk_tree_path_new();
-
-    tnode = iter->user_data2;
-
-    snode = iter->user_data3;
-
-    /* Level 1 */
-    tpos = g_list_position (model->priv->tlist, tnode);
-
-    if (tpos == -1)
-        goto fail;
-
-    gtk_tree_path_append_index (path, tpos);
-
-    /* Level 2 - All ways 0 */
-    if (IS_TROW2 (iter))
-        gtk_tree_path_append_index (path, 0);
-
-    /* Level 3 */
-    if (IS_SPLIT (iter))
-    {
-        /* Check if this is the blank split */
-        if ((tnode == model->priv->bsplit_parent_node) && (IS_BLANK (iter)))
-        {
-            spos = xaccTransCountSplits (tnode->data);
-        }
-        else
-        {
-            /* Can not use snode position directly as slist length does not follow
-               number of splits exactly, especailly if you delete a split */
-            spos = xaccTransGetSplitIndex (tnode->data, snode->data);
-        }
-
-        if (spos == -1)
-            goto fail;
-
-        gtk_tree_path_append_index (path, 0); /* Add the Level 2 part */
-        gtk_tree_path_append_index (path, spos);
-    }
-
-    {
-        gchar *path_string = gtk_tree_path_to_string (path);
-        //LEAVE("get path  %s", path_string);
-        g_free (path_string);
-    }
-    return path;
-
- fail:
-    //LEAVE("No Valid Path");
-    return NULL;
-}
-
-
-/* Decide which renderer should be shown in the NUM/ACT column */
-static gboolean
-gnc_tree_model_split_reg_get_numact_vis (GncTreeModelSplitReg *model, gboolean trow1, gboolean trow2)
-{
-    // TRUE for SHOW and FALSE for HIDE, TRUE for NUM is FALSE for ACT
-
-    if (trow1)
-        return TRUE;
-
-    if (trow2)
-    {
-        if (qof_book_use_split_action_for_num_field (model->priv->book))
-            return TRUE;
-        else
-            return FALSE;
-    }
-    return FALSE;
-}
-
-
-/* Return TRUE if this row should be marked read only */
-gboolean
-gnc_tree_model_split_reg_get_read_only (GncTreeModelSplitReg *model, Transaction *trans)
-{
-    if (qof_book_is_readonly (model->priv->book)) // book is read only
-        return TRUE;
-
-    if (model->read_only) // register is read only
-        return TRUE;
-
-    /* Voided Transaction. */
-    if (xaccTransHasSplitsInState (trans, VREC))
-        return TRUE;
-
-    if (qof_book_uses_autoreadonly (model->priv->book)) // use auto read only
-    {
-        if (trans == model->priv->btrans) // blank transaction
-            return FALSE;
-        else
-            return xaccTransIsReadonlyByPostedDate (trans);
-    }
-    return FALSE;
-}
-
-
-/* Returns the row color */
-gchar*
-gnc_tree_model_split_reg_get_row_color (GncTreeModelSplitReg *model, gboolean is_trow1, gboolean is_trow2, gboolean is_split, gint num)
-{
-
-    gchar *cell_color = NULL;
-
-    if (!model->use_theme_colors)
-    {
-        if (model->use_double_line)
-        {
-            if (model->alt_colors_by_txn)
-            {
-                if (num % 2 == 0)
-                {
-                    if (is_trow1 || is_trow2)
-                        cell_color = (gchar*)GREENROW;
-                }
-                else 
-                {
-                    if (is_trow1 || is_trow2)
-                        cell_color = (gchar*)TANROW;
-                }
-            }
-            else
-            {
-                if (is_trow1)
-                    cell_color = (gchar*)GREENROW;
-                else if (is_trow2)
-                    cell_color = (gchar*)TANROW;
-            }
-        }
-        else
-        {
-            if (num % 2 == 0)
-            {
-                if (is_trow1)
-                    cell_color = (gchar*)GREENROW;
-                else if (is_trow2)
-                    cell_color = (gchar*)TANROW;
-            }
-            else
-            {
-                if (is_trow1)
-                    cell_color = (gchar*)TANROW;
-                else if (is_trow2)
-                    cell_color = (gchar*)GREENROW;
-            }
-        }
-        if (is_split)
-            cell_color = (gchar*)SPLITROW;
-    }
-    else
-        cell_color = (gchar*)NULL;
-
-    return cell_color;
-}
-
-
-static void
-gnc_tree_model_split_reg_get_value (GtkTreeModel *tree_model,
-                                  GtkTreeIter *iter,
-                                  int column,
-                                  GValue *value)
-{
-    /* Initializes and sets value to that at column. When done with value,
-       g_value_unset() needs to be called to free any allocated memory. */
-    GncTreeModelSplitReg *model = GNC_TREE_MODEL_SPLIT_REG (tree_model);
-    const GncGUID *guid;
-    GList *tnode;
-    gint depth, *indices;
-
-    g_return_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (model));
-
-    //ENTER("model %p, iter %s, col %d", tree_model, iter_to_string (iter), column);
-
-    tnode = (GList *) iter->user_data2;
-
-    g_value_init (value, gnc_tree_model_split_reg_get_column_type (tree_model, column));
-
-    switch (column)
-    {
-    case GNC_TREE_MODEL_SPLIT_REG_COL_GUID:
-        guid = qof_entity_get_guid (QOF_INSTANCE (tnode->data));
-        g_value_set_pointer (value, (gpointer) guid);
-        break;
-
-    case GNC_TREE_MODEL_SPLIT_REG_COL_DATE:
-        break;
-
-    case GNC_TREE_MODEL_SPLIT_REG_COL_DUEDATE:
-        break;
-
-    case GNC_TREE_MODEL_SPLIT_REG_COL_NUMACT:
-        break;
-
-    case GNC_TREE_MODEL_SPLIT_REG_COL_DESCNOTES:
-        break;
-
-    case GNC_TREE_MODEL_SPLIT_REG_COL_TRANSFERVOID:
-        break;
-
-    case GNC_TREE_MODEL_SPLIT_REG_COL_RECN:
-        break;
-
-    case GNC_TREE_MODEL_SPLIT_REG_COL_DEBIT:
-        break;
-
-    case GNC_TREE_MODEL_SPLIT_REG_COL_CREDIT:
-        break;
-
-    case GNC_TREE_MODEL_SPLIT_REG_COL_RO:
-            g_value_set_boolean (value, gnc_tree_model_split_reg_get_read_only (model, tnode->data));
-        break;
-
-    case GNC_TREE_MODEL_SPLIT_REG_COL_NUM_VIS:
-            g_value_set_boolean (value, gnc_tree_model_split_reg_get_numact_vis (model, IS_TROW1(iter), IS_TROW2(iter)));
-        break;
-
-    case GNC_TREE_MODEL_SPLIT_REG_COL_ACT_VIS:
-            g_value_set_boolean (value, !gnc_tree_model_split_reg_get_numact_vis (model, IS_TROW1(iter), IS_TROW2(iter)));
-        break;
-
-    default:
-        g_assert_not_reached ();
-    }
-    //LEAVE(" ");
-}
-
-
-static gboolean
-gnc_tree_model_split_reg_iter_next (GtkTreeModel *tree_model, GtkTreeIter *iter)
-{
-    /* Sets iter to point to the node following it at the current level.
-       If there is no next iter, FALSE is returned and iter is set to be
-       invalid */
-    GncTreeModelSplitReg *model = GNC_TREE_MODEL_SPLIT_REG (tree_model);
-    Split *split;
-    SplitList *slist;
-    GList *tnode = NULL, *snode = NULL;
-    gint flags = 0;
-
-    g_return_val_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (model), FALSE);
-
-    ENTER("model %p, iter %s", tree_model, iter_to_string (iter));
-
-    if (IS_TROW2 (iter)) {
-        LEAVE("Transaction row 2 never has a next");
-        goto fail;
-    }
-
-    if (IS_TROW1 (iter)) {
-        flags = TROW1;
-        tnode = iter->user_data2;
-        tnode = g_list_next (tnode);
-
-        if (!tnode) {
-           LEAVE("last trans has no next");
-           goto fail;
-        }
-
-        slist = xaccTransGetSplitList (tnode->data);
-
-        /* Check if this is the blank trans */
-        if (tnode->data == model->priv->btrans)
-        {
-            flags |= BLANK;
-
-            if (xaccTransCountSplits (tnode->data) == 0)
-            {
-                if (model->priv->bsplit_parent_node == tnode)
-                    snode = model->priv->bsplit_node; // blank split
-                else
-                    snode = NULL; // blank trans with no splits
-            }
-            else
-            {
-                split = xaccTransGetSplit (tnode->data, 0);
-                snode = g_list_find (slist, split); // else first split
-            }
-        }
-        else
-        {
-            split = xaccTransGetSplit (tnode->data, 0);
-            snode = g_list_find (slist, split); // else first split
-        }
-    }
-
-    if (IS_SPLIT (iter)) {
-
-        gint i = 0;
-        flags = SPLIT;
-        tnode = iter->user_data2;
-
-        if (IS_BLANK (iter)) {
-            LEAVE("Blank split never has a next");
-            goto fail;
-        }
-
-        slist = xaccTransGetSplitList (tnode->data);
-        snode = iter->user_data3;
-
-        i = xaccTransGetSplitIndex (tnode->data, snode->data);
-        i++;
-        split = xaccTransGetSplit (tnode->data, i);
-        snode = g_list_find (slist, split);
-
-        if (!snode) {
-            if (tnode == model->priv->bsplit_parent_node) {
-                snode = model->priv->bsplit_node;
-                flags |= BLANK;
-            } else {
-                LEAVE("Last non-blank split has no next");
-                goto fail;
-            }
-        }
-    }
-
-    *iter = gtm_sr_make_iter (model, flags, tnode, snode);
-    LEAVE("iter %s", iter_to_string (iter));
-    return TRUE;
- fail:
-    iter->stamp = 0;
-    return FALSE;
-}
-
-
-static gboolean
-gnc_tree_model_split_reg_iter_children (GtkTreeModel *tree_model,
-                                      GtkTreeIter *iter,
-                                      GtkTreeIter *parent_iter)
-{
-    /* Sets iter to point to the first child of parent. If parent has no children,
-       FALSE is returned and iter is set to be invalid. Parent will remain a valid
-       node after this function has been called. */
-    GncTreeModelSplitReg *model = GNC_TREE_MODEL_SPLIT_REG (tree_model);
-    GList *tnode = NULL, *snode = NULL;
-    gint flags = 0;
-    Split *split;
-    SplitList *slist;
-
-    g_return_val_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (tree_model), FALSE);
-    ENTER("model %p, iter %p , parent %s",
-          tree_model, iter, (parent_iter ? iter_to_string (parent_iter) : "(null)"));
-
-    if (!parent_iter) // special parent iter is NULL
-    {
-        /* Get the very first iter */
-        tnode = g_list_first (model->priv->tlist);
-        if (tnode)
-        {
-            flags = TROW1;
-            slist = xaccTransGetSplitList (tnode->data);
-            if (tnode->data == model->priv->btrans)
-            {
-                flags |= BLANK;
-
-                if (xaccTransCountSplits (tnode->data) == 0)
-                {
-                    if (model->priv->bsplit_parent_node == tnode)
-                        snode = model->priv->bsplit_node; // blank split
-                    else
-                        snode = NULL; // blank trans with no splits
-                }
-                else
-                {
-                     split = xaccTransGetSplit (tnode->data, 0);
-                     snode = g_list_find (slist, split); // else first split
-                }
-            }
-            else
-            {
-                split = xaccTransGetSplit (tnode->data, 0);
-                snode = g_list_find (slist, split); // else first split
-            }
-
-            *iter = gtm_sr_make_iter (model, flags, tnode, snode);
-            LEAVE("Parent iter NULL, First iter is %s", iter_to_string (iter));
-            return TRUE;
-        }
-        else
-        {
-            PERR("We should never have a NULL trans list.");
-            goto fail;
-        }
-    }
-
-/*    g_assert(VALID_ITER(model, parent_iter)); */
-
-    if (IS_TROW1 (parent_iter))
-    {
-        flags = TROW2;
-        tnode = parent_iter->user_data2;
-        slist = xaccTransGetSplitList (tnode->data);
-
-        if (tnode->data == model->priv->btrans)
-        {
-            flags |= BLANK;
-
-            if (xaccTransCountSplits (tnode->data) == 0)
-            {
-                if (model->priv->bsplit_parent_node == tnode)
-                    snode = model->priv->bsplit_node; // blank split
-                else
-                    snode = NULL; // blank trans with no splits
-            }
-            else
-            {
-                split = xaccTransGetSplit (tnode->data, 0);
-                snode = g_list_find (slist, split); // else first split
-            }
-        }
-        else
-        {
-            split = xaccTransGetSplit (tnode->data, 0);
-            snode = g_list_find (slist, split); // else first split
-        }
-    }
-
-    if (IS_TROW2 (parent_iter))
-    {
-        tnode = parent_iter->user_data2;
-
-        if ((tnode->data == model->priv->btrans) && (tnode != model->priv->bsplit_parent_node)) // blank trans has no split to start with
-            goto fail;
-        else if ((tnode->data != model->priv->btrans) && (xaccTransCountSplits (tnode->data) == 0) && (tnode != model->priv->bsplit_parent_node)) // trans has no splits after trans reinit.
-            goto fail;
-        else
-        {
-            flags = SPLIT;
-            tnode = parent_iter->user_data2;
-            slist = xaccTransGetSplitList (tnode->data);
-
-            if (((tnode->data == model->priv->btrans) || (xaccTransCountSplits (tnode->data) == 0)) && (tnode == model->priv->bsplit_parent_node))
-            {
-                flags |= BLANK;
-                snode = model->priv->bsplit_node; // blank split on blank trans
-            }
-            else
-            {
-                split = xaccTransGetSplit (tnode->data, 0);
-                snode = g_list_find (slist, split); // else first split
-            }
-        }
-    }
-
-    if (IS_SPLIT (parent_iter)) // Splits do not have children
-        goto fail;
-
-    *iter = gtm_sr_make_iter (model, flags, tnode, snode);
-    LEAVE("First Child iter is %s", iter_to_string (iter));
-    return TRUE;
- fail:
-    LEAVE("iter has no children");
-    iter->stamp = 0;
-    return FALSE;
-}
-
-
-static gboolean
-gnc_tree_model_split_reg_iter_has_child (GtkTreeModel *tree_model, GtkTreeIter *iter)
-{
-    /* Returns TRUE if iter has children, FALSE otherwise. */
-    GncTreeModelSplitReg *model = GNC_TREE_MODEL_SPLIT_REG (tree_model);
-    GList *tnode;
-
-    g_return_val_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (tree_model), FALSE);
-
-    ENTER("model %p, iter %s", tree_model, iter_to_string (iter));
-
-    tnode = iter->user_data2;
-
-    if (IS_TROW1 (iter)) // Normal Transaction TROW1
-    {
-        LEAVE ("Transaction Row 1 is yes");
-        return TRUE;
-    }
-
-    if (IS_TROW2 (iter) && !(IS_BLANK (iter))) // Normal Transaction TROW2
-    {
-        if (xaccTransCountSplits (tnode->data) != 0) // with splits
-	{
-            LEAVE ("Transaction Row 2 is yes");
-            return TRUE;
-        }
-        else
-        {
-            if (tnode == model->priv->bsplit_parent_node) // with no splits, just blank split
-	    {
-                LEAVE ("Transaction Row 2 is yes, blank split");
-                return TRUE;
-            }
-        }
-    }
-
-    if (IS_TROW2 (iter) && IS_BLANK (iter) && (tnode == model->priv->bsplit_parent_node)) // Blank Transaction TROW2
-    {
-        LEAVE ("Blank Transaction Row 2 is yes");
-        return TRUE;
-    }
-
-    LEAVE ("We have no child");
-    return FALSE;
-}
-
-
-static int
-gnc_tree_model_split_reg_iter_n_children (GtkTreeModel *tree_model, GtkTreeIter *iter)
-{
-    /* Returns the number of children that iter has. As a special case,
-       if iter is NULL, then the number of toplevel nodes is returned.  */
-    GncTreeModelSplitReg *model = GNC_TREE_MODEL_SPLIT_REG (tree_model);
-    GList *tnode;
-    int i;
-
-    g_return_val_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (tree_model), FALSE);
-    ENTER("model %p, iter %s", tree_model, iter_to_string (iter));
-
-    if (iter == NULL) {
-        i = g_list_length (model->priv->tlist);
-        LEAVE ("toplevel count is %d", i);
-        return i;
-    }
-
-    if (IS_SPLIT (iter))
-        i = 0;
-
-    if (IS_TROW1 (iter))
-        i = 1;
-
-    if (IS_TROW2 (iter))
-    {
-        tnode = iter->user_data2;
-        i = xaccTransCountSplits (tnode->data);
-        if (tnode == model->priv->bsplit_parent_node)
-            i++;
-    }
-
-    LEAVE ("The number of children iter has is %d", i);
-    return i;
-}
-
-
-static gboolean
-gnc_tree_model_split_reg_iter_nth_child (GtkTreeModel *tree_model,
-                                       GtkTreeIter *iter,
-                                       GtkTreeIter *parent_iter,
-                                       int n)
-{
-    /* Sets iter to be the n'th child of parent, using the given index. 0 > */
-    GncTreeModelSplitReg *model = GNC_TREE_MODEL_SPLIT_REG (tree_model);
-    Split *split;
-    SplitList *slist;
-    GList *tnode, *snode;
-    gint flags = 0;
-
-    ENTER("model %p, iter %s, n %d", tree_model, iter_to_string (parent_iter), n);
-    g_return_val_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (tree_model), FALSE);
-
-    if (parent_iter == NULL) {  /* Top-level */
-        flags = TROW1;
-        tnode = g_list_nth (model->priv->tlist, n);
-
-        if (!tnode) {
-            PERR("Index greater than trans list.");
-            goto fail;
-        }
-
-        slist = xaccTransGetSplitList (tnode->data);
-
-        /* Check if this is the blank trans */
-        if (tnode->data == model->priv->btrans)
-        {
-            flags |= BLANK;
-
-            if (xaccTransCountSplits (tnode->data) == 0)
-            {
-                if (model->priv->bsplit_parent_node == tnode)
-                    snode = model->priv->bsplit_node; // blank split
-                else
-                    snode = NULL; // blank trans with no splits
-            }
-            else
-            {
-                split = xaccTransGetSplit (tnode->data, 0);
-                snode = g_list_find (slist, split); // else first split
-            }
-        }
-        else
-        {
-            split = xaccTransGetSplit (tnode->data, 0);
-            snode = g_list_find (slist, split); // else first split
-        }
-
-        *iter = gtm_sr_make_iter (model, flags, tnode, snode);
-        LEAVE ("iter (2) %s", iter_to_string (iter));
-        return TRUE;
-    }
-
-/*    g_assert(VALID_ITER(model, parent_iter)); */
-
-    if (IS_SPLIT (parent_iter))
-        goto fail;  /* Splits have no children */
-
-    if (IS_TROW1 (parent_iter) && (n != 0))
-        goto fail; /* TROW1 has only one child */
-
-    flags = TROW2;
-    snode = NULL;
-
-    tnode = parent_iter->user_data2;
-
-    if (IS_TROW1 (parent_iter) && IS_BLANK (parent_iter))
-    {
-        flags |= BLANK;
-    }
-
-    if (IS_TROW2 (parent_iter) && (n > xaccTransCountSplits (tnode->data)))
-    {
-        goto fail;
-    }
-    else
-    {
-        if (tnode->data == model->priv->btrans)
-        {
-            snode = NULL;
-        }
-        else if ((tnode == model->priv->bsplit_parent_node) && (xaccTransCountSplits (tnode->data) == n))
-        {
-            flags = SPLIT | BLANK;
-            snode = model->priv->bsplit_node;
-        }
-        else
-        {
-            flags = SPLIT;
-            slist = xaccTransGetSplitList (tnode->data);
-            split = xaccTransGetSplit (tnode->data, n);
-            snode = g_list_find (slist, split);
-        }
-    }
-
-    *iter = gtm_sr_make_iter (model, flags, tnode, snode);
-    LEAVE("iter of child with index %u is %s", n, iter_to_string (iter));
-    return TRUE;
- fail:
-    LEAVE("iter has no child with index %u", n);
-    iter->stamp = 0;
-    return FALSE;
-}
-
-
-static gboolean
-gnc_tree_model_split_reg_iter_parent (GtkTreeModel *tree_model,
-                                    GtkTreeIter *iter,
-                                    GtkTreeIter *child)
-{
-    /* Sets iter to be the parent of child. If child is at the toplevel,
-       and doesn't have a parent, then iter is set to an invalid iterator
-       and FALSE is returned. Child will remain a valid node after this 
-       function has been called. */
-    GncTreeModelSplitReg *model = GNC_TREE_MODEL_SPLIT_REG (tree_model);
-    GList *tnode, *snode;
-    gint flags = TROW1;
-
-    ENTER("model %p, child %s", tree_model, iter_to_string (child));
-
-/*    g_assert(VALID_ITER(model, child)); */
-
-    tnode = child->user_data2;
-    snode = child->user_data3;
-
-    if (IS_TROW1 (child))
-        goto fail;
-
-    if (IS_TROW2 (child))
-        flags = TROW1;
-
-    if (IS_SPLIT (child))
-        flags = TROW2;
-
-    if (tnode->data == model->priv->btrans)
-        flags |= BLANK;
-
-    *iter = gtm_sr_make_iter (model, flags, tnode, snode);
-    LEAVE("parent iter is %s", iter_to_string (iter));
-    return TRUE;
- fail:
-    LEAVE("we have no parent");
-    iter->stamp = 0;
-    return FALSE;
-}
-
-
-/*##########################################################################*/
-/* increment the stamp of the model */
-static void
-gtm_sr_increment_stamp (GncTreeModelSplitReg *model)
-{
-    do model->stamp++;
-    while (model->stamp == 0);
-}
-
-
-/* Return these values based on the model and iter provided */
-gboolean
-gnc_tree_model_split_reg_get_split_and_trans (
-    GncTreeModelSplitReg *model, GtkTreeIter *iter,
-    gboolean *is_trow1, gboolean *is_trow2, gboolean *is_split,
-    gboolean *is_blank, Split **split, Transaction **trans)
-{
-    GList *node;
-
-/*    g_return_val_if_fail(VALID_ITER(model, iter), FALSE); */
-    //ENTER("model pointer is %p", model);
-    if (is_trow1)
-        *is_trow1 = !!IS_TROW1(iter);
-    if (is_trow2)
-        *is_trow2 = !!IS_TROW2(iter);
-    if (is_split)
-        *is_split = !!IS_SPLIT(iter);
-    if (is_blank)
-        *is_blank = !!IS_BLANK(iter);
-
-    if (trans)
-    {
-        node = iter->user_data2;
-        *trans = node ? (Transaction *) node->data : NULL;
-    }
-
-    if (split)
-    {
-        node = iter->user_data3;
-        *split = node ? (Split *) node->data : NULL;
-    }
-    //LEAVE("");
-    return TRUE;
-}
-
-/* Return TRUE if blank_split is on trans */
-gboolean
-gnc_tree_model_split_reg_is_blank_split_parent (GncTreeModelSplitReg *model, Transaction *trans)
-{
-    GncTreeModelSplitRegPrivate *priv;
-    GList *node;
-
-    priv = model->priv;
-
-    node = priv->bsplit_parent_node;
-
-    if (node == NULL)
-        return FALSE;
-
-    if (trans == priv->bsplit_parent_node->data)
-        return TRUE;
-    else
-        return FALSE;
-}
-
-
-/* Return the tree path of trans and split
-   if trans and split NULL, return blank trans in list */
-GtkTreePath *
-gnc_tree_model_split_reg_get_path_to_split_and_trans (GncTreeModelSplitReg *model, Split *split, Transaction *trans)
-{
-    GtkTreePath *path;
-    GList *slist;
-    gint tpos, spos, number;
-
-    ENTER("transaction is %p, split is %p", trans, split);
-
-    path = gtk_tree_path_new();
-
-    number = gnc_tree_model_split_reg_iter_n_children (GTK_TREE_MODEL (model), NULL) - 1;
-
-    if (trans == NULL && split == NULL)
-    {
-        gchar *path_string;
-
-        /* Level 1 */
-        tpos = g_list_index (model->priv->tlist, model->priv->btrans);
-        if (tpos == -1)
-            tpos = number;
-        gtk_tree_path_append_index (path, tpos);
-
-        path_string = gtk_tree_path_to_string (path);
-        LEAVE("path is %s", path_string);
-        g_free (path_string);
-        return path;
-    }
-
-    if (trans == NULL && split != NULL)
-    {
-        if (split == model->priv->bsplit)
-            trans = model->priv->bsplit_parent_node->data;
-        else
-            trans = xaccSplitGetParent (split);
-    }
-
-    if (trans != NULL)
-    {
-        /* Level 1 */
-        tpos = g_list_index (model->priv->tlist, trans);
-        if (tpos == -1)
-            tpos = number;
-        gtk_tree_path_append_index (path, tpos);
-    }
-
-    if (split != NULL)
-    {
-        slist = xaccTransGetSplitList (trans);
-        /* Level 3 */
-        spos = xaccTransGetSplitIndex (trans, split);
-        if (spos == -1)
-        {
-            if (model->priv->bsplit == split) // test for blank split
-                spos = xaccTransCountSplits (trans);
-            else
-                spos = -1;
-        }
-        gtk_tree_path_append_index (path, 0); /* Level 2 */
-        if (spos != -1)
-            gtk_tree_path_append_index (path, spos);
-    }
-
-    {
-        gchar *path_string = gtk_tree_path_to_string (path);
-        LEAVE("path is %s", path_string);
-        g_free (path_string);
-    }
-    return path;
-}
-
-
-#define get_iter gnc_tree_model_split_reg_get_iter_from_trans_and_split
-gboolean
-gnc_tree_model_split_reg_get_iter_from_trans_and_split (
-    GncTreeModelSplitReg *model, Transaction *trans, Split *split, 
-    GtkTreeIter *iter1, GtkTreeIter *iter2)
-{
-    GncTreeModelSplitRegPrivate *priv;
-    GList *tnode, *snode = NULL;
-    gint flags1 = TROW1;
-    gint flags2 = TROW2;
-
-    g_return_val_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (model), FALSE);
-    g_return_val_if_fail (iter1, FALSE);
-    g_return_val_if_fail (iter2, FALSE);
-    PINFO("get_iter model %p, trans %p, split %p\n", model, trans, split);
-
-    priv = model->priv;
-    if (split && !trans)
-        trans = xaccSplitGetParent (split);
-
-    if (trans && priv->book != xaccTransGetBook (trans)) return FALSE;
-    if (split && priv->book != xaccSplitGetBook (split)) return FALSE;    
-    if (split && !xaccTransStillHasSplit (trans, split)) return FALSE;
-
-    tnode = g_list_find (priv->tlist, trans);
-    if (!tnode) return FALSE;
-
-    if (trans == priv->btrans)
-    {
-        flags1 |= BLANK;
-        flags2 |= BLANK;
-    }
-
-    if (split)
-    {
-        GList *slist = xaccTransGetSplitList (trans);
-        snode = g_list_find (slist, split);
-        flags1 = SPLIT;
-        if (!snode && split == (Split *) ((GList *)priv->bsplit_node)->data)
-        {
-            snode = priv->bsplit_node;
-            flags1 |= BLANK;
-        }
-        if (!snode) return FALSE;
-    }
-
-    *iter1 = gtm_sr_make_iter (model, flags1, tnode, snode);
-    *iter2 = gtm_sr_make_iter (model, flags2, tnode, snode);
-
-    return TRUE;
-}
-
-
-/* Return the blank split */
-Split *
-gnc_tree_model_split_get_blank_split (GncTreeModelSplitReg *model)
-{
-    return model->priv->bsplit;
-}
-
-
-/* Return the blank transaction */
-Transaction *
-gnc_tree_model_split_get_blank_trans (GncTreeModelSplitReg *model)
-{
-    return model->priv->btrans;
-}
-
-
-/* Dummy Sort function */
-gint
-gnc_tree_model_split_reg_sort_iter_compare_func (GtkTreeModel *tm,
-                          GtkTreeIter  *a,
-                          GtkTreeIter  *b,
-                          gpointer      user_data)
-{
-    GncTreeModelSplitReg *model = GNC_TREE_MODEL_SPLIT_REG (tm);
-
-    /* This is really a dummy sort function, it leaves the list as is. */
-
-    if (model->sort_direction == 1) // Ascending
-        return gtk_tree_path_compare (gnc_tree_model_split_reg_get_path (tm, a),
-                                      gnc_tree_model_split_reg_get_path (tm, b));
-    else
-        return gtk_tree_path_compare (gnc_tree_model_split_reg_get_path (tm, b),
-                                      gnc_tree_model_split_reg_get_path (tm, a));
-}
-
-/*##########################################################################*/
-
-/* Update the parent when row changes made */
-static void
-gtm_sr_update_parent (GncTreeModelSplitReg *model, GtkTreePath *path)
-{
-    GList *tnode;
-    GtkTreeIter iter;
-
-    ENTER(" ");
-    if (gtk_tree_path_up (path) && gnc_tree_model_split_reg_get_iter (GTK_TREE_MODEL (model), &iter, path))
-    {
-        gchar *path_string = gtk_tree_path_to_string (path);
-        PINFO("row_changed - '%s'", path_string);
-        g_free (path_string);
-
-        gtk_tree_model_row_changed (GTK_TREE_MODEL (model), path, &iter);
-
-        tnode = iter.user_data2;
-
-        /* If this is the blank transaction, the only split will be deleted, hence toggle has child */
-        if (IS_BLANK_TRANS (&iter) && (tnode->data == model->priv->btrans) && (xaccTransCountSplits (model->priv->btrans) == 0))
-        {
-            gchar *path_string;
-            path_string = gtk_tree_path_to_string (path);
-            PINFO("toggling has_child at row '%s'", path_string);
-            g_free (path_string);
-            gtm_sr_increment_stamp (model);
-            gtk_tree_model_row_has_child_toggled (GTK_TREE_MODEL (model), path, &iter);
-        }
-    }
-    LEAVE(" ");
-}
-
-
-/* Insert row at iter */
-static void
-gtm_sr_insert_row_at (GncTreeModelSplitReg *model, GtkTreeIter *iter)
-{
-    GtkTreePath *path;
-
-//    g_assert (VALID_ITER (model, iter));
-    ENTER(" ");
-    path = gnc_tree_model_split_reg_get_path (GTK_TREE_MODEL (model), iter);
-    if (!path)
-        PERR("Null path");
-
-    gtm_sr_increment_stamp (model);
-    if (gnc_tree_model_split_reg_get_iter (GTK_TREE_MODEL (model), iter, path))
-    {
-        gtk_tree_model_row_inserted (GTK_TREE_MODEL (model), path, iter);
-    }
-    else
-        PERR("Tried to insert with invalid iter.");
-
-    gtm_sr_update_parent (model, path);
-    gtk_tree_path_free (path);
-    LEAVE(" ");
-}
-
-
-/* Delete row at path */
-static void
-gtm_sr_delete_row_at_path (GncTreeModelSplitReg *model, GtkTreePath *path)
-{
-    gint depth;
-
-    ENTER(" ");
-
-    if (!path)
-        PERR("Null path");
-
-    gtm_sr_increment_stamp (model);
-    gtk_tree_model_row_deleted (GTK_TREE_MODEL (model), path);
-
-    depth = gtk_tree_path_get_depth (path);
-
-    if (depth == 2)
-    {
-        gtm_sr_update_parent (model, path);
-    }
-    else if (depth == 3)
-    {
-        gtm_sr_update_parent (model, path);
-    }
-    else
-    {
-        GtkTreeIter iter;
-        if (gnc_tree_model_split_reg_get_iter (GTK_TREE_MODEL (model), &iter, path))
-        { 
-            GList *tnode = iter.user_data2;
-            GncTreeModelSplitRegPrivate *priv = model->priv;
-            if (tnode == priv->bsplit_parent_node)
-                priv->bsplit_parent_node = NULL;
-        }
-    }
-    LEAVE(" ");
-}
-
-
-/* Delete row at iter */
-static void
-gtm_sr_delete_row_at (GncTreeModelSplitReg *model, GtkTreeIter *iter)
-{
-    GtkTreePath *path;
-//    g_assert(VALID_ITER (model, iter));
-
-    ENTER(" ");
-    path = gnc_tree_model_split_reg_get_path (GTK_TREE_MODEL (model), iter);
-    gtm_sr_delete_row_at_path (model, path);
-    gtk_tree_path_free (path);
-    LEAVE(" ");
-}
-
-
-/* Change row at iter */
-static void
-gtm_sr_changed_row_at (GncTreeModelSplitReg *model, GtkTreeIter *iter)
-{
-    GtkTreePath *path;
-//    g_assert(VALID_ITER (model, iter));
-
-    ENTER(" ");
-    path = gnc_tree_model_split_reg_get_path (GTK_TREE_MODEL (model), iter);
-    if (!path)
-        PERR ("Null path");
-
-    gtm_sr_increment_stamp (model);
-    if (gnc_tree_model_split_reg_get_iter (GTK_TREE_MODEL (model), iter, path))
-    {
-        gtk_tree_model_row_changed (GTK_TREE_MODEL (model), path, iter);
-    }
-    else 
-        PERR ("Tried to change with invalid iter.");
-
-    gtk_tree_path_free (path);
-    LEAVE(" ");
-}
-
-
-/* Insert transaction into model */
-static void
-gtm_sr_insert_trans (GncTreeModelSplitReg *model, Transaction *trans, gboolean before)
-{
-    GtkTreeIter iter;
-    GtkTreePath *path;
-    GList *tnode = NULL, *snode = NULL;
-
-    ENTER("insert transaction %p into model %p", trans, model);
-    if (before == TRUE)
-        model->priv->tlist = g_list_prepend (model->priv->tlist, trans);
-    else
-        model->priv->tlist = g_list_append (model->priv->tlist, trans);
-    tnode = g_list_find (model->priv->tlist, trans);
-
-    iter = gtm_sr_make_iter (model, TROW1, tnode, NULL);
-    gtm_sr_insert_row_at (model, &iter);
-
-    iter = gtm_sr_make_iter (model, TROW2, tnode, NULL);
-    gtm_sr_insert_row_at (model, &iter);
-    path = gnc_tree_model_split_reg_get_path (GTK_TREE_MODEL (model), &iter);
-
-    gtk_tree_path_up (path); // to TROW1
-    gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &iter, path);
-    gtk_tree_model_row_has_child_toggled (GTK_TREE_MODEL (model), path, &iter);
-
-    DEBUG("insert %d splits for transaction %p", xaccTransCountSplits (trans), trans);
-
-    for (snode = xaccTransGetSplitList (trans); snode; snode = snode->next)
-    {
-        if (xaccTransStillHasSplit (trans, snode->data))
-        {
-            iter = gtm_sr_make_iter (model, SPLIT, tnode, snode);
-            gtm_sr_insert_row_at (model, &iter);
-        }
-    }
-    gtk_tree_path_down (path); // to TROW2
-    gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &iter, path);
-    gtk_tree_model_row_has_child_toggled (GTK_TREE_MODEL (model), path, &iter);
-    gtk_tree_path_free (path);
-
-    LEAVE(" ");
-}
-
-
-/* Delete transaction from model */
-static void
-gtm_sr_delete_trans (GncTreeModelSplitReg *model, Transaction *trans)
-{
-    GtkTreeIter iter;
-    GList *tnode = NULL, *snode = NULL;
-
-    ENTER("delete trans %p", trans);
-    tnode = g_list_find (model->priv->tlist, trans);
-
-    DEBUG("tlist length is %d and no of splits is %d", g_list_length (model->priv->tlist), xaccTransCountSplits (trans));
-
-    if (tnode == model->priv->bsplit_parent_node)
-    {
-        /* Delete the row where the blank split is. */
-        iter = gtm_sr_make_iter (model, SPLIT | BLANK, tnode, model->priv->bsplit_node);
-        gtm_sr_delete_row_at (model, &iter);
-        model->priv->bsplit_parent_node = NULL;
-    }
-
-    for (snode = xaccTransGetSplitList (trans); snode; snode = snode->next)
-    {
-        if (xaccTransStillHasSplit (trans, snode->data))
-        {
-            iter = gtm_sr_make_iter (model, SPLIT, tnode, snode);
-            gtm_sr_delete_row_at (model, &iter);
-        }
-    }
-
-    iter = gtm_sr_make_iter (model, TROW2, tnode, NULL);
-    gtm_sr_delete_row_at (model, &iter);
-
-    iter = gtm_sr_make_iter (model, TROW1, tnode, NULL);
-    gtm_sr_delete_row_at (model, &iter);
-
-    model->priv->tlist = g_list_delete_link (model->priv->tlist, tnode);
-    LEAVE(" ");
-}
-
-
-/* Moves the blank split to 'trans' and remove old one. */
-gboolean
-gnc_tree_model_split_reg_set_blank_split_parent (GncTreeModelSplitReg *model, Transaction *trans, gboolean remove_only)
-{
-    GList *tnode, *bs_parent_node;
-    GncTreeModelSplitRegPrivate *priv;
-    GtkTreeIter iter;
-    gboolean moved;
-
-    priv = model->priv;
-
-    if (trans == NULL)
-        tnode = g_list_last (priv->tlist);
-    else
-        tnode = g_list_find (priv->tlist, trans);
-
-    ENTER("set blank split %p parent to trans %p and remove_only is %d", priv->bsplit, trans, remove_only);
-
-    bs_parent_node = priv->bsplit_parent_node;
-
-    if (tnode != bs_parent_node || remove_only == TRUE)
-    {
-        moved = (bs_parent_node != NULL || remove_only == TRUE);
-        if (moved)
-        {
-            /* Delete the row where the blank split used to be. */
-            iter = gtm_sr_make_iter (model, SPLIT | BLANK, bs_parent_node, priv->bsplit_node);
-            gtm_sr_delete_row_at (model, &iter);
-            priv->bsplit_parent_node = NULL;
-
-        }
-        if (remove_only == FALSE)
-        {
-            /* Create the row where the blank split will be. */
-            priv->bsplit_parent_node = tnode;
-            iter = gtm_sr_make_iter (model, SPLIT | BLANK, tnode, priv->bsplit_node);
-            gtm_sr_insert_row_at (model, &iter);
-            xaccSplitReinit (priv->bsplit); // set split back to default entries
-        }
-    }
-    else
-        moved = FALSE;
-
-    LEAVE(" ");
-    return moved;
-}
-
-
-/* Make a new blank split and insert at iter */
-static void
-gtm_sr_make_new_blank_split (GncTreeModelSplitReg *model)
-{
-    GtkTreeIter iter;
-    Split *split;
-    GList *tnode = model->priv->bsplit_parent_node;
-
-    ENTER("");
-
-    split = xaccMallocSplit (model->priv->book);
-    model->priv->bsplit = split;
-    model->priv->bsplit_node->data = model->priv->bsplit;
-
-    DEBUG("make new blank split %p and insert at trans %p", split, tnode->data);
-
-    /* Insert the new blank split */
-    iter = gtm_sr_make_iter (model, BLANK|SPLIT, tnode, model->priv->bsplit_node);
-    gtm_sr_insert_row_at (model, &iter);
-    LEAVE("");
-}
-
-
-/* Turn the current blank split into a real split.  This function is
- * never called in response to an engine event.  Instead, this
- * function is called from the treeview to tell the model to commit
- * the blank split.
- */
-void
-gnc_tree_model_split_reg_commit_blank_split (GncTreeModelSplitReg *model)
-{
-    Split *bsplit;
-    GList *tnode, *snode;
-    GtkTreeIter iter;
-
-    ENTER(" ");
-
-    tnode = model->priv->bsplit_parent_node;
-    bsplit = model->priv->bsplit;
-
-    if (!tnode || !tnode->data) {
-        LEAVE("blank split has no trans");
-        return;
-    }
-
-    if (xaccTransGetSplitIndex (tnode->data, bsplit) == -1) {
-        LEAVE("blank split has been removed from this trans");
-        return;
-    }
-
-    snode = g_list_find (xaccTransGetSplitList (tnode->data), bsplit);
-    if (!snode) {
-        LEAVE("Failed to turn blank split into real split");
-        return;
-    }
-
-    /* If we haven't set an amount yet, and there's an imbalance, use that. */
-    if (gnc_numeric_zero_p (xaccSplitGetAmount (bsplit)))
-    {
-        gnc_numeric imbal = gnc_numeric_neg (xaccTransGetImbalanceValue (tnode->data));
-        if (!gnc_numeric_zero_p (imbal))
-        {
-            gnc_numeric amount, rate;
-            Account *acct = xaccSplitGetAccount (bsplit);
-            xaccSplitSetValue (bsplit, imbal);
-
-            if (gnc_commodity_equal (xaccAccountGetCommodity (acct), xaccTransGetCurrency (tnode->data)))
-            {
-                amount = imbal;
-            }
-            else
-            {
-                rate = xaccTransGetAccountConvRate (tnode->data, acct);
-                amount = gnc_numeric_mul (imbal, rate, xaccAccountGetCommoditySCU (acct), GNC_HOW_RND_ROUND);
-            }
-            if (gnc_numeric_check (amount) == GNC_ERROR_OK)
-            {
-                xaccSplitSetAmount (bsplit, amount);
-            }
-        }
-    }
-    /* Mark the old blank split as changed */
-    iter = gtm_sr_make_iter (model, SPLIT, tnode, snode);
-    gtm_sr_changed_row_at (model, &iter);
-    gtm_sr_make_new_blank_split (model);
-
-    LEAVE(" ");
-}
-
-
-/* Update the display sub account and general ledger settings */
-void
-gnc_tree_model_split_reg_set_display (GncTreeModelSplitReg *model, gboolean subacc, gboolean gl)
-{
-    GncTreeModelSplitRegPrivate *priv = model->priv;
-
-    priv->display_subacc = subacc;
-    priv->display_gl = gl;
-}
-
-
-/* Returns just the path to the transaction if idx_of_split is -1. */
-static GtkTreePath *
-gtm_sr_get_removal_path (GncTreeModelSplitReg *model, Transaction *trans,
-                 gint idx_of_split)
-{
-    GncTreeModelSplitRegPrivate *priv;
-    GList *tnode = NULL;
-    GtkTreeIter iter;
-    GtkTreePath *path;
-
-    g_return_val_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (model), NULL);
-    g_return_val_if_fail (trans, NULL);
-
-    priv = model->priv;
-    if (priv->book != xaccTransGetBook (trans))
-        return FALSE;
-
-    tnode = g_list_find (priv->tlist, trans);
-    if (!tnode)
-        return FALSE;
-
-    iter = gtm_sr_make_iter (model, TROW1, tnode, NULL); // TROW1
-    path = gnc_tree_model_split_reg_get_path (GTK_TREE_MODEL (model), &iter);
-
-    if (idx_of_split >= 0)
-    {
-        gtk_tree_path_append_index (path, 0); // TROW2
-        gtk_tree_path_append_index (path, idx_of_split); //SPLIT
-    }
-    else if (idx_of_split != -1)
-        PERR("Invalid idx_of_split");
-
-    return path;
-}
-
-
-/*##########################################################################*/
-/*             Combo and Autocompletion ListStore functions                 */
-
-Account *
-gnc_tree_model_split_reg_get_anchor (GncTreeModelSplitReg *model)
-{
-    g_return_val_if_fail(GNC_IS_TREE_MODEL_SPLIT_REG(model), NULL);
-    return model->priv->anchor;
-}
-
-GtkListStore *
-gnc_tree_model_split_reg_get_description_list (GncTreeModelSplitReg *model)
-{
-    g_return_val_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (model), NULL);
-    return model->priv->description_list;
-}
-
-GtkListStore *
-gnc_tree_model_split_reg_get_notes_list (GncTreeModelSplitReg *model)
-{
-    g_return_val_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (model), NULL);
-    return model->priv->notes_list;
-}
-
-GtkListStore *
-gnc_tree_model_split_reg_get_memo_list (GncTreeModelSplitReg *model)
-{
-    g_return_val_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (model), NULL);
-    return model->priv->memo_list;
-}
-
-GtkListStore *
-gnc_tree_model_split_reg_get_action_list (GncTreeModelSplitReg *model)
-{
-    g_return_val_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (model), NULL);
-    return model->priv->action_list;
-}
-
-GtkListStore *
-gnc_tree_model_split_reg_get_acct_list (GncTreeModelSplitReg *model)
-{
-    g_return_val_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (model), NULL);
-    return model->priv->account_list;
-}
-
-//FIXME Is this the best way to check for duplicates ??
-
-/* Return TRUE if string already exists in the list */
-static gboolean
-gtm_sr_check_for_duplicates (GtkListStore *liststore, const gchar *string)
-{
-    GtkTreeIter iter;
-    gboolean valid;
-
-    valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (liststore), &iter);
-    while (valid)
-    {
-        gchar *text;
-        // Walk through the list, reading each row
-        gtk_tree_model_get (GTK_TREE_MODEL (liststore), &iter, 0, &text, -1);
-
-        if(!(g_strcmp0 (text, string)))
-        {
-            g_free(text);
-            return TRUE;
-        }
-        g_free(text);
-
-        valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (liststore), &iter);
-    }
-    return FALSE;
-}
-
-
-/* Update the Auto Complete List Stores.... */
-void
-gnc_tree_model_split_reg_update_completion (GncTreeModelSplitReg *model)
-{
-    GncTreeModelSplitRegPrivate *priv;
-    GtkTreeIter d_iter, n_iter, m_iter;
-    GList *tlist_cpy, *tnode, *slist, *snode;
-    int cnt, nSplits;
-
-    ENTER(" ");
-
-    priv = model->priv;
-
-    // Copy the tlist, put it in date order and reverse it.
-    tlist_cpy = g_list_copy (priv->tlist);
-    tlist_cpy = g_list_sort (tlist_cpy, (GCompareFunc)xaccTransOrder );
-    tlist_cpy = g_list_reverse (tlist_cpy);
-
-    /* Clear the liststores */
-    gtk_list_store_clear (priv->description_list);
-    gtk_list_store_clear (priv->notes_list);
-    gtk_list_store_clear (priv->memo_list);
-
-    for (tnode = tlist_cpy; tnode; tnode = tnode->next)
-    {
-        Split       *split;
-        const gchar *string;
-
-        nSplits = xaccTransCountSplits (tnode->data);
-        slist = xaccTransGetSplitList (tnode->data);
-    
-        /* Add to the Description list */
-        string = xaccTransGetDescription (tnode->data);
-        if (g_strcmp0 (string, ""))
-        {
-            if (gtm_sr_check_for_duplicates (priv->description_list, string) == FALSE)
-            {
-                gtk_list_store_append (priv->description_list, &d_iter);
-                gtk_list_store_set (priv->description_list, &d_iter, 0, string, 1, tnode->data, -1);
-            }
-        }
-
-        /* Add to the Notes list */
-        string = xaccTransGetNotes (tnode->data);
-        if (g_strcmp0 (string, ""))
-        {
-            if (gtm_sr_check_for_duplicates (priv->notes_list, string) == FALSE)
-            {
-                gtk_list_store_append (priv->notes_list, &n_iter);
-                gtk_list_store_set (priv->notes_list, &n_iter, 0, string, -1);
-            }
-        }
-
-         /* Loop through the list of splits for each Transaction - **do not free the list** */
-        snode = slist;
-        cnt = 0;
-        while (cnt < nSplits)
-        {
-            split = snode->data;
-
-            /* Add to the Memo list */
-            string = xaccSplitGetMemo (split);
-            if (g_strcmp0 (string, ""))
-            {
-                if (gtm_sr_check_for_duplicates (priv->memo_list, string) == FALSE)
-                {
-                    gtk_list_store_append (priv->memo_list, &m_iter);
-                    gtk_list_store_set (priv->memo_list, &m_iter, 0, string, -1);
-                }
-            }
-            cnt++;
-            snode = snode->next;
-         }
-    }
-
-    g_list_free (tlist_cpy);
-    PINFO("desc list is %d long", gtk_tree_model_iter_n_children (GTK_TREE_MODEL (priv->description_list), NULL));
-    PINFO("notes list is %d long", gtk_tree_model_iter_n_children (GTK_TREE_MODEL (priv->notes_list), NULL));
-    PINFO("memo list is %d long", gtk_tree_model_iter_n_children (GTK_TREE_MODEL (priv->memo_list), NULL));
-    LEAVE(" ");
-}
-
-
-/* Update the model with entries for the Action field */
-void
-gnc_tree_model_split_reg_update_action_list (GncTreeModelSplitReg *model)
-{
-    GncTreeModelSplitRegPrivate *priv;
-    GtkListStore *store;
-    GtkTreeIter iter;
-
-    priv = model->priv;
-    store = priv->action_list;
-
-//FIXME This may need some more thought ???
-
-    /* Clear the liststore */
-    gtk_list_store_clear (store);
-
-    /* setup strings in the action pull-down */
-    switch (model->type)
-    {
-    case BANK_REGISTER2:
-        /* broken ! FIXME bg ????????? What is broken */
-    case SEARCH_LEDGER2:
-
-        /* Translators: This string has a context prefix; the translation
-        	must only contain the part after the | character. */
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, Q_("Action Column|Deposit"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Withdraw"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Check"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Interest"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("ATM Deposit"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("ATM Draw"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Teller"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Charge"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Payment"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Receipt"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Increase"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Decrease"), -1);
-        /* Action: Point Of Sale */
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("POS"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Phone"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Online"), -1);
-        /* Action: Automatic Deposit */
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("AutoDep"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Wire"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Credit"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Direct Debit"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Transfer"), -1);
-        break;
-    case CASH_REGISTER2:
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Increase"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Decrease"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Buy"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Sell"), -1);
-        break;
-    case ASSET_REGISTER2:
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Buy"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Sell"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Fee"), -1);
-        break;
-    case CREDIT_REGISTER2:
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("ATM Deposit"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("ATM Withdraw"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Buy"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Credit"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Fee"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Interest"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Online"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Sell"), -1);
-        break;
-    case LIABILITY_REGISTER2:
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Buy"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Sell"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Loan"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Interest"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Payment"), -1);
-        break;
-    case RECEIVABLE_REGISTER2:
-    case PAYABLE_REGISTER2:
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Invoice"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Payment"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Interest"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Credit"), -1);
-        break;
-    case INCOME_LEDGER2:
-    case INCOME_REGISTER2:
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Increase"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Decrease"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Buy"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Sell"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Interest"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Payment"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Rebate"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Paycheck"), -1);
-        break;
-    case EXPENSE_REGISTER2:
-    case TRADING_REGISTER2:
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Increase"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Decrease"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Buy"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Sell"), -1);
-        break;
-    case GENERAL_LEDGER2:
-    case EQUITY_REGISTER2:
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Buy"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Sell"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Equity"), -1);
-        break;
-    case STOCK_REGISTER2:
-    case PORTFOLIO_LEDGER2:
-    case CURRENCY_REGISTER2:
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Buy"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Sell"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Price"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Fee"), -1);
-        /* Action: Dividend */
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Dividend"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Interest"), -1);
-        /* Action: Long Term Capital Gains */
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("LTCG"), -1);
-        /* Action: Short Term Capital Gains */
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("STCG"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Income"), -1);
-        /* Action: Distribution */
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Dist"), -1);
-        /* Translators: This string has a disambiguation prefix */
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, Q_("Action Column|Split"), -1);
-        break;
-
-    default:
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Increase"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Decrease"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Buy"), -1);
-        gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Sell"), -1);
-        break;
-    }
-    priv->action_list = store;
-}
-
-static int
-gtm_sr_account_order_by_name (const Account *aa, const Account *ab)
-{
-    const char *na, *nb;
-    int retval;
-
-    na = xaccAccountGetName (aa);
-    nb = xaccAccountGetName (ab);
-
-    retval = g_utf8_collate (na, nb);
-    if (retval)
-       return retval;
-
-    return 0;
-}
-
-static int
-gtm_sr_account_order_by_full_name (const Account *aa, const Account *ab)
-{
-    gchar *fna, *fnb;
-    int retval;
-
-    fna = gnc_account_get_full_name (aa);
-    fnb = gnc_account_get_full_name (ab);
-
-    retval = g_utf8_collate (fna, fnb);
-
-    g_free (fna);
-    g_free (fnb);
-
-    if (retval)
-       return retval;
-
-    return 0;
-}
-
-/* Return the GtkListstore of Accounts */
-void
-gnc_tree_model_split_reg_update_account_list (GncTreeModelSplitReg *model)
-{
-    GncTreeModelSplitRegPrivate *priv;
-    Account *root;
-    Account *acc;
-    GtkTreeIter iter;
-    GList *accts, *accts_cpy, *ptr;
-    gboolean valid;
-    const gchar *name;
-    gchar *fname;
-    gint i;
-
-    priv = model->priv;
-
-    /* Clear the liststore, Store is short name, full name and account pointer */
-    gtk_list_store_clear (priv->account_list);
-
-    root = gnc_book_get_root_account (priv->book);
-
-    // Get a list of accounts.
-    accts = gnc_account_get_descendants (root);
-
-    // Copy the accts, put it in full name order. 
-    accts_cpy = g_list_copy (accts);
-
-    if (gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_SHOW_LEAF_ACCT_NAMES))
-        accts_cpy = g_list_sort (accts_cpy, (GCompareFunc)gtm_sr_account_order_by_name);
-    else
-        accts_cpy = g_list_sort (accts_cpy, (GCompareFunc)gtm_sr_account_order_by_full_name);
-
-    for (ptr = accts_cpy, i = 0; ptr; ptr = g_list_next (ptr), i++)
-    {
-        acc = ptr->data;
-
-        if(!(acc == model->priv->anchor))
-        {
-            fname = gnc_account_get_full_name (acc);
-            name = xaccAccountGetName (acc);
-            gtk_list_store_append (priv->account_list, &iter);
-            gtk_list_store_set (priv->account_list, &iter, 0, name, 1, fname, 2, acc, -1);
-            g_free (fname);
-        }
-    }
-    g_list_free (accts);
-    g_list_free (accts_cpy);
-}
-
-
-/* Return the split for which ancestor is it's parent */
-Split *
-gnc_tree_model_split_reg_trans_get_split_equal_to_ancestor (const Transaction *trans, const Account *ancestor)
-{
-    GList *node;
-
-    for (node = xaccTransGetSplitList (trans); node; node = node->next)
-    {
-        Split *split = node->data;
-        Account *split_acc = xaccSplitGetAccount (split);
-
-        if (!xaccTransStillHasSplit (trans, split))
-            continue;
-
-        if (ancestor == split_acc)
-            return split;
-
-        if (ancestor && xaccAccountHasAncestor (split_acc, ancestor))
-            return split;
-    }
-    return NULL;
-}
-
-
-/*******************************************************************/
-/*   Split Register Tree Model - Engine Event Handling Functions   */
-/*******************************************************************/
-
-/** This function is the handler for all event messages from the
- *  engine.  Its purpose is to update the account tree model any time
- *  an account is added to the engine or deleted from the engine.
- *  This change to the model is then propagated to any/all overlying
- *  filters and views.  This function listens to the ADD, REMOVE, and
- *  DESTROY events.
- *
- *  @internal
- *
- *  @warning There is a "Catch 22" situation here.
- *  gtk_tree_model_row_deleted() can't be called until after the item
- *  has been deleted from the real model (which is the engine's
- *  account tree for us), but once the account has been deleted from
- *  the engine we have no way to determine the path to pass to
- *  row_deleted().  This is a PITA, but the only other choice is to
- *  have this model mirror the engine's accounts instead of
- *  referencing them directly.
- *
- *  @param entity The guid of the affected item.
- *
- *  @param type The type of the affected item.  This function only
- *  cares about items of type "account".
- *
- *  @param event type The type of the event. This function only cares
- *  about items of type ADD, REMOVE, MODIFY, and DESTROY.
- *
- *  @param user_data A pointer to the split register tree model.
- */
-static void
-gnc_tree_model_split_reg_event_handler (QofInstance *entity,
-                                      QofEventId event_type,
-                                      GncTreeModelSplitReg *model,
-                                      GncEventData *event_data)
-{
-    GncTreeModelSplitRegPrivate *priv = model->priv;
-    GncEventData *ed = event_data;
-    GtkTreeIter iter1, iter2;
-    GtkTreePath *path;
-    Transaction *trans;
-    Split *split = NULL;
-    QofIdType type;
-    const gchar *name = NULL;
-    GList *tnode;
-
-    g_return_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (model));
-
-    if (qof_instance_get_book (entity) != priv->book)
-        return;
-    type = entity->e_type;
-
-    if (g_strcmp0 (type, GNC_ID_SPLIT) == 0)
-    {
-        /* Get the split.*/
-        split = (Split *) entity;
-        name = xaccSplitGetMemo (split);
-
-        switch (event_type)
-        {
-        case QOF_EVENT_MODIFY:
-            if (get_iter (model, NULL, split, &iter1, &iter2))
-            {
-                DEBUG ("change split %p (%s)", split, name);
-                gtm_sr_changed_row_at (model, &iter1);
-
-                /* If we change split to different account, remove from view */
-                if (priv->anchor != NULL)
-                {
-                    Split *find_split;
-                    Transaction *trans;
-                    trans = xaccSplitGetParent (split);
-                    if (priv->display_subacc) // Sub accounts
-                        find_split = gnc_tree_model_split_reg_trans_get_split_equal_to_ancestor (trans, priv->anchor);
-                    else
-                        find_split = xaccTransFindSplitByAccount (trans, priv->anchor);
-
-                    if (find_split == NULL)
-                    {
-                        g_signal_emit_by_name (model, "selection_move_delete", trans);
-                        gtm_sr_delete_trans (model, trans);
-                    }
-                }
-            }
-            break;
-        default:
-            DEBUG ("ignored event for %p (%s)", split, name);
-        }
-    }
-    else if (g_strcmp0 (type, GNC_ID_TRANS) == 0)
-    {
-        /* Get the trans.*/
-        trans = (Transaction *) entity;
-        name = xaccTransGetDescription (trans);
-
-        switch (event_type)
-        {
-        case GNC_EVENT_ITEM_ADDED:
-            split = (Split *) ed->node;
-            /* The blank split will be added to the transaction when
-               it's first edited.  That will generate an event, but
-               we don't want to emit row_inserted because we were
-               already showing the blank split. */
-            if (split == priv->bsplit) break;
-
-            if (xaccTransCountSplits (trans) < 2) break;
-
-            /* Tell the filters/views where the new row was added. */
-            if (get_iter (model, trans, split, &iter1, &iter2))
-            {
-                DEBUG ("add split %p (%s)", split, name);
-                gtm_sr_insert_row_at (model, &iter1);
-            }
-            break;
-        case GNC_EVENT_ITEM_REMOVED:
-            split = (Split *) ed->node;
-
-            path = gtm_sr_get_removal_path (model, trans, ed->idx);
-            if (path)
-            {
-                DEBUG ("remove split %p from trans %p (%s)", split, trans, name);
-                if (ed->idx == -1)
-                    gtm_sr_delete_trans (model, trans); //Not sure when this would be so
-                else
-                    gtm_sr_delete_row_at_path (model, path);
-                gtk_tree_path_free (path);
-            }
-            if (split == priv->bsplit)
-                gtm_sr_make_new_blank_split (model);
-            break;
-        case QOF_EVENT_MODIFY:
-            /* The blank trans won't emit MODIFY until it's committed */
-            if (priv->btrans == trans)
-            {
-                priv->btrans = xaccMallocTransaction (priv->book);
-                priv->tlist = g_list_append (priv->tlist, priv->btrans);
-
-                tnode = g_list_find (priv->tlist, priv->btrans);
-                /* Insert a new blank trans */
-                iter1 = gtm_sr_make_iter (model, TROW1 | BLANK, tnode, NULL);
-                gtm_sr_insert_row_at (model, &iter1);
-                iter2 = gtm_sr_make_iter (model, TROW2 | BLANK, tnode, NULL);
-                gtm_sr_insert_row_at (model, &iter2);
-                g_signal_emit_by_name (model, "refresh_trans", priv->btrans);
-            }
-
-            if (get_iter (model, trans, NULL, &iter1, &iter2))
-            {
-                DEBUG ("change trans %p (%s)", trans, name);
-                gtm_sr_changed_row_at (model, &iter1);
-                gtm_sr_changed_row_at (model, &iter2);
-                g_signal_emit_by_name (model, "refresh_trans", trans);
-            }
-            break;
-        case QOF_EVENT_DESTROY:
-            if (priv->btrans == trans)
-            {
-                tnode = g_list_find (priv->tlist, priv->btrans);
-                priv->btrans = xaccMallocTransaction (priv->book);
-                tnode->data = priv->btrans;
-                iter1 = gtm_sr_make_iter (model, TROW1 | BLANK, tnode, NULL);
-                gtm_sr_changed_row_at (model, &iter1);
-                iter2 = gtm_sr_make_iter (model, TROW2 | BLANK, tnode, NULL);
-                gtm_sr_changed_row_at (model, &iter2);
-            }
-            else if (get_iter (model, trans, NULL, &iter1, &iter2))
-            {
-                DEBUG("destroy trans %p (%s)", trans, name);
-                g_signal_emit_by_name (model, "selection_move_delete", trans);
-                gtm_sr_delete_trans (model, trans);
-                g_signal_emit_by_name (model, "refresh_trans", trans);
-            }
-            break;
-        default:
-            DEBUG("ignored event for %p (%s)", trans, name);
-        }
-    }
-    else if (g_strcmp0 (type, GNC_ID_ACCOUNT) == 0)
-    {
-        switch (event_type)
-        {
-            Account *acc;
-        case GNC_EVENT_ITEM_ADDED:
-            split = (Split *) ed;
-            acc = xaccSplitGetAccount (split);
-            trans = xaccSplitGetParent (split);
-
-            if (!g_list_find (priv->tlist, trans) && priv->display_gl)
-            {
-                gnc_commodity *split_com;
-                split_com = xaccAccountGetCommodity (acc);
-                if (!g_strcmp0 (gnc_commodity_get_namespace (split_com), "template") == 0)
-                {
-                    DEBUG("Insert trans %p for gl (%s)", trans, name);
-                    gtm_sr_insert_trans (model, trans, TRUE);
-                    g_signal_emit_by_name (model, "refresh_trans", trans);
-                }
-            }
-            else if (!g_list_find (priv->tlist, trans) && ((xaccAccountHasAncestor (acc, priv->anchor) && priv->display_subacc) || acc == priv->anchor ))
-            {
-                DEBUG("Insert trans %p (%s)", trans, name);
-                gtm_sr_insert_trans (model, trans, TRUE);
-                g_signal_emit_by_name (model, "refresh_trans", trans);
-            }
-            break;
-        default:
-            ;
-        }
-        /* Lets refresh the status bar */
-        g_signal_emit_by_name (model, "refresh_status_bar", NULL);
-    }
-}
-
-
-/* Returns the parent Window of the register */
-GtkWidget *
-gnc_tree_model_split_reg_get_parent (GncTreeModelSplitReg *model)
-{
-    GncTreeModelSplitRegPrivate *priv;
-    GtkWidget *parent = NULL;
-
-    priv = model->priv;
-
-    if (priv->get_parent)
-        parent = priv->get_parent (priv->user_data);
-
-    return parent;
-}

Deleted: gnucash/trunk/src/gnome-utils/gnc-tree-model-split-reg.h
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-model-split-reg.h	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-model-split-reg.h	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,334 +0,0 @@
-/********************************************************************\
- * gnc-tree-model-split-reg.h -- GtkTreeView implementation to      *
- *                     display registers   in a GtkTreeView.        *
- *                                                                  *
- * Copyright (C) 2006-2007 Chris Shoemaker <c.shoemaker at cox.net>    *
- * Copyright (C) 2012 Robert Fewell                                 *
- *                                                                  *
- * 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_TREE_MODEL_SPLIT_REG_H
-#define __GNC_TREE_MODEL_SPLIT_REG_H
-
-#include <gtk/gtk.h>
-#include "gnc-tree-model.h"
-#include "Query.h"
-
-
-G_BEGIN_DECLS
-
-/* type macros */
-#define GNC_TYPE_TREE_MODEL_SPLIT_REG            (gnc_tree_model_split_reg_get_type ())
-#define GNC_TREE_MODEL_SPLIT_REG(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_TREE_MODEL_SPLIT_REG, GncTreeModelSplitReg))
-#define GNC_TREE_MODEL_SPLIT_REG_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_TREE_MODEL_SPLIT_REG, GncTreeModelSplitRegClass))
-#define GNC_IS_TREE_MODEL_SPLIT_REG(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_TREE_MODEL_SPLIT_REG))
-#define GNC_IS_TREE_MODEL_SPLIT_REG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_TREE_MODEL_SPLIT_REG))
-#define GNC_TREE_MODEL_SPLIT_REG_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_TREE_MODEL_SPLIT_REG, GncTreeModelSplitRegClass))
-#define GNC_TREE_MODEL_SPLIT_REG_NAME            "GncTreeModelSplitReg"
-
-
-/* Define the number of transaction to load */
-#define NUM_OF_TRANS 30
-
-
-/** @brief Register types
- *
- * "registers" are single-account display windows.
- * "ledgers" are multiple-account display windows */
-typedef enum
-{
-    BANK_REGISTER2,             //0
-    CASH_REGISTER2,             //1
-    ASSET_REGISTER2,            //2
-    CREDIT_REGISTER2,           //3
-    LIABILITY_REGISTER2,        //4
-    INCOME_REGISTER2,           //5
-    EXPENSE_REGISTER2,          //6
-    EQUITY_REGISTER2,           //7
-    STOCK_REGISTER2,            //8
-    CURRENCY_REGISTER2,         //9
-    RECEIVABLE_REGISTER2,       //10
-    PAYABLE_REGISTER2,          //11
-    TRADING_REGISTER2,          //12
-    NUM_SINGLE_REGISTER_TYPES2, //13
-
-    GENERAL_LEDGER2 = NUM_SINGLE_REGISTER_TYPES2, //13
-    INCOME_LEDGER2,             //14
-    PORTFOLIO_LEDGER2,          //15
-    SEARCH_LEDGER2,             //16
-
-    NUM_REGISTER_TYPES2         //17
-} SplitRegisterType2;
-
-
-/** Register styles */
-typedef enum
-{
-    REG2_STYLE_LEDGER,      //0
-    REG2_STYLE_AUTO_LEDGER, //1
-    REG2_STYLE_JOURNAL      //2
-} SplitRegisterStyle2;
-
-
-typedef enum
-{
-    GNC_TREE_MODEL_SPLIT_REG_COL_GUID,         //0
-    GNC_TREE_MODEL_SPLIT_REG_COL_DATE,         //1
-    GNC_TREE_MODEL_SPLIT_REG_COL_DUEDATE,      //2
-    GNC_TREE_MODEL_SPLIT_REG_COL_NUMACT,       //3
-    GNC_TREE_MODEL_SPLIT_REG_COL_DESCNOTES,    //4
-    GNC_TREE_MODEL_SPLIT_REG_COL_TRANSFERVOID, //5
-    GNC_TREE_MODEL_SPLIT_REG_COL_RECN,         //6
-    GNC_TREE_MODEL_SPLIT_REG_COL_DEBIT,        //7
-    GNC_TREE_MODEL_SPLIT_REG_COL_CREDIT,       //8
-
-    GNC_TREE_MODEL_SPLIT_REG_COL_LAST_VISIBLE = GNC_TREE_MODEL_SPLIT_REG_COL_CREDIT, //8
-
-    /* internal hidden columns */
-    GNC_TREE_MODEL_SPLIT_REG_COL_RO,           //9
-    GNC_TREE_MODEL_SPLIT_REG_COL_NUM_VIS,      //10
-    GNC_TREE_MODEL_SPLIT_REG_COL_ACT_VIS,      //11
-
-    GNC_TREE_MODEL_SPLIT_REG_NUM_COLUMNS       //12
-} GncTreeModelSplitRegColumn;
-
-
-
-typedef enum
-{
-    VIEW_HOME,    //0
-    VIEW_UP,      //1
-    VIEW_PGUP,    //2
-    VIEW_GOTO,    //3
-    VIEW_PGDOWN,  //4
-    VIEW_DOWN,    //5
-    VIEW_END,     //6
-} GncTreeModelSplitRegUpdate;
-
-
-/* typedefs & structures */
-typedef struct GncTreeModelSplitRegPrivate GncTreeModelSplitRegPrivate;
-
-/** The instance data structure for an account tree model. */
-typedef struct 
-{
-    GncTreeModel                 gnc_tree_model;        /**< The parent object data. */
-    GncTreeModelSplitRegPrivate *priv;
-    gint                         stamp;                 /**< The state of the model. Any state change increments this number. */
-
-    SplitRegisterType2           type;                  /**<FIXME ? This may be the wrong place for these, may be the view ? */
-    SplitRegisterStyle2          style;                 /**<FIXME ? This may be the wrong place for these, may be the view ? */
-    gboolean                     use_double_line;       /**<FIXME ? As above, whether to use two lines per transaction */
-
-    gboolean                     is_template;           /**< Are we using a template */
-
-    gint                         sort_depth;            /**< This is the row the sort direction is based on. */
-    gint                         sort_col;              /**< This is the column the sort direction is based on. */
-    gint                         sort_direction;        /**< This is the direction of sort, 1 for ascending or -1 rest */
-
-    gboolean                     use_accounting_labels; /**< whether to use accounting Labels */
-    gboolean                     separator_changed;     /**< whether the separator has changed */ 
-    gboolean                     alt_colors_by_txn;     /**< whether to use alternative colors by transaction */ 
-    gboolean                     use_theme_colors;      /**< whether to use theme colors */
-
-    gboolean                     read_only;             /**< register is read only */
-
-    Transaction                 *current_trans;         /**< Current transaction */
-    gint                         current_row;           /**< Current row in treeview */
-    gint                         number_of_trans_in_full_tlist;     /**< The total number of transactions in full_tlist */
-    gint                         position_of_trans_in_full_tlist;   /**< The position of current transaction in full_tlist */
-
-}GncTreeModelSplitReg;
-
-
-/** The class data structure for an account tree model. */
-typedef struct
-{
-    GncTreeModelClass gnc_tree_model;                   /**< The parent object data. */
-
-    /* This signal is emitted to refresh the transaction view, the pointer has
-       the transaction */
-    void (*refresh_trans) (GncTreeModelSplitReg *model, gpointer item);
-
-    /* This signal is emitted to refresh the model */
-    void (*refresh_view) (GncTreeModelSplitReg *model, gpointer user_data);
-
-    /* This signal is emitted to keep scrollbar in sync */
-    void (*scroll_sync) (GncTreeModelSplitReg *model, gpointer user_data);
-
-    /* This signal is emitted to refresh the status bar */
-    void (*refresh_status_bar) (GncTreeModelSplitReg *model, gpointer user_data);
-
-    /* This signal is emitted before a transaction delete, the pointer has
-       the transaction */
-    void (*selection_move_delete) (GncTreeModelSplitReg *model, gpointer item);
-
-} GncTreeModelSplitRegClass;
-
-
-/** Callback function type - Used to get parent window */
-typedef GtkWidget *(*SRGetParentCallback2) (gpointer user_data);
-
-/** Get the type of split register tree plugin.
- *
- *  @return A GType.
- */
-GType gnc_tree_model_split_reg_get_type (void);
-
-/** Create new model and set options for register. */
-GncTreeModelSplitReg *
-gnc_tree_model_split_reg_new (SplitRegisterType2 reg_type, SplitRegisterStyle2 style,
-                        gboolean use_double_line, gboolean is_template);
-
-/** Load the model from a slist and set default account for register. */
-void gnc_tree_model_split_reg_load (GncTreeModelSplitReg *model, GList * slist, Account *default_account);
-
-/** Sets the template account. */
-void gnc_tree_model_split_reg_set_template_account (GncTreeModelSplitReg *model, Account *template_account);
-
-/** Returns the template account. */
-Account * gnc_tree_model_split_reg_get_template_account (GncTreeModelSplitReg *model);
-
-/** Return TRUE if this is a template register. */
-gboolean gnc_tree_model_split_reg_get_template (GncTreeModelSplitReg *model);
-
-/** Destroy the model. */
-void gnc_tree_model_split_reg_destroy (GncTreeModelSplitReg *model);
-
-/** Sets the user data and callback hooks for the register. */
-void gnc_tree_model_split_reg_set_data (GncTreeModelSplitReg *model, gpointer user_data,
-                                  SRGetParentCallback2 get_parent);
-
-/** Sets the default query for the register. */
-void gnc_tree_model_split_reg_default_query (GncTreeModelSplitReg *model, Account *default_account, Query *query);
-
-/** Update the query for the register. */
-void gnc_tree_model_split_reg_update_query (GncTreeModelSplitReg *model, Query *query);
-
-/** Returns the parent Window of the register. */
-GtkWidget * gnc_tree_model_split_reg_get_parent (GncTreeModelSplitReg *model);
-
-/** Set style and type for register. */
-void gnc_tree_model_split_reg_config (GncTreeModelSplitReg *model, SplitRegisterType2 newtype,
-                                      SplitRegisterStyle2 newstyle, gboolean use_double_line);
-
-/** Return the default account for this register model. */
-Account * gnc_tree_model_split_reg_get_anchor (GncTreeModelSplitReg *model);
-
-/** Commit the blank split. */
-void gnc_tree_model_split_reg_commit_blank_split (GncTreeModelSplitReg *model);
-
-/** Set display general ledger and show sub accounts. */
-void gnc_tree_model_split_reg_set_display (GncTreeModelSplitReg *model, gboolean subacc, gboolean gl);
-
-/** Change transactions in the tlist based on view movement. */
-void gnc_tree_model_split_reg_move (GncTreeModelSplitReg *model, GncTreeModelSplitRegUpdate model_update);
-
-/* Sync the vertical scrollbar to position in full_tlist. */
-void gnc_tree_model_split_reg_sync_scrollbar (GncTreeModelSplitReg *model);
-
-/** Return the first transaction, opposite to blank transaction in the full list. */
-Transaction * gnc_tree_model_split_reg_get_first_trans (GncTreeModelSplitReg *model);
-
-/** Return TRUE if transaction is in the view list. */
-gboolean gnc_tree_model_split_reg_trans_is_in_view (GncTreeModelSplitReg *model, Transaction *trans);
-
-/* These are to do with autocompletion */
-GtkListStore * gnc_tree_model_split_reg_get_description_list (GncTreeModelSplitReg *model);
-
-GtkListStore * gnc_tree_model_split_reg_get_notes_list (GncTreeModelSplitReg *model);
-
-GtkListStore * gnc_tree_model_split_reg_get_memo_list (GncTreeModelSplitReg *model);
-
-GtkListStore * gnc_tree_model_split_reg_get_action_list (GncTreeModelSplitReg *model);
-
-GtkListStore * gnc_tree_model_split_reg_get_acct_list (GncTreeModelSplitReg *model);
-
-void gnc_tree_model_split_reg_update_num_list (GncTreeModelSplitReg *model);
-
-void gnc_tree_model_split_reg_update_action_list (GncTreeModelSplitReg *model);
-
-void gnc_tree_model_split_reg_update_account_list (GncTreeModelSplitReg *model);
-
-void gnc_tree_model_split_reg_update_completion (GncTreeModelSplitReg *model);
-
-
-/* Get the split and transaction */
-gboolean gnc_tree_model_split_reg_get_split_and_trans (
-          GncTreeModelSplitReg *model, GtkTreeIter *iter,
-          gboolean *is_trow1, gboolean *is_trow2, gboolean *is_split,
-          gboolean *is_blank, Split **split, Transaction **trans);
-
-/* Return FALSE if failure */
-gboolean gnc_tree_model_split_reg_set_blank_split_parent (
-          GncTreeModelSplitReg *model, Transaction *trans, gboolean remove_only);
-
-/* Return the blank split */
-Split * gnc_tree_model_split_get_blank_split (GncTreeModelSplitReg *model);
-
-/* Return TRUE if blank_split is on trans */
-gboolean gnc_tree_model_split_reg_is_blank_split_parent (GncTreeModelSplitReg *model, Transaction *trans);
-
-/* Return the blank trans */
-Transaction * gnc_tree_model_split_get_blank_trans (GncTreeModelSplitReg *model);
-
-/* If 'trans' is NULL, use split's parent.  If 'split' is NULL, just
-   get the transaction iter. */
-gboolean gnc_tree_model_split_reg_get_iter_from_trans_and_split (
-          GncTreeModelSplitReg *model, Transaction *trans, Split *split,
-          GtkTreeIter *iter1, GtkTreeIter *iter2);
-
-/* Return the row color for the view */
-gchar * gnc_tree_model_split_reg_get_row_color (GncTreeModelSplitReg *model, gboolean is_trow1,
-         gboolean is_trow2, gboolean is_split, gint num);
-
-/* Return the tooltip for transaction at position in full_tlist. */
-gchar * gnc_tree_model_split_reg_get_tooltip (GncTreeModelSplitReg *model, gint position);
-
-/* Set the current transaction to that at position in full_tlist */
-void gnc_tree_model_split_reg_set_current_trans_by_position (GncTreeModelSplitReg *model, gint position);
-
-/* Return TRUE if this transaction is read only for the view */
-gboolean
-gnc_tree_model_split_reg_get_read_only (GncTreeModelSplitReg *model, Transaction *trans);
-
-/* Return TRUE if this is a sub account view */
-gboolean
-gnc_tree_model_split_reg_get_sub_account (GncTreeModelSplitReg *model);
-
-/* Return the tree path, if split and trans are null, last in list returned */
-GtkTreePath * gnc_tree_model_split_reg_get_path_to_split_and_trans (
-               GncTreeModelSplitReg *model, Split *split, Transaction *trans);
-
-/* Returns TRUE if iter is a blank transaction */
-gboolean gnc_tree_model_split_reg_is_blank_trans (GncTreeModelSplitReg *model, GtkTreeIter *iter);
-
-/* Return the split for which ancestor is it's parent */
-Split * gnc_tree_model_split_reg_trans_get_split_equal_to_ancestor (const Transaction *trans, const Account *ancestor);
-
-/* Dummy Sort function */
-gint gnc_tree_model_split_reg_sort_iter_compare_func (GtkTreeModel *tm, GtkTreeIter *a, GtkTreeIter *b, gpointer user_data);
-
-/*****************************************************************************/
-
-G_END_DECLS
-
-#endif /* __GNC_TREE_MODEL_SPLIT_REG_H */

Deleted: gnucash/trunk/src/gnome-utils/gnc-tree-util-split-reg.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-util-split-reg.c	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-util-split-reg.c	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,1376 +0,0 @@
-/********************************************************************\
- * gnc-tree-util-split-reg.c -- GtkTreeView implementation          *
- *                     to display registers in a GtkTreeView.       *
- *                                                                  *
- * Copyright (C) 2006-2007 Chris Shoemaker <c.shoemaker at cox.net>    *
- * Copyright (C) 2012 Robert Fewell                                 *
- *                                                                  *
- * 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 <stdlib.h>
-#include <string.h>
-
-#include "gnc-tree-util-split-reg.h"
-#include "gnc-tree-model-split-reg.h"
-#include "gnc-tree-view-split-reg.h"
-
-#include "gnc-ui.h"
-#include "dialog-utils.h"
-#include "dialog-transfer.h"
-#include "engine-helpers.h"
-#include "Transaction.h"
-
-
-#define SPLIT_TRANS_STR _("-- Split Transaction --")
-#define STOCK_SPLIT_STR _("-- Stock Split --")
-
-/** Static Globals *******************************************************/
-static QofLogModule log_module = GNC_MOD_LEDGER;
-
-/*****************************************************************************/
-
-
-/* Is current split a security account */
-static gboolean
-gtu_sr_use_security (GncTreeViewSplitReg *view)
-{
-    RowDepth depth;
-    Account *account = NULL;
-    Split *split;
-
-    split = gnc_tree_view_split_reg_get_current_split (view);
-
-    depth = gnc_tree_view_reg_get_selected_row_depth (view);
-
-    if (!split)
-        return TRUE;
-
-    if (depth != SPLIT3)
-        return TRUE;
-
-    if (!account)
-        account = xaccSplitGetAccount (split);
-
-    if (!account)
-        return TRUE;
-
-    if (xaccTransUseTradingAccounts (xaccSplitGetParent (split)))
-    {
-        if (!gnc_commodity_is_iso (xaccAccountGetCommodity (account)))
-            return TRUE;
-    }
-
-    return xaccAccountIsPriced (account);
-}
-
-
-/* Get the rate from the price db */
-static gnc_numeric
-gtu_sr_get_rate_from_db (gnc_commodity *from, gnc_commodity *to)
-{
-    GNCPrice *prc;
-    gnc_numeric rate_split;
-    gboolean have_rate = FALSE;
-    QofBook *book = gnc_get_current_book ();
-
-    /* Do we have a rate allready */
-    prc = gnc_pricedb_lookup_latest (gnc_pricedb_get_db (book), from, to);
-    if (prc)
-    {
-        rate_split = gnc_price_get_value (prc);
-        gnc_price_unref (prc);
-        have_rate = TRUE;
-    }
-
-    /* Lets try reversing the commodities */
-    if (!have_rate)
-    {
-        prc = gnc_pricedb_lookup_latest (gnc_pricedb_get_db (book), to, from);
-        if (prc)
-        {
-            rate_split = gnc_numeric_div (gnc_numeric_create (100, 100), gnc_price_get_value (prc),
-                                 GNC_DENOM_AUTO, GNC_HOW_DENOM_REDUCE);
-
-            gnc_price_unref (prc);
-            have_rate = TRUE;
-        }
-    }
-
-    /* No rate, set to 1/1 */
-    if (!have_rate)
-        rate_split = gnc_numeric_create (100, 100);
-
-    return rate_split;
-}
-
-
-/* Do we need an exchange rate */
-static gboolean
-gtu_sr_needs_exchange_rate (GncTreeViewSplitReg *view, Transaction *trans, Split *split)
-{
-    gnc_commodity *split_com, *txn_curr, *reg_com;
-
-    ENTER("gtu_sr_needs_exchange_rate - trans %p and split %p", trans, split);
-
-    txn_curr = xaccTransGetCurrency (trans);
-    split_com = xaccAccountGetCommodity (xaccSplitGetAccount (split));
-    if (split_com && txn_curr && !gnc_commodity_equiv (split_com, txn_curr))
-    {
-        LEAVE("gtu_sr_needs_exchange_rate split_com to txn_curr return TRUE");
-        return TRUE;
-    }
-
-    reg_com = gnc_tree_view_split_reg_get_reg_commodity (view);
-    if (split_com && reg_com && !gnc_commodity_equiv (split_com, reg_com))
-    {
-        LEAVE("gtu_sr_needs_exchange_rate split_com and reg_com return TRUE");
-        return TRUE;
-    }
-    LEAVE("No Exchange rate needed");
-    return FALSE;
-}
-
-
-/* Either sets the value and amount for split and returns TRUE, or
-   does nothing and returns FALSE. */
-static gboolean
-gtu_sr_handle_exchange_rate (GncTreeViewSplitReg *view, gnc_numeric amount, Transaction *trans, Split *split, gboolean force)
-{
-    GncTreeModelSplitReg *model;
-    XferDialog *xfer;
-    gboolean rate_split_ok, rate_reg_ok;
-    gnc_numeric rate_split, rate_reg, value;
-    Account *reg_acc;
-    gnc_commodity *xfer_comm = xaccAccountGetCommodity (xaccSplitGetAccount (split));
-    gnc_commodity *reg_comm = gnc_tree_view_split_reg_get_reg_commodity (view);
-    gnc_commodity *trans_curr = xaccTransGetCurrency (trans);
-    gboolean expanded;
-    gboolean have_rate = TRUE;
-
-    ENTER("handle_exchange_rate amount %s, trans %p and split %p force %d", gnc_numeric_to_string (amount), trans, split, force);
-
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    reg_acc = gnc_tree_model_split_reg_get_anchor (model);
-
-    /* Rate from trans-curr to split-comm */
-    rate_split_ok = xaccTransGetRateForCommodity (trans, xfer_comm, split, &rate_split);
-    DEBUG("rate_split_ok %d and xfer_comm %s", rate_split_ok, gnc_commodity_get_fullname (xfer_comm));
-
-    /* Rate from trans-curr to reg-comm */
-    rate_reg_ok = xaccTransGetRateForCommodity (trans, reg_comm, split, &rate_reg);
-    DEBUG("rate_reg_ok %d and reg_comm %s", rate_reg_ok, gnc_commodity_get_fullname (reg_comm));
-
-    /* Are we expanded */
-    expanded = gnc_tree_view_split_reg_trans_expanded (view, trans);
-
-    if (gnc_commodity_equal (trans_curr, xfer_comm) && rate_split_ok)
-    {
-        xaccSplitSetAmount (split, amount);
-        xaccSplitSetValue (split, amount);
-        return TRUE;
-    }
-
-    if (rate_reg_ok && rate_split_ok && !force)
-    {
-        value = gnc_numeric_div (amount, rate_reg, gnc_commodity_get_fraction (trans_curr), GNC_HOW_DENOM_REDUCE);
-        amount = gnc_numeric_mul (value, rate_split, GNC_DENOM_AUTO, GNC_HOW_RND_ROUND);
-    }
-    else
-    {
-        if (!rate_split_ok)
-            rate_split = gtu_sr_get_rate_from_db (reg_comm, xfer_comm);
-
-        /* create the exchange-rate dialog */
-        xfer = gnc_xfer_dialog (NULL, NULL);
-
-        gnc_xfer_dialog_is_exchange_dialog (xfer, &rate_split);
-
-        /* fill in the dialog entries */
-        gnc_xfer_dialog_set_description (xfer, xaccTransGetDescription (trans));
-        gnc_xfer_dialog_set_memo (xfer, xaccSplitGetMemo (split));
-
-        /* Get per book option */
-        gnc_xfer_dialog_set_num (xfer, gnc_get_num_action (trans, split));
-        gnc_xfer_dialog_set_date (xfer, timespecToTime64 (xaccTransRetDatePostedTS (trans)));
-
-        value = amount;
-        if (gnc_xfer_dialog_run_exchange_dialog (xfer, &rate_split, value, reg_acc, trans, xfer_comm, expanded))
-        {
-            if (!rate_split_ok)
-                rate_split = gnc_numeric_create (1, 1);
-            have_rate = FALSE;
-        }
-        else
-            have_rate = TRUE;
-
-        amount = gnc_numeric_mul (value, rate_split, GNC_DENOM_AUTO, GNC_HOW_RND_ROUND);
-    }
-    xaccSplitSetAmount (split, amount);
-    xaccSplitSetValue (split, value);
-
-    LEAVE("handle_exchange_rate set split %p amt=%s; and val=%s", split, gnc_numeric_to_string (amount), gnc_numeric_to_string (value));
-    return have_rate;
-}
-
-
-/* Returns the value denom */
-static int
-gtu_sr_get_value_denom (Split *split)
-{
-    gnc_commodity *currency;
-    int denom;
-
-    currency = xaccTransGetCurrency (xaccSplitGetParent (split));
-    denom = gnc_commodity_get_fraction (currency);
-    if (denom == 0)
-    {
-        gnc_commodity *commodity = gnc_default_currency ();
-        denom = gnc_commodity_get_fraction (commodity);
-        if (denom == 0)
-            denom = 100;
-    }
-    return denom;
-}
-
-
-/* Returns the amount denom */
-static int
-gtu_sr_get_amount_denom (Split *split)
-{
-    int denom;
-
-    denom = xaccAccountGetCommoditySCU (xaccSplitGetAccount (split));
-    if (denom == 0)
-    {
-        gnc_commodity *commodity = gnc_default_currency ();
-        denom = gnc_commodity_get_fraction (commodity);
-        if (denom == 0)
-            denom = 100;
-    }
-    return denom;
-}
-
-
-
-/*###########################################################################*/
-
-
-
-/* return TRUE if we have a RATE; return FALSE if we do not. */
-gboolean
-gnc_tree_util_split_reg_has_rate (GncTreeViewSplitReg *view)
-{
-    GncTreeModelSplitReg *model;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    switch (model->type)
-    {
-    case BANK_REGISTER2:
-    case CASH_REGISTER2:
-    case ASSET_REGISTER2:
-    case CREDIT_REGISTER2:
-    case LIABILITY_REGISTER2:
-    case INCOME_REGISTER2:
-    case EXPENSE_REGISTER2:
-    case EQUITY_REGISTER2:
-    case TRADING_REGISTER2:
-    case GENERAL_LEDGER2:
-    case INCOME_LEDGER2:
-    case SEARCH_LEDGER2:
-        return TRUE;
-
-    case STOCK_REGISTER2:
-    case CURRENCY_REGISTER2:
-    case PORTFOLIO_LEDGER2:
-    case RECEIVABLE_REGISTER2:
-    case PAYABLE_REGISTER2:
-    default:
-        return FALSE;
-    }
-}
-
-
-/* Is this split part of a multi split transaction */
-gboolean
-gnc_tree_util_split_reg_is_multi (Split *split)
-{
-    gboolean multi = FALSE;
-    Split *osplit;
-
-    if (!split)
-        return FALSE;
-
-    osplit = xaccSplitGetOtherSplit (split);
-
-    if (osplit)
-            multi = FALSE;
-    else
-    {
-        /* For multi-split transactions and stock splits,
-         * use a special value. */
-        osplit = xaccTransGetSplit (xaccSplitGetParent (split), 1);
-
-        if (osplit)
-            multi = TRUE;
-        else if (g_strcmp0 ("stock-split", xaccSplitGetType (split)) == 0)
-            multi = TRUE;
-        else
-            multi = FALSE;
-    }
-    return multi;
-}
-
-
-/* Return the string entry for transfer column and if multi */
-const char *
-gnc_tree_util_split_reg_get_transfer_entry (Split *split, gboolean *is_multi)
-{
-    static char *name = NULL;
-    gboolean multi = FALSE;
-
-    Split *osplit;
-
-    if (is_multi)
-        *is_multi = multi;
-
-    if (!split)
-        return NULL;
-
-    osplit = xaccSplitGetOtherSplit (split);
-
-    g_free (name);
-
-    if (osplit)
-        name = gnc_get_account_name_for_register (xaccSplitGetAccount (osplit));
-    else
-    {
-        /* For multi-split transactions and stock splits,
-         * use a special value. */
-        osplit = xaccTransGetSplit (xaccSplitGetParent (split), 1);
-        if (osplit)
-        {
-            name = g_strdup (SPLIT_TRANS_STR);
-            multi = TRUE;
-        }
-        else if (g_strcmp0 ("stock-split", xaccSplitGetType (split)) == 0)
-        {
-            name = g_strdup (STOCK_SPLIT_STR);
-            multi = TRUE;
-        }
-        else
-            name = g_strdup ("");
-    }
-
-    if (is_multi)
-        *is_multi = multi;
-
-    return name;
-}
-
-
-/* Return the string entry for transfer column when template */
-const char *
-gnc_tree_util_split_reg_template_get_transfer_entry (Split *split)
-{
-    static char *name = NULL;
-
-    kvp_frame *kvpf;
-
-    if (!split)
-        return NULL;
-
-    kvpf = xaccSplitGetSlots (split);
-
-    g_free (name);
-
-    if (kvpf)
-    {
-        Account *account;
-        GncGUID *guid;
-
-        guid = kvp_value_get_guid(
-                   kvp_frame_get_slot_path (kvpf, "sched-xaction", "account", NULL));
-
-        account = xaccAccountLookup (guid, gnc_get_current_book ());
-
-        name = account ? gnc_get_account_name_for_register (account) : NULL;
-    }
-    else
-        name = NULL;
-
-    return name;
-}
-
-
-const char *
-gnc_tree_util_split_reg_template_get_fdebt_entry (Split *split)
-{
-    kvp_frame *kvpf = xaccSplitGetSlots (split);
-
-    return kvp_value_get_string(
-               kvp_frame_get_slot_path (kvpf, "sched-xaction", "debit-formula", NULL));
-}
-
-
-const char *
-gnc_tree_util_split_reg_template_get_fcred_entry (Split *split)
-{
-    kvp_frame *kvpf = xaccSplitGetSlots (split);
-
-    return kvp_value_get_string(
-               kvp_frame_get_slot_path (kvpf, "sched-xaction", "credit-formula", NULL));
-}
-
-
-gchar *
-gnc_tree_util_split_reg_get_date_help (GDate *date)
-{
-    char string[1024];
-    struct tm tm;
-
-    if (g_date_valid (date))
-    {
-        struct tm tm;
-        memset (&tm, 0, sizeof (tm));
-        g_date_to_struct_tm (date, &tm);
-        qof_strftime (string, sizeof (string), "%A %d %B %Y", &tm);
-        return g_strdup (string);
-    }
-    else
-        return g_strdup (" ");
-}
-
-
-void
-gnc_tree_util_split_reg_parse_date (GDate *parsed, const char *datestr)
-{
-    int day, month, year;
-    gboolean use_autoreadonly = qof_book_uses_autoreadonly (gnc_get_current_book ());
-
-    if (!parsed) return;
-    if (!datestr) return;
-
-    if (!qof_scan_date (datestr, &day, &month, &year))
-    {
-        // Couldn't parse date, use today
-        struct tm tm_today;
-        gnc_tm_get_today_start (&tm_today);
-        day = tm_today.tm_mday;
-        month = tm_today.tm_mon + 1;
-        year = tm_today.tm_year + 1900;
-    }
-
-    // If we have an auto-read-only threshold, do not accept a date that is
-    // older than the threshold.
-    if (use_autoreadonly)
-    {
-        GDate *d = g_date_new_dmy (day, month, year);
-        GDate *readonly_threshold = qof_book_get_autoreadonly_gdate (gnc_get_current_book());
-        if (g_date_compare (d, readonly_threshold) < 0)
-        {
-            g_warning("Entered date %s is before the \"auto-read-only threshold\"; resetting to the threshold.", datestr);
-#if 0
-            GtkWidget *dialog = gtk_message_dialog_new (NULL,
-                                                       0,
-                                                       GTK_MESSAGE_ERROR,
-                                                       GTK_BUTTONS_OK,
-                                                       "%s", _("Cannot store a transaction at this date"));
-            gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-                                                     "%s", _("The entered date of the new transaction is older than the \"Read-Only Threshold\" set for this book. "
-                                                             "This setting can be changed in File -> Properties -> Accounts."));
-            gtk_dialog_run (GTK_DIALOG (dialog));
-            gtk_widget_destroy (dialog);
-#endif
-
-            // Reset the date to the threshold date
-            day = g_date_get_day (readonly_threshold);
-            month = g_date_get_month (readonly_threshold);
-            year = g_date_get_year (readonly_threshold);
-        }
-        g_date_free (d);
-        g_date_free (readonly_threshold);
-    }
-    g_date_set_dmy (parsed, day, month, year);
-}
-
-
-gboolean
-gnc_tree_util_split_reg_rotate (GncTreeViewSplitReg *view, GtkTreeViewColumn *col, Transaction *trans, Split *split)
-{
-    GtkCellRenderer *cr0 = NULL;
-    GList *renderers;
-    ViewCol viewcol;
-
-    // Get the first renderer, it has the view-column value.
-    renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (col));
-    cr0 = g_list_nth_data (renderers, 0);
-    g_list_free (renderers);
-
-    viewcol = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cr0), "view_column"));
-
-    if (viewcol == COL_RECN)
-    {
-        const char recn_flags[] = {NREC, CREC, 0}; // List of reconciled flags
-        const gchar *flags;
-        const gchar *text;
-        gchar *this_flag;
-        gint index = 0;
-        char rec;
-
-        flags = recn_flags;
-
-        text = g_strdup_printf("%c", xaccSplitGetReconcile (split));
-
-        /* Find the existing text in the list of flags */
-        this_flag = strstr (flags, text);
-
-        if (this_flag != NULL && *this_flag != '\0')
-        {
-            /* In the list, choose the next item in the list
-               (wrapping around as necessary). */
-            index = this_flag - flags;
-
-            if (flags[index + 1] != '\0')
-                index = index + 1;
-            else
-                index = 0;
-
-            rec = recn_flags[index];
-        }
-        else
-            rec = NREC;
-
-        gnc_tree_view_split_reg_set_dirty_trans (view, trans);
-        if (!xaccTransIsOpen (trans))
-            xaccTransBeginEdit (trans);
-
-        xaccSplitSetReconcile (split, rec);
-        return TRUE;
-    }
-
-    if (viewcol == COL_TYPE)
-    {
-        const char type_flags[] = {TXN_TYPE_INVOICE, TXN_TYPE_PAYMENT, 0}; // list of type flags
-        const gchar *flags;
-        const gchar *text;
-        gchar *this_flag;
-        gint index = 0;
-        char type;
-
-        flags = type_flags;
-
-        text = g_strdup_printf("%c", xaccTransGetTxnType (trans));
-
-        /* Find the existing text in the list of flags */
-        this_flag = strstr (flags, text);
-
-        if (this_flag != NULL && *this_flag != '\0')
-        {
-            /* In the list, choose the next item in the list
-               (wrapping around as necessary). */
-            index = this_flag - flags;
-
-            if (flags[index + 1] != '\0')
-                index = index + 1;
-            else
-                index = 0;
-
-            type = type_flags[index];
-        }
-        else
-            type = TXN_TYPE_NONE;
-
-        gnc_tree_view_split_reg_set_dirty_trans (view, trans);
-        if (!xaccTransIsOpen (trans))
-            xaccTransBeginEdit (trans);
-
-        xaccTransSetTxnType (trans, type);
-        return TRUE;
-    }
-    return FALSE;
-}
-
-/*###########################################################################*/
-
-/* returns TRUE if you need to convert the split's value to the local
- * (account) display currency.  Returns FALSE if you can just use the
- * split->value directly.
- */
-gboolean
-gnc_tree_util_split_reg_needs_conv_rate (GncTreeViewSplitReg *view,
-                                    Transaction *trans, Account *acc)
-{
-    gnc_commodity *trans_cur, *acc_com;
-
-    /* If there is not a RATE_CELL, then don't do anything */
-    if (!gnc_tree_util_split_reg_has_rate (view))
-        return FALSE;
-
-    /* if txn->currency == acc->commodity, then return FALSE */
-    acc_com = xaccAccountGetCommodity (acc);
-    trans_cur = xaccTransGetCurrency (trans);
-    if (trans_cur && acc_com && gnc_commodity_equal (trans_cur, acc_com))
-        return FALSE;
-
-    return TRUE;
-}
-
-
-gboolean
-gnc_tree_util_split_reg_needs_amount (GncTreeViewSplitReg *view, Split *split)
-{
-    Transaction *txn = xaccSplitGetParent (split);
-    Account *acc = xaccSplitGetAccount (split);
-
-    return gnc_tree_util_split_reg_needs_conv_rate (view, txn, acc);
-}
-
-/*###########################################################################*/
-
-gnc_numeric
-gnc_tree_util_split_reg_get_value_for (GncTreeViewSplitReg *view, Transaction *trans, Split *split, gboolean is_blank)
-{
-    gnc_numeric        ret_num;
-    GNCPrintAmountInfo ret_print_info;
-
-    if (gnc_tree_util_split_reg_get_debcred_entry (view, trans, split, is_blank, &ret_num, &ret_print_info))
-        return ret_num;
-    else
-        return gnc_numeric_zero();
-}
-
-
-gboolean
-gnc_tree_util_split_reg_get_debcred_entry (GncTreeViewSplitReg *view,
-                                      Transaction *trans, Split *split,
-                                      gboolean is_blank, gnc_numeric *ret_num,
-                                      GNCPrintAmountInfo *ret_print_info)
-
-{
-    GncTreeModelSplitReg *model;
-    gnc_commodity *currency;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    currency = xaccTransGetCurrency (trans);
-    if (!currency)
-        currency = gnc_default_currency ();
-
-    if (is_blank)
-    {
-        gnc_numeric imbalance;
-        Account *acc;
-
-        imbalance = xaccTransGetImbalanceValue (trans);
-
-        if (gnc_numeric_zero_p (imbalance))
-            return FALSE;
-
-        if (xaccTransUseTradingAccounts (trans))
-        {
-            MonetaryList *imbal_list;
-            gnc_monetary *imbal_mon;
-            imbal_list = xaccTransGetImbalance (trans);
-
-            if (!imbal_list)
-            {
-                /* No commodity imbalance, there shouldn't be a value imablance. */
-                return FALSE;
-            }
-
-            if (imbal_list->next)
-            {
-                /* Multiple currency imbalance. */
-                gnc_monetary_list_free (imbal_list);
-                return FALSE;
-            }
-
-            imbal_mon = imbal_list->data;
-            if (!gnc_commodity_equal (gnc_monetary_commodity (*imbal_mon), currency))
-            {
-                /* Imbalance is in wrong currency */
-                gnc_monetary_list_free (imbal_list);
-                return FALSE;
-            }
-
-            if (!gnc_numeric_equal (gnc_monetary_value (*imbal_mon), imbalance))
-            {
-                /* Value and commodity imbalances differ */
-                gnc_monetary_list_free (imbal_list);
-                return FALSE;
-            }
-
-            /* Done with the imbalance list */
-            gnc_monetary_list_free (imbal_list);
-        }
-
-        imbalance = gnc_numeric_neg (imbalance);
-
-        acc = gnc_tree_model_split_reg_get_anchor (model);
-
-        if (gnc_tree_util_split_reg_needs_conv_rate (view, trans, acc))
-        {
-            imbalance = gnc_numeric_mul (imbalance,
-                                         xaccTransGetAccountConvRate (trans, acc),
-                                         gnc_commodity_get_fraction (currency),
-                                         GNC_HOW_RND_ROUND_HALF_UP);
-        }
-        else
-        {
-            imbalance = gnc_numeric_convert (imbalance,
-                                             gnc_commodity_get_fraction (currency),
-                                             GNC_HOW_RND_ROUND_HALF_UP);
-        }
-
-        *ret_num = imbalance;
-        *ret_print_info = gnc_account_print_info (acc, FALSE);
-         return TRUE;
-    }
-
-    {
-        gnc_numeric amount;
-        gnc_commodity *split_commodity;
-        GNCPrintAmountInfo print_info;
-        Account *account;
-        gnc_commodity *commodity;
-
-        account = gnc_tree_model_split_reg_get_anchor (model);
-
-        commodity = xaccAccountGetCommodity (account);
-        split_commodity = xaccAccountGetCommodity (xaccSplitGetAccount (split));
-
-        if (xaccTransUseTradingAccounts (trans))
-        {
-            gboolean use_symbol, is_current = FALSE;
-            Split *current_split = gnc_tree_view_split_reg_get_current_split (view);
-            RowDepth depth = gnc_tree_view_reg_get_selected_row_depth (view);
-
-            if ((split == current_split) && (depth == SPLIT3))
-                is_current = TRUE;
-
-            if (model->type == STOCK_REGISTER2 ||
-                    model->type == CURRENCY_REGISTER2 ||
-                    model->type == PORTFOLIO_LEDGER2)
-            {
-                gnc_commodity *amount_commodity;
-                /* security register.  If this split has price and shares columns,
-                   use the value, otherwise use the amount.  */
-                if (gtu_sr_use_security (view))
-                {
-                    amount = xaccSplitGetValue (split);
-                    amount_commodity = currency;
-                }
-                else
-                {
-                    amount = xaccSplitGetAmount (split);
-                    amount_commodity = split_commodity;
-                }
-                /* Show the currency if it is not the default currency */
-                if (is_current ||
-                        gnc_commodity_equiv (amount_commodity, gnc_default_currency ()))
-                    use_symbol = FALSE;
-                else
-                    use_symbol = TRUE;
-                print_info = gnc_commodity_print_info (amount_commodity, use_symbol);
-            }
-            else
-            {
-                /* non-security register, always use the split amount. */
-                amount = xaccSplitGetAmount (split);
-                if (is_current ||
-                        gnc_commodity_equiv (split_commodity, commodity))
-                    use_symbol = FALSE;
-                else
-                    use_symbol = TRUE;
-                print_info = gnc_commodity_print_info (split_commodity, use_symbol);
-            }
-        }
-        else
-        {
-            /* If this account is not a stock/mutual/currency account, and
-            * currency != the account commodity, then use the SplitAmount
-            * instead of the SplitValue.
-            */
-            switch (model->type)
-            {
-            case STOCK_REGISTER2:
-            case CURRENCY_REGISTER2:
-            case PORTFOLIO_LEDGER2:
-                amount = xaccSplitGetValue (split);
-                print_info = gnc_commodity_print_info (currency, FALSE);
-                break;
-
-            default:
-                if (commodity && !gnc_commodity_equal (commodity, currency))
-                    /* Convert this to the "local" value */
-                    amount = xaccSplitConvertAmount (split, account);
-                else
-                    amount = xaccSplitGetValue (split);
-                print_info = gnc_account_print_info (account, FALSE);
-                break;
-            }
-        }
-
-        if (gnc_numeric_zero_p (amount))
-            return FALSE;
-
-        *ret_num = amount;
-        *ret_print_info = print_info;
-         return TRUE;
-    }
-}
-
-/*###########################################################################*/
-
-void
-gnc_tree_util_split_reg_set_value_for (GncTreeViewSplitReg *view, Transaction *trans, Split *split, gnc_numeric input, gboolean force)
-{
-    GncTreeModelSplitReg *model;
-    GtkWidget *window;
-    Account *anchor;
-    Account *acct = xaccSplitGetAccount (split);
-    gnc_commodity *currency;
-    gnc_numeric value, amount, rate;
-
-    ENTER("set_value_for trans %p and split %p input %s force %d", trans, split, gnc_numeric_to_string (input), force);
-
-    currency = xaccTransGetCurrency (trans);
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    anchor = gnc_tree_model_split_reg_get_anchor (model);
-
-    if (gnc_numeric_zero_p (input))
-    {
-        xaccSplitSetValue (split, input);
-        xaccSplitSetAmount (split, input);
-        LEAVE("input is zero");
-        return;
-    }
-
-    window = gnc_tree_view_split_reg_get_parent (view);
-
-    if (gtu_sr_needs_exchange_rate (view, trans, split))
-    {
-        if (gtu_sr_handle_exchange_rate (view, input, trans, split, force))
-        {
-            ; //FIXME ??????
-        }
-        else
-        {
-            gnc_error_dialog (window, "%s",
-                         _("Exchange Rate Canceled, using existing rate or default 1 to 1 rate if this is a new transaction."));
-        }
-        LEAVE("used exchange rate");
-        return;
-    }
-
-    gnc_tree_util_split_reg_save_amount_values (view, trans, split, input);
-
-    LEAVE(" ");
-}
-
-void
-gnc_tree_util_split_reg_save_amount_values (GncTreeViewSplitReg *view, Transaction *trans, Split *split, gnc_numeric input)
-{
-    GncTreeModelSplitReg *model;
-    Account *acc;
-    gnc_numeric new_amount, convrate, amtconv, value;
-    gnc_commodity *curr, *reg_com, *xfer_com;
-    Account *xfer_acc;
-
-    ENTER("View is %p, trans is %p, split is %p, input is %s", view, trans, split, gnc_numeric_to_string (input));
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    new_amount = input;
-
-    acc = gnc_tree_model_split_reg_get_anchor (model);
-
-    xfer_acc = xaccSplitGetAccount (split);
-    xfer_com = xaccAccountGetCommodity (xfer_acc);
-    reg_com = xaccAccountGetCommodity (acc);
-    curr = xaccTransGetCurrency (trans);
-
-    if (!xaccTransGetRateForCommodity (trans, reg_com, NULL, &convrate))
-        convrate = gnc_numeric_create (100, 100);
-
-    amtconv = convrate;
-
-    if (gnc_tree_util_split_reg_needs_conv_rate (view, trans, acc))
-    {
-
-        /* If we are in an expanded register and the xfer_acc->comm !=
-        * reg_acc->comm then we need to compute the convrate here.
-        * Otherwise, we _can_ use the rate_cell!
-        */
-        if (gnc_commodity_equal (reg_com, xfer_com))
-            amtconv = xaccTransGetAccountConvRate (trans, acc);
-    }
-
-    if (xaccTransUseTradingAccounts (trans))
-    {
-        /* Using currency accounts, the amount is probably really the
-           amount and not the value. */
-        gboolean is_amount;
-
-        if (model->type == STOCK_REGISTER2 ||
-                model->type == CURRENCY_REGISTER2 ||
-                model->type == PORTFOLIO_LEDGER2)
-        {
-            if (xaccAccountIsPriced (xfer_acc) ||
-                    !gnc_commodity_is_iso (xaccAccountGetCommodity (xfer_acc)))
-                is_amount = FALSE;
-            else
-                is_amount = TRUE;
-        }
-        else
-        {
-            is_amount = TRUE;
-        }
-
-        if (is_amount)
-        {
-            xaccSplitSetAmount (split, new_amount);
-            if (gnc_tree_util_split_reg_needs_amount (view, split))
-            {
-                value = gnc_numeric_div (new_amount, amtconv,
-                                        gnc_commodity_get_fraction (curr),
-                                        GNC_HOW_RND_ROUND_HALF_UP);
-                xaccSplitSetValue (split, value);
-            }
-            else
-                xaccSplitSetValue (split, new_amount);
-        }
-        else
-        {
-            xaccSplitSetValue (split, new_amount);
-        }
-        LEAVE(" ");
-        return;
-    }
-
-    /* How to interpret new_amount depends on our view of this
-     * transaction.  If we're sitting in an account with the same
-     * commodity as the transaction, then we can set the Value and then
-     * compute the amount.  Otherwise we are setting the "converted
-     * value".  This means we need to convert new_amount to the actual
-     * 'value' by dividing by the convrate in order to set the value.
-     */
-
-    /* Now compute/set the split value.  Amount is in the register
-     * currency but we need to convert to the txn currency.
-     */
-    if (gnc_tree_util_split_reg_needs_conv_rate (view, trans, acc))
-    {
-        /* convert the amount to the Value ... */
-        value = gnc_numeric_div (new_amount, amtconv,
-                                 gnc_commodity_get_fraction (curr),
-                                 GNC_HOW_RND_ROUND_HALF_UP);
-        xaccSplitSetValue (split, value);
-    }
-    else
-    {
-        xaccSplitSetValue (split, new_amount);
-    }
-
-    /* Now re-compute the Amount from the Value.  We may need to convert
-     * from the Value back to the amount here using the convrate from
-     * earlier.
-     */
-    value = xaccSplitGetValue (split);
-
-    if (gnc_tree_util_split_reg_needs_amount (view, split))
-    {
-        acc = xaccSplitGetAccount (split);
-        new_amount = gnc_numeric_mul (value, convrate,
-                                      xaccAccountGetCommoditySCU (acc),
-                                      GNC_HOW_RND_ROUND_HALF_UP);
-        xaccSplitSetAmount (split, new_amount);
-    }
-    else
-    {
-        xaccSplitSetAmount (split, value);
-    }
-    LEAVE(" ");
-}
-
-/*###########################################################################*/
-
-/* Takes the input with column and sets the price / amount / value so they are consistent */
-void
-gnc_tree_util_set_number_for_input (GncTreeViewSplitReg *view, Transaction *trans, Split *split, gnc_numeric input, gint viewcol)
-{
-    GncTreeModelSplitReg *model;
-    gnc_numeric  price;
-    gnc_numeric  amount;
-    gnc_numeric  value;
-
-    gboolean price_changed = FALSE;   // Price of each share
-    gboolean value_changed = FALSE;   // Total value of shares
-    gboolean amount_changed = FALSE;  // No of shares
-
-    gboolean recalc_amount = FALSE;
-    gboolean recalc_price = FALSE;
-    gboolean recalc_value = FALSE;
-    gboolean expanded = FALSE;
-    int denom;
-    Account *account = NULL;
-
-    ENTER("trans %p and split %p and input is %s and viewcol is %d", trans, split, gnc_numeric_to_string (input), viewcol);
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    /* Check for sub account view */
-    if (!gnc_tree_model_split_reg_get_sub_account (model))
-        account = gnc_tree_model_split_reg_get_anchor (model);
-
-    expanded = gnc_tree_view_split_reg_trans_expanded (view, trans);
-
-    if (!account)
-        account = xaccSplitGetAccount (split);
-
-    if (!xaccAccountIsPriced (account))
-        return;
-
-    /* If we are using commodity trading accounts then the value may
-       not really be the value.  Punt if so. */
-    if (xaccTransUseTradingAccounts (xaccSplitGetParent (split)))
-    {
-        gnc_commodity *acc_commodity;
-        acc_commodity = xaccAccountGetCommodity (account);
-        if (!(xaccAccountIsPriced (account) || !gnc_commodity_is_iso (acc_commodity)))
-            return;
-    }
-
-    if (gnc_numeric_zero_p (input))
-    {
-        xaccSplitSetValue (split, input);
-        xaccSplitSetAmount (split, input);
-        LEAVE("zero");
-        return;
-    }
-
-    amount = xaccSplitGetAmount (split);
-    value = xaccSplitGetValue (split);
-
-    if (viewcol == COL_AMTVAL && !expanded)
-    {
-        value_changed = TRUE;
-        if (gnc_numeric_zero_p (amount))
-        {
-            xaccSplitSetValue (split, input);
-            xaccSplitSetAmount (split, input);
-            LEAVE("");
-            return;
-        }
-    }
-    else if (viewcol == COL_AMTVAL && expanded)
-    {
-        amount_changed = TRUE;
-        if (gnc_numeric_zero_p (value))
-        {
-            xaccSplitSetValue (split, input);
-            xaccSplitSetAmount (split, input);
-            LEAVE("");
-            return;
-        }
-    }
-
-    if (viewcol == COL_PRICE)
-    {
-        price_changed = TRUE;
-        if (gnc_numeric_zero_p (value))
-        {
-            amount = gnc_numeric_create (1,1);
-            value = gnc_numeric_mul (input, amount, GNC_DENOM_AUTO, GNC_HOW_RND_ROUND);
-            xaccSplitSetValue (split, input);
-            xaccSplitSetAmount (split, amount);
-            LEAVE("");
-            return;
-        }
-    }
-
-    if ((viewcol == COL_CREDIT || viewcol == COL_DEBIT) && !expanded)
-    {
-        amount_changed = TRUE;
-        if (gnc_numeric_zero_p (value))
-        {
-            xaccSplitSetValue (split, input);
-            xaccSplitSetAmount (split, input);
-            LEAVE("");
-            return;
-        }
-    }
-    else if ((viewcol == COL_CREDIT || viewcol == COL_DEBIT) && expanded)
-    {
-        value_changed = TRUE;
-        if (gnc_numeric_zero_p (value))
-        {
-            xaccSplitSetValue (split, input);
-            xaccSplitSetAmount (split, input);
-            LEAVE("");
-            return;
-        }
-    }
-
-    DEBUG("value_changed %d, price_changed %d, amount_changed %d", value_changed, price_changed, amount_changed);
-
-    {
-        int choice;
-        int default_value;
-        GList *node;
-        GList *radio_list = NULL;
-        const char *title = _("Recalculate Transaction");
-        const char *message = _("The values entered for this transaction "
-                                "are inconsistent. Which value would you "
-                                "like to have recalculated?");
-
-        if (amount_changed)
-            radio_list = g_list_append (radio_list,
-                                        g_strdup_printf ("%s (%s)",
-                                                _("_Shares"), _("Changed")));
-        else
-            radio_list = g_list_append (radio_list, g_strdup (_("_Shares")));
-
-        if (price_changed)
-            radio_list = g_list_append (radio_list,
-                                        g_strdup_printf ("%s (%s)",
-                                                _("_Price"), _("Changed")));
-        else
-            radio_list = g_list_append (radio_list, g_strdup (_("_Price")));
-
-        if (value_changed)
-            radio_list = g_list_append (radio_list,
-                                        g_strdup_printf ("%s (%s)",
-                                                _("_Value"), _("Changed")));
-        else
-            radio_list = g_list_append (radio_list, g_strdup (_("_Value")));
-
-        if(expanded)
-        {
-            if (price_changed)
-                default_value = 2;  /* change the value */
-            else
-                default_value = 1;  /* change the price */
-        }
-        else
-        {
-            if (price_changed)
-                default_value = 0;  /* change the amount / shares */
-            else
-                default_value = 1;  /* change the price */
-        }
-        choice = gnc_choose_radio_option_dialog
-                 (gnc_tree_view_split_reg_get_parent (view),
-                  title,
-                  message,
-                  _("_Recalculate"),
-                  default_value,
-                  radio_list);
-
-        for (node = radio_list; node; node = node->next)
-            g_free (node->data);
-
-        g_list_free (radio_list);
-
-        switch (choice)
-        {
-        case 0: /* Modify number of shares */
-            recalc_amount = TRUE;
-            break;
-        case 1: /* Modify the share price */
-            recalc_price = TRUE;
-            break;
-        case 2: /* Modify total value */
-            recalc_value = TRUE;
-            break;
-        default: /* Cancel */
-            LEAVE(" " );
-            return;
-        }
-    }
-
-    DEBUG("recalc_value %d, recalc_price %d, recalc_amount %d", recalc_value, recalc_price, recalc_amount);
-
-    if (recalc_amount)
-    {
-        denom = gtu_sr_get_amount_denom (split);
-
-        if (amount_changed)
-        {
-            LEAVE("");
-            return;
-        }
-
-        if (price_changed)
-            price = input;
-        else
-            price = gnc_numeric_div (value, amount, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT);
-
-        if (value_changed)
-        {
-            xaccSplitSetValue (split, input);
-            amount = gnc_numeric_div (input, price, denom, GNC_HOW_RND_ROUND_HALF_UP);
-            xaccSplitSetAmount (split, amount);
-        }
-        else
-        {
-            amount = gnc_numeric_div (value, price, denom, GNC_HOW_RND_ROUND_HALF_UP);
-            xaccSplitSetAmount (split, amount);
-        }
-    }
-
-    if (recalc_price)
-    {
-        if (price_changed)
-        {
-            LEAVE("");
-            return;
-        }
-
-        if (amount_changed)
-        {
-            xaccSplitSetAmount (split, input);
-            xaccSplitSetValue (split, value);
-        }
-
-        if (value_changed)
-        {
-            xaccSplitSetValue (split, input);
-            xaccSplitSetAmount (split, amount);
-        }
-    }
-
-    if (recalc_value)
-    {
-        denom = gtu_sr_get_value_denom (split);
-
-        if (value_changed)
-        {
-            LEAVE("");
-            return;
-        }
-
-        if (price_changed)
-            price = input;
-        else
-            price = gnc_numeric_div (value, amount, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT);
-
-        if (amount_changed)
-        {
-            xaccSplitSetAmount (split, input);
-            value = gnc_numeric_mul (input, price, denom, GNC_HOW_RND_ROUND_HALF_UP);
-            xaccSplitSetValue (split, value);
-        }
-        else
-        {
-            value = gnc_numeric_mul (amount, price, denom, GNC_HOW_RND_ROUND_HALF_UP);
-            xaccSplitSetValue (split, value);
-        }
-    }
-
-    /* If the number of splits is two, change other split to balance */
-    if (!gnc_tree_util_split_reg_is_multi (split) && expanded)
-    {
-        Split *osplit;
-        gnc_commodity *osplit_com;
-
-        osplit = xaccSplitGetOtherSplit (split);
-
-        value = xaccSplitGetValue (split);
-
-        osplit_com = xaccAccountGetCommodity (xaccSplitGetAccount (osplit));
-
-        if (gnc_commodity_is_currency (osplit_com))
-        {
-            xaccSplitSetValue (osplit, gnc_numeric_neg (value));
-            xaccSplitSetAmount (osplit, gnc_numeric_neg (value));
-        }
-    }
-    LEAVE("");
-}
-
-
-/* Set the value for the given input amount */
-void
-gnc_tree_util_set_value_for_amount (GncTreeViewSplitReg *view, Transaction *trans, Split *split, gnc_numeric input)
-{
-    gnc_numeric  split_rate;
-    gnc_numeric  amount;
-    gnc_numeric  value, new_value;
-    int denom;
-
-    ENTER("trans %p and split %p and input is %s", trans, split, gnc_numeric_to_string (input));
-
-    if (gnc_numeric_zero_p (input))
-    {
-        xaccSplitSetValue (split, input);
-        xaccSplitSetAmount (split, input);
-        LEAVE("zero");
-        return;
-    }
-
-    amount = xaccSplitGetAmount (split);
-    value = xaccSplitGetValue (split);
-
-    denom = gtu_sr_get_value_denom (split);
-
-    split_rate = gnc_numeric_div (value, amount, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT);
-    if (gnc_numeric_check (split_rate) != GNC_ERROR_OK)
-        split_rate = gnc_numeric_create (100,100);
-
-    new_value = gnc_numeric_mul (input, split_rate, denom, GNC_HOW_RND_ROUND_HALF_UP);
-
-    xaccSplitSetValue (split, new_value);
-    xaccSplitSetAmount (split, input);
-
-    LEAVE("");
-}
-
-
-/* Get the rate */
-gnc_numeric
-gnc_tree_util_get_rate_for (GncTreeViewSplitReg *view, Transaction *trans, Split *split, gboolean is_blank)
-{
-    gnc_numeric num;
-
-    ENTER("trans %p and split %p is_blank %d", trans, split, is_blank);
-
-    num = gnc_tree_util_split_reg_get_value_for (view, trans, split, is_blank);
-//FIXME Not sure about this...
-    if (xaccTransUseTradingAccounts (trans))
-        num = gnc_numeric_div (num, xaccSplitGetValue (split), GNC_DENOM_AUTO, GNC_HOW_RND_ROUND);
-    else
-        num = gnc_numeric_div (xaccSplitGetAmount (split), num, GNC_DENOM_AUTO, GNC_HOW_RND_ROUND);
-
-    LEAVE("split %p and return num is %s", split, gnc_numeric_to_string (num));
-    return num;
-}
-
-
-/*****************************************************************************/

Deleted: gnucash/trunk/src/gnome-utils/gnc-tree-util-split-reg.h
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-util-split-reg.h	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-util-split-reg.h	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,89 +0,0 @@
-/********************************************************************\
- * gnc-tree-util-split-reg.h -- GtkTreeView implementation          *
- *                     to display registers   in a GtkTreeView.     *
- *                                                                  *
- * Copyright (C) 2006-2007 Chris Shoemaker <c.shoemaker at cox.net>    *
- * Copyright (C) 2012 Robert Fewell                                 *
- *                                                                  *
- * 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_TREE_UTIL_SPLIT_REG_H
-#define __GNC_TREE_UTIL_SPLIT_REG_H
-
-#include "gnc-tree-model-split-reg.h"
-#include "gnc-tree-view-split-reg.h"
-
-G_BEGIN_DECLS
-
-
-/*****************************************************************************/
-
-gboolean gnc_tree_util_split_reg_has_rate (GncTreeViewSplitReg *view);
-
-gboolean gnc_tree_util_split_reg_needs_conv_rate (GncTreeViewSplitReg *view,
-                                    Transaction *trans, Account *acc);
-
-const char * gnc_tree_util_split_reg_get_transfer_entry (Split *split, gboolean *is_multi);
-
-const char * gnc_tree_util_split_reg_template_get_transfer_entry (Split *split);
-
-const char * gnc_tree_util_split_reg_template_get_fdebt_entry (Split *split);
-
-const char * gnc_tree_util_split_reg_template_get_fcred_entry (Split *split);
-
-gchar * gnc_tree_util_split_reg_get_date_help (GDate *date);
-
-void gnc_tree_util_split_reg_parse_date (GDate *parsed, const char *datestr);
-
-gboolean gnc_tree_util_split_reg_rotate (GncTreeViewSplitReg *view, GtkTreeViewColumn *col,
-                                         Transaction *trans, Split *split);
-
-gboolean gnc_tree_util_split_reg_is_multi (Split *split);
-
-gboolean gnc_tree_util_split_reg_needs_amount (GncTreeViewSplitReg *view, Split *split);
-
-void gnc_tree_util_split_reg_set_value_for (GncTreeViewSplitReg *view, Transaction *trans,
-                                            Split *split, gnc_numeric input, gboolean force);
-
-void gnc_tree_util_split_reg_save_amount_values (GncTreeViewSplitReg *view, Transaction *trans,
-                                                 Split *split, gnc_numeric input);
-
-gnc_numeric gnc_tree_util_split_reg_get_value_for (GncTreeViewSplitReg *view, Transaction *trans,
-                                                   Split *split, gboolean is_blank);
-
-gboolean gnc_tree_util_split_reg_get_debcred_entry (GncTreeViewSplitReg *view,
-                                                    Transaction *trans, Split *split,
-                                                    gboolean is_blank,gnc_numeric *ret_num,
-                                                    GNCPrintAmountInfo *ret_print_info);
-
-void gnc_tree_util_set_number_for_input (GncTreeViewSplitReg *view, Transaction *trans,
-                                         Split *split, gnc_numeric input, gint viewcol);
-
-void gnc_tree_util_set_value_for_amount (GncTreeViewSplitReg *view, Transaction *trans,
-                                         Split *split, gnc_numeric input);
-
-gnc_numeric gnc_tree_util_get_rate_for (GncTreeViewSplitReg *view, Transaction *trans,
-                                        Split *split, gboolean is_blank);
-
-/*****************************************************************************/
-
-G_END_DECLS
-
-#endif /* __GNC_TREE_UTIL_SPLIT_REG_H */

Deleted: gnucash/trunk/src/gnome-utils/gnc-tree-view-split-reg.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-view-split-reg.c	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-view-split-reg.c	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,6491 +0,0 @@
-/********************************************************************\
- * gnc-tree-view-split-reg.c -- GtkTreeView implementation to       *
- *                     display registers   in a GtkTreeView.        *
- *                                                                  *
- * Copyright (C) 2006-2007 Chris Shoemaker <c.shoemaker at cox.net>    *
- * Copyright (C) 2012 Robert Fewell                                 *
- *                                                                  *
- * 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 <stdlib.h>
-#include <string.h>
-#include <gdk/gdkkeysyms.h>
-
-#include "gnc-tree-view.h"
-#include "gnc-tree-view-split-reg.h"
-#include "gnc-tree-model-split-reg.h"
-#include "gnc-tree-control-split-reg.h"
-#include "gnc-tree-util-split-reg.h"
-#include "gnc-ui.h"
-#include "gnome-utils/gnc-warnings.h"
-#include "dialog-utils.h"
-#include "gnc-prefs.h"
-#include "Transaction.h"
-#include "engine-helpers.h"
-#include "Scrub.h"
-#include "gnc-exp-parser.h"
-#include "SchedXaction.h"
-
-#include "gnc-amount-edit.h"
-
-
-/* Signal codes */
-enum
-{
-    UPDATE_SIGNAL,
-    HELP_SIGNAL,
-    LAST_SIGNAL
-};
-
-typedef enum {
-    RESET,  //0
-    ACCEPT, //1
-    DISCARD,//2
-    CANCEL  //3
-}TransConfirm;
-
-
-/** Static Globals *******************************************************/
-static QofLogModule log_module = GNC_MOD_LEDGER;
-
-static void gnc_tree_view_split_reg_class_init (GncTreeViewSplitRegClass *klass);
-static void gnc_tree_view_split_reg_init (GncTreeViewSplitReg *view);
-static void gnc_tree_view_split_reg_dispose (GObject *object);
-static void gnc_tree_view_split_reg_finalize (GObject *object);
-
-static guint gnc_tree_view_split_reg_signals[LAST_SIGNAL] = {0};
-
-static void gnc_tree_view_split_reg_pref_changed (gpointer prefs, gchar *pref, gpointer user_data);
-
-static void gtv_sr_cdf0 (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *s_model,
-				GtkTreeIter *s_iter, gpointer user_data);
-
-static void gtv_sr_cdf1 (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *s_model,
-				GtkTreeIter *s_iter, gpointer user_data);
-
-static void gtv_sr_control_cdf0 (GtkTreeViewColumn *col, GtkCellRenderer *renderer,
-                                 GtkTreeModel *s_model, GtkTreeIter *s_iter, gpointer user_data);
-
-static void gtv_sr_titles (GncTreeViewSplitReg *view, RowDepth depth);
-
-static void gtv_sr_edited_cb (GtkCellRendererText *cell, const gchar *path_string,
-				const gchar *new_text, gpointer user_data);
-
-static void gtv_sr_edited_normal_cb (GtkCellRendererText *cell, const gchar *path_string,
-                                const gchar *new_text, gpointer user_data);
-
-static void gtv_sr_edited_template_cb (GtkCellRendererText *cell, const gchar *path_string,
-                                const gchar *new_text, gpointer user_data);
-
-static void start_edit (GtkCellRenderer *cr, GtkCellEditable *editable,
-				const gchar *path, gpointer user_data); //FIXME This may not be needed
-
-static void gtv_sr_begin_edit (GncTreeViewSplitReg *view, Transaction *trans);
-
-static void gtv_sr_finish_edit (GncTreeViewSplitReg *view);
-
-static void gtv_sr_editable_start_editing_cb (GtkCellRenderer *cr, GtkCellEditable *editable,
-				const gchar *path, gpointer user_data);
-
-static void gtv_sr_editing_canceled_cb (GtkCellRenderer *cr, gpointer user_data);
-
-static void gtv_sr_match_selected_cb (GtkEntryCompletion *widget, GtkTreeModel *model,
-                        GtkTreeIter *iter, gpointer user_data); //FIXME This may not be needed
-
-static void gtv_sr_changed_cb (GtkCellRendererCombo *widget, gchar *path_string,
-                        GtkTreeIter *iter, gpointer user_data); //FIXME This may not be needed
-
-static void gtv_sr_selection_move_delete_cb (GncTreeModelSplitReg *model, gpointer item, gpointer user_data);
-
-static gboolean gtv_sr_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer user_data);
-
-static gboolean gtv_sr_ed_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer user_data);
-
-static gboolean gtv_sr_button_cb (GtkWidget *widget, GdkEventButton *event, gpointer user_data);
-
-static gboolean gtv_sr_focus_out_cb (GtkWidget *widget, GdkEventFocus *event, gpointer user_data);
-
-static void gtv_sr_motion_cb (GtkTreeSelection *sel, gpointer user_data);
-
-static void gtv_sr_refresh_view_cb (GncTreeModelSplitReg *model, gpointer user_data);
-
-static gboolean gtv_sr_transaction_changed_confirm (GncTreeViewSplitReg *view, Transaction *new_trans);
-
-
-typedef struct {
-    ViewCol viewcol;
-    gint modelcol;
-    gchar *title;
-    gchar *pref_name;
-    gchar *sizer;
-    int visibility_model_col;
-    int always_visible_col;
-    void (*edited_cb)(GtkCellRendererText *, const gchar *,
-                      const gchar *, gpointer);
-    void (*editing_started_cb)(GtkCellRenderer *, GtkCellEditable *,
-                               const gchar *, gpointer);
-    GtkTreeIterCompareFunc sort_fn;
-} ColDef;
-
-
-static ColDef all_tree_view_split_reg_columns[] = {
-    {COL_DATE, GNC_TREE_MODEL_SPLIT_REG_COL_DATE,
-     "Date", "date", "00/00/0000",
-     GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, 1,
-     gtv_sr_edited_cb, gtv_sr_editable_start_editing_cb,
-     gnc_tree_model_split_reg_sort_iter_compare_func},
-
-    {COL_DUEDATE, -1,
-     "Due Date", "duedate", "00/00/0000",
-     GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, 1,
-     gtv_sr_edited_cb, gtv_sr_editable_start_editing_cb, NULL},
-
-    {COL_NUMACT, GNC_TREE_MODEL_SPLIT_REG_COL_NUMACT,
-     "Num / Act / Act", "numact", "0000",
-     GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, 0,
-     gtv_sr_edited_cb, gtv_sr_editable_start_editing_cb,
-     gnc_tree_model_split_reg_sort_iter_compare_func},
-
-    {COL_DESCNOTES, GNC_TREE_MODEL_SPLIT_REG_COL_DESCNOTES,
-     "Description / Notes / Memo", "descnotes", "xxxxxxxxxxxxxxxxxxx",
-     GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, 1,
-     gtv_sr_edited_cb, gtv_sr_editable_start_editing_cb,
-     gnc_tree_model_split_reg_sort_iter_compare_func},
-
-    {COL_TRANSFERVOID, -1,
-     "Transfer / Void", "transfervoid", "xxxxxxxxxxxxxxxxxxx",
-     GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, 1,
-     gtv_sr_edited_cb, gtv_sr_editable_start_editing_cb, NULL},
-
-    {COL_RECN, GNC_TREE_MODEL_SPLIT_REG_COL_RECN,
-     "R", "recn", "xx",
-     GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, 0,
-     gtv_sr_edited_cb, gtv_sr_editable_start_editing_cb,
-     gnc_tree_model_split_reg_sort_iter_compare_func},
-
-    {COL_TYPE, -1,
-     "Type", "type", "xx",
-     GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, 0,
-     gtv_sr_edited_cb, gtv_sr_editable_start_editing_cb, NULL},
-
-    {COL_VALUE, -1,
-     "Value", "value", "00000",
-     GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, 0,
-     gtv_sr_edited_cb, gtv_sr_editable_start_editing_cb, NULL},
-
-    {COL_AMOUNT, -1,
-     "Amount", "amount", "00000",
-     GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, 0,
-     gtv_sr_edited_cb, gtv_sr_editable_start_editing_cb, NULL},
-
-    {COL_AMTVAL, -1,
-     "Amount / Value", "amtval", "00000",
-     GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, 1,
-     gtv_sr_edited_cb, gtv_sr_editable_start_editing_cb, NULL},
-
-    {COL_RATE, -1,
-     "Rate", "rate", "00000",
-     GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, 0,
-     gtv_sr_edited_cb, gtv_sr_editable_start_editing_cb, NULL},
-
-    {COL_PRICE, -1,
-     "Price", "price", "00000",
-     GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, 1,
-     gtv_sr_edited_cb, gtv_sr_editable_start_editing_cb, NULL},
-
-    {COL_DEBIT, GNC_TREE_MODEL_SPLIT_REG_COL_DEBIT,
-     "Debit", "debit", "00000",
-     GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, 1,
-     gtv_sr_edited_cb, gtv_sr_editable_start_editing_cb,
-     gnc_tree_model_split_reg_sort_iter_compare_func},
-
-    {COL_CREDIT, GNC_TREE_MODEL_SPLIT_REG_COL_CREDIT,
-     "Credit", "credit", "00000",
-     GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, 1,
-     gtv_sr_edited_cb, gtv_sr_editable_start_editing_cb,
-     gnc_tree_model_split_reg_sort_iter_compare_func},
-
-    {COL_BALANCE, -1,
-     "Balance", "balance", "00000",
-     GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, 0,
-     NULL, NULL, NULL},
-
-    {COL_STATUS, -1,
-     " ", "status", "x",
-     GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, 1,
-     NULL, NULL, NULL},
-
-    {COL_COMM, -1,
-     "Commodity", "commodity", "xxxxxxxx",
-     GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS, 0,
-     NULL, NULL, NULL},
-};
-
-
-struct GncTreeViewSplitRegPrivate
-{
-    gboolean             disposed;
-  
-    Account             *anchor;              // The register default Account
-    gnc_commodity       *reg_comm;            // The register commodity (which may be a non-currency)
-    gnc_commodity       *reg_currency;        // The currency for txns in this register (guaranteed to be a currency)
-
-    Transaction         *current_trans;       // The current highlighted transaction
-    Split               *current_split;       // The current highlighted split
-    RowDepth             current_depth;       // The current depth 1=TROW1, 2=TROW2, 3=SPLIT3
-    GtkTreeRowReference *current_ref;         // The current model path reference
-
-    Transaction         *dirty_trans;         // Set when transaction is changed
-    TransConfirm         trans_confirm;       // This is the return value for gtv_sr_transaction_changed_confirm
-
-    GtkCellRenderer     *temp_cr;             // Pointer to Temp Cell Renderer
-    gulong               fo_handler_id;       // Focus out callback id
-
-    gboolean             acct_short_names;    // Use account short names
-    gboolean             double_line;         // Use double line mode
-    gboolean             expanded;            // Are we expanded to splits
-    gboolean             auto_complete;       // Whether auto complete has run
-    gboolean             negative_in_red;     // Display negative numbers in red
-    gboolean             use_horizontal_lines;// Draw horizontal lines
-    gboolean             use_vertical_lines;  // Draw vertical lines
-
-    gboolean             show_calendar_buttons;        // Show the calendar buttons
-    gboolean             show_extra_dates_on_selection;// Show the above on the selected transaction
-    gboolean             selection_to_blank_on_expand; // Move the selection to the blank split on expand
-
-    gint                 key_length;                   // The number of characters before auto complete starts.
-    gint                 single_button_press;          // Capture single button press.
-
-    gchar               *transfer_string;              // The transfer account string.
-    gboolean             stop_cell_move;               // Stops the cursor moving to a different cell.
-
-};
-
-/* Define some cell colors */
-#define PINKCELL "#F8BEC6"
-#define REDCELL "#F34943"
-#define BLUECELL "#1D80DF"
-#define BLACKCELL "#CBCBD2"
-#define YELLOWCELL "#FFEF98"
-#define ORANGECELL "#F39536"
-
-
-#define GNC_PREF_SHOW_EXTRA_DATES        "show-extra-dates"
-#define GNC_PREF_SHOW_EXTRA_DATES_ON_SEL "show-extra-dates-on-selection"
-#define GNC_PREF_SHOW_CAL_BUTTONS        "show-calendar-buttons"
-#define GNC_PREF_SEL_TO_BLANK_ON_EXPAND  "selection-to-blank-on-expand"
-#define GNC_PREF_KEY_LENGTH              "key-length"
-
-/* This could be a preference setting, show currency / commodity symbols */
-#define SHOW_SYMBOL FALSE
-
-#define GNC_TREE_VIEW_SPLIT_REG_GET_PRIVATE(o)  \
-   (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_TREE_VIEW_SPLIT_REG, GncTreeViewSplitRegPrivate))
-
-static GObjectClass *parent_class = NULL;
-
-GType
-gnc_tree_view_split_reg_get_type(void)
-{
-    static GType gnc_tree_view_split_reg_type = 0;
-
-    if (gnc_tree_view_split_reg_type == 0)
-    {
-        static const GTypeInfo our_info =
-        {
-            sizeof (GncTreeViewSplitRegClass),
-            NULL,
-            NULL,
-            (GClassInitFunc) gnc_tree_view_split_reg_class_init,
-            NULL,
-            NULL,
-            sizeof (GncTreeViewSplitReg),
-            0,
-            (GInstanceInitFunc) gnc_tree_view_split_reg_init
-        };
-
-        gnc_tree_view_split_reg_type = g_type_register_static (GNC_TYPE_TREE_VIEW,
-                                     "GncTreeViewSplitReg",
-                                     &our_info, 0);
-    }
-    return gnc_tree_view_split_reg_type;
-}
-
-
-static void
-gnc_tree_view_split_reg_class_init (GncTreeViewSplitRegClass *klass)
-{
-    GObjectClass *o_class;
-
-    parent_class = g_type_class_peek_parent (klass);
-
-    o_class = G_OBJECT_CLASS (klass);
-
-    o_class->dispose =  gnc_tree_view_split_reg_dispose;
-    o_class->finalize = gnc_tree_view_split_reg_finalize;
-
-    g_type_class_add_private (klass, sizeof(GncTreeViewSplitRegPrivate));
-
-    gnc_tree_view_split_reg_signals[UPDATE_SIGNAL] =
-        g_signal_new("update_signal",
-                     G_TYPE_FROM_CLASS (o_class),
-                     G_SIGNAL_RUN_LAST,
-                     G_STRUCT_OFFSET (GncTreeViewSplitRegClass, update_signal),
-                     NULL, NULL,
-                     g_cclosure_marshal_VOID__VOID,
-                     G_TYPE_NONE, 0);
-
-    gnc_tree_view_split_reg_signals[HELP_SIGNAL] =
-        g_signal_new("help_signal",
-                     G_TYPE_FROM_CLASS (o_class),
-                     G_SIGNAL_RUN_LAST,
-                     G_STRUCT_OFFSET (GncTreeViewSplitRegClass, help_signal),
-                     NULL, NULL,
-                     g_cclosure_marshal_VOID__VOID,
-                     G_TYPE_NONE, 0);
-
-    klass->update_signal = NULL;
-    klass->help_signal = NULL;
-}
-
-/*****************************************************************************/
-
-/* Return the tree model from the tree view */
-GncTreeModelSplitReg *
-gnc_tree_view_split_reg_get_model_from_view (GncTreeViewSplitReg *view)
-{
-    GtkTreeModelSort *s_model = GTK_TREE_MODEL_SORT (gtk_tree_view_get_model (GTK_TREE_VIEW (view)));
-    return GNC_TREE_MODEL_SPLIT_REG (gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT (s_model)));
-}
-
-/* Get the model iter from the view path string */
-static gboolean
-gtv_sr_get_model_iter_from_view_string (GncTreeViewSplitReg *view,
-                                const gchar *path_string, GtkTreeIter *m_iter)
-{
-    GtkTreeModel *s_model;
-    GtkTreeIter s_iter;
-
-    s_model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
-
-    if (!gtk_tree_model_get_iter_from_string (s_model, &s_iter, path_string))
-    {
-        m_iter = NULL;
-        return FALSE;
-    }
-    gtk_tree_model_sort_convert_iter_to_child_iter (GTK_TREE_MODEL_SORT (s_model), m_iter, &s_iter);
-    return TRUE;
-}
-
-/* Get the model iter from the selection */
-static gboolean
-gtv_sr_get_model_iter_from_selection (GncTreeViewSplitReg *view,
-                              GtkTreeSelection *sel, GtkTreeIter *m_iter)
-{
-    GtkTreeModel *s_model;
-    GtkTreeIter s_iter;
-
-    if (gtk_tree_selection_get_selected (sel, &s_model, &s_iter))
-    {
-        gtk_tree_model_sort_convert_iter_to_child_iter (GTK_TREE_MODEL_SORT (s_model), m_iter, &s_iter);
-        return TRUE;
-    }
-    return FALSE;
-}
-
-/* Get sort model path from the model path
- *
- * Return A newly allocated GtkTreePath, or NULL */
-GtkTreePath *
-gnc_tree_view_split_reg_get_sort_path_from_model_path (GncTreeViewSplitReg *view, GtkTreePath *mpath)
-{
-    GtkTreeModel *s_model;
-    GtkTreePath *spath;
-
-    g_return_val_if_fail (mpath, NULL);
-    s_model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
-    spath = gtk_tree_model_sort_convert_child_path_to_path (GTK_TREE_MODEL_SORT (s_model), mpath);
-    if (!spath)
-    {
-        /* No parent path available */
-        return NULL;
-    }
-    return spath;
-}
-
-/* Get model path from the sort model path
- *
- * Return A newly allocated GtkTreePath, or NULL. */
-GtkTreePath *
-gnc_tree_view_split_reg_get_model_path_from_sort_path (GncTreeViewSplitReg *view, GtkTreePath *spath)
-{
-    GtkTreeModel *s_model;
-    GtkTreePath *mpath;
-
-    g_return_val_if_fail (spath, NULL);
-    s_model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
-    mpath = gtk_tree_model_sort_convert_path_to_child_path (GTK_TREE_MODEL_SORT (s_model), spath);
-    if (!mpath)
-    {
-        /* No child path available */
-        return NULL;
-    }
-    return mpath;
-}
-
-/*****************************************************************************/
-
-static void
-gnc_tree_view_split_reg_init (GncTreeViewSplitReg *view)
-{
-    view->priv = g_new0 (GncTreeViewSplitRegPrivate, 1);
-
-    view->priv->current_trans = NULL;
-    view->priv->current_split = NULL;
-    view->priv->current_depth = 0;
-    view->reg_closing = FALSE;
-    view->priv->fo_handler_id = 0;
-    view->sort_depth = 1;
-    view->sort_direction = 1;
-    view->priv->auto_complete = FALSE;
-    view->priv->trans_confirm = RESET;
-    view->priv->single_button_press = 0;
-
-    view->priv->transfer_string = g_strdup ("Dummy");
-    view->priv->stop_cell_move = FALSE;
-
-    view->priv->show_calendar_buttons = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_SHOW_CAL_BUTTONS);
-    view->show_extra_dates = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_SHOW_EXTRA_DATES);
-    view->priv->show_extra_dates_on_selection = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_SHOW_EXTRA_DATES_ON_SEL);
-    view->priv->selection_to_blank_on_expand = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_SEL_TO_BLANK_ON_EXPAND);
-    view->priv->key_length = gnc_prefs_get_float (GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_KEY_LENGTH);
-
-    view->priv->acct_short_names = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_SHOW_LEAF_ACCT_NAMES);
-    view->priv->negative_in_red = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_NEGATIVE_IN_RED);
-    view->priv->use_horizontal_lines = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER,
-                                                           GNC_PREF_DRAW_HOR_LINES);
-
-    view->priv->use_vertical_lines = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER,
-                                                         GNC_PREF_DRAW_VERT_LINES);
-
-    gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL_REGISTER,
-                           GNC_PREF_DRAW_HOR_LINES,
-                           gnc_tree_view_split_reg_pref_changed,
-                           view);
-    gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL_REGISTER,
-                           GNC_PREF_DRAW_VERT_LINES,
-                           gnc_tree_view_split_reg_pref_changed,
-                           view);
-}
-
-
-static void
-gnc_tree_view_split_reg_dispose (GObject *object)
-{
-    GncTreeViewSplitReg *view;
-    GncTreeViewSplitRegPrivate *priv;
-
-    gnc_leave_return_if_fail (object != NULL);
-    gnc_leave_return_if_fail (GNC_IS_TREE_VIEW_SPLIT_REG (object));
-
-    view = GNC_TREE_VIEW_SPLIT_REG (object);
-    priv = GNC_TREE_VIEW_SPLIT_REG_GET_PRIVATE (view);
-
-    if (priv->disposed)
-        return;
-
-    ENTER("split reg view %p", object);
-
-    priv->disposed = TRUE;
-
-    if(view->priv->current_ref != NULL)
-    {
-        gtk_tree_row_reference_free (view->priv->current_ref);
-        view->priv->current_ref = NULL;
-    }
-
-    if (view->help_text)
-        g_free (view->help_text);
-
-    if (view->priv->transfer_string)
-        g_free (view->priv->transfer_string);
-
-    gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL_REGISTER,
-                                 GNC_PREF_DRAW_HOR_LINES,
-                                 gnc_tree_view_split_reg_pref_changed,
-                                 view);
-    gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL_REGISTER,
-                                 GNC_PREF_DRAW_VERT_LINES,
-                                 gnc_tree_view_split_reg_pref_changed,
-                                 view);
-
-    if (G_OBJECT_CLASS (parent_class)->dispose)
-        (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-
-    LEAVE(" ");
-}
-
-
-static void
-gnc_tree_view_split_reg_finalize (GObject *object)
-{
-    GncTreeViewSplitReg *view;
-
-    gnc_leave_return_if_fail(object != NULL);
-    gnc_leave_return_if_fail(GNC_IS_TREE_VIEW_SPLIT_REG (object));
-
-    ENTER("split reg view %p", object);
-
-    view = GNC_TREE_VIEW_SPLIT_REG (object);
-
-    if (G_OBJECT_CLASS(parent_class)->finalize)
-        (* G_OBJECT_CLASS(parent_class)->finalize) (object);
-
-    LEAVE(" ");
-}
-
-
-/* Update internal settings based on preferences */
-void
-gnc_tree_view_split_reg_refresh_from_prefs (GncTreeViewSplitReg *view)
-{
-    GncTreeModelSplitReg *model;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    model->use_theme_colors = gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL_REGISTER,
-                                                 GNC_PREF_USE_THEME_COLORS);
-    model->use_accounting_labels = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL,
-                                                       GNC_PREF_ACCOUNTING_LABELS);
-
-    model->alt_colors_by_txn = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER,
-                                                   GNC_PREF_ALT_COLOR_BY_TRANS);
-
-    view->priv->negative_in_red = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL,
-                                                      GNC_PREF_NEGATIVE_IN_RED);
-}
-
-
-static void
-gnc_tree_view_split_reg_pref_changed (gpointer prefs, gchar *pref, gpointer user_data)
-{
-    GncTreeViewSplitReg *view = user_data;
-
-    g_return_if_fail (pref);
-
-    if (view == NULL)
-        return;
-
-    if (g_str_has_suffix (pref, GNC_PREF_DRAW_HOR_LINES) || g_str_has_suffix (pref, GNC_PREF_DRAW_VERT_LINES))
-    {
-        view->priv->use_horizontal_lines = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER,
-                                                               GNC_PREF_DRAW_HOR_LINES);
-
-        view->priv->use_vertical_lines = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER,
-                                                             GNC_PREF_DRAW_VERT_LINES);
-
-        if (view->priv->use_horizontal_lines)
-        {
-            if (view->priv->use_vertical_lines)
-                gtk_tree_view_set_grid_lines (GTK_TREE_VIEW (view), GTK_TREE_VIEW_GRID_LINES_BOTH);
-            else
-                gtk_tree_view_set_grid_lines (GTK_TREE_VIEW (view), GTK_TREE_VIEW_GRID_LINES_HORIZONTAL);
-        }
-        else if (view->priv->use_vertical_lines)
-            gtk_tree_view_set_grid_lines (GTK_TREE_VIEW (view), GTK_TREE_VIEW_GRID_LINES_VERTICAL);
-        else
-            gtk_tree_view_set_grid_lines (GTK_TREE_VIEW (view), GTK_TREE_VIEW_GRID_LINES_NONE);
-    }
-    else
-    {
-        g_warning("gnc_tree_view_split_reg_pref_changed: Unknown preference %s", pref);
-    }
-}
-
-
-/* Set the grid lines to be solid */
-static const gchar *rc_string =
-{
-"style \"solidTreeLines\"\n"
-"{\n"
-" GtkTreeView::grid-line-pattern = \"\1\"\n"
-" GtkTreeView::grid-line-width = 1\n" 
-"}\n"
-"\n"
-"class \"GtkTreeView\" style \"solidTreeLines\"\n"
-};
-
-
-/* Define which columns are in which views */
-static ViewCol *
-gnc_tree_view_split_reg_get_colummn_list (GncTreeModelSplitReg *model)
-{
-    DEBUG("Model-type is %d", model->type);
-
-    switch (model->type)
-    {
-    case BANK_REGISTER2:
-    case CASH_REGISTER2:
-    case ASSET_REGISTER2:
-    case CREDIT_REGISTER2:
-    case LIABILITY_REGISTER2:
-    case INCOME_REGISTER2:
-    case EXPENSE_REGISTER2:
-    case EQUITY_REGISTER2:
-    case TRADING_REGISTER2:
-    case INCOME_LEDGER2:
-        {
-        static ViewCol col_list[] = {
-        COL_DATE, COL_NUMACT, COL_DESCNOTES, COL_TRANSFERVOID, COL_RECN,
-        COL_STATUS, COL_DEBIT, COL_CREDIT, COL_BALANCE, -1};
-        return col_list;
-        }
-        break;
-
-    case GENERAL_LEDGER2:
-        {
-        static ViewCol col_list[] = {
-        COL_DATE, COL_NUMACT, COL_DESCNOTES, COL_TRANSFERVOID, COL_RECN,
-        COL_STATUS, COL_COMM, COL_VALUE, COL_RATE, COL_AMOUNT, COL_DEBIT, COL_CREDIT, -1};
-        return col_list;
-        }
-        break;
-
-    case STOCK_REGISTER2:
-    case CURRENCY_REGISTER2:
-        {
-        static ViewCol col_list[] = {
-        COL_DATE, COL_NUMACT, COL_DESCNOTES, COL_TRANSFERVOID, COL_RECN,
-        COL_STATUS, COL_AMTVAL, COL_PRICE, COL_DEBIT, COL_CREDIT, COL_BALANCE, -1};
-        return col_list;
-        }
-        break;
-
-    case RECEIVABLE_REGISTER2:
-    case PAYABLE_REGISTER2:
-        {
-        static ViewCol col_list[] = {
-        COL_DATE, COL_TYPE, COL_DUEDATE, COL_NUMACT, COL_DESCNOTES, COL_TRANSFERVOID,
-        COL_STATUS, COL_DEBIT, COL_CREDIT, COL_BALANCE, -1};
-        return col_list;
-        }
-
-     case PORTFOLIO_LEDGER2:
-        {
-        static ViewCol col_list[] = {
-        COL_DATE, COL_NUMACT, COL_DESCNOTES, COL_TRANSFERVOID, COL_RECN,
-        COL_STATUS, COL_AMOUNT, COL_PRICE, COL_DEBIT, COL_CREDIT, -1};
-        return col_list;
-        }
-
-    case SEARCH_LEDGER2:
-        {
-        static ViewCol col_list[] = {
-        COL_DATE, COL_NUMACT, COL_DESCNOTES, COL_TRANSFERVOID, COL_RECN,
-        COL_STATUS, COL_DEBIT, COL_CREDIT, -1};
-        return col_list;
-        }
-        break;
-
-    default:
-        {
-        static ViewCol col_list[] = {
-        COL_DATE, COL_NUMACT, COL_DESCNOTES, COL_TRANSFERVOID, COL_RECN,
-	COL_STATUS,
-        COL_VALUE, COL_AMOUNT, COL_RATE, COL_PRICE, COL_DEBIT, COL_CREDIT,
-        COL_BALANCE, -1};
-        return col_list;
-        }
-    }
-}
-
-
-/* Creates a treeview with the list of fields */
-static GncTreeViewSplitReg *
-gnc_tree_view_split_reg_set_cols (GncTreeViewSplitReg *view,
-				  GncTreeModelSplitReg *model,
-				  ViewCol col_list[])
-{
-    int i = 0;
-
-    while (col_list && col_list[i] != -1) {
-        GList *renderers;
-        GtkCellRenderer *cr0;
-        GtkCellRenderer *cr1;
-        GtkTreeViewColumn *col;
-        ColDef def;
-
-        int j, ncol = G_N_ELEMENTS (all_tree_view_split_reg_columns);
-
-        for (j = 0; j < ncol; j++) {
-            if (col_list[i] == all_tree_view_split_reg_columns[j].viewcol) {
-                def = all_tree_view_split_reg_columns[j];
-                break;
-            }
-        }
-        if (j == ncol) {
-            PERR("Failed to find column definition.");
-            i++;
-            continue;
-        }
-        if (col_list[i] == COL_TRANSFERVOID) {
-
-            col = gnc_tree_view_add_combo_column (
-                GNC_TREE_VIEW (view), def.title, def.pref_name, def.sizer,
-                def.modelcol, def.visibility_model_col,
-                GTK_TREE_MODEL (gnc_tree_model_split_reg_get_acct_list (model)), 0, def.sort_fn);
-
-        } else if (col_list[i] == COL_DATE) {
-            col = gnc_tree_view_add_date_column (
-                GNC_TREE_VIEW (view), def.title, def.pref_name, NULL, def.sizer,
-                def.modelcol, def.visibility_model_col, def.sort_fn);
-
-        } else if (col_list[i] == COL_NUMACT) { 
-            col = gnc_tree_view_add_combo_column (
-                GNC_TREE_VIEW (view), def.title, def.pref_name, def.sizer,
-                def.modelcol, def.visibility_model_col,
-                GTK_TREE_MODEL (gnc_tree_model_split_reg_get_action_list (model)), 0, def.sort_fn);
-
-            // Here we are adding a second renderer, we will use the model to switch between the
-            // two by hiding one so we endup with rows of text or combo renderers.
-            cr1 = gtk_cell_renderer_text_new ();
-            gtk_tree_view_column_pack_start (col, cr1, TRUE);
-            gtk_tree_view_column_add_attribute (col, cr1, "visible", GNC_TREE_MODEL_SPLIT_REG_COL_NUM_VIS);
-
-            // Set all the same properties as the first renderer.
-            g_object_set (cr1, "xalign", 1.0, NULL);
-            g_object_set_data (G_OBJECT(cr1), "model_column", GINT_TO_POINTER (def.modelcol));
-            g_object_set_data (G_OBJECT(cr1), "column_name", GINT_TO_POINTER (def.pref_name));
-            g_signal_connect (G_OBJECT(cr1), "editing-started", (GCallback) def.editing_started_cb, view);
-            g_signal_connect (G_OBJECT(cr1), "editing-canceled", G_CALLBACK (gtv_sr_editing_canceled_cb), view);
-            g_object_set (G_OBJECT (cr1), "editable", TRUE, NULL);
-            g_signal_connect (G_OBJECT (cr1), "edited", (GCallback) def.edited_cb, view);
-            g_object_set_data (G_OBJECT (cr1), "view_column", GINT_TO_POINTER (def.viewcol));
-            gtk_tree_view_column_set_cell_data_func (col, cr1, gtv_sr_cdf1, view, NULL);
-
-        } else { 
-            col = gnc_tree_view_add_text_column (
-                GNC_TREE_VIEW (view), def.title, def.pref_name, NULL, def.sizer,
-                def.modelcol, def.visibility_model_col, def.sort_fn);
-        } 
-
-        g_object_set_data (G_OBJECT (col), DEFAULT_VISIBLE, GINT_TO_POINTER (1));
-        g_object_set_data (G_OBJECT (col), ALWAYS_VISIBLE, GINT_TO_POINTER (def.always_visible_col));
-
-        // Set the properties for the first renderer.
-        renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (col));
-        cr0 = g_list_nth_data (renderers, 0);
-        g_list_free (renderers);
-
-        /* Setup cell background color and default alignment */
-        g_object_set (cr0, "xalign", 1.0, NULL);
-
-        if (col_list[i] == COL_NUMACT)
-            gtk_tree_view_column_add_attribute (col, cr0, "visible", GNC_TREE_MODEL_SPLIT_REG_COL_ACT_VIS);
-
-        /* Add the full title for status column to the object for menu creation */
-        if (col_list[i] == COL_STATUS)
-            g_object_set_data_full (G_OBJECT(col), REAL_TITLE, g_strdup (_("Status Bar")), g_free);
-
-        /* This sets the background of the treeview control columns */
-        gnc_tree_view_set_control_column_background (GNC_TREE_VIEW (view), 0, gtv_sr_control_cdf0);
-
-        if (def.editing_started_cb)
-        {
-            //Store the position of the column in the model
-            g_object_set_data (G_OBJECT (cr0), "model_column", GINT_TO_POINTER (def.modelcol));
-            g_object_set_data (G_OBJECT (cr0), "column_name", GINT_TO_POINTER (def.pref_name));
-            g_signal_connect (G_OBJECT (cr0), "editing-started", (GCallback) def.editing_started_cb, view);
-        }
-
-        // Connect editing-canceled signal so that edit-cancelled can be set appropriately
-        g_signal_connect (G_OBJECT (cr0), "editing-canceled", G_CALLBACK (gtv_sr_editing_canceled_cb), view);
-
-        gtk_tree_view_column_set_sizing (col, GTK_TREE_VIEW_COLUMN_FIXED);
-
-//        gtk_tree_view_column_set_min_width (col, -1);
-
-        // Set Columns to be resizable default.
-        g_object_set (G_OBJECT (col), "resizable", TRUE, NULL);
-
-        // Allow the columns to be reorderable.
-        g_object_set (G_OBJECT (col), "reorderable", TRUE, NULL);
-
-        if (def.edited_cb)
-        {
-            g_object_set (G_OBJECT (cr0), "editable", TRUE, NULL);
-            g_signal_connect (G_OBJECT (cr0), "edited", (GCallback) def.edited_cb, view);
-        }
-
-        g_object_set_data (G_OBJECT (cr0), "view_column", GINT_TO_POINTER (def.viewcol));
-        gtk_tree_view_column_set_cell_data_func (col, cr0, gtv_sr_cdf0, view, NULL);
-
-        i++;
-    }
-    gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (view)), GTK_SELECTION_BROWSE);
-
-    g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (view)), "changed", G_CALLBACK (gtv_sr_motion_cb), view);
-
-    //Add a data-edited property to keep track of transaction edits.
-    g_object_set_data (G_OBJECT (view), "data-edited", GINT_TO_POINTER (FALSE));
-
-    // This is used to move the selected item if the selected transaction is deleted.
-    g_signal_connect (G_OBJECT (model), "selection_move_delete", G_CALLBACK (gtv_sr_selection_move_delete_cb), view);
-
-    // This will refresh the view.
-    g_signal_connect (G_OBJECT (model), "refresh_view", G_CALLBACK (gtv_sr_refresh_view_cb), view);
-
-    // This is for key navigation, tabbing...
-    g_signal_connect (G_OBJECT (view), "key-press-event", G_CALLBACK (gtv_sr_key_press_cb), NULL);
-
-    // This is for mouse buttons...
-    g_signal_connect (G_OBJECT (view), "button_press_event", G_CALLBACK (gtv_sr_button_cb), NULL);
-
-    return view;
-}
-
-
-/* Set up the view */
-gboolean
-gnc_tree_view_split_reg_set_format (GncTreeViewSplitReg *view)
-{
-    GncTreeViewSplitRegPrivate *priv;
-    GncTreeModelSplitReg *model;
-    GtkTreePath *mpath, *spath;
-    gint total_num = 0;
-
-    ENTER(" #### Set View Format #### ");
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    priv = view->priv;
-
-    total_num = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (model), NULL);
-
-    mpath = gtk_tree_row_reference_get_path (view->priv->current_ref);
-
-    spath = gnc_tree_view_split_reg_get_sort_path_from_model_path (view, mpath);
-
-    priv->expanded = FALSE;
-
-    {
-        if (model->style == REG2_STYLE_JOURNAL)
-        {
-            gtk_tree_view_expand_all (GTK_TREE_VIEW (view));
-
-            priv->expanded = TRUE;
-
-            gtk_tree_path_free (mpath);
-            gtk_tree_path_free (spath);
-
-            /* This updates the plugin page gui */
-            gnc_tree_view_split_reg_call_uiupdate_cb (view);
-
-            LEAVE("#### Journal format ####");
-            return (FALSE);
-        }
-
-        if (!model->use_double_line)
-        {
-            gtk_tree_view_collapse_all (GTK_TREE_VIEW (view));
-
-            priv->expanded = FALSE;
-
-            LEAVE("#### Single line foramt ####");
-        }
-
-        if (model->use_double_line)
-        {
-            gint index = 0;
-            GtkTreePath *path;
-
-            path = gtk_tree_path_new_first ();
-            while (index < total_num)
-            {
-                gtk_tree_view_expand_to_path (GTK_TREE_VIEW (view), path);
-                gtk_tree_path_down (path);
-                gtk_tree_view_collapse_row (GTK_TREE_VIEW (view), path);
-                gtk_tree_path_up (path);
-                gtk_tree_path_next (path); //Next Transaction
-                index = index + 1;
-            }
-            gtk_tree_path_free (path);
-            LEAVE("#### Double line format ####");
-        }
-
-        /* This expands to split from top level auto.. */
-        if ((model->style == REG2_STYLE_AUTO_LEDGER) || (model->style == REG2_STYLE_JOURNAL))
-        {
-            gtk_tree_view_expand_row (GTK_TREE_VIEW (view), spath, TRUE);
-
-            priv->expanded = TRUE;
-            LEAVE("#### Auto expand line format ####");
-        }
-    }
-
-    gtk_tree_path_free (mpath);
-    gtk_tree_path_free (spath);
-
-    /* This updates the plugin page gui */
-    gnc_tree_view_split_reg_call_uiupdate_cb (view);
-
-    return (FALSE);
-}
-
-
-/* Set up the view for this transaction, used in transaction discard and cancel */
-static gboolean
-gnc_tree_view_split_reg_format_trans (GncTreeViewSplitReg *view, Transaction *trans)
-{
-    GncTreeViewSplitRegPrivate *priv;
-    GncTreeModelSplitReg *model;
-    GtkTreePath *mpath, *spath;
-
-    ENTER(" ");
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    priv = view->priv;
-
-    mpath = gnc_tree_model_split_reg_get_path_to_split_and_trans (model, NULL, trans);
-
-    spath = gnc_tree_view_split_reg_get_sort_path_from_model_path (view, mpath);
-
-    if ((!model->use_double_line) && (model->style != REG2_STYLE_JOURNAL))
-    {
-        gtk_tree_view_collapse_row (GTK_TREE_VIEW (view), spath);
-        priv->expanded = FALSE;
-        LEAVE("#### Single line transaction foramt ####");
-    }
-
-    if ((model->use_double_line) && (model->style != REG2_STYLE_JOURNAL))
-    {
-        gtk_tree_view_expand_to_path (GTK_TREE_VIEW (view), spath);
-        gtk_tree_path_down (spath);
-        gtk_tree_view_collapse_row (GTK_TREE_VIEW (view), spath);
-        gtk_tree_path_up (spath);
-        priv->expanded = FALSE;
-        LEAVE("#### Double line transaction format ####");
-    }
-
-    /* This expands to split from top level auto.. */
-    if ((model->style == REG2_STYLE_AUTO_LEDGER) || (model->style == REG2_STYLE_JOURNAL))
-    {
-        gtk_tree_view_expand_row (GTK_TREE_VIEW (view), spath, TRUE);
-        priv->expanded = TRUE;
-        LEAVE("#### Auto expand line transaction format ####");
-    }
-
-    gtk_tree_path_free (mpath);
-    gtk_tree_path_free (spath);
-
-    /* This updates the plugin page gui */
-    gnc_tree_view_split_reg_call_uiupdate_cb (view);
-
-    return (FALSE);
-}
-
-
-/* Callback to update the view after transactions are added or deleted */
-static void
-gtv_sr_refresh_view_cb (GncTreeModelSplitReg *model, gpointer user_data)
-{
-    GncTreeViewSplitReg *view = user_data;
-
-    gnc_tree_view_split_reg_set_format (view);
-}
-
-
-/* Create a tree view from a given model */
-GncTreeViewSplitReg*
-gnc_tree_view_split_reg_new_with_model (GncTreeModelSplitReg *model)
-{
-    GtkTreeModel        *s_model;
-    GncTreeViewSplitReg *view;
-    GtkTreeSelection    *selection;
-
-    view = g_object_new (gnc_tree_view_split_reg_get_type(), NULL);
-    g_object_set (view, "name", "split_reg_tree", NULL);
-
-    view->priv->anchor = gnc_tree_model_split_reg_get_anchor (model);
-    view->priv->reg_comm = xaccAccountGetCommodity (view->priv->anchor);
-    view->priv->reg_currency = gnc_account_or_default_currency (view->priv->anchor, NULL);
-    g_assert (view->priv->reg_currency);
-    g_assert (gnc_commodity_is_currency (view->priv->reg_currency));
-    view->help_text = g_strdup ("Help Text");
-
-    // This sets up solid lines for the grid line.
-    gtk_rc_parse_string (rc_string);
-
-    /* TreeView Grid lines */
-    if (view->priv->use_horizontal_lines)
-    {
-        if (view->priv->use_vertical_lines)
-            gtk_tree_view_set_grid_lines (GTK_TREE_VIEW (view), GTK_TREE_VIEW_GRID_LINES_BOTH);
-        else
-            gtk_tree_view_set_grid_lines (GTK_TREE_VIEW (view), GTK_TREE_VIEW_GRID_LINES_HORIZONTAL);
-    }
-    else if (view->priv->use_vertical_lines)
-            gtk_tree_view_set_grid_lines (GTK_TREE_VIEW (view), GTK_TREE_VIEW_GRID_LINES_VERTICAL);
-    else
-        gtk_tree_view_set_grid_lines (GTK_TREE_VIEW (view), GTK_TREE_VIEW_GRID_LINES_NONE);
-
-    // Set the view to fixed height mode...
-//    gtk_tree_view_set_fixed_height_mode (GTK_TREE_VIEW (view), TRUE);
-
-    /* Expanders off */
-    gtk_tree_view_set_show_expanders (GTK_TREE_VIEW (view), FALSE);
-
-    /* Tree Selection */
-    selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
-
-    gtk_tree_selection_unselect_all (selection);
-
-    // Setup the sort model
-    s_model = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (model));
-
-    PINFO("#### After Models are Setup ####");
-
-    /* Set the user_data for the sort callback */
-    gnc_tree_view_set_sort_user_data (GNC_TREE_VIEW (view), s_model);
-
-    /* Set up the columns */
-    gnc_tree_view_split_reg_set_cols (view, model, gnc_tree_view_split_reg_get_colummn_list (model));
-
-    PINFO("#### Before View connected to Model ####");
-
-    // Connect model to tree view
-    gnc_tree_view_set_model (GNC_TREE_VIEW (view), s_model);
-    g_object_unref (G_OBJECT (s_model));
-
-    PINFO("#### After View connected to Model ####");
-
-    // Default the sorting to date.
-    gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (s_model),
-                                          GNC_TREE_MODEL_SPLIT_REG_COL_DATE,
-                                          GTK_SORT_ASCENDING);
-
-    PINFO("#### After Set Default Sort Column ####");
-
-    return view;
-}
-
-
-/* This allows the blocking / unblocking of selection */
-void
-gnc_tree_view_split_reg_block_selection (GncTreeViewSplitReg *view, gboolean block)
-{
-    if (block)
-        g_signal_handlers_block_by_func (gtk_tree_view_get_selection (GTK_TREE_VIEW (view)), gtv_sr_motion_cb, view);
-    else
-        g_signal_handlers_unblock_by_func (gtk_tree_view_get_selection (GTK_TREE_VIEW (view)), gtv_sr_motion_cb, view);
-}
-
-
-/* Set the default selection path */
-void
-gnc_tree_view_split_reg_default_selection (GncTreeViewSplitReg *view)
-{
-    GncTreeModelSplitReg *model;
-    GtkTreePath *new_mpath, *mpath, *spath;
-    gint *indices;
-
-    ENTER("#### Default Selection ####");
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    /* Do we have a current transaction set on the model, use it */
-    if (model->current_trans != NULL)
-        view->priv->current_trans = model->current_trans;
-
-    /* Set the default start position to end of list */
-    if (view->priv->current_trans == NULL)
-    {
-        Transaction *btrans;
-
-        btrans = gnc_tree_control_split_reg_get_blank_trans (view);
-        mpath = gnc_tree_model_split_reg_get_path_to_split_and_trans (model, NULL, btrans);
-        view->priv->current_trans = btrans;
-    }
-    else
-        mpath = gnc_tree_model_split_reg_get_path_to_split_and_trans (model, view->priv->current_split, view->priv->current_trans);
-
-    indices = gtk_tree_path_get_indices (mpath);
-
-    if (view->priv->current_depth == 2)
-        new_mpath = gtk_tree_path_new_from_indices (indices[0], indices[1], -1);
-    else
-        new_mpath = gtk_tree_path_new_from_indices (indices[0], -1);
-
-    spath = gnc_tree_view_split_reg_get_sort_path_from_model_path (view, new_mpath);
-
-    {
-        gchar *mstring, *sstring, *tstring;
-        mstring = gtk_tree_path_to_string (mpath);
-        sstring = gtk_tree_path_to_string (spath);
-        tstring = gtk_tree_path_to_string (new_mpath);
-        DEBUG("default_selection mpath is %s, spath is %s, new path is %s", mstring, sstring, tstring);
-        g_free (mstring);
-        g_free (sstring);
-        g_free (tstring);
-    }
-
-    if (view->priv->current_ref != NULL)
-    {
-        gtk_tree_row_reference_free (view->priv->current_ref);
-        view->priv->current_ref = NULL;
-    }
-    view->priv->current_ref = gtk_tree_row_reference_new (GTK_TREE_MODEL (model), new_mpath);
-
-    /* Update the titles */
-    gtv_sr_titles (view, view->priv->current_depth);
-
-    /* Make sure blank split is on current transaction */
-    gnc_tree_model_split_reg_set_blank_split_parent (model, view->priv->current_trans, FALSE);
-
-    PINFO("#### Default Selection - After Titles ####");
-
-    /* Set the view format */
-    gnc_tree_view_split_reg_set_format (view);
-
-    PINFO("#### Default Selection - After View Format ####");
-
-    /* scroll window to show selection */
-    gnc_tree_view_split_reg_scroll_to_cell (view);
-
-    /* Set cursor to new spath */
-    gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), spath, NULL, FALSE);
-
-    gtk_tree_path_free (mpath);
-    gtk_tree_path_free (spath);
-    gtk_tree_path_free (new_mpath);
-
-    LEAVE("#### Leave Default Selection ####");
-}
-
-/*###########################################################################*/
-
-/* Sets read only flag */
-void
-gnc_tree_view_split_reg_set_read_only (GncTreeViewSplitReg *view, gboolean read_only)
-{
-    GncTreeModelSplitReg *model;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    model->read_only = read_only;
-}
-
-
-/* Return the register commodity */
-gnc_commodity *
-gnc_tree_view_split_reg_get_reg_commodity (GncTreeViewSplitReg *view)
-{
-    return view->priv->reg_comm;
-}
-
-
-/* Returns a Split that matches the current Account */
-static Split *
-gtv_sr_get_this_split (GncTreeViewSplitReg *view, Transaction *trans)
-{
-    GncTreeModelSplitReg *model;
-    int i;
-    Split *split = NULL;
-    Account *anchor;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    anchor = gnc_tree_model_split_reg_get_anchor (model);
-
-    if (xaccTransCountSplits (trans) == 0) // this may be a blank or a reinit trans.
-    {
-        if (gnc_tree_model_split_reg_is_blank_split_parent (model, trans))
-            return gnc_tree_model_split_get_blank_split (model);
-    }
-
-    for (i = 0; (split = xaccTransGetSplit (trans, i)); i++) {
-        if (anchor == xaccSplitGetAccount (split))
-            return split;
-    }
-    return NULL;
-}
-
-
-/* The returned Splits may be newly created and not yet belong to trans. */
-static gboolean
-gtv_sr_get_split_pair (GncTreeViewSplitReg *view, Transaction *trans, Split **osplit, Split **split)
-{
-    GncTreeModelSplitReg *model;
-    QofBook       *book;
-
-    gint count = xaccTransCountSplits (trans);
-    Account *anchor = view->priv->anchor;
-
-    book = gnc_get_current_book();
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    if (count == 0) // blank trans
-    {
-        *split = gnc_tree_model_split_get_blank_split (model);
-        xaccSplitSetAccount (*split, anchor);
-        xaccSplitSetParent (*split, trans);
-        *osplit = xaccMallocSplit (book);
-        xaccSplitSetParent (*osplit, trans);
-    }
-    else
-    {
-        int i;
-        Split *s, *first_split;
-
-        first_split = xaccTransGetSplit (trans, 0);
-
-        if (gnc_tree_util_split_reg_is_multi (first_split)) // multi trans
-            return FALSE;
-        else // two split trans
-        {
-            for (i = 0; (s = xaccTransGetSplit (trans, i)); i++)
-            {
-                if (anchor == xaccSplitGetAccount (s))
-                {
-                    *split = s;
-                    break;
-                }
-            }
-            g_assert (*split);
-            *osplit = xaccSplitGetOtherSplit(*split);
-            g_assert (*osplit);
-        }
-    }
-    DEBUG("gtv_sr_get_split_pair return - trans is %p, osplit is %p and split %p is set to anchor %p", trans, *osplit, *split, anchor);
-    return TRUE;
-}
-
-
-/* Does this transaction have any Imbalance splits */
-static gboolean
-gtv_sr_get_imbalance (Transaction *trans)
-{
-    int i;
-    Split *split = NULL;
-    const gchar *acc_name;
-    const gchar *prefix = _("Imbalance"); 
-
-    for (i = 0; (split = xaccTransGetSplit (trans, i)); i++)
-    {
-        if (xaccSplitGetAccount (split) != NULL)
-        {
-            acc_name = xaccAccountGetName (xaccSplitGetAccount (split));
-
-            if (g_str_has_prefix (acc_name, prefix))
-                return TRUE;
-        }
-    }
-    return FALSE;
-}
-
-
-/* Only allow changes to values if we have valid split accounts */
-static gboolean
-gtv_sr_have_account (GncTreeViewSplitReg *view, RowDepth depth, gboolean expanded, gboolean is_template, Transaction *trans, Split *split)
-{
-    gboolean gtv_sr_have_account = FALSE;
-
-    DEBUG("gtv_sr_have_account trans %p, split %p, expanded %d, depth %d", trans, split, expanded, depth);
-
-    if ((depth == TRANS1) && !expanded && !gnc_tree_util_split_reg_is_multi (split)) // normal trans
-    {
-        if (xaccSplitGetAccount (xaccSplitGetOtherSplit (split)) != NULL)
-            gtv_sr_have_account = TRUE;
-    }
-
-    if ((depth == SPLIT3) && (xaccTransCountSplits (trans) == 0)) // blank trans, blank split
-        gtv_sr_have_account = TRUE;
-
-    if (depth == SPLIT3)
-    {
-        if (!is_template) // Are we using a template
-        {
-            Account *acc = xaccSplitGetAccount (split);
-            if (acc != NULL)
-            {
-                if (xaccAccountGetType (acc) != ACCT_TYPE_TRADING)
-                    gtv_sr_have_account = TRUE; // normal split
-                else
-                    gtv_sr_have_account = FALSE; // trading split
-            }
-         }
-         else
-         {
-             if (gnc_tree_util_split_reg_template_get_transfer_entry (split) != NULL)
-                 gtv_sr_have_account = TRUE;
-         }
-    }
-    return gtv_sr_have_account;
-}
-
-/*###########################################################################*/
-
-/* This cellDataFunc is to set the cell-background property of the control columns. */
-static void
-gtv_sr_control_cdf0 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_model,
-    GtkTreeIter *s_iter, gpointer user_data)
-{
-    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-    GncTreeModelSplitReg *model;
-    GtkTreeIter m_iter;
-    GtkTreePath *mpath;
-    Transaction *trans;
-    Split *split;
-    gboolean is_split, is_blank, is_trow1, is_trow2;
-    const gchar *row_color;
-
-    gint *indices;
-
-    ENTER("");
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    gtk_tree_model_sort_convert_iter_to_child_iter (GTK_TREE_MODEL_SORT (s_model), &m_iter, s_iter);
-
-    g_return_if_fail (gnc_tree_model_split_reg_get_split_and_trans (
-                         GNC_TREE_MODEL_SPLIT_REG (model), &m_iter,
-                          &is_trow1, &is_trow2, &is_split, &is_blank,
-                          &split, &trans));
-
-    mpath = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &m_iter);
-
-    indices = gtk_tree_path_get_indices (mpath);
-
-    row_color = gnc_tree_model_split_reg_get_row_color (model, is_trow1, is_trow2, is_split, indices[0]);
-
-    gtk_tree_path_free (mpath);
-
-    /* Set the background color / this works for sorting and deleting transactions */
-    g_object_set (cell, "cell-background", row_color, (gchar*)NULL);
-
-    LEAVE("");
-}
-
-
-/* Instead of setting a different cellDataFunc for each column, we just
-   collect everything here for the first cell renderer. */
-static void
-gtv_sr_cdf0 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_model,
-    GtkTreeIter *s_iter, gpointer user_data)
-{
-    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-    GncTreeModelSplitReg *model;
-    GtkTreeIter m_iter;
-    GtkTreePath *spath;
-    ViewCol viewcol;
-    Transaction *trans;
-    Split *split;
-    gboolean is_split, is_blank, is_trow1, is_trow2;
-    gboolean editable = FALSE, expanded = FALSE;
-    gboolean read_only = FALSE;
-    gboolean open_edited = FALSE;
-    gboolean is_template = FALSE;
-    gboolean negative_in_red = FALSE;
-    gboolean show_extra_dates = FALSE;
-    gnc_numeric num;
-    const gchar *s = "";
-    const gchar *row_color;
-    RowDepth depth;
-    gint *indices;
-    Account *anchor = view->priv->anchor;
-    char type;
-
-    ENTER("");
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    gtk_tree_model_sort_convert_iter_to_child_iter (GTK_TREE_MODEL_SORT (s_model), &m_iter, s_iter);
-
-    viewcol = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cell), "view_column"));
-
-    g_return_if_fail (gnc_tree_model_split_reg_get_split_and_trans (
-                         GNC_TREE_MODEL_SPLIT_REG (model), &m_iter,
-                          &is_trow1, &is_trow2, &is_split, &is_blank,
-                          &split, &trans));
-
-    spath = gtk_tree_model_get_path (GTK_TREE_MODEL (s_model), s_iter);
-
-    depth = gtk_tree_path_get_depth (spath);
-
-    indices = gtk_tree_path_get_indices (spath);
-
-    row_color = gnc_tree_model_split_reg_get_row_color (model, is_trow1, is_trow2, is_split, indices[0]);
-
-    /* Lets see if the splits are expanded */
-    if (is_trow1 || is_trow2) // transaction
-    {
-        if (is_trow1)
-            gtk_tree_path_down (spath); /* Move the path down to trow2 */
-        expanded = gtk_tree_view_row_expanded (GTK_TREE_VIEW (view), spath);
-    }
-    else
-        expanded = TRUE; // splits are always expanded
-
-    gtk_tree_path_free (spath);
-
-    /* Set the background color / this works for sorting and deleting of transactions */
-    g_object_set (cell, "cell-background", row_color, (gchar*)NULL);
-
-    /* Get the read only model setting */
-    gtk_tree_model_get (GTK_TREE_MODEL (model), &m_iter, GNC_TREE_MODEL_SPLIT_REG_COL_RO, &read_only, -1);
-
-    /* Are we being edited in other register */
-    if (xaccTransIsOpen (trans) && (view->priv->dirty_trans != trans))
-    {
-        read_only = TRUE;
-        open_edited = TRUE;
-    }
-
-    /* Test for a transaction type of invoice, always read only */
-    type = xaccTransGetTxnType (trans);
-    if (model->type == RECEIVABLE_REGISTER2 || model->type == PAYABLE_REGISTER2)
-    {
-        if (((type == TXN_TYPE_INVOICE) || (type == TXN_TYPE_NONE)) && (view->priv->dirty_trans != trans) && !is_blank)
-            read_only = TRUE;
-    }
-
-    /* Is this a template */
-    is_template = gnc_tree_model_split_reg_get_template (model);
-
-    /* Show negative numbers in red */
-    negative_in_red = view->priv->negative_in_red;
-
-    switch (viewcol) {
-    case COL_DATE:
-        /* Column is DATE */
-        if (is_split)
-            g_object_set (cell, "cell-background", "white", (gchar*)NULL);
-
-        // Show the extra dates for selected transaction
-        if ((view->priv->current_trans == trans) && view->priv->show_extra_dates_on_selection)
-            show_extra_dates = TRUE;
-
-        // Show the extra dates allways
-        if (view->show_extra_dates == TRUE)
-            show_extra_dates = TRUE;
-
-        if (is_trow1) {
-            Timespec ts = {0,0};
-            xaccTransGetDatePostedTS (trans, &ts);
-            //If the time returned by xaccTransGetDatePostedTS is 0 then assume it
-            //is a new transaction and set the time to current time to show current
-            //date on new transactions
-            if (ts.tv_sec == 0)
-            {
-                ts.tv_sec = gnc_time (NULL);
-                //xaccTransSetDatePostedSecs (trans, ts.tv_sec);
-            }//if
-            s = gnc_print_date (ts);
-            editable = TRUE;
-        }
-        else if (is_trow2 && show_extra_dates) {
-            Timespec ts = {0,0};
-
-            g_object_set (cell, "cell-background", YELLOWCELL, (gchar*)NULL);
-
-            xaccTransGetDateEnteredTS (trans, &ts);
-            //If the time returned by xaccTransGetDateEnteredTS is 0 then assume it
-            //is a new transaction and set the time to current time to show current
-            //date on new transactions
-            if (ts.tv_sec == 0)
-            {
-                ts.tv_sec = gnc_time (NULL);
-                //xaccTransSetDateEnteredSecs (trans, ts.tv_sec);
-            }//if
-            s = gnc_print_date (ts);
-            editable = FALSE;
-        }
-        else if (is_split && show_extra_dates) {
-            Timespec ts = {0,0};
-
-            if (xaccSplitGetReconcile (split) == YREC)
-            {
-                xaccSplitGetDateReconciledTS (split, &ts);
-                //If the time returned by xaccTransGetDateEnteredTS is 0 then assume it
-                //is a new transaction and set the time to current time to show current
-                //date on new transactions
-                if (ts.tv_sec == 0)
-                {
-                    ts.tv_sec = gnc_time (NULL);
-                    //xaccSplitSetDateReconciledTS (split, ts.tv_sec);
-                }//if
-                s = gnc_print_date (ts);
-            }
-            else
-                s = "";
-            editable = FALSE;
-        }
-        else {
-            s = "";
-            editable = FALSE;
-        }
-
-        /* Is this a template */
-        if (is_template && is_trow1)
-        {
-            s =  _(" Scheduled ");
-            editable = FALSE;
-        }
-        else if (is_template && is_trow2 && show_extra_dates)
-        {
-            s = "";
-            editable = FALSE;
-        }
-        else if (is_template && is_split && show_extra_dates)
-        {
-            s = "";
-            editable = FALSE;
-        }
-
-        editable = (read_only == TRUE) ? FALSE : editable;
-
-        /* This will remove the calander buttons if FALSE */
-        g_object_set (cell, "use_buttons", view->priv->show_calendar_buttons, NULL );
-        g_object_set (cell, "text", s, "editable", editable, NULL);
-        break;
-
-    case COL_DUEDATE:
-        /* Column is DUE DATE */
-        if (is_split)
-            g_object_set (cell, "cell-background", "white", (gchar*)NULL);
-
-        if (is_trow1) {
-            Timespec ts = {0,0};
-
-            /* Only print the due date for invoice transactions */
-            if (type == TXN_TYPE_INVOICE)
-            {
-                xaccTransGetDateDueTS (trans, &ts);
-                s = gnc_print_date (ts);
-                editable = FALSE;
-            }
-            else {
-                s = "";
-                editable = FALSE;
-            }
-        }
-        editable = (read_only == TRUE) ? FALSE : editable;
-
-        g_object_set (cell, "text", s, "editable", editable, NULL);
-        break;
-
-    case COL_NUMACT:
-        /* Column is NUM / ACT but relates to ACT */
-        /* Override default alignment */
-        g_object_set (cell, "xalign", 0.0, NULL );
-
-        editable = TRUE;
-
-        if (is_trow1)
-            /* Get per book option */
-            s = gnc_get_num_action (trans, gtv_sr_get_this_split (view, trans));
-
-        else if (is_trow2 && expanded)
-        {
-            /* Get per book option */
-            if (qof_book_use_split_action_for_num_field (gnc_get_current_book()))
-                s = gnc_get_action_num (trans, gtv_sr_get_this_split (view, trans));
-            else
-                s = "";
-            editable = FALSE;
-        }
-        else if (is_trow2 && !expanded)
-        {
-            /* Get per book option */
-            if (gtv_sr_get_this_split (view, trans) != NULL) // Blank split of blank trans is not child of trans yet.
-               s = gnc_get_action_num (trans, gtv_sr_get_this_split (view, trans));
-            else
-               s = "";
-        }
-        else if (is_split)
-            /* Get split-action with gnc_get_num_action which is the same as
-             * xaccSplitGetAction with these arguments */
-            s = gnc_get_num_action (NULL, split);
-
-        editable = (read_only == TRUE) ? FALSE : editable;
-
-        g_object_set (cell, "text", s, "editable", editable, NULL);
-        break;
-
-    case COL_DESCNOTES:
-        /* Column is DESCRIPTION / NOTES */
-        /* Override default alignment */
-        g_object_set( cell, "xalign", 0.0, NULL );
-        if (is_trow1)
-            s =  xaccTransGetDescription (trans);
-        else if (is_trow2)
-            s =  xaccTransGetNotes (trans);
-        else if (is_split)
-            s = xaccSplitGetMemo (split);
-        editable = TRUE;
-
-        editable = (read_only == TRUE) ? FALSE : editable;
-
-        g_object_set (cell, "text", s, "editable", editable, NULL);
-        break;
-
-    case COL_TRANSFERVOID:
-        /* Column is TRANSFER / VOID */
-        /* Not sure if this will stay here, this sets the combo column
-           0 for short account names, 1 for long */
-        if (view->priv->acct_short_names)
-            g_object_set (G_OBJECT (cell), "text-column", 0, NULL );
-        else
-            g_object_set (G_OBJECT (cell), "text-column", 1, NULL );
-
-        {
-            gchar *string = NULL;
-
-            if (is_trow1)
-            {
-                if (expanded)
-                {
-                    string = g_strdup (" "); /* blank-out if splits are visible */
-                    editable = FALSE;
-                }
-                else
-                {
-                    gboolean is_multi;
-                    string = g_strdup (gnc_tree_util_split_reg_get_transfer_entry (gtv_sr_get_this_split (view, trans), &is_multi));
-
-                    editable = anchor && !expanded && !is_multi;
-                }
-            }
-            if (is_trow2)
-            {
-                string = g_strdup (xaccTransGetVoidReason (trans)); // This is the Void Reason
-                editable = FALSE;
-            }
-            if (is_split)
-            {
-                if (!is_template) // Are we using a template
-                {
-                    Account *acct = xaccSplitGetAccount (split);
-
-                    // This will be all but the General Ledger which has anchor == NULL
-                    if ((xaccTransCountSplits (trans) == 0) && (anchor != NULL)) // First split on blank transaction
-                        acct = anchor;
-
-                    if (acct != NULL)
-                    {
-                        if (view->priv->acct_short_names)
-                            string = g_strdup (xaccAccountGetName (acct));
-                        else
-                            string = gnc_account_get_full_name (acct);
-
-                    }
-                    else
-                        string = g_strdup (" ");
-
-                    if (anchor == acct && model->type != GENERAL_LEDGER2 && model->type != SEARCH_LEDGER2)
-                        editable = FALSE;
-                    else
-                        editable = TRUE;
-                }
-                else
-                {
-                    string = g_strdup (gnc_tree_util_split_reg_template_get_transfer_entry (split));
-                    editable = TRUE;
-                }
-            }
-            editable = (read_only == TRUE) ? FALSE : editable;
-
-            g_object_set (cell, "text", string, "editable", editable, NULL);
-            g_free (string);
-        }
-        break;
-
-    case COL_RECN:
-        /* Column is RECN */
-        /* Override default alignment */
-        g_object_set( cell, "xalign", 0.5, NULL );
-        editable = FALSE;
-        s = "";
-        if (is_trow1 && !expanded)
-        {
-            Split *this_split;
-            char rec;
-
-            this_split = gtv_sr_get_this_split (view, trans);
-
-            if (this_split != NULL) // this could be a blank trans
-            {
-                rec = xaccSplitGetReconcile (this_split);
-                if (rec == VREC || rec == FREC)
-                    editable = FALSE;
-                else
-                    editable = TRUE;
-
-                if (rec != ' ')
-                    s = gnc_get_reconcile_str (rec);
-                else
-                    s = gnc_get_reconcile_str (NREC);
-            }
-        }
-
-        if (is_split)
-        {
-            char rec = xaccSplitGetReconcile (split);
-            if (rec == VREC || rec == FREC)
-                editable = FALSE;
-            else
-                editable = TRUE;
-
-            if (rec != ' ')
-                s = gnc_get_reconcile_str (rec);
-            else
-                s = gnc_get_reconcile_str (NREC);
-        }
-
-        editable = (read_only == TRUE) ? FALSE : editable;
-
-        g_object_set (cell, "text", s, "editable", editable, NULL);
-        break;
-
-    case COL_TYPE:
-        /* Column is TYPE */
-        /* Override default alignment */
-        g_object_set( cell, "xalign", 0.5, NULL );
-        if (is_split)
-            g_object_set (cell, "cell-background", "white", (gchar*)NULL);
-
-        if (is_trow1) {
-            static char ss[2];
-            if (type == TXN_TYPE_NONE)
-                type = '?';
-
-            ss[0] = type;
-            ss[1] = '\0';
-            editable = TRUE;
-            g_object_set (cell, "text", ss, NULL);
-        }
-        else
-        {
-            s = "";
-            editable = FALSE;
-            g_object_set (cell, "text", s, NULL);
-        }
-
-        editable = (read_only == TRUE) ? FALSE : editable;
-
-        g_object_set (cell, "editable", editable, NULL);
-        break;
-
-    case COL_VALUE:
-        /* Column is VALUE */
-        if (is_split)
-        {
-            num = xaccSplitGetValue (split);
-            s = xaccPrintAmount (num, gnc_commodity_print_info (xaccTransGetCurrency (trans), SHOW_SYMBOL));
-            editable = FALSE;
-
-            if (gtv_sr_get_imbalance (trans))
-                g_object_set (cell, "cell-background", PINKCELL, (gchar*)NULL);
-        }
-        else
-        {
-            s = "";
-            editable = FALSE;
-        }
-
-        editable = (read_only == TRUE) ? FALSE : editable;
-
-        // Display negative numbers in red if requested in preferences
-        if (gnc_numeric_negative_p (num) && negative_in_red)
-            g_object_set (cell, "foreground", "red", (gchar*)NULL);
-        else
-            g_object_set (cell, "foreground", NULL, (gchar*)NULL);
-
-        g_object_set (cell, "text", s, "editable", editable, NULL);
-        break;
-
-    case COL_RATE:
-        /* Column is RATE */
-        if ((is_trow1)||(is_trow2))
-        {
-            s = "";
-            editable = FALSE;
-        }
-        else
-        {
-            GNCPrintAmountInfo print_info;
-
-            gnc_commodity *split_com = xaccAccountGetCommodity (xaccSplitGetAccount (split));
-
-            print_info = gnc_default_price_print_info();
-            print_info.min_decimal_places = 2;
-
-            num = gnc_numeric_convert (gnc_tree_util_get_rate_for (view, trans, split, is_blank), 1000000, GNC_HOW_RND_ROUND_HALF_UP);
-
-            if (gnc_numeric_check (num) == GNC_ERROR_OK)
-                s = xaccPrintAmount (num, print_info);
-            else
-                s = "";
-
-            editable = FALSE;
-
-            if (gtv_sr_get_imbalance (trans))
-                g_object_set (cell, "cell-background", PINKCELL, (gchar*)NULL);
-        }
-
-        editable = (read_only == TRUE) ? FALSE : editable;
-
-        g_object_set (cell, "text", s, "editable", editable, NULL);
-        break;
-
-    case COL_AMOUNT:
-        /* Column is AMOUNT */
-        if (is_split && (anchor == NULL))
-        {
-            num = xaccSplitGetAmount (split);
-            s = xaccPrintAmount (num, gnc_account_print_info (xaccSplitGetAccount (split), SHOW_SYMBOL));
-            editable = FALSE;
-
-            if (gtv_sr_get_imbalance (trans))
-                g_object_set (cell, "cell-background", PINKCELL, (gchar*)NULL);
-        }
-        else if (is_split && (anchor))
-        {
-            gnc_commodity *split_comm;
-            split_comm = xaccAccountGetCommodity (xaccSplitGetAccount (split));
-
-            if (!gnc_commodity_is_currency (split_comm) || (is_blank))
-            {
-                num = xaccSplitGetAmount (split);
-                s = xaccPrintAmount (num, gnc_account_print_info (xaccSplitGetAccount (split), SHOW_SYMBOL));
-                editable = TRUE;
-            }
-
-            if (gtv_sr_get_imbalance (trans))
-                g_object_set (cell, "cell-background", PINKCELL, (gchar*)NULL);
-        }
-        else
-        {
-            s = "";
-            editable = FALSE;
-        }
-
-        editable = (read_only == TRUE) ? FALSE : editable;
-
-        // Display negative numbers in red if requested in preferences
-        if (gnc_numeric_negative_p (num) && negative_in_red)
-            g_object_set (cell, "foreground", "red", (gchar*)NULL);
-        else
-            g_object_set (cell, "foreground", NULL, (gchar*)NULL);
-
-        g_object_set (cell, "text", s, "editable", editable, NULL);
-        break;
-
-    case COL_AMTVAL:
-        /* Column is AMOUNT / VALUE */
-        if (is_trow2)
-        {
-            s = "";
-            editable = FALSE;
-        }
-        else if (is_trow1) // Value
-        {
-            if (anchor)
-            {
-                Split *this_split;
-
-                this_split = gtv_sr_get_this_split (view, trans);
-
-                num = xaccTransGetAccountValue (trans, anchor);
-
-                editable = !expanded && !gnc_tree_util_split_reg_is_multi (this_split);
-
-                if (expanded)
-                    s = "";
-                else
-                    s = xaccPrintAmount (num, gnc_commodity_print_info (xaccTransGetCurrency (trans), SHOW_SYMBOL));
-            }
-            else
-            {
-                s = "";
-                editable = FALSE;
-            }
-        }
-
-        if (is_split) // Amount
-        {
-            if (anchor == NULL)
-            {
-                num = xaccSplitGetAmount (split);
-                s = xaccPrintAmount (num, gnc_account_print_info (xaccSplitGetAccount (split), SHOW_SYMBOL));
-                editable = TRUE;
-            }
-            else if (anchor)
-            {
-                gnc_commodity *split_comm;
-                split_comm = xaccAccountGetCommodity (xaccSplitGetAccount (split));
-
-                if (!gnc_commodity_is_currency (split_comm) || (is_blank))
-                {
-                    num = xaccSplitGetAmount (split);
-                    s = xaccPrintAmount (num, gnc_account_print_info (xaccSplitGetAccount (split), SHOW_SYMBOL));
-                    editable = TRUE;
-                }
-            }
-            else
-            {
-                s = "";
-                editable = FALSE;
-            }
-
-            if (gtv_sr_get_imbalance (trans))
-                g_object_set (cell, "cell-background", PINKCELL, (gchar*)NULL);
-        }
-
-        /* Only allow changes to entries if we have a valid split accounts */
-        editable = gtv_sr_have_account (view, depth, expanded, is_template, trans, split);
-
-        editable = (read_only == TRUE) ? FALSE : editable;
-
-        // Display negative numbers in red if requested in preferences
-        if (gnc_numeric_negative_p (num) && negative_in_red)
-            g_object_set (cell, "foreground", "red", (gchar*)NULL);
-        else
-            g_object_set (cell, "foreground", NULL, (gchar*)NULL);
-
-        g_object_set (cell, "text", s, "editable", editable, NULL);
-        break;
-
-    case COL_PRICE:
-        /* Column is PRICE */
-        if (is_trow2)
-        {
-            s = "";
-            editable = FALSE;
-        }
-        else if (is_trow1)
-        {
-            if (expanded)
-            {
-                s = "";
-                editable = FALSE;
-            }
-            else
-            {
-                if (anchor)
-                {
-                    Split *this_split;
-
-                    this_split = gtv_sr_get_this_split (view, trans);
-                    if (this_split != NULL) // this could be a blank split
-                    {
-                        if (gnc_tree_util_split_reg_is_multi (this_split))
-                            num = gnc_numeric_zero();
-                        else
-                            num = xaccSplitGetSharePrice (this_split);
-
-                        editable = !expanded && !gnc_tree_util_split_reg_is_multi (this_split);
-
-                        if (gnc_numeric_check (num) == GNC_ERROR_OK)
-                        {
-                            s = xaccPrintAmount (num, gnc_split_amount_print_info (split, SHOW_SYMBOL));
-                        }
-                        else
-                        {
-                            s = "";
-                            editable = FALSE;
-                        }
-                    }
-                    else
-                    {
-                        s = "";
-                        editable = FALSE;
-                    }
-                }
-            }
-        }
-
-        if (is_split)
-        {
-            gnc_commodity *split_comm;
-            split_comm = xaccAccountGetCommodity (xaccSplitGetAccount (split));
-
-            if (!gnc_commodity_is_currency (split_comm) || (is_blank))
-            {
-                num = xaccSplitGetSharePrice (split);
-
-                if (gnc_numeric_check (num) == GNC_ERROR_OK)
-                {
-                    s = xaccPrintAmount (num, gnc_split_amount_print_info (split, SHOW_SYMBOL));
-                    editable = TRUE;
-                }
-                else
-                {
-                    s = "";
-                    editable = FALSE;
-                }
-            }
-            else
-            {
-                s = "";
-                editable = FALSE;
-            }
-
-            if (gtv_sr_get_imbalance (trans))
-                g_object_set(cell, "cell-background", PINKCELL, (gchar*)NULL);
-        }
-
-        /* Only allow changes to entries if we have a valid split accounts */
-        editable = gtv_sr_have_account (view, depth, expanded, is_template, trans, split);
-
-        editable = (read_only == TRUE) ? FALSE : editable;
-
-        g_object_set (cell, "text", s, "editable", editable, NULL);
-        break;
-
-    case COL_DEBIT:
-    case COL_CREDIT:
-        /* Column is CREDIT and DEBIT */
-        {
-            if (!is_template) // Is this a template
-            {
-                GNCPrintAmountInfo print_info;
-                print_info = gnc_account_print_info (anchor, SHOW_SYMBOL);
-
-                if (is_split)
-                {
-                    if (!gnc_tree_util_split_reg_get_debcred_entry (view, trans, split, is_blank, &num, &print_info))
-                        num = gnc_numeric_zero();
-
-                    editable = TRUE;
-                    if (gtv_sr_get_imbalance (trans))
-                        g_object_set (cell, "cell-background", PINKCELL, (gchar*)NULL);
-                }
-                else if (is_trow1)
-                {
-                    if (anchor)
-                    {
-                         editable = !expanded && !gnc_tree_util_split_reg_is_multi (gtv_sr_get_this_split (view, trans));
-                         num = xaccTransGetAccountAmount (trans, anchor);
-                    }
-                    else
-                    {
-                        editable = FALSE;
-                        num = gnc_numeric_zero();
-                    }
-                }
-                else if (is_trow2)
-                {
-                    editable = FALSE;
-                    num = gnc_numeric_zero();
-                }
-
-                if ((gnc_numeric_check(num) != GNC_ERROR_OK) ||
-                     gnc_numeric_zero_p(num) ||
-                    (gnc_numeric_negative_p(num) && viewcol == COL_DEBIT) ||
-                    (gnc_numeric_positive_p(num) && viewcol == COL_CREDIT))
-                {
-                    s = "";
-                }
-                else
-                {
-                    if ((is_trow1 || is_trow2) && expanded)
-                        s = "";
-                    else
-                        s = xaccPrintAmount (gnc_numeric_abs (num), print_info);
-                }
-            }
-            else
-            {
-                editable = TRUE;
-
-                if (is_trow1 || is_trow2)
-                {
-                    s = "";
-                    editable = FALSE;
-                }
-                else if (is_split && viewcol == COL_DEBIT)
-                    s = gnc_tree_util_split_reg_template_get_fdebt_entry (split);
-                else
-                    s = gnc_tree_util_split_reg_template_get_fcred_entry (split);
-            }
-
-            /* Only allow changes to entries if we have a valid split accounts */
-            editable = gtv_sr_have_account (view, depth, expanded, is_template, trans, split);
-        }
-
-        editable = (read_only == TRUE) ? FALSE : editable;
-
-        g_object_set (cell, "text", s, "editable", editable, NULL);
-        break;
-
-    case COL_BALANCE:
-        /* Column is BALANCE */
-        if (is_split)
-            g_object_set(cell, "cell-background", "white", (gchar*)NULL);
-
-        if (is_trow1 && anchor) {
-            num = xaccTransGetAccountBalance (trans, anchor);
-            if (gnc_reverse_balance (anchor))
-                num = gnc_numeric_neg (num);
-            s = xaccPrintAmount (num, gnc_account_print_info(anchor, FALSE));
-
-            // Display negative numbers in red if requested in preferences
-            if (gnc_numeric_negative_p (num) && negative_in_red)
-                g_object_set (cell, "foreground", "red", (gchar*)NULL);
-            else
-                g_object_set (cell, "foreground", NULL, (gchar*)NULL);
-        } else {
-            s = "";
-        }
-        g_object_set (cell, "text", s, "editable", FALSE, NULL);
-        break;
-
-    case COL_STATUS:
-        /* Column is STATUS */
-        if (read_only && !open_edited)
-            g_object_set(cell, "cell-background", REDCELL, (gchar*)NULL);
-        else if (read_only && open_edited)
-            g_object_set(cell, "cell-background", ORANGECELL, (gchar*)NULL);
-        else if (xaccTransInFutureByPostedDate (trans))
-            g_object_set(cell, "cell-background", BLUECELL, (gchar*)NULL);
-        else
-            g_object_set(cell, "cell-background", BLACKCELL, (gchar*)NULL);
-        break;
-
-    case COL_COMM:
-        /* Column COMMODITY */
-        {
-            gchar *string = NULL;
-            if (is_split)
-            {
-                gnc_commodity *split_com, *txn_com;
-
-                split_com = xaccAccountGetCommodity (xaccSplitGetAccount(split));
-                txn_com = xaccTransGetCurrency (trans);
-                if (split_com == txn_com)
-                   string = g_strconcat (gnc_commodity_get_printname (split_com), "*", NULL);
-                else
-                   string = g_strdup (gnc_commodity_get_printname (split_com));
-            }
-            else
-                string = g_strdup ("");
-
-            g_object_set (cell, "text", string, "editable", FALSE, NULL);
-            g_free (string);
-        }
-        break;
-
-    default:
-        break;
-    }
-    LEAVE("");
-}
-
-
-/* Instead of setting a different cellDataFunc for each column, we just
-   collect everything here for the second cell renderer. */
-static void
-gtv_sr_cdf1 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_model,
-    GtkTreeIter *s_iter, gpointer user_data)
-{
-    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-    GncTreeModelSplitReg *model;
-    GtkTreeIter m_iter;
-    GtkTreePath *spath;
-    ViewCol viewcol;
-    Transaction *trans;
-    Split *split;
-    gboolean is_split, is_blank, is_trow1, is_trow2;
-    gboolean editable = FALSE, expanded = FALSE;
-    gboolean read_only = FALSE;
-    gboolean open_edited = FALSE;
-    gnc_numeric num;
-    const gchar *s = "";
-    const gchar *row_color;
-    RowDepth depth;
-    gint *indices;
-    Account *anchor = view->priv->anchor;
-    char type;
-
-    ENTER("");
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    gtk_tree_model_sort_convert_iter_to_child_iter (GTK_TREE_MODEL_SORT (s_model), &m_iter, s_iter);
-
-    viewcol = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cell), "view_column"));
-
-    g_return_if_fail (gnc_tree_model_split_reg_get_split_and_trans (
-                         GNC_TREE_MODEL_SPLIT_REG (model), &m_iter,
-                          &is_trow1, &is_trow2, &is_split, &is_blank,
-                          &split, &trans));
-
-    spath = gtk_tree_model_get_path (GTK_TREE_MODEL (s_model), s_iter);
-
-    depth = gtk_tree_path_get_depth (spath);
-
-    indices = gtk_tree_path_get_indices (spath);
-
-    row_color = gnc_tree_model_split_reg_get_row_color (model, is_trow1, is_trow2, is_split, indices[0]);
-
-    /* Lets see if the splits are expanded */
-    if (is_trow1 || is_trow2) // transaction
-    {
-        if (is_trow1)
-            gtk_tree_path_down (spath); /* Move the path down to trow2 */
-        expanded = gtk_tree_view_row_expanded (GTK_TREE_VIEW (view), spath);
-    }
-    else
-        expanded = TRUE; // splits are always expanded
-
-    gtk_tree_path_free (spath);
-
-    /* Set the background color / this works for sorting and deleting of transactions */
-    g_object_set (cell, "cell-background", row_color, (gchar*)NULL);
-
-    /* Get the read only model setting */
-    gtk_tree_model_get (GTK_TREE_MODEL (model), &m_iter, GNC_TREE_MODEL_SPLIT_REG_COL_RO, &read_only, -1);
-
-    /* Are we being edited in other register */
-    if (xaccTransIsOpen (trans) && (view->priv->dirty_trans != trans))
-    {
-        read_only = TRUE;
-        open_edited = TRUE;
-    }
-
-    /* Test for a transaction type of invoice, always read only */
-    type = xaccTransGetTxnType (trans);
-    if (model->type == RECEIVABLE_REGISTER2 || model->type == PAYABLE_REGISTER2)
-    {
-        if (((type == TXN_TYPE_INVOICE) || (type == TXN_TYPE_NONE)) && (view->priv->dirty_trans != trans) && !is_blank)
-            read_only = TRUE;
-    }
-
-    switch (viewcol) {
-    case COL_DATE:
-        /* Column is DATE */
-        break;
-
-    case COL_DUEDATE:
-        /* Column is DUE DATE */
-        break;
-
-    case COL_NUMACT:
-        /* Column is NUM / ACT  but relates to NUM */
-        /* Override default alignment */
-        g_object_set (cell, "xalign", 0.0, NULL );
-
-        editable = TRUE;
-
-        if (is_trow1)
-        {
-            /* Get per book option */
-            s = gnc_get_num_action (trans, gtv_sr_get_this_split (view, trans));
-        }
-        else if (is_trow2 && expanded)
-        {
-            /* Get per book option */
-            if (qof_book_use_split_action_for_num_field (gnc_get_current_book()))
-                s = gnc_get_action_num (trans, gtv_sr_get_this_split (view, trans));
-            else
-                s = "";
-            editable = FALSE;
-        }
-        else if (is_trow2 && !expanded)
-        {
-            /* Get per book option */
-            if (qof_book_use_split_action_for_num_field (gnc_get_current_book()))
-            {
-               if (gtv_sr_get_this_split (view, trans) != NULL) // Blank split of blank trans is not child of trans yet.
-                   s = gnc_get_action_num (trans, gtv_sr_get_this_split (view, trans));
-               else
-                   s = "";
-            }
-            else
-            {
-                s = "XY";
-            }
-        }
-        else if (is_split)
-        {
-            s = "XZ";
-        }
-
-        editable = (read_only == TRUE) ? FALSE : editable;
-
-        g_object_set (cell, "text", s, "editable", editable, NULL);
-        break;
-
-    case COL_DESCNOTES:
-        /* Column is DESCRIPTION / NOTES */
-        break;
-
-    case COL_TRANSFERVOID:
-        /* Column is TRANSFER / VOID */
-        break;
-
-    case COL_RECN:
-        /* Column is RECN */
-        break;
-
-    case COL_TYPE:
-        /* Column is TYPE */
-        break;
-
-    case COL_VALUE:
-        /* Column is VALUE */
-        break;
-
-    case COL_RATE:
-        /* Column is RATE */
-        break;
-
-    case COL_AMOUNT:
-        /* Column is AMOUNT */
-        break;
-
-    case COL_AMTVAL:
-        /* Column is AMOUNT / VALUE */
-        break;
-
-    case COL_PRICE:
-        /* Column is PRICE */
-        break;
-
-    case COL_DEBIT:
-    case COL_CREDIT:
-        /* Column is CREDIT and DEBIT */
-        break;
-
-    case COL_BALANCE:
-        /* Column is BALANCE */
-        break;
-
-    case COL_STATUS:
-        /* Column is STATUS */
-        break;
-
-    case COL_COMM:
-        /* Column COMMODITY */
-        break;
-
-    default:
-        break;
-    }
-    LEAVE("");
-}
-
-
-/*###########################################################################*/
-
-/* Returns TRUE if dialog was canceled or discarded.
-   Does nothing if 'new_trans' is the dirty trans. */
-static gboolean
-gtv_sr_transaction_changed_confirm (GncTreeViewSplitReg *view,
-                            Transaction *new_trans)
-{
-    GtkWidget            *dialog, *window;
-    GncTreeModelSplitReg *model;
-    Split                *split;
-    gint response;
-    const char *title = _("Save the changed transaction?");
-    const char *message = _(
-        "The current transaction has changed. Would you like to "
-        "record the changes, or discard the changes?");
-
-    // Look for dirty_trans not being new_trans.
-    if (!view->priv->dirty_trans || view->priv->dirty_trans == new_trans)
-        return FALSE;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    // If using trading accounts, lets scrub them to make them work.
-    if (xaccTransUseTradingAccounts (view->priv->dirty_trans))
-    {
-        Account *default_account = gnc_tree_model_split_reg_get_anchor (model);
-        if (default_account != NULL)
-            xaccTransScrubImbalance (view->priv->dirty_trans, gnc_account_get_root(default_account), NULL);
-        else
-        {
-            Account *root = gnc_book_get_root_account (gnc_get_current_book());
-            xaccTransScrubImbalance (view->priv->dirty_trans, root, NULL);
-        }
-    }
-
-    // Test if the transaction is balanced.
-    if (gnc_tree_control_split_reg_balance_trans (view, view->priv->dirty_trans))
-    {
-        view->priv->trans_confirm = CANCEL;
-        return TRUE;
-    }
-
-    window = gnc_tree_view_split_reg_get_parent (view);
-    dialog = gtk_message_dialog_new (GTK_WINDOW (window),
-                                    GTK_DIALOG_DESTROY_WITH_PARENT,
-                                    GTK_MESSAGE_QUESTION,
-                                    GTK_BUTTONS_NONE,
-                                    "%s", title);
-    gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-                                             "%s", message);
-
-    gtk_dialog_add_buttons (GTK_DIALOG(dialog),_("_Discard Changes"), GTK_RESPONSE_REJECT,
-                            GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-                            _("_Record Changes"), GTK_RESPONSE_ACCEPT, NULL);
-
-    response = gnc_dialog_run (GTK_DIALOG (dialog), GNC_PREF_WARN_REG_TRANS_MOD);
-    gtk_widget_destroy (dialog);
-
-    switch (response)
-    {
-    case GTK_RESPONSE_ACCEPT:
-        g_object_set_data (G_OBJECT (view), "data-edited", GINT_TO_POINTER (FALSE));
-        xaccTransCommitEdit (view->priv->dirty_trans);
-        split = gnc_tree_model_split_get_blank_split (model);
-        xaccSplitReinit (split); // Clear the blank split
-        view->priv->dirty_trans = NULL;
-        view->change_allowed = FALSE;
-        view->priv->auto_complete = FALSE;
-        view->priv->trans_confirm = ACCEPT;
-        return FALSE;
-        break;
-
-    case GTK_RESPONSE_REJECT:
-        if (view->priv->dirty_trans && xaccTransIsOpen (view->priv->dirty_trans))
-        {
-            // Move selection to trans - selection is blocked
-            gnc_tree_control_split_reg_goto_rel_trans_row (view, 0);
-
-            g_object_set_data (G_OBJECT (view), "data-edited", GINT_TO_POINTER (FALSE));
-            xaccTransRollbackEdit (view->priv->dirty_trans);
-            split = gnc_tree_model_split_get_blank_split (model);
-            xaccSplitReinit (split); // Clear the blank split
-            view->change_allowed = FALSE;
-            view->priv->auto_complete = FALSE;
-            view->priv->trans_confirm = DISCARD;
-        }
-        return TRUE;
-        break;
-
-    case GTK_RESPONSE_CANCEL:
-        view->priv->trans_confirm = CANCEL;
-        return TRUE;
-        break;
-
-    default:
-        return FALSE;
-    }
-    return FALSE;
-}
-
-
-/*###########################################################################
-             vvvvv    edit function call backs      vvvvvv
-#############################################################################*/
-static void
-start_edit (GtkCellRenderer *cr, GtkCellEditable *editable,
-           const gchar *path_string, gpointer user_data)
-{
-    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-    GncTreeModelSplitReg *model;
-    GtkTreePath         *path;
-//g_print("\n\nstart_edit\n");
-/*FIXME Not sure if this is required, leave for now ? */
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    gtv_sr_editable_start_editing_cb (cr, editable, path_string, user_data);
-/*    g_signal_connect(G_OBJECT(editable), "editing-done", (GCallback) editing_done_cb, view); */
-
-//FIXME this could be the sort path instead of model path / check !!
-    path = gtk_tree_path_new_from_string (path_string);
-
-//FIXME stuff here...
-
-    gtk_tree_path_free (path);
-
-    return;
-}
-
-
-/* Open Transaction for editing */
-static void
-gtv_sr_begin_edit (GncTreeViewSplitReg *view, Transaction *trans)
-{
-    ENTER("gtv_sr_begin_edit trans %p", trans);
-
-    if (trans != view->priv->dirty_trans)
-    {
-        Timespec ts = {0,0};
-        xaccTransGetDatePostedTS (trans, &ts);
-
-        if (!xaccTransIsOpen (trans))
-            xaccTransBeginEdit (trans);
-        view->priv->dirty_trans = trans;
-
-        if (ts.tv_sec == 0)
-        {
-            //If the time returned by xaccTransGetDatePostedTS is 0 then assume it
-            //is a new transaction and set the time to current time to show current
-            //date on new transactions
-
-            ts.tv_sec = gnc_time (NULL);
-            xaccTransSetDatePostedSecs (trans, ts.tv_sec);
-        }
-    }
-    LEAVE(" ");
-}
-
-
-/* Call back to remove date widget */
-static void
-gtv_sr_remove_edit_date (GtkCellEditable *ce, gpointer user_data)
-{
-    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-    GncPopupEntry *popup_entry;
-    const gchar *new_string; 
-    const gchar *current_string;
-    GDate date;
-    gchar *date_string;
-
-    ENTER("remove edit date and temp cell rend %p", view->priv->temp_cr);
-
-    if (view->priv->temp_cr != NULL)
-    {
-        // These strings are used to determine if cell data was altered so that keynav works better
-        popup_entry = GNC_POPUP_ENTRY (g_object_get_data (G_OBJECT (view->priv->temp_cr), "cell-editable"));
-
-        new_string = gtk_entry_get_text (GTK_ENTRY (popup_entry->entry));
-
-        current_string = g_object_get_data (G_OBJECT (view->priv->temp_cr), "current-string");
-
-        DEBUG("New string is %s and Current_string is %s", new_string, current_string);
-
-        // If editing wasn't canceled and strings don't match then cell data was edited
-        if (!GPOINTER_TO_INT (g_object_get_data (G_OBJECT (view->priv->temp_cr), "edit-canceled"))
-             && g_ascii_strcasecmp (new_string, current_string))
-        {
-            g_object_set_data (G_OBJECT (view), "data-edited", GINT_TO_POINTER (TRUE));
-        }
-
-        /* Lets update the help text */
-        gnc_tree_util_split_reg_parse_date (&date, new_string);
-        date_string = gnc_tree_util_split_reg_get_date_help (&date);
-
-        if (view->help_text)
-            g_free (view->help_text);
-        view->help_text = g_strdup (date_string);
-
-        g_signal_emit_by_name (view, "help_signal", NULL);
-        g_free (date_string);
-
-        g_object_set_data (G_OBJECT (view->priv->temp_cr), "cell-editable", NULL);
-        view->priv->temp_cr = NULL;
-        view->editing_now = FALSE;
-    }
-    LEAVE(" ");
-}
-
-
-/* Call back to remove combo widget */
-static void
-gtv_sr_remove_edit_combo (GtkCellEditable *ce, gpointer user_data)
-{
-    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-    GtkEntry *entry; 
-    const gchar *new_string; 
-    const gchar *current_string;
-
-    ENTER("remove edit combo and temp cell rend %p", view->priv->temp_cr);
-
-    if (view->priv->temp_cr != NULL)
-    {
-        // These strings are used to determine if cell data was altered so that keynav works better
-        entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (g_object_get_data (G_OBJECT (view->priv->temp_cr), "cell-editable"))));
-
-        new_string = gtk_entry_get_text (GTK_ENTRY (entry));
-
-        current_string = g_object_get_data (G_OBJECT (view->priv->temp_cr), "current-string");
-
-        DEBUG("New string is %s and Current_string is %s", new_string, current_string);
-
-        // If editing wasn't canceled and strings don't match then cell data was edited
-        if (!GPOINTER_TO_INT (g_object_get_data (G_OBJECT (view->priv->temp_cr), "edit-canceled"))
-             && g_ascii_strcasecmp (new_string, current_string))
-        {
-            g_object_set_data (G_OBJECT (view), "data-edited", GINT_TO_POINTER (TRUE));
-        }
-
-        g_object_set_data (G_OBJECT (view->priv->temp_cr), "cell-editable", NULL);
-        view->priv->temp_cr = NULL;
-        view->editing_now = FALSE;
-    }
-    LEAVE(" ");
-}
-
-
-/* Call back to remove entry widget */
-static void
-gtv_sr_remove_edit_entry (GtkCellEditable *ce, gpointer user_data)
-{
-    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-    const gchar *new_string; 
-    const gchar *current_string; 
-
-    ENTER("remove edit entry and temp cell rend %p", view->priv->temp_cr);
-
-    if (view->priv->temp_cr != NULL)
-    {
-        // These strings are used to determine if cell data was altered so that keynav works better
-        new_string = gtk_entry_get_text (GTK_ENTRY (g_object_get_data (G_OBJECT (view->priv->temp_cr), "cell-editable")));
-
-        current_string = g_object_get_data (G_OBJECT (view->priv->temp_cr), "current-string");
-
-        DEBUG("New string is %s and Current_string is %s", new_string, current_string);
-
-        // If editing wasn't canceled and strings don't match then cell data was edited
-        if (!GPOINTER_TO_INT (g_object_get_data (G_OBJECT (view->priv->temp_cr), "edit-canceled"))
-             && g_ascii_strcasecmp (new_string, current_string))
-        {
-            g_object_set_data (G_OBJECT (view), "data-edited", GINT_TO_POINTER (TRUE));
-        }
-        if (g_object_get_data (G_OBJECT (view->priv->temp_cr), "current-flag") != NULL) // flag
-            g_object_set_data (G_OBJECT (view->priv->temp_cr), "current-flag", NULL);
-
-        g_object_set_data (G_OBJECT (view->priv->temp_cr), "cell-editable", NULL);
-        view->priv->temp_cr = NULL;
-        view->editing_now = FALSE;
-    }
-    LEAVE(" ");
-}
-
-
-/* Explain: GtkEntry has a cursor that blinks upon
-   g_timeout_dispatch(). It complains if it blinks after the GtkEntry
-   loses focus. So, we can't pop up any dialogs while the blinking
-   cursor is around. The solution is to force the editing to be
-   finished before raising the dialog. That finalizes the
-   gtkcelleditable. */
-static void
-gtv_sr_finish_edit (GncTreeViewSplitReg *view)
-{
-    GtkCellEditable *ce;
-
-    if (view->priv->temp_cr == NULL)
-        return;
-
-    DEBUG("gtv_sr_finish_edit temp_cr is %p", view->priv->temp_cr);
-
-    if ((ce = GTK_CELL_EDITABLE (g_object_get_data (G_OBJECT (view->priv->temp_cr), "cell-editable"))))
-    {
-        DEBUG("gtv_sr_finish_edit - editing_done");
-        gtk_cell_editable_editing_done (ce);
-        gtk_cell_editable_remove_widget (ce);
-    }
-}
-
-
-/* This is used in g_idle_add to finish an edit */
-static gboolean
-gtv_sr_idle_finish_edit (GncTreeViewSplitReg *view)
-{
-   gtv_sr_finish_edit (view);
-   return FALSE;
-}
-
-
-/* This is used in g_idle_add to cancel an edit */
-static gboolean
-gtv_sr_idle_cancel_edit (GtkCellRenderer *cr)
-{
-    GtkCellEditable *ce;
-
-    gtk_cell_renderer_stop_editing (cr, TRUE);
-
-    ce = GTK_CELL_EDITABLE (g_object_get_data (G_OBJECT (cr), "cell-editable"));
-    gtk_cell_editable_editing_done (ce);
-    gtk_cell_editable_remove_widget (ce);
-
-   return FALSE;
-}
-
-/* This is used in g_idle_add to repopulate the transfer cell */
-static gboolean
-gtv_sr_idle_transfer (GncTreeViewSplitReg *view)
-{
-    GtkTreePath *spath;
-    GList *columns;
-    GList  *column;
-    gint i;
-
-    spath = gnc_tree_view_split_reg_get_current_path (view);
-    columns = gtk_tree_view_get_columns (GTK_TREE_VIEW (view));
-
-    for (column = columns, i = 1; column; column = g_list_next (column), i++)
-    {
-        GList *renderers;
-        GtkCellRenderer *cr0;
-        GtkTreeViewColumn *tvc;
-        ViewCol viewcol;
-
-        tvc = column->data;
-
-        // Get the first renderer, it has the view-column value.
-        renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (tvc));
-        cr0 = g_list_nth_data (renderers, 0);
-        g_list_free (renderers);
-
-        viewcol = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cr0), "view_column"));
-
-        if (viewcol == COL_TRANSFERVOID)
-            gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), spath, tvc, TRUE);
-    }
-    g_list_free (columns);
-    gtk_tree_path_free (spath);
-    return FALSE;
-}
-
-/*###########################################################################*/
-
-/* Set the column titles based on register type and depth */
-static void
-gtv_sr_titles (GncTreeViewSplitReg *view, RowDepth depth)
-{
-    GncTreeModelSplitReg *model;
-    GtkCellRenderer *cr0;
-    GList *renderers;
-    GList *columns;
-    GList  *column;
-    gint i;
-    RowDepth temp_depth;
-    gboolean is_template;
-
-    ENTER("title depth is %d and sort_depth %d, sort_col is %d", depth, view->sort_depth, view->sort_col);
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-    columns = gtk_tree_view_get_columns (GTK_TREE_VIEW (view));
-
-    is_template = gnc_tree_model_split_reg_get_template (model);
-
-    for (column = columns, i = 1; column; column = g_list_next (column), i++)
-    {
-        GtkTreeViewColumn *tvc;
-        ViewCol viewcol;
-
-        tvc = column->data;
-
-        // Get the first renderer, it has the view-column value.
-        renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (tvc));
-        cr0 = g_list_nth_data (renderers, 0);
-        g_list_free (renderers);
-
-        viewcol = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cr0), "view_column"));
-
-        DEBUG("viewcol is %d", viewcol);
-
-        switch (viewcol)
-        {
-        case COL_DATE:
-            switch (model->type)
-            {
-            default: //FIXME These if statements may not be required
-                /* Display arrows if we are sorting on this row */
-                if (view->sort_depth == depth && view->sort_col == viewcol)
-                    gtk_tree_view_column_set_sort_indicator (tvc, TRUE);
-                else
-                    gtk_tree_view_column_set_sort_indicator (tvc, FALSE);
-
-                if (depth == TRANS1)
-                    gtk_tree_view_column_set_title (tvc, _("Date Posted"));
-                else if (depth == TRANS2)
-                    gtk_tree_view_column_set_title (tvc, _("Date Entered"));
-                else if (depth == SPLIT3)
-                    gtk_tree_view_column_set_title (tvc, _("Date Reconciled"));
-                else
-                    gtk_tree_view_column_set_title (tvc, _("Date Posted / Entered / Reconciled"));
-                break;
-            }
-            break;
-
-        case COL_DUEDATE:
-            switch (model->type)
-            {
-            default: //FIXME These if statements may not be required
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                    gtk_tree_view_column_set_title (tvc, _("Due Date"));
-                break;
-            }
-            break;
-
-        case COL_NUMACT:
-            switch (model->type)
-            {
-            case RECEIVABLE_REGISTER2:
-            case PAYABLE_REGISTER2:
-                if (depth == TRANS1)
-                    gtk_tree_view_column_set_title (tvc, _("Reference"));
-                else if (depth == TRANS2)
-                    gtk_tree_view_column_set_title (tvc, _("Action"));
-                else if (depth == SPLIT3)
-                    gtk_tree_view_column_set_title (tvc, _("Action"));
-                else
-                    gtk_tree_view_column_set_title (tvc, _("Reference / Action"));
-                break;
-
-
-            default:
-                /* Display arrows if we are sorting on this row */
-                if (view->sort_depth == depth && view->sort_col == viewcol)
-                    gtk_tree_view_column_set_sort_indicator (tvc, TRUE);
-                else
-                    gtk_tree_view_column_set_sort_indicator (tvc, FALSE);
-
-                if (depth == TRANS1)
-                    gtk_tree_view_column_set_title (tvc, _("Number"));
-                else if (depth == TRANS2 && (qof_book_use_split_action_for_num_field (gnc_get_current_book())))
-                    gtk_tree_view_column_set_title (tvc, _("T-Number"));
-                else if (depth == TRANS2 && (!qof_book_use_split_action_for_num_field (gnc_get_current_book())))
-                    gtk_tree_view_column_set_title (tvc, _("Action"));
-                else if (depth == SPLIT3)
-                    gtk_tree_view_column_set_title (tvc, _("Action"));
-                else
-                    gtk_tree_view_column_set_title (tvc, _("Number / Action"));
-                break;
-            }
-            break;
-
-        case COL_DESCNOTES:
-            switch (model->type)
-            {
-            case RECEIVABLE_REGISTER2:
-                if (depth == TRANS1)
-                    gtk_tree_view_column_set_title (tvc, _("Customer"));
-                else if (depth == TRANS2)
-                    gtk_tree_view_column_set_title (tvc, _("Memo"));
-                else if (depth == SPLIT3)
-                    gtk_tree_view_column_set_title (tvc, _("Memo"));
-                else
-                    gtk_tree_view_column_set_title (tvc, _("Customer / Memo"));
-                break;
-
-            case PAYABLE_REGISTER2:
-                if (depth == TRANS1)
-                    gtk_tree_view_column_set_title (tvc, _("Vendor"));
-                else if (depth == TRANS2)
-                    gtk_tree_view_column_set_title (tvc, _("Memo"));
-                else if (depth == SPLIT3)
-                    gtk_tree_view_column_set_title (tvc, _("Memo"));
-                else
-                    gtk_tree_view_column_set_title (tvc, _("Vendor / Memo"));
-                break;
-
-
-            default:
-                /* Display arrows if we are sorting on this row */
-                if (view->sort_depth == depth && view->sort_col == viewcol)
-                    gtk_tree_view_column_set_sort_indicator (tvc, TRUE);
-                else
-                    gtk_tree_view_column_set_sort_indicator (tvc, FALSE);
-
-                if (depth == TRANS1)
-                    gtk_tree_view_column_set_title (tvc, _("Description"));
-                else if (depth == TRANS2)
-                    gtk_tree_view_column_set_title (tvc, _("Notes"));
-                else if (depth == SPLIT3)
-                    gtk_tree_view_column_set_title (tvc, _("Memo"));
-                else
-                    gtk_tree_view_column_set_title (tvc, _("Description / Notes / Memo"));
-                break;
-            }
-            break;
-
-        case COL_TRANSFERVOID:
-            switch (model->type)
-            {
-            case RECEIVABLE_REGISTER2:
-            case PAYABLE_REGISTER2:
-                if (depth == TRANS1)
-                    gtk_tree_view_column_set_title (tvc, _("Accounts"));
-                else if (depth == TRANS2)
-                    gtk_tree_view_column_set_title (tvc, _("Accounts"));
-                else if (depth == SPLIT3)
-                    gtk_tree_view_column_set_title (tvc, _("Accounts"));
-                else
-                    gtk_tree_view_column_set_title (tvc, _("Accounts"));
-                break;
-
-            default:
-                /* Display arrows if we are sorting on this row */
-                if (view->sort_depth == depth && view->sort_col == viewcol)
-                    gtk_tree_view_column_set_sort_indicator (tvc, TRUE);
-                else
-                    gtk_tree_view_column_set_sort_indicator (tvc, FALSE);
-
-                if (depth == TRANS1)
-                    gtk_tree_view_column_set_title (tvc, _("Accounts"));
-                else if (depth == TRANS2)
-                    gtk_tree_view_column_set_title (tvc, _("Void Reason"));
-                else if (depth == SPLIT3)
-                    gtk_tree_view_column_set_title (tvc, _("Accounts"));
-                else
-                    gtk_tree_view_column_set_title (tvc, _("Accounts / Void Reason"));
-                break;
-            }
-            break;
-
-        case COL_RECN:
-            switch (model->type)
-            {
-            default: //FIXME These if statements may not be required
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                    gtk_tree_view_column_set_title (tvc, _("R"));
-                break;
-            }
-            break;
-
-        case COL_TYPE:
-            switch (model->type)
-            {
-            default: //FIXME These if statements may not be required
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                    gtk_tree_view_column_set_title (tvc, _("Type"));
-                break;
-            }
-            break;
-
-        case COL_VALUE:
-            switch (model->type)
-            {
-            default: //FIXME These if statements may not be required
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                    gtk_tree_view_column_set_title (tvc, _("Value"));
-                break;
-            }
-            break;
-
-        case COL_AMOUNT:
-            switch (model->type)
-            {
-            default: //FIXME These if statements may not be required
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                    gtk_tree_view_column_set_title (tvc, _("Amount"));
-                break;
-            }
-            break;
-
-        case COL_AMTVAL:
-            switch (model->type)
-            {
-            default:
-                if (depth == TRANS1 || depth == TRANS2)
-                    gtk_tree_view_column_set_title (tvc, _("Value"));
-                else if (depth == SPLIT3)
-                    gtk_tree_view_column_set_title (tvc, _("Amount"));
-                else
-                    gtk_tree_view_column_set_title (tvc, _("Amount / Value"));
-                break;
-            }
-            break;
-
-        case COL_COMM:
-            switch (model->type)
-            {
-            default: //FIXME These if statements may not be required
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                    gtk_tree_view_column_set_title (tvc, _("Commodity"));
-                break;
-            }
-            break;
-
-        case COL_RATE:
-            switch (model->type)
-            {
-            default: //FIXME These if statements may not be required
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                    gtk_tree_view_column_set_title (tvc, _("Rate"));
-                break;
-            }
-            break;
-
-        case COL_PRICE:
-            switch (model->type)
-            {
-            default: //FIXME These if statements may not be required
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                    gtk_tree_view_column_set_title (tvc, _("Price"));
-                break;
-            }
-            break;
-
-        case COL_CREDIT:
-            if(!(model->use_accounting_labels))
-            {
-                switch (model->type)
-                {
-                case BANK_REGISTER2: //FIXME These if statements may not be required
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Withdrawal"));
-                    break;
-
-                case CASH_REGISTER2:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Spend"));
-                    break;
-
-                case ASSET_REGISTER2:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Decrease"));
-                    break;
-
-                case LIABILITY_REGISTER2:
-                case EQUITY_REGISTER2:
-                case TRADING_REGISTER2:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Increase"));
-                    break;
-
-                case CREDIT_REGISTER2:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Charge"));
-                    break;
-
-                case INCOME_REGISTER2:
-                case INCOME_LEDGER2:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Income"));
-                    break;
-
-                case EXPENSE_REGISTER2:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Rebate"));
-                    break;
-
-                case STOCK_REGISTER2:
-                case CURRENCY_REGISTER2:
-                case PORTFOLIO_LEDGER2:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Sell"));
-                    break;
-
-                case RECEIVABLE_REGISTER2:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Payment"));
-                    break;
-
-                case PAYABLE_REGISTER2:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Bill"));
-                    break;
-
-                case GENERAL_LEDGER2:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Funds Out"));
-                    break;
-
-                case SEARCH_LEDGER2:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                {
-                    if (!is_template)
-                        gtk_tree_view_column_set_title (tvc, _("Funds Out"));
-                    else
-                        gtk_tree_view_column_set_title (tvc, _("Credit Formula"));
-                }
-                    break;
-
-                default:
-                    if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Credit"));
-                    break;
-                }
-            }
-            else
-                gtk_tree_view_column_set_title (tvc, _("Credit"));
-            break;
-
-        case COL_DEBIT:
-            if(!(model->use_accounting_labels))
-            {
-                switch (model->type)
-                {
-                case BANK_REGISTER2: //FIXME These if statements may not be required
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Deposit"));
-                    break;
-
-                case CASH_REGISTER2:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Receive"));
-                    break;
-
-                case ASSET_REGISTER2:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Increase"));
-                    break;
-
-                case LIABILITY_REGISTER2:
-                case EQUITY_REGISTER2:
-                case TRADING_REGISTER2:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Decrease"));
-                    break;
-
-                case INCOME_REGISTER2:
-                case INCOME_LEDGER2:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Charge"));
-                    break;
-
-                case EXPENSE_REGISTER2:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Expense"));
-                    break;
-
-                case STOCK_REGISTER2:
-                case CURRENCY_REGISTER2:
-                case PORTFOLIO_LEDGER2:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Buy"));
-                    break;
-
-                case RECEIVABLE_REGISTER2:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Invoice"));
-                    break;
-
-                case CREDIT_REGISTER2:
-                case PAYABLE_REGISTER2:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Payment"));
-                    break;
-
-                case GENERAL_LEDGER2:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Funds In"));
-                    break;
-
-                case SEARCH_LEDGER2:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                {
-                    if (!is_template)
-                        gtk_tree_view_column_set_title (tvc, _("Funds In"));
-                    else
-                        gtk_tree_view_column_set_title (tvc, _("Debit Formula"));
-                }
-                    break;
-
-                default:
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                        gtk_tree_view_column_set_title (tvc, _("Debit"));
-                    break;
-                }
-            }
-            else
-                gtk_tree_view_column_set_title (tvc, _("Debit"));
-            break;
-
-        case COL_BALANCE:
-            switch (model->type)
-            {
-            default: //FIXME These if statements may not be required
-                if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                    gtk_tree_view_column_set_title (tvc, _("Balance"));
-                break;
-            }
-            break;
-
-        default:
-            break;
-        }
-    }
-    LEAVE(" ");
-    g_list_free (columns);
-}
-
-
-/* Update the help text */
-static void
-gtv_sr_help (GncTreeViewSplitReg *view, GtkCellRenderer *cr, ViewCol viewcol, RowDepth depth)
-{
-    GncTreeModelSplitReg *model;
-    gchar *help = NULL;
-    const gchar *current_string;
-
-    ENTER("Help Viewcol is %d and depth is %d", viewcol, depth);
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    switch (viewcol)
-    {
-    case COL_DATE:
-        switch (model->type)
-        {
-        default: //FIXME These if statements may not be required
-            if (depth == TRANS1)
-            {
-                GDate date;
-
-                current_string = g_object_get_data (G_OBJECT (cr), "current-string");
-                g_date_set_parse (&date, current_string);
-                help = gnc_tree_util_split_reg_get_date_help (&date);
-            }
-            else
-                help = g_strdup (" ");
-            break;
-        }
-        break;
-
-    case COL_DUEDATE:
-        switch (model->type)
-        {
-        default: //FIXME These if statements may not be required
-            if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                help = g_strdup (_("Enter Due Date"));
-            break;
-        }
-        break;
-
-    case COL_NUMACT:
-        switch (model->type)
-        {
-        case RECEIVABLE_REGISTER2:
-        case PAYABLE_REGISTER2:
-            if (depth == TRANS1)
-                help = g_strdup (_("Enter the transaction reference, such as the invoice or check number"));
-            else if (depth == TRANS2 || depth == SPLIT3)
-                help = g_strdup (_("Enter the type of transaction, or choose one from the list"));
-            break;
-
-        default:
-            if (depth == TRANS1)
-                help = g_strdup (_("Enter the transaction number, such as the check number"));
-            else if (depth == TRANS2 || depth == SPLIT3)
-                help = g_strdup (_("Enter the type of transaction, or choose one from the list"));
-            break;
-        }
-        break;
-
-    case COL_DESCNOTES:
-        switch (model->type)
-        {
-        case RECEIVABLE_REGISTER2:
-            if (depth == TRANS1)
-                help = g_strdup (_("Enter the name of the Customer"));
-            else if (depth == TRANS2)
-                help = g_strdup (_("Enter notes for the transaction"));
-            else if (depth == SPLIT3)
-                help = g_strdup (_("Enter a description of the split"));
-            break;
-
-        case PAYABLE_REGISTER2:
-            if (depth == TRANS1)
-                help = g_strdup (_("Enter the name of the Vendor"));
-            else if (depth == TRANS2)
-                help = g_strdup (_("Enter notes for the transaction"));
-            else if (depth == SPLIT3)
-                help = g_strdup (_("Enter a description of the split"));
-            break;
-
-        default:
-            if (depth == TRANS1)
-                help = g_strdup (_("Enter a description of the transaction"));
-            else if (depth == TRANS2)
-                help = g_strdup (_("Enter notes for the transaction"));
-            else if (depth == SPLIT3)
-                help = g_strdup (_("Enter a description of the split"));
-            break;
-        }
-        break;
-
-    case COL_TRANSFERVOID:
-        switch (model->type)
-        {
-        default:
-            if (depth == TRANS1)
-                help = g_strdup (_("Enter the account to transfer from, or choose one from the list"));
-            else if (depth == TRANS2)
-                help = g_strdup (_("Reason the transaction was voided"));
-            else if (depth == SPLIT3)
-                help = g_strdup (_("Enter the account to transfer from, or choose one from the list"));
-            break;
-        }
-        break;
-
-    case COL_RECN:
-        switch (model->type)
-        {
-        default: //FIXME These if statements may not be required
-            if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                help = g_strdup (_("Enter the reconcile type"));
-            break;
-        }
-        break;
-
-    case COL_TYPE:
-        switch (model->type)
-        {
-        default: //FIXME These if statements may not be required
-            if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                help = g_strdup (_("Enter the type of transaction"));
-            break;
-        }
-        break;
-
-    case COL_VALUE:
-        switch (model->type)
-        {
-        default: //FIXME These if statements may not be required
-            if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                help = g_strdup (_("Enter the value of shares bought or sold"));
-            break;
-        }
-        break;
-
-    case COL_AMOUNT:
-        switch (model->type)
-        {
-        default: //FIXME These if statements may not be required
-            if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                help = g_strdup (_("Enter the number of shares bought or sold"));
-            break;
-        }
-        break;
-
-    case COL_AMTVAL:
-        switch (model->type)
-        {
-        default:
-            if ((depth == TRANS1) || (depth == TRANS2))
-                help = g_strdup (_("Enter the value of shares bought or sold"));
-            else if (depth == SPLIT3)
-                help = g_strdup (_("Enter the number of shares bought or sold"));
-            break;
-        }
-        break;
-
-    case COL_COMM:
-        switch (model->type)
-        {
-        default: //FIXME These if statements may not be required
-            if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                help = g_strdup (_("* Indicates the transaction Commodity."));
-            break;
-        }
-        break;
-
-    case COL_RATE:
-        switch (model->type)
-        {
-        default: //FIXME These if statements may not be required
-            if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                help = g_strdup (_("Enter the rate"));
-            break;
-        }
-        break;
-
-    case COL_PRICE:
-        switch (model->type)
-        {
-        default: //FIXME These if statements may not be required
-            if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                help = g_strdup (_("Enter the effective share price"));
-            break;
-        }
-        break;
-
-    case COL_CREDIT:
-        switch (model->type)
-        {
-        default: //FIXME These if statements may not be required
-            if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                help = g_strdup (_("Enter credit formula for real transaction"));
-            break;
-        }
-        break;
-
-    case COL_DEBIT:
-        switch (model->type)
-        {
-        default: //FIXME These if statements may not be required
-            if (depth == TRANS1 || depth == TRANS2 || depth == SPLIT3)
-                help = g_strdup (_("Enter debit formula for real transaction"));
-            break;
-        }
-        break;
-
-    default:
-            help = g_strdup (" ");
-        break;
-    }
-
-    LEAVE("Help text is - %s", help);
-    if (view->help_text)
-        g_free (view->help_text);
-    view->help_text = g_strdup (help);
-    g_free (help);
-    g_signal_emit_by_name (view, "help_signal", NULL);
-}
-
-/*###########################################################################*/
-
-/* Move the selection to the blank split when expanded */
-static gboolean
-gtv_sr_selection_to_blank (GncTreeViewSplitReg *view)
-{
-    GncTreeModelSplitReg *model;
-    GtkTreePath *bpath, *spath;
-    Split *bsplit;
-
-    /* give gtk+ a chance to handle pending events */
-    while (gtk_events_pending ())
-        gtk_main_iteration ();
-
-    /* Make sure we have expanded splits */
-    if (view->priv->expanded == FALSE)
-        return FALSE;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    bsplit = gnc_tree_model_split_get_blank_split (model);
-    bpath =  gnc_tree_model_split_reg_get_path_to_split_and_trans (model, bsplit, NULL);
-
-    spath = gnc_tree_view_split_reg_get_sort_path_from_model_path (view, bpath);
-
-    /* Set cursor to new spath */
-    gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), spath, NULL, FALSE);
-
-    gtk_tree_path_free (bpath);
-    gtk_tree_path_free (spath);
-
-    return FALSE;
-}
-
-
-/* Call back for when a change to a Transaction requires the selection to get out of the way */
-static void
-gtv_sr_selection_move_delete_cb (GncTreeModelSplitReg *model, gpointer item, gpointer user_data)
-{
-    GncTreeViewSplitReg *view = user_data;
-    Transaction *trans = item;
-
-    DEBUG("gtv_sr_selection_move_delete_cb view %p model %p trans %p", view, model, trans);
-
-    DEBUG("gtv_sr_selection_move_delete_cb current_trans %p trans %p", view->priv->current_trans, trans);
-
-    /* if same, lets get out of the way, so move */
-    if (trans == view->priv->current_trans)
-        gnc_tree_control_split_reg_goto_rel_trans_row (view, 1);
-
-}
-
-
-/* Call back for focus out event so we can finish edit */
-static gboolean
-gtv_sr_focus_out_cb (GtkWidget *widget, GdkEventFocus *event, gpointer user_data)
-{
-    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-
-    gnc_tree_view_split_reg_finish_edit (view);
-
-    return FALSE;
-}
-
-
-/* Reconcile column tests */
-static gboolean
-gtv_sr_recn_tests (GncTreeViewSplitReg *view, GtkTreeViewColumn *column, GtkTreePath *spath)
-{
-    GtkCellRenderer *cr0;
-    GList *renderers;
-    ViewCol viewcol;
-
-    ENTER(" ");
-
-    // Get the first renderer, it has the view-column value.
-    renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (column));
-    cr0 = g_list_nth_data (renderers, 0);
-    g_list_free (renderers);
-
-    viewcol = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cr0), "view_column"));
-
-    /* Test for change of RECN COLUMN setting from reconciled */
-    if (viewcol == COL_RECN)
-    {
-        /* Are we trying to change the reconcile setting */
-        if (!gnc_tree_control_split_reg_recn_change (view, spath))
-        {
-            LEAVE("Not allowed to change reconciled transaction");
-            return TRUE;
-        }
-    }
-
-    /* Ask, are we allowed to change reconciled values other than 'description / notes / memo'
-       which we can change always */
-    if (viewcol != COL_DESCNOTES && viewcol != COL_RECN)
-    {
-        if (!gnc_tree_control_split_reg_recn_test (view, spath))
-        {
-            LEAVE("Not allowed to edit reconciled transaction");
-            return TRUE;
-        }
-    }
-    LEAVE(" ");
-    return FALSE;
-}
-
-
-/* Test to see if we need to do a move */
-static void
-gtv_split_reg_test_for_move (GncTreeModelSplitReg *model, GtkTreePath *spath)
-{
-    gint num_of_trans, trans_pos;
-    gint *indices;
-
-    indices = gtk_tree_path_get_indices (spath);
-    num_of_trans = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (model), NULL);
-
-    trans_pos = indices[0];
-
-    if (trans_pos < num_of_trans*1/3)
-        gnc_tree_model_split_reg_move (model, VIEW_UP);
-
-    if (trans_pos > num_of_trans*2/3)
-        gnc_tree_model_split_reg_move (model, VIEW_DOWN);
-}
-
-/*###########################################################################*/
-
-/* This is the callback for the mouse click */
-static gboolean
-gtv_sr_button_cb (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
-{
-    GncTreeViewSplitReg  *view = GNC_TREE_VIEW_SPLIT_REG (widget);
-    GncTreeModelSplitReg *model;
-    GtkTreePath *mpath, *spath;
-    GtkTreeViewColumn    *col;
-    ViewCol viewcol;
-    GtkTreeIter m_iter;
-    Split *split = NULL;
-    Split *rotate_split = NULL;
-    Transaction *trans = NULL;
-    gboolean is_trow1, is_trow2, is_split, is_blank;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    /* This is for a single click */
-    if (event->button == 1 && event->type == GDK_BUTTON_PRESS)
-    {
-        GdkWindow *window = gtk_tree_view_get_bin_window (GTK_TREE_VIEW (view));
-
-        if (event->window != window)
-            return FALSE;
-
-        // Make sure we have stoped editing.
-        gnc_tree_view_split_reg_finish_edit (view);
-
-        // This prevents the cell changing.
-        if (view->priv->stop_cell_move == TRUE)
-            return TRUE;
-
-        /* Get tree path for row that was clicked, true if row exists */
-        if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (view), (gint) event->x, (gint) event->y,
-                                             &spath, &col, NULL, NULL))
-        {
-            DEBUG("event->x is %d and event->y is %d", (gint)event->x, (gint)event->y);
-
-            mpath = gnc_tree_view_split_reg_get_model_path_from_sort_path (view, spath);
-
-            /* This is to block the single click on a double click */
-            if (view->priv->single_button_press > 0)
-            {
-                view->priv->single_button_press = view->priv->single_button_press -1;
-                return TRUE;
-            }
-
-            if (gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &m_iter, mpath))
-            {
-                gchar *mstring, *sstring;
-                mstring = gtk_tree_path_to_string (mpath);
-                sstring = gtk_tree_path_to_string (spath);
-                DEBUG("Mouse Button Press - mpath is %s, spath is %s", mstring, sstring);
-                g_free (mstring);
-                g_free (sstring);
-
-                // Reset the transaction confirm flag.
-                view->priv->trans_confirm = RESET;
-
-                gnc_tree_model_split_reg_get_split_and_trans (
-                       GNC_TREE_MODEL_SPLIT_REG (model), &m_iter, &is_trow1, &is_trow2, &is_split, &is_blank, &split, &trans);
-
-                // Ask for confirmation if data has been edited, gtv_sr_transaction_changed_confirm return TRUE if canceled
-                if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (view), "data-edited")) && gtv_sr_transaction_changed_confirm (view, trans))
-                {
-                    DEBUG("MB - Restore position - Cancel / Discard");
-
-                    /* Restore position - Cancel / Discard */
-                    if (view->priv->trans_confirm == CANCEL)
-                    {
-                        DEBUG("MB - Cancel");
-
-                        // Expand trans on split-trans (We only expand on cancel and more than two splits)
-                        if ((xaccTransCountSplits (view->priv->dirty_trans) > 2) && view->priv->dirty_trans != NULL)
-                        {
-                            // Jump to the first split of dirty_trans.
-                            gnc_tree_control_split_reg_jump_to (view, NULL, xaccTransGetSplit (view->priv->dirty_trans, 0), FALSE);
-                        }
-                        else
-                            // Jump to the dirty_trans.
-                            gnc_tree_control_split_reg_jump_to (view, view->priv->dirty_trans, NULL, FALSE);
-
-                        gtk_tree_path_free (spath);
-                        gtk_tree_path_free (mpath);
-                        return TRUE;
-                    }
-
-                    if (view->priv->trans_confirm == DISCARD)
-                    {
-                        DEBUG("MB - Discard");
-                        view->priv->dirty_trans = NULL;
-                    }
-                }
-                /* Skip */
-
-                /* Test for change of transaction */
-                if (view->priv->current_trans != trans)
-                    /* Reset allow changes for reconciled transactions */
-                    view->change_allowed = FALSE;
-
-                // Reconcile tests
-                if (gtv_sr_recn_tests (view, col, spath))
-                {
-                    gtk_tree_path_free (spath);
-                    gtk_tree_path_free (mpath);
-                    return TRUE;
-                }
-
-                // Get the right split for rotate test
-                if (is_split)
-                    rotate_split = split;
-                else
-                    rotate_split = gtv_sr_get_this_split (view, trans);
-
-                /* Set cursor to column */
-                if (!gnc_tree_util_split_reg_rotate (view, col, trans, rotate_split))
-                    gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), spath, col, TRUE);
-                else
-                    gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), spath, col, FALSE);
-
-                /* Test to see if we need to do a move */
-                gtv_split_reg_test_for_move (model, spath);
-
-                gtk_tree_path_free (spath);
-                gtk_tree_path_free (mpath);
-                return TRUE;
-            }
-            gtk_tree_path_free (spath);
-            gtk_tree_path_free (mpath);
-        }
-    }
-
-    /* This is for a double click */
-    if (event->button == 1 && event->type == GDK_2BUTTON_PRESS)
-    {
-        GdkWindow *window = gtk_tree_view_get_bin_window (GTK_TREE_VIEW (view));
-
-        if (event->window != window)
-            return FALSE;
-
-        /* this works on non editable cells like void, balance */
-        if (model->style != REG2_STYLE_JOURNAL)
-        {
-            /* This is to block the single click on a double click */
-            view->priv->single_button_press = 1;
-
-            if (view->priv->expanded)
-                gnc_tree_view_split_reg_collapse_trans (view, NULL);
-            else
-                gnc_tree_view_split_reg_expand_trans (view, NULL);
-
-            /* This updates the plugin page gui */
-            gnc_tree_view_split_reg_call_uiupdate_cb(view);
-        }
-        return TRUE;
-    }
-    return FALSE;
-}
-
-
-static gboolean
-gtv_sr_transaction_changed (GncTreeViewSplitReg *view)
-{
-    GncTreeModelSplitReg *model;
-    GtkTreeViewColumn *col;
-    GtkTreePath *spath;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    // spath is where we are...
-    gtk_tree_view_get_cursor (GTK_TREE_VIEW (view), &spath, &col);
-
-    if (!spath)
-        return FALSE;
-
-    if (gtv_sr_recn_tests (view, col, spath))
-    {
-        gtk_tree_path_free (spath);
-        return FALSE;
-    }
-    gtk_tree_path_free (spath);
-
-    // Reset the transaction confirm flag.
-    view->priv->trans_confirm = RESET;
-
-    //Ask for confirmation if data has been edited, gtv_sr_transaction_changed_confirm return TRUE if canceled
-    if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (view), "data-edited")) && gtv_sr_transaction_changed_confirm (view, NULL))
-    {
-        /* Restore position - Cancel / Discard */
-        DEBUG("KB - Restore position - Cancel / Discard");
-
-        if (view->priv->trans_confirm == CANCEL)
-        {
-            DEBUG("KB - Cancel");
-
-            // Expand trans on split-trans (We only expand on cancel)
-            if ((xaccTransCountSplits (view->priv->dirty_trans) > 2) && view->priv->dirty_trans != NULL)
-            {
-                // Jump to the first split of dirty_trans.
-                gnc_tree_control_split_reg_jump_to (view, NULL, xaccTransGetSplit (view->priv->dirty_trans, 0), FALSE);
-            }
-            else
-                // Jump to the dirty_trans.
-                gnc_tree_control_split_reg_jump_to (view, view->priv->dirty_trans, NULL, FALSE);
-
-            return TRUE;
-        }
-
-        if (view->priv->trans_confirm == DISCARD)
-        {
-            DEBUG("KB - Discard");
-
-            gnc_tree_view_split_reg_block_selection (view, TRUE);
-
-            // Check to see if dirty_trans expanded, collapse it.
-            if (gnc_tree_view_split_reg_trans_expanded (view, view->priv->dirty_trans))
-                gnc_tree_view_split_reg_collapse_trans (view, view->priv->dirty_trans);
-
-            gnc_tree_view_split_reg_block_selection (view, FALSE);
-
-            /* Remove the blank split and re-add - done so we keep it last in list */
-            gnc_tree_model_split_reg_set_blank_split_parent (model, view->priv->dirty_trans, TRUE);
-            gnc_tree_model_split_reg_set_blank_split_parent (model, view->priv->dirty_trans, FALSE);
-
-            // Set the transaction to show correct view
-            gnc_tree_view_split_reg_format_trans (view, view->priv->dirty_trans);
-            view->priv->dirty_trans = NULL;
-        }
-    }
-    return FALSE;
-}
-
-
-/* Return whether the cell is in editing mode */
-static gboolean
-gtv_sr_get_editing (GtkTreeViewColumn *col)
-{
-    GtkCellRenderer *cr0 = NULL, *cr1 = NULL;
-    GList *renderers;
-    gboolean cell_editing0 = FALSE;
-    gboolean cell_editing1 = FALSE;
-    gboolean editing = FALSE;
-
-    renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (col));
-    cr0 = g_list_nth_data (renderers, 0); // We always have one renderer
-    if (g_list_length (renderers) == 2)
-        cr1 = g_list_nth_data (renderers, 1); // There is only one column with two renderers
-    g_list_free (renderers);
-
-    if (gtk_cell_renderer_get_visible (cr0))
-        g_object_get (G_OBJECT (cr0), "editing", &cell_editing0, NULL);
-
-    if (cr1 && gtk_cell_renderer_get_visible (cr1))
-        g_object_get (G_OBJECT (cr1), "editing", &cell_editing1, NULL);
-
-    if (cell_editing0 || cell_editing1)
-        editing = TRUE;
-
-    DEBUG("editing is %d for column title %s", editing, gtk_tree_view_column_get_title (col));
-
-    return editing;
-}
-
-
-/* For handling keynav */
-static gboolean
-gtv_sr_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer user_data)
-{
-    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (widget);
-    GncTreeModelSplitReg *model;
-    GtkTreeViewColumn *col;
-    GtkTreePath *spath, *start_spath;
-    GtkTreePath *start_path, *end_path;
-    gboolean editing = FALSE;
-    gboolean step_off = FALSE;
-    gboolean trans_changed = FALSE;
-    gint *start_indices;
-    gint *next_indices;
-    gboolean keyup = FALSE;
-    Transaction *btrans, *ctrans, *hetrans;
-    gboolean goto_blank = FALSE;
-    gboolean next_trans = TRUE;
-    gint depth;
-
-    // spath is where we are, before key press...
-    gtk_tree_view_get_cursor (GTK_TREE_VIEW (view), &spath, &col);
-
-    if (event->type != GDK_KEY_PRESS)
-    {
-        if (spath)
-            gtk_tree_path_free (spath);
-        return FALSE;
-    }
-
-    switch (event->keyval)
-    {
-    case GDK_KEY_plus:
-    case GDK_KEY_minus:
-    case GDK_KEY_KP_Add:
-    case GDK_KEY_KP_Subtract:
-
-        if (!spath)
-            return TRUE;
-
-        gtk_tree_path_free (spath);
-        return TRUE; //FIXME I may use these to expand / collapse to splits later...
-        break;
-
-    case GDK_KEY_Up:
-    case GDK_KEY_Down:
-
-        model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-        if (event->keyval == GDK_KEY_Up)
-        {
-            gnc_tree_model_split_reg_move (model, VIEW_UP);
-        }
-        else
-            gnc_tree_model_split_reg_move (model, VIEW_DOWN);
-
-        return FALSE;
-        break;
-
-    case GDK_KEY_Page_Up:
-    case GDK_KEY_Page_Down:
-
-        model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-        if (gtk_tree_view_get_visible_range (GTK_TREE_VIEW (view), &start_path, &end_path))
-        {
-            if (event->keyval == GDK_KEY_Page_Up)
-            {
-                GtkTreePath *new_start_path;
-                gint *start_indices, *end_indices;
-                gint new_start;
-                gint num_of_trans;
-
-                start_indices = gtk_tree_path_get_indices (start_path);
-                end_indices = gtk_tree_path_get_indices (end_path);
-                num_of_trans = end_indices[0] - start_indices[0];
-
-                new_start = start_indices[0] - num_of_trans + 2;
-
-                if (new_start < 0)
-                    new_start = 0;
-
-                new_start_path = gtk_tree_path_new_from_indices (new_start, -1);
-
-                /* Scroll to cell, top of view */
-                gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (view), new_start_path, NULL, TRUE, 0.0, 0.0);
-
-                /* Set cursor to new top row */
-                gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), new_start_path, col, FALSE);
-
-                gtk_tree_path_free (new_start_path);
-
-                gnc_tree_model_split_reg_move (model, VIEW_UP);
-            }
-            else
-            {
-                GtkTreePath *new_end_path;
-                gint *start_indices, *end_indices;
-                gint new_end;
-                gint num_of_trans, total_num;
-
-                start_indices = gtk_tree_path_get_indices (start_path);
-                end_indices = gtk_tree_path_get_indices (end_path);
-                num_of_trans = end_indices[0] - start_indices[0];
-
-                total_num = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (model), NULL);
-
-                new_end = end_indices[0] + num_of_trans - 1;
-
-                if (new_end > (total_num - 1))
-                    new_end = total_num -1;
-
-                new_end_path = gtk_tree_path_new_from_indices (new_end, -1);
-
-                /* Scroll to cell, bottom of view */
-                if (model->use_double_line == TRUE)
-                {
-                    gtk_tree_path_down (new_end_path);
-                    gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (view), new_end_path, NULL, TRUE, 1.0, 0.0);
-                    gtk_tree_path_up (new_end_path);
-                }
-                else
-                    gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (view), new_end_path, NULL, TRUE, 1.0, 0.0);
-
-                /* Set cursor to new bottom row */
-                gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), new_end_path, col, FALSE);
-
-                gtk_tree_path_free (new_end_path);
-
-                gnc_tree_model_split_reg_move (model, VIEW_DOWN);
-            }
-            gtk_tree_path_free (start_path);
-            gtk_tree_path_free (end_path);
-        }
-        return TRUE;
-        break;
-
-    case GDK_KEY_Home:
-    case GDK_KEY_End:
-
-        model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-        if (event->keyval == GDK_KEY_Home)
-            hetrans = gnc_tree_model_split_reg_get_first_trans (model);
-        else
-            hetrans = gnc_tree_model_split_get_blank_trans (model);
-
-        model->current_trans = hetrans;
-
-        if (!gnc_tree_model_split_reg_trans_is_in_view (model, hetrans))
-            g_signal_emit_by_name (model, "refresh_trans");
-        else
-            gnc_tree_control_split_reg_jump_to (view, hetrans, NULL, FALSE);
-
-        return TRUE;
-        break;
-
-    case GDK_KEY_Return:
-    case GDK_KEY_space:
-
-        if (!spath)
-            return TRUE;
-
-        // Do the reconcile tests.
-        if (!gtv_sr_recn_tests (view, col, spath))
-        {
-            /* Set cursor to new column, open for editing */
-            gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), spath, col, TRUE);
-        }
-
-        gtk_tree_path_free (spath);
-        return TRUE;
-        break;
-
-    case GDK_KEY_KP_Enter:
-
-        if (!spath)
-            return TRUE;
-
-        goto_blank = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER,
-                                         GNC_PREF_ENTER_MOVES_TO_END);
-
-        model = gnc_tree_view_split_reg_get_model_from_view (view);
-        btrans = gnc_tree_model_split_get_blank_trans (model);
-        ctrans = gnc_tree_view_split_reg_get_current_trans (view);
-
-        /* Are we on the blank transaction */
-        if (btrans == ctrans)
-            next_trans = FALSE;
-
-        /* First record the transaction */
-        if (gnc_tree_view_split_reg_enter (view))
-        {
-            /* Now move. */
-            if (goto_blank)
-                g_idle_add ((GSourceFunc)gnc_tree_control_split_reg_jump_to_blank, view);
-            else if (next_trans)
-                gnc_tree_control_split_reg_goto_rel_trans_row (view, 1);
-        }
-        return TRUE;
-        break;
-
-    case GDK_KEY_Tab:
-    case GDK_KEY_ISO_Left_Tab:
-    case GDK_KEY_KP_Tab:
-
-        if (!spath)
-            return TRUE;
-
-        // Bypass Auto-complete
-        if (event->state & GDK_CONTROL_MASK)
-            view->priv->auto_complete = TRUE;
-
-        // Make sure we have stopped editing.
-        gnc_tree_view_split_reg_finish_edit (view);
-
-        // This prevents the cell changing.
-        if (view->priv->stop_cell_move == TRUE)
-        {
-            gtk_tree_path_free (spath);
-            return TRUE;
-        }
-
-        while (!editing && !step_off) // lets step over non editable columns
-        {
-            // Create a copy of the path we started with.
-            start_spath = gtk_tree_path_copy (spath);
-            start_indices = gtk_tree_path_get_indices (start_spath);
-
-            {
-                gchar *string = gtk_tree_path_to_string (start_spath);
-                DEBUG("Column title is %s and start path is %s", gtk_tree_view_column_get_title (col), string);
-                g_free (string);
-            }
-
-            model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-            /* Step to the next column, we may wrap */
-            gnc_tree_view_keynav (GNC_TREE_VIEW (view), &col, spath, event); // returns path and column
-
-            {
-                gchar *string = gtk_tree_path_to_string (spath);
-                DEBUG("Column title is %s and spath is %s", gtk_tree_view_column_get_title (col), string);
-                g_free (string);
-            }
-
-            // Have we changed transactions
-            next_indices = gtk_tree_path_get_indices (spath);
-            if (start_indices[0] != next_indices[0])
-            {
-                 if (view->priv->dirty_trans != NULL) // from a dirty trans
-                    trans_changed = TRUE;
-
-                 /* Reset allow changes for reconciled transctions */
-                 view->change_allowed = FALSE;
-            }
-
-            // Do the reconcile tests.
-            if (gnc_tree_view_path_is_valid (GNC_TREE_VIEW (view), spath))
-            {
-                if (gtv_sr_recn_tests (view, col, spath))
-                {
-                    gtk_tree_path_free (start_spath);
-                    gtk_tree_path_free (spath);
-                    return TRUE;
-                }
-            }
-
-            // Have we stepped off the end
-            if (!spath || !gnc_tree_view_path_is_valid (GNC_TREE_VIEW (view), spath) || trans_changed) // We have stepped off the end / or changed trans
-            {
-                // Test for transaction changed.
-                if (gtv_sr_transaction_changed (view))
-                {
-                    gtk_tree_path_free (spath);
-                    return TRUE;
-                }
-                step_off = TRUE;
-            }
-            // This stops the cell activation on discard
-            if (view->priv->trans_confirm != DISCARD)
-            {
-                // Set cursor to new column, open for editing
-                gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), spath, col, TRUE);
-            }
-            // Is this an editable cell ?
-            editing = gtv_sr_get_editing (col);
-        }
-        gtk_tree_path_free (start_spath);
-        gtk_tree_path_free (spath);
-        return TRUE;
-        break;
-
-    default:
-        gtk_tree_path_free (spath);
-	return FALSE;
-    }
-}
-
-
-/*###########################################################################*/
-
-/* Callback for selection move */
-static void
-gtv_sr_motion_cb (GtkTreeSelection *sel, gpointer user_data)
-{
-    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-    GncTreeModelSplitReg *model;
-    GtkTreeModel *s_model;
-    GtkTreePath *mpath, *spath;
-    Split *split = NULL;
-    Transaction *trans = NULL;
-    Transaction *old_trans;
-    gboolean is_trow1, is_trow2, is_split, is_blank;
-    RowDepth depth = 0;
-    GtkTreeIter m_iter;
-    gint *indices;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    ENTER("View is %p and Model is %p", view, model);
-
-    s_model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
-
-    DEBUG("Current trans %p, Split %p, Depth %d and Dirty Trans %p", view->priv->current_trans, view->priv->current_split,
-                                                                     view->priv->current_depth, view->priv->dirty_trans);
-
-    /* Reset help text */
-    if (view->help_text)
-        g_free (view->help_text);
-    view->help_text = g_strdup (" ");
-    g_signal_emit_by_name (view, "help_signal", NULL);
-
-    if (gtv_sr_get_model_iter_from_selection (view, sel, &m_iter))
-    {
-        gchar *mstring, *sstring;
-
-        mpath = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &m_iter);
-        spath = gnc_tree_view_split_reg_get_sort_path_from_model_path (view, mpath);
-
-        mstring = gtk_tree_path_to_string (mpath);
-        sstring = gtk_tree_path_to_string (spath);
-        DEBUG("Valid Selection - mpath is %s, spath is %s", mstring, sstring);
-        g_free (mstring);
-        g_free (sstring);
-
-        /* save the current path */
-        gnc_tree_view_split_reg_set_current_path (view, mpath);
-
-        /* Use depth to determine if it is a split or transaction */
-        depth = gtk_tree_path_get_depth (mpath);
-
-        gtk_tree_path_free (mpath);
-
-        gnc_tree_model_split_reg_get_split_and_trans (
-                GNC_TREE_MODEL_SPLIT_REG (model), &m_iter, &is_trow1, &is_trow2, &is_split, &is_blank, &split, &trans);
-
-        DEBUG("Get model trans %p, split %p, is_split %d, is_blank %d\n", trans, split, is_split, is_blank);
-
-        /* Update the titles if depth changes, we change rows */
-        if (depth != view->priv->current_depth)
-            gtv_sr_titles (view, depth);
-
-        /* Move the blank split */ 
-        gnc_tree_model_split_reg_set_blank_split_parent (model, trans, FALSE);
-
-        /* Save trans / split / depth to the current values */
-        old_trans = view->priv->current_trans;
-        view->priv->current_trans = trans;
-        view->priv->current_split = split;
-        view->priv->current_depth = depth;
-
-        DEBUG("Current trans %p, split %p, depth %d and old_trans %p", view->priv->current_trans, view->priv->current_split,
-                                                                     view->priv->current_depth, old_trans);
-
-        /* Save trans and current row to model */
-        model->current_trans = trans;
-        indices = gtk_tree_path_get_indices (spath);
-        model->current_row = indices[0];
-        gnc_tree_model_split_reg_sync_scrollbar (model);
-
-        /* Test for change of transaction and old transaction equals a dirty transaction */
-        if ((trans != old_trans) && (old_trans == view->priv->dirty_trans))
-        {
-            if (gtv_sr_transaction_changed (view))
-            {
-                gtk_tree_path_free (spath);
-                LEAVE("Leave Transaction Changed");
-                return;
-            }
-        }
-        if (view->priv->trans_confirm == CANCEL)
-        {
-            gtk_tree_path_free (spath);
-            LEAVE("Leave Transaction Changed - Cancel");
-            return;
-        }
-
-        /* Auto expand transaction and collapse previous transaction */
-        if (old_trans != trans)
-        {
-            if (model->style != REG2_STYLE_JOURNAL)
-            {
-                gnc_tree_view_split_reg_block_selection (view, TRUE);
-
-                if (gnc_tree_view_split_reg_trans_expanded (view, old_trans))
-                    gnc_tree_view_split_reg_collapse_trans (view, old_trans);
-
-                gnc_tree_view_split_reg_block_selection (view, FALSE);
-            }
-            else
-                gnc_tree_view_split_reg_expand_trans (view, NULL);
-
-            if (model->style == REG2_STYLE_AUTO_LEDGER)
-            {
-                gtk_tree_view_expand_row (GTK_TREE_VIEW (view), spath, TRUE);
-
-                view->priv->expanded = TRUE;
-
-                if (view->priv->selection_to_blank_on_expand)
-                    gtv_sr_selection_to_blank (view);
-            }
-        }
-        gtk_tree_path_free (spath);
-
-        // Check to see if current trans is expanded and remember
-        if (gnc_tree_view_split_reg_trans_expanded (view, trans))
-            view->priv->expanded = TRUE;
-        else
-            view->priv->expanded = FALSE;
-    }
-    else
-    {
-        DEBUG("Not Valid Selection");
-        /* We do not have a valid iter */
-        gtv_sr_titles (view, 0);
-
-        /* Move the blank split to the last transaction */ 
-        gnc_tree_model_split_reg_set_blank_split_parent (model, NULL, FALSE);
-
-        /* Set the default selection start position */
-        gnc_tree_view_split_reg_default_selection (view);
-    }
-
-    /* This updates the plugin page gui */
-    gnc_tree_view_split_reg_call_uiupdate_cb (view);
-
-    LEAVE(" ");
-}
-
-/*###########################################################################*/
-
-/* Connected to "edited" from cellrenderer. For reference, see
-   split-register-model-save.c */
-static void
-gtv_sr_edited_cb (GtkCellRendererText *cell, const gchar *path_string,
-               const gchar *new_text, gpointer user_data)
-{
-    GncTreeViewSplitReg  *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-    GncTreeModelSplitReg *model;
-    GtkCellEditable      *editable;
-
-    editable = g_object_get_data (G_OBJECT (cell), "cell-editable");
-
-    DEBUG("cell is %p editable pointer is %p and id %lu", cell, editable, view->priv->fo_handler_id);
-
-    /* Remove the focus out cb if one exists */
-    if (view->priv->fo_handler_id != 0)
-    {
-        if (g_signal_handler_is_connected (G_OBJECT (editable), view->priv->fo_handler_id))
-            g_signal_handler_disconnect (G_OBJECT (editable), view->priv->fo_handler_id);
-    }
-    view->priv->fo_handler_id = 0;
-
-    /* Make sure we set focus to the tree view after cell editing */
-    gtk_widget_grab_focus (GTK_WIDGET (view));
-
-    if (g_strcmp0 (g_object_get_data (G_OBJECT (cell), "current-string"), new_text) == 0) // No change, return
-    {
-        if (view->priv->stop_cell_move == FALSE)
-            return;
-    }
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-    g_return_if_fail (model);
-
-    /* Are we using a template or not */
-    if (!gnc_tree_model_split_reg_get_template (model))
-        gtv_sr_edited_normal_cb (cell, path_string, new_text, view);
-    else
-        gtv_sr_edited_template_cb (cell, path_string, new_text, view);
-}
-
-
-/* This is used for the normal registers */
-static void
-gtv_sr_edited_normal_cb (GtkCellRendererText *cell, const gchar *path_string,
-               const gchar *new_text, gpointer user_data)
-{
-    GncTreeViewSplitReg  *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-    GncTreeModelSplitReg *model;
-    GtkCellEditable      *editable;
-    GtkTreeIter           m_iter;
-    Split                *split;
-    Transaction          *trans;
-    gboolean              is_trow1, is_trow2, is_split, is_blank;
-    ViewCol               viewcol;
-    char                 *error_loc = NULL;
-    Account              *anchor = view->priv->anchor;
-
-    editable = g_object_get_data (G_OBJECT (cell), "cell-editable");
-
-    DEBUG("cell is %p editable pointer is %p", cell, editable);
-
-    g_return_if_fail (gtv_sr_get_model_iter_from_view_string (view, path_string, &m_iter));
-
-    viewcol = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cell), "view_column"));
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-    g_return_if_fail (model);
-
-    gnc_tree_model_split_reg_get_split_and_trans (
-        model, &m_iter, &is_trow1, &is_trow2, &is_split, &is_blank, &split, &trans);
-
-    switch (viewcol) {
-    case COL_DATE:
-        /* Column is DATE */
-        if (is_trow1)
-        {
-            GDate parsed_date;
-            gnc_tree_util_split_reg_parse_date (&parsed_date, new_text);
-            if (g_date_valid (&parsed_date))
-            {
-                gtv_sr_begin_edit (view, trans);
-                xaccTransSetDate (trans, g_date_get_day (&parsed_date), g_date_get_month (&parsed_date), g_date_get_year (&parsed_date));
-            }
-            else
-            {
-                // We should never get here
-                PERR("invalid date '%s'", new_text);
-            }
-        }
-        break;
-
-    case COL_NUMACT:
-        /* Column is NUM / ACT */
-        gtv_sr_begin_edit (view, trans);
-        if (is_trow1)
-        {
-            /* set per book option */
-            gnc_set_num_action (trans, gtv_sr_get_this_split (view, trans),
-                                                                new_text, NULL);
-
-            if (!qof_book_use_split_action_for_num_field (gnc_get_current_book()))
-            {
-                // Set the last number value for this account.
-                if (gnc_strisnum (new_text) && anchor != NULL)
-                    xaccAccountSetLastNum (anchor, new_text);
-            }
-        }
-        if (is_trow2)
-        {
-            /* set per book option */
-            gnc_set_num_action (trans, gtv_sr_get_this_split (view, trans),
-                                                                NULL, new_text);
-
-            if (qof_book_use_split_action_for_num_field (gnc_get_current_book()))
-            {
-                // Set the last number value for this account.
-                if (gnc_strisnum (new_text) && anchor != NULL)
-                    xaccAccountSetLastNum (anchor, new_text);
-            }
-        }
-        if (is_split)
-        {
-            /* Set split-action with gnc_set_num_action which is the same as
-             * xaccSplitSetAction with these arguments */
-            gnc_set_num_action (NULL, split, NULL, new_text);
-        }
-        break;
-
-    case COL_DESCNOTES:
-        /* Column is DESCRIPTION / NOTES / MEMO */
-        gtv_sr_begin_edit (view, trans);
-        if (is_trow1)
-        {
-            xaccTransSetDescription (trans, new_text);
-            // This will potentially fill in the rest of the transaction.
-            if (view->priv->auto_complete == FALSE)
-            {
-                gnc_tree_control_auto_complete (view, trans, new_text);
-                view->priv->auto_complete = TRUE;
-            }
-        }
-        if (is_trow2)
-            xaccTransSetNotes (trans, new_text);
-
-        if (is_split)
-            xaccSplitSetMemo (split, new_text);
-
-        break;
-
-    case COL_RECN:
-        /* Column is RECONCILE */
-        gtv_sr_begin_edit (view, trans);
-        {
-            char rec = 'n';
-
-            if (new_text != NULL)
-            {
-                const gchar *cflag = gnc_get_reconcile_str (CREC);
-                const gchar *nflag = gnc_get_reconcile_str (NREC);
-                const char recn_flags[] = {NREC, CREC, 0}; // List of reconciled flags
-                const gchar *flags;
-                gchar *this_flag;
-                gint index = 0;
-
-                flags = g_strconcat (nflag, cflag, NULL); // List of translated strings.
-
-                /* Find the current flag in the list of flags */
-                this_flag = strstr (flags, new_text);
-
-                if (this_flag != NULL)
-                {
-                    index = this_flag - flags;
-                    rec = recn_flags[index];
-                }
-            }
-            if (is_trow1) 
-                xaccSplitSetReconcile (gtv_sr_get_this_split (view, trans), rec);
-            if (is_split)
-                xaccSplitSetReconcile (split, rec);
-        }
-        break;
-
-    case COL_TYPE:
-        /* Column is TYPE */
-        gtv_sr_begin_edit (view, trans);
-        {
-            char type = TXN_TYPE_NONE;
-            if (new_text != NULL)
-                type = new_text[0];
-
-            if (is_trow1)
-                xaccTransSetTxnType (trans, type);
-        }
-        break;
-
-    case COL_TRANSFERVOID:
-    case COL_AMTVAL:
-    case COL_AMOUNT:
-    case COL_PRICE:
-    case COL_DEBIT:
-    case COL_CREDIT:
-        {
-            Account       *acct, *old_acct;
-            gnc_numeric    input;
-            Split         *osplit = NULL;
-            gboolean       valid_input = FALSE;
-            gboolean       force = FALSE;
-            gboolean       input_used = FALSE;
-
-            gtv_sr_begin_edit (view, trans);
-
-            /* Get the split pair if anchored to a register */
-            if (!is_split && anchor)
-            {
-                if (!gtv_sr_get_split_pair (view, trans, &osplit, &split))
-                {
-                    DEBUG("couldn't get split pair");
-                    break;
-                }
-            }
-
-            /* Setup the account field */
-            if (viewcol == COL_TRANSFERVOID)
-            {
-                view->priv->stop_cell_move = FALSE;
-                acct = gnc_tree_control_split_reg_get_account_by_name (view, new_text);
-                if (acct == NULL)
-                {
-                    DEBUG("Account is NULL");
-                    xaccSplitReinit(split);
-                    if (osplit)
-                        xaccSplitDestroy (osplit);
-
-                    g_free (view->priv->transfer_string);
-                    view->priv->transfer_string = g_strdup (new_text);
-                    view->priv->stop_cell_move = TRUE;
-
-                    /* this will populate cell with original value */
-                    g_idle_add ((GSourceFunc) gtv_sr_idle_transfer, view);
-                    break;
-                }
-
-                if (acct != NULL && is_split)
-                {
-                    old_acct = xaccSplitGetAccount (split);
-                    xaccSplitSetAccount (split, acct);
-                    if (!gnc_commodity_equiv (xaccAccountGetCommodity (old_acct), xaccAccountGetCommodity (acct)))
-                        force = TRUE;
-                }
-                else
-                {
-                    old_acct = xaccSplitGetAccount (osplit);
-                    xaccSplitSetAccount (osplit, acct);
-                    if (!gnc_commodity_equiv (xaccAccountGetCommodity (old_acct), xaccAccountGetCommodity (acct)))
-                        force = TRUE;
-                }
-            }
-            else
-            {
-                if (!gnc_exp_parser_parse (new_text, &input, &error_loc))
-                    break;
-                else
-                    valid_input = TRUE;
-            }
-
-            /* Get the account for this split */
-            acct = xaccSplitGetAccount (split);
-            if (!acct)
-            {
-                if (anchor)
-                {
-                    xaccSplitSetAccount (split, anchor);
-                    acct = xaccSplitGetAccount (split);
-                }
-                else
-                {
-                    break; //Well, what else is there to do?
-                }
-            }
-
-            /* Set the transaction currency if not set */
-            if (!xaccTransGetCurrency (trans))
-            {
-                // set transaction currency to that of register (which is guaranteed to be a currency)
-                xaccTransSetCurrency (trans, view->priv->reg_currency);
-
-                // We are on General ledger
-                if (!anchor)
-                {
-                    xaccTransSetCurrency (trans, gnc_account_or_default_currency (xaccSplitGetAccount (split), NULL));
-                }
-            }
-
-            // No need to check for a non-currency register because that's what
-            // was already checked when reg_currency was stored.
-
-            /* This computes the value if we just commit the split after entering account */
-            if (!valid_input)
-                input = gnc_tree_util_split_reg_get_value_for (view, trans, split, is_blank);
-
-            // Negate the input if COL_CREDIT
-            if (viewcol == COL_CREDIT)
-                input = gnc_numeric_neg (input);
-
-            // Set the split parent trans
-            xaccSplitSetParent (split, trans);
-
-            // If we are at trasaction level, column is value, split level is amount
-            if (viewcol == COL_AMTVAL)
-            {
-                gnc_tree_util_set_number_for_input (view, trans, split, input, COL_AMTVAL);
-                input_used = TRUE;
-            }
-
-            // The price of stock / shares, editable only when expanded and sub_account
-            if (viewcol == COL_AMOUNT)
-            {
-                gnc_tree_util_set_number_for_input (view, trans, split, input, COL_AMTVAL);
-                input_used = TRUE;
-            }
-
-            // The price of stock / shares
-            if (viewcol == COL_PRICE)
-            {
-                gnc_tree_util_set_number_for_input (view, trans, split, input, COL_PRICE);
-                input_used = TRUE;
-            }
-
-            // Check if this is a stock / share amount
-            if (viewcol == COL_CREDIT || viewcol == COL_DEBIT)
-            {
-                if (!gnc_commodity_is_currency (xaccAccountGetCommodity (acct)))
-                {
-                    gnc_tree_util_set_number_for_input (view, trans, split, input, viewcol);
-                    input_used = TRUE;
-                }
-            }
-
-            // This is used in transaction mode, two splits
-            if (input_used == FALSE)
-            {
-                if (gnc_commodity_is_currency (xaccAccountGetCommodity (acct)))
-                    gnc_tree_util_split_reg_set_value_for (view, trans, split, input, force);
-                else
-                    gnc_tree_util_set_value_for_amount (view, trans, split, input);
-            }
-
-            // If this is the blank split, promote it.
-            if (is_blank)
-            {
-                /*FIXME May be this should be a signal - Promote the blank split to a real split */
-                g_idle_add ((GSourceFunc) gnc_tree_model_split_reg_commit_blank_split, gnc_tree_view_split_reg_get_model_from_view (view));
-
-                /* scroll when view idle */
-                g_idle_add ((GSourceFunc) gnc_tree_view_split_reg_scroll_to_cell, view);
-            }
-
-            // In transaction mode, two splits only, set up the other split.
-            if (osplit)
-            {
-                xaccSplitSetParent (osplit, trans);
-
-                if (gnc_commodity_is_currency (xaccAccountGetCommodity (acct)))
-                    gnc_tree_util_split_reg_set_value_for (view, trans, osplit, gnc_numeric_neg (input), force);
-                else
-                    gnc_tree_util_set_value_for_amount (view, trans, osplit, gnc_numeric_neg (xaccSplitGetValue (split)));
-            }
-        }
-        break;
-
-    default:
-        //g_assert_not_reached();
-        break;
-    }
-}
-
-
-/* This is used for the template registers */
-static void
-gtv_sr_edited_template_cb (GtkCellRendererText *cell, const gchar *path_string,
-               const gchar *new_text, gpointer user_data)
-{
-    GncTreeViewSplitReg  *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-    GncTreeModelSplitReg *model;
-    GtkCellEditable      *editable;
-    GtkTreeIter           m_iter;
-    Split                *split;
-    Transaction          *trans;
-    gboolean              is_trow1, is_trow2, is_split, is_blank;
-    ViewCol               viewcol;
-    char                 *error_loc = NULL;
-    Account              *anchor = view->priv->anchor;
-
-    editable = g_object_get_data (G_OBJECT (cell), "cell-editable");
-
-    DEBUG("cell is %p editable pointer is %p", cell, editable);
-
-    g_return_if_fail (gtv_sr_get_model_iter_from_view_string (view, path_string, &m_iter));
-
-    viewcol = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cell), "view_column"));
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-    g_return_if_fail (model);
-
-    gnc_tree_model_split_reg_get_split_and_trans (
-        model, &m_iter, &is_trow1, &is_trow2, &is_split, &is_blank, &split, &trans);
-
-    switch (viewcol) {
-    case COL_NUMACT:
-        /* Column is NUM / ACT */
-        gtv_sr_begin_edit (view, trans);
-        if (is_trow1)
-        {
-            /* set per book option */
-            gnc_set_num_action (trans, gtv_sr_get_this_split (view, trans),
-                                                                new_text, NULL);
-
-            if (!qof_book_use_split_action_for_num_field (gnc_get_current_book()))
-            {
-                // Set the last number value for this account.
-                if (gnc_strisnum (new_text) && anchor != NULL)
-                    xaccAccountSetLastNum (anchor, new_text);
-            }
-        }
-        if (is_trow2)
-        {
-            /* set per book option */
-            gnc_set_num_action (trans, gtv_sr_get_this_split (view, trans),
-                                                                NULL, new_text);
-
-            if (qof_book_use_split_action_for_num_field (gnc_get_current_book()))
-            {
-                // Set the last number value for this account.
-                if (gnc_strisnum (new_text) && anchor != NULL)
-                    xaccAccountSetLastNum (anchor, new_text);
-            }
-        }
-        if (is_split)
-        {
-            /* Set split-action with gnc_set_num_action which is the same as
-             * xaccSplitSetAction with these arguments */
-            gnc_set_num_action (NULL, split, NULL, new_text);
-        }
-        break;
-
-    case COL_DESCNOTES:
-        /* Column is DESCRIPTION / NOTES / MEMO */
-        gtv_sr_begin_edit (view, trans);
-        if (is_trow1)
-        {
-            xaccTransSetDescription (trans, new_text);
-            // This will potentially fill in the rest of the transaction.
-            if (view->priv->auto_complete == FALSE)
-            {
-                gnc_tree_control_auto_complete (view, trans, new_text);
-                view->priv->auto_complete = TRUE;
-            }
-        }
-        if (is_trow2)
-            xaccTransSetNotes (trans, new_text);
-
-        if (is_split)
-            xaccSplitSetMemo (split, new_text);
-
-        break;
-
-    case COL_RECN:
-        /* Column is RECONCILE */
-        gtv_sr_begin_edit (view, trans);
-        {
-            char rec = 'n';
-
-            if (new_text != NULL)
-            {
-                const gchar *cflag = gnc_get_reconcile_str (CREC);
-                const gchar *nflag = gnc_get_reconcile_str (NREC);
-                const char recn_flags[] = {NREC, CREC, 0}; // List of reconciled flags
-                const gchar *flags;
-                gchar *this_flag;
-                gint index = 0;
-
-                flags = g_strconcat (nflag, cflag, NULL); // List of translated strings.
-
-                /* Find the current flag in the list of flags */
-                this_flag = strstr (flags, new_text);
-
-                if (this_flag != NULL)
-                {
-                    index = this_flag - flags;
-                    rec = recn_flags[index];
-                }
-            }
-            if (is_trow1)
-                xaccSplitSetReconcile (gtv_sr_get_this_split (view, trans), rec);
-            if (is_split)
-                xaccSplitSetReconcile (split, rec);
-        }
-        break;
-
-    case COL_TRANSFERVOID:
-    case COL_DEBIT:
-    case COL_CREDIT:
-        {
-            gtv_sr_begin_edit (view, trans);
-
-            /* Setup the account field */
-            if (viewcol == COL_TRANSFERVOID)
-            {
-                Account *template_acc;
-                const GncGUID *acctGUID;
-                kvp_frame *kvpf;
-                Account *acct;
-
-                /* save the account GncGUID into the kvp_data. */
-                view->priv->stop_cell_move = FALSE;
-                acct = gnc_tree_control_split_reg_get_account_by_name (view, new_text);
-                if (acct == NULL)
-                {
-                    DEBUG("Template Account is NULL");
-
-                    g_free (view->priv->transfer_string);
-                    view->priv->transfer_string = g_strdup (new_text);
-                    view->priv->stop_cell_move = TRUE;
-
-                    /* this will populate cell with original value */
-                    g_idle_add ((GSourceFunc) gtv_sr_idle_transfer, view);
-                    break;
-                }
-
-                acctGUID = xaccAccountGetGUID (acct);
-                kvpf = xaccSplitGetSlots (split);
-                kvp_frame_set_slot_path (kvpf, kvp_value_new_guid (acctGUID),
-                             GNC_SX_ID, GNC_SX_ACCOUNT, NULL);
-
-                template_acc = gnc_tree_model_split_reg_get_template_account (model);
-
-                /* set the actual account to the fake account for these templates */
-                xaccAccountInsertSplit (template_acc, split);
-            }
-
-            /* Set the transaction currency if not set */
-            if (!xaccTransGetCurrency (trans))
-            {
-                xaccTransSetCurrency (trans, gnc_account_or_default_currency (xaccSplitGetAccount (split), NULL));
-            }
-
-            // No need to check for a non-currency register because that's what
-            // was already checked when reg_currency was stored.
-
-            /* Setup the debit and credit fields */
-            if (viewcol == COL_DEBIT)
-            {
-                kvp_frame *kvpf;
-                char *error_loc;
-                gnc_numeric new_value;
-                gboolean parse_result;
-
-                kvpf = xaccSplitGetSlots (split);
-
-                DEBUG ("kvp_frame debit before: %s\n", kvp_frame_to_string (kvpf));
-
-                /* Setup the debit formula */
-                kvp_frame_set_slot_path (kvpf, kvp_value_new_string (new_text),
-                                         GNC_SX_ID,
-                                         GNC_SX_DEBIT_FORMULA,
-                                         NULL);
-
-                /* If the value can be parsed into a numeric result, store that
-                 * numeric value additionally. See above comment.*/
-                parse_result = gnc_exp_parser_parse_separate_vars (new_text, &new_value, &error_loc, NULL);
-                if (!parse_result)
-                {
-                    new_value = gnc_numeric_zero();
-                }
-                kvp_frame_set_slot_path (kvpf, kvp_value_new_numeric (new_value),
-                                         GNC_SX_ID,
-                                         GNC_SX_DEBIT_NUMERIC,
-                                         NULL);
-
-                DEBUG ("kvp_frame debit after: %s\n", kvp_frame_to_string (kvpf));
-
-                /* Blank the credit formula */
-                kvp_frame_set_slot_path (kvpf, kvp_value_new_string (NULL),
-                                         GNC_SX_ID,
-                                         GNC_SX_CREDIT_FORMULA,
-                                         NULL);
-
-                new_value = gnc_numeric_zero();
-                kvp_frame_set_slot_path (kvpf, kvp_value_new_numeric (new_value),
-                                         GNC_SX_ID,
-                                         GNC_SX_CREDIT_NUMERIC,
-                                         NULL);
-            }
-
-            /* Setup the debit and credit fields */
-            if (viewcol == COL_CREDIT)
-            {
-                kvp_frame *kvpf;
-                char *error_loc;
-                gnc_numeric new_value;
-                gboolean parse_result;
-
-                kvpf = xaccSplitGetSlots (split);
-
-                DEBUG ("kvp_frame credit before: %s\n", kvp_frame_to_string (kvpf));
-
-                /* Setup the credit formula */
-                kvp_frame_set_slot_path (kvpf, kvp_value_new_string (new_text),
-                                             GNC_SX_ID,
-                                             GNC_SX_CREDIT_FORMULA,
-                                             NULL);
-
-                /* If the value can be parsed into a numeric result (without any
-                 * further variable definitions), store that numeric value
-                 * additionally in the kvp. Otherwise store a zero numeric
-                 * there.*/
-                parse_result = gnc_exp_parser_parse_separate_vars (new_text, &new_value, &error_loc, NULL);
-                if (!parse_result)
-                {
-                    new_value = gnc_numeric_zero();
-                }
-                kvp_frame_set_slot_path (kvpf, kvp_value_new_numeric (new_value),
-                                         GNC_SX_ID,
-                                         GNC_SX_CREDIT_NUMERIC,
-                                         NULL);
-
-                DEBUG ("kvp_frame credit after: %s\n", kvp_frame_to_string (kvpf));
-
-                /* Blank the debit formula */
-                kvp_frame_set_slot_path (kvpf, kvp_value_new_string (NULL),
-                                         GNC_SX_ID,
-                                         GNC_SX_DEBIT_FORMULA,
-                                         NULL);
-
-                new_value = gnc_numeric_zero();
-                kvp_frame_set_slot_path (kvpf, kvp_value_new_numeric (new_value),
-                                         GNC_SX_ID,
-                                         GNC_SX_DEBIT_NUMERIC,
-                                         NULL);
-            }
-            /* set the amount to an innocuous value */
-            xaccSplitSetValue (split, gnc_numeric_create (0, 1));
-
-            // Set the split parent trans
-            xaccSplitSetParent (split, trans);
-
-            // If this is the blank split, promote it.
-            if (is_blank)
-            {
-                /*FIXME May be this should be a signal - Promote the blank split to a real split */
-                g_idle_add ((GSourceFunc) gnc_tree_model_split_reg_commit_blank_split, gnc_tree_view_split_reg_get_model_from_view (view));
-
-                /* scroll when view idle */
-                g_idle_add ((GSourceFunc) gnc_tree_view_split_reg_scroll_to_cell, view);
-            }
-        }
-        break;
-
-    default:
-        //g_assert_not_reached();
-        break;
-    }
-}
-
-/*###########################################################################*/
-
-/* Parses the string value and returns true if it is a
- * number. In that case, *num is set to the value parsed. */
-static gboolean
-gtv_sr_parse_num (const char *string, long int *num)
-{
-    long int number;
-
-    if (string == NULL)
-        return FALSE;
-
-    if (!gnc_strisnum (string))
-        return FALSE;
-
-    number = strtol (string, NULL, 10);
-
-    if ((number == LONG_MIN) || (number == LONG_MAX))
-        return FALSE;
-
-    if (num != NULL)
-        *num = number;
-
-    return TRUE;
-}
-
-/* Callback for Number Accelerator key */
-static void
-gtv_sr_num_cb (GtkEntry    *entry,
-                          const gchar *text,
-                          gint         length,
-                          gint        *position,
-                          gpointer     user_data)
-{
-    GtkEditable *editable = GTK_EDITABLE (entry);
-    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-    GncTreeModelSplitReg *model;
-    RowDepth depth;
-    Account *account;
-    gchar *entered_string;
-    gchar *leave_string = NULL;
-
-    gboolean accel = FALSE;
-    gboolean is_num;
-    long int number = 0;
-    gunichar uc;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    account = gnc_tree_model_split_reg_get_anchor (model);
-
-    depth = gnc_tree_view_reg_get_selected_row_depth (view);
-
-    // This only works on the number field.
-    if ((depth == TRANS2 || depth == SPLIT3))
-        return;
-
-    // Get entered string
-    entered_string = gtk_editable_get_chars (editable, 0, -1);
-
-    // Test for number and return it.
-    is_num = gtv_sr_parse_num (entered_string, &number);
-
-    if (is_num && (number < 0))
-        is_num = FALSE;
-
-    // Test for accelerator keys.
-    uc = g_utf8_get_char (text);
-    switch (uc)
-    {
-    case '+':
-    case '=':
-        number++;
-        accel = TRUE;
-        break;
-
-    case '_':
-    case '-':
-        number--;
-        accel = TRUE;
-        break;
-
-    case '}':
-    case ']':
-        number += 10;
-        accel = TRUE;
-        break;
-
-    case '{':
-    case '[':
-        number -= 10;
-        accel = TRUE;
-        break;
-    }
-
-    if (number < 0)
-        number = 0;
-
-    /* If there is already a non-number there, don't accelerate. */
-    if (accel && !is_num && (g_strcmp0 (entered_string, "") != 0))
-        accel = FALSE;
-
-    // See if entered string is empty, try and get the last number.
-    if (accel && (g_strcmp0 (entered_string, "") == 0))
-    {
-        if (account != NULL)
-        {
-            if (gtv_sr_parse_num (xaccAccountGetLastNum (account), &number))
-                number = number + 1;
-            else
-                number = 1;
-        }
-        else
-            number = 1;
-
-        is_num = TRUE;
-    }
-
-    if (!accel)
-    {
-        leave_string = g_strconcat (entered_string, text, NULL);
-    }
-
-    if (accel && is_num)
-    {
-        char buff[128];
-
-        strcpy (buff, "");
-        snprintf (buff, sizeof(buff), "%ld", number);
-
-        if (g_strcmp0 (buff, "") == 0)
-            leave_string = "";
-        else
-            leave_string = g_strdup (buff);
-    }
-
-    g_signal_handlers_block_by_func (editable, (gpointer) gtv_sr_num_cb, user_data);
-
-    gtk_editable_delete_text (editable, 0, -1);
-    gtk_editable_set_position (editable, 0);
-
-    if (leave_string != NULL)
-        gtk_editable_insert_text (editable, leave_string, -1, position);
-
-    g_signal_handlers_unblock_by_func (editable, (gpointer) gtv_sr_num_cb, user_data);
-
-    g_signal_stop_emission_by_name (editable, "insert_text");
-
-    if (leave_string)
-        g_free (leave_string);
-
-    g_free (entered_string);
-}
-
-
-/* Callback for Account seperator key */
-static void
-gtv_sr_acct_cb (GtkEntry    *entry,
-                          const gchar *text,
-                          gint         length,
-                          gint        *position,
-                          gpointer     user_data)
-{
-    GtkEditable *editable = GTK_EDITABLE (entry);
-    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-    GtkEntryCompletion *completion;
-    GtkTreeModel *model;
-    GtkTreeIter  iter;
-
-    const gchar *sep_char;
-    gchar       *entered_string;
-    gchar       *acct_string = NULL;
-
-    gint         num_of_items = 0;
-    gboolean     valid;
-    gboolean     all_the_same = TRUE;
-
-    sep_char = gnc_get_account_separator_string ();
-
-    if (g_strcmp0 (text, sep_char) == 0)
-        entered_string = g_strconcat (gtk_editable_get_chars (editable, 0, -1), NULL);
-    else
-        entered_string = g_strconcat (gtk_editable_get_chars (editable, 0, -1), text, NULL);
-
-    // Get the completion and model
-    completion = gtk_entry_get_completion (entry);
-    model = gtk_entry_completion_get_model (completion);
-
-    // Get the first item in the list
-    valid = gtk_tree_model_get_iter_first (model, &iter);
-    while (valid)
-    {
-        gchar *item, *item_string, *l_item, *l_entered_string, *l_acct_string;
-
-        // Walk through the list, reading each row
-        if (view->priv->acct_short_names)
-            gtk_tree_model_get (model, &iter, 0, &item, -1);
-        else
-            gtk_tree_model_get (model, &iter, 1, &item, -1);
-
-        item_string = g_strconcat (item, sep_char, NULL);
-
-        l_item = g_utf8_strdown (item_string, -1);
-        l_entered_string = g_utf8_strdown (entered_string, -1);
-
-        if (g_str_has_prefix (l_item, l_entered_string))
-        {
-            if (num_of_items == 0)
-                acct_string = g_strdup (item);
-            else
-            {
-                l_acct_string = g_utf8_strdown (acct_string, -1);
-                if (!g_str_has_prefix (g_utf8_strdown (l_item, -1), l_acct_string))
-                    all_the_same = FALSE;
-                g_free (l_acct_string);
-            }
-            num_of_items = num_of_items + 1;
-        }
-        g_free (item);
-        g_free (item_string);
-        g_free (l_item);
-        g_free (l_entered_string);
-        valid = gtk_tree_model_iter_next (model, &iter);
-    }
-
-    g_signal_handlers_block_by_func (editable, (gpointer) gtv_sr_acct_cb, user_data);
-
-    gtk_editable_delete_text (editable, 0, -1);
-    gtk_editable_set_position (editable, 0);
-
-    if (num_of_items == 0)
-        gtk_editable_insert_text (editable, entered_string, -1, position);
-    else
-    {
-        if (num_of_items == 1)
-            gtk_editable_insert_text (editable, acct_string, -1, position);
-        else
-        {
-            if (all_the_same)
-            {
-                if (g_strcmp0 (text, sep_char) == 0)
-                    gtk_editable_insert_text (editable, g_strconcat (acct_string, sep_char, NULL), -1, position);
-                else
-                    gtk_editable_insert_text (editable, entered_string, -1, position);
-            }
-            else
-               gtk_editable_insert_text (editable, entered_string, -1, position);
-        }
-    }
-    g_signal_handlers_unblock_by_func (editable, (gpointer) gtv_sr_acct_cb, user_data);
-
-    g_signal_stop_emission_by_name (editable, "insert_text");
-    g_free (acct_string);
-    g_free (entered_string);
-}
-
-
-/* Callback for changing reconcile setting with space bar */
-static void
-gtv_sr_recn_cb (GtkEntry    *entry,
-                          const gchar *text,
-                          gint         length,
-                          gint        *position,
-                          gpointer     user_data)
-{
-    GtkEditable *editable = GTK_EDITABLE (entry);
-    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-
-    const gchar *cflag = gnc_get_reconcile_str (CREC);
-    const gchar *nflag = gnc_get_reconcile_str (NREC);
-
-    const gchar *flags;
-    gchar *this_flag;
-    gchar *result;
-    static char ss[2];
-    gint index = 0;
-
-    result = g_ascii_strdown (text, length);
-
-    if (g_object_get_data (G_OBJECT (view->priv->temp_cr), "current-flag") != NULL)
-        index = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (view->priv->temp_cr), "current-flag"));
-    else
-    {
-        if (g_strcmp0 (g_object_get_data (G_OBJECT (view->priv->temp_cr), "current-string"), nflag) == 0)
-            index = 0;
-    }
-
-    flags = g_strconcat (nflag, cflag, NULL);
-
-    /* So we can test for space */
-    ss[0] = ' ';
-    ss[1] = '\0';
-
-    /* Find the entered text in the list of flags */
-    this_flag = strstr (flags, text);
-
-    if (this_flag == NULL || *this_flag == '\0')
-    {
-        if (g_strcmp0 (text, ss) == 0)  // test for space
-        {
-            /* In the list, choose the next item in the list
-               (wrapping around as necessary). */
-
-            if (flags[index + 1] != '\0')
-                index = index + 1;
-            else
-                index = 0;
-
-            g_free (result);
-            result = g_strdup_printf("%c", flags[index]);
-        }
-        else
-        {
-            /* If it's not there (or the list is empty) use default_flag */
-            g_free (result);
-            result = g_strdup (gnc_get_reconcile_str (NREC));
-        }
-    }
-    else
-    {
-        g_free (result);
-        result = g_strdup (text);
-    }
-
-    /* save the index in the cellrenderer */
-    g_object_set_data (G_OBJECT (view->priv->temp_cr), "current-flag", GINT_TO_POINTER (index));
-
-    g_signal_handlers_block_by_func (editable, (gpointer) gtv_sr_recn_cb, user_data);
-
-    gtk_editable_delete_text (editable, 0, -1);
-    gtk_editable_insert_text (editable, result, length, position);
-
-    g_signal_handlers_unblock_by_func (editable, (gpointer) gtv_sr_recn_cb, user_data);
-
-    g_signal_stop_emission_by_name (editable, "insert_text");
-
-    g_free (result);
-}
-
-
-/* Callback for changing type setting with space bar */
-static void
-gtv_sr_type_cb (GtkEntry    *entry,
-                          const gchar *text,
-                          gint         length,
-                          gint        *position,
-                          gpointer     user_data)
-{
-    GtkEditable *editable = GTK_EDITABLE (entry);
-    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-    const gchar *flags;
-    const char type_flags[] = {TXN_TYPE_INVOICE, TXN_TYPE_PAYMENT, 0};
-    gchar *this_flag;
-    gchar *result;
-    static char ss[2];
-    gint index = 0;
-
-    flags = type_flags;
-
-    result = g_ascii_strup (text, length);
-
-    if (g_object_get_data (G_OBJECT (view->priv->temp_cr), "current-flag") != NULL)
-        index = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (view->priv->temp_cr), "current-flag"));
-    else
-    {
-        if (g_strcmp0 (g_object_get_data (G_OBJECT (view->priv->temp_cr), "current-string"), "I") == 0)
-            index = 0;
-    }
-
-    /* So we can test for space */
-    ss[0] = ' ';
-    ss[1] = '\0';
-
-    /* Find the entered text in the list of flags */
-    this_flag = strstr (flags, text);
-
-    if (this_flag == NULL || *this_flag == '\0')
-    {
-        if (g_strcmp0 (text, ss) == 0)  // test for space
-        {
-            /* In the list, choose the next item in the list
-               (wrapping around as necessary). */
-
-            if (flags[index + 1] != '\0')
-                index = index + 1;
-            else
-                index = 0;
-
-            g_free (result);
-            result = g_strdup_printf("%c", flags[index]);
-        }
-        else
-        {
-            /* If it's not there (or the list is empty) use default_flag */
-            g_free (result);
-            result  = g_strdup (TXN_TYPE_NONE);
-        }
-    }
-    else
-    {
-        g_free (result);
-        result = g_strdup (text);
-    }
-
-    /* save the index in the cellrenderer */
-    g_object_set_data (G_OBJECT (view->priv->temp_cr), "current-flag", GINT_TO_POINTER (index));
-
-    g_signal_handlers_block_by_func (editable, (gpointer) gtv_sr_type_cb, user_data);
-
-    gtk_editable_delete_text (editable, 0, -1);
-    gtk_editable_insert_text (editable, result, length, position);
-
-    g_signal_handlers_unblock_by_func (editable, (gpointer) gtv_sr_type_cb, user_data);
-
-    g_signal_stop_emission_by_name (editable, "insert_text");
-
-    g_free (result);
-}
-
-
-/* For handling keynav */
-static gboolean
-gtv_sr_ed_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer user_data)
-{
-    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-    GncTreeModelSplitReg *model;
-    GtkTreeViewColumn *col;
-    GtkTreePath *spath, *start_spath;
-    gboolean goto_blank = FALSE;
-    gboolean next_trans = TRUE;
-    Transaction *btrans, *ctrans;
-    gint depth;
-    gboolean auto_popped = FALSE;
-
-    // spath is where we are, before key press...
-    gtk_tree_view_get_cursor (GTK_TREE_VIEW (view), &spath, &col);
-
-    if (event->type != GDK_KEY_PRESS)
-    {
-        if (spath)
-            gtk_tree_path_free (spath);
-        return FALSE;
-    }
-
-    switch (event->keyval)
-    {
-
-    case GDK_KEY_Up:
-    case GDK_KEY_Down:
-
-        if (!spath)
-            return TRUE;
-
-        // This is to test for the auto completion popup window
-        {
-            GtkWidget *toplevel;
-            GtkWindowGroup *window_group;
-            GList *win_list;
-
-            toplevel = gtk_widget_get_toplevel (widget);
-            if (GTK_IS_WINDOW (toplevel))
-            {
-                window_group = gtk_window_get_group (GTK_WINDOW (toplevel));
-                win_list = gtk_window_group_list_windows (window_group);
-                if (g_list_length (win_list) == 1 && gtk_widget_get_visible (GTK_WIDGET (win_list->data)))
-                    auto_popped = TRUE;
-
-            g_list_free (win_list);
-            }
-        }
-
-        // Auto complete window popped
-        if (auto_popped == TRUE)
-        {
-            gtk_tree_path_free (spath);
-            return FALSE;
-        }
-
-        model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-        // Make sure we have stopped editing.
-        gnc_tree_view_split_reg_finish_edit (view);
-
-        // This stops the cell changing.
-        if (view->priv->stop_cell_move == TRUE)
-        {
-            gtk_tree_path_free (spath);
-            return TRUE;
-        }
-
-        depth = gtk_tree_path_get_depth (spath);
-        if (event->keyval == GDK_KEY_Up)
-        {
-            if (depth == 1)
-            {
-                if (gtk_tree_path_prev (spath))
-                {
-                    if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (view), spath))
-                    {
-                        gtk_tree_path_down (spath);
-
-                        if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (view), spath) && model->type == GENERAL_LEDGER2)
-                        {
-                            gtk_tree_path_down (spath);
-
-                            while (gnc_tree_view_path_is_valid (GNC_TREE_VIEW (view), spath))
-                            {
-                                gtk_tree_path_next (spath);
-                            }
-                            gtk_tree_path_prev (spath);
-                        }
-                    }
-                }
-            }
-            else if (!gtk_tree_path_prev (spath) && depth > 1)
-            {
-                gtk_tree_path_up (spath);
-            }
-        }
-        else if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (view), spath))
-        {
-            gtk_tree_path_down (spath);
-        }
-        else
-        {
-            gtk_tree_path_next (spath);
-            if (!gnc_tree_view_path_is_valid (GNC_TREE_VIEW (view), spath) && depth > 2)
-            {
-                gtk_tree_path_prev (spath);
-                gtk_tree_path_up (spath);
-                gtk_tree_path_next (spath);
-            }
-            if (!gnc_tree_view_path_is_valid (GNC_TREE_VIEW (view), spath) && depth > 1)
-            {
-                gtk_tree_path_prev (spath);
-                gtk_tree_path_up (spath);
-                gtk_tree_path_next (spath);
-            }
-        }
-
-        /* Set cursor to new column, open for editing */
-        gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), spath, col, TRUE);
-
-        if (event->keyval == GDK_KEY_Up)
-        {
-            gnc_tree_model_split_reg_move (model, VIEW_UP);
-        }
-        else
-            gnc_tree_model_split_reg_move (model, VIEW_DOWN);
-
-        return TRUE;
-        break;
-
-    case GDK_KEY_Return:
-
-        if (!spath)
-            return TRUE;
-
-        // This stops the cell changing.
-        if (view->priv->stop_cell_move == TRUE)
-        {
-            gtk_tree_path_free (spath);
-            return TRUE;
-        }
-
-        // Do sums if we have ctrl key
-        if (event->state & GDK_CONTROL_MASK)
-        {
-            // Make sure we have stopped editing.
-            gnc_tree_view_split_reg_finish_edit (view);
-
-            /* Set cursor to the column, open for editing */
-            gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), spath, col, TRUE);
-            gtk_tree_path_free (spath);
-            return TRUE;
-        }
-        return FALSE;
-        break;
-
-    case GDK_KEY_KP_Enter:
-
-        if (!spath)
-            return TRUE;
-
-        // This stops the cell changing.
-        if (view->priv->stop_cell_move == TRUE)
-        {
-            gtk_tree_path_free (spath);
-            return TRUE;
-        }
-
-        goto_blank = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER,
-                                         GNC_PREF_ENTER_MOVES_TO_END);
-
-        model = gnc_tree_view_split_reg_get_model_from_view (view);
-        btrans = gnc_tree_model_split_get_blank_trans (model);
-        ctrans = gnc_tree_view_split_reg_get_current_trans (view);
-
-        /* Are we on the blank transaction */
-        if (btrans == ctrans)
-            next_trans = FALSE;
-
-        /* First record the transaction */
-        if (gnc_tree_view_split_reg_enter (view))
-        {
-            /* Now move. */
-            if (goto_blank)
-                g_idle_add ((GSourceFunc)gnc_tree_control_split_reg_jump_to_blank, view);
-            else if (next_trans)
-                gnc_tree_control_split_reg_goto_rel_trans_row (view, 1);
-        }
-        return TRUE;
-        break;
-
-    default:
-        gtk_tree_path_free (spath);
-	return FALSE;
-    }
-}
-
-/*###########################################################################*/
-
-/* The main Start Editing Call back for the TEXT columns */
-static void
-gtv_sr_editable_start_editing_cb (GtkCellRenderer *cr, GtkCellEditable *editable,
-                              const gchar *path_string, gpointer user_data)
-{
-    GncTreeViewSplitReg  *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-    GncTreeModelSplitReg *model;
-    GtkTreeModel         *s_model;
-    GtkTreePath          *spath, *mpath, *fpath;
-    GtkEntry             *entry = NULL;
-    ViewCol               viewcol;
-    RowDepth              depth;
-    gint                 *indices;
-
-    GtkListStore *description_list;
-    GtkListStore *memo_list;
-    GtkListStore *notes_list;
-    GtkListStore *account_list;
-
-    GtkEntryCompletion *completion = gtk_entry_completion_new();
-
-    ENTER("gtv_sr_editable_start_editing_cb Path string is '%s'", path_string);
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    s_model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
-
-    /* Description / Notes / Memo / Accounts Completion Lists */
-    description_list = gnc_tree_model_split_reg_get_description_list (model);
-    notes_list = gnc_tree_model_split_reg_get_notes_list (model);
-    memo_list = gnc_tree_model_split_reg_get_memo_list (model);
-    account_list = gnc_tree_model_split_reg_get_acct_list (model);
-
-    // Use depth to determine if it is a split or transaction
-    spath = gtk_tree_path_new_from_string (path_string);
-    depth = gtk_tree_path_get_depth (spath);
-    indices = gtk_tree_path_get_indices (spath);
-
-    viewcol = GPOINTER_TO_INT (g_object_get_data (G_OBJECT(cr), "view_column"));
-
-    DEBUG("editable Depth is %u and ViewCol is %d", depth, viewcol);
-
-    g_object_set_data (G_OBJECT (cr), "cell-editable", editable);
-
-    // This is for key navigation...
-    g_signal_connect (G_OBJECT (editable), "key-press-event", G_CALLBACK (gtv_sr_ed_key_press_cb), view);
-
-    /* DATE COLUMN */
-    if (viewcol == COL_DATE)
-    {
-        entry = GTK_ENTRY (GNC_POPUP_ENTRY (editable)->entry);
-
-        //Copy the string in the GtkEntry for later comparison
-        g_object_set_data_full (G_OBJECT (cr), "current-string", g_strdup (gtk_entry_get_text (entry)), g_free);
-
-        g_signal_connect (G_OBJECT (editable), "remove-widget", (GCallback) gtv_sr_remove_edit_date, view);
-
-        DEBUG("Current String date is '%s'", gtk_entry_get_text (entry));
-    }
-
-    /* TRANSFER / VOID COLUMN */
-    else if (viewcol == COL_TRANSFERVOID)
-    {
-        entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (editable)));
-
-        // This is for key navigation...
-        g_signal_connect (G_OBJECT (entry), "key-press-event", G_CALLBACK (gtv_sr_ed_key_press_cb), view);
-
-        {
-            GtkEditable *editable = GTK_EDITABLE (entry);
-
-            if (view->priv->stop_cell_move == TRUE)
-            {
-                gint textPosition = 0;
-                gtk_editable_insert_text (GTK_EDITABLE (editable), view->priv->transfer_string, -1, &textPosition);
-                gtk_editable_set_position (GTK_EDITABLE (editable), -1);
-            }
-        }
-
-        // Update the Account list combo.
-        gnc_tree_model_split_reg_update_account_list (model);
-
-        gtk_entry_set_completion (entry, completion);
-        gtk_entry_completion_set_model (completion, GTK_TREE_MODEL (account_list));
-
-        /* This sets which text column to use, 0 for short names, 1 for long */
-        if (view->priv->acct_short_names)
-            gtk_entry_completion_set_text_column (completion, 0);
-        else
-            gtk_entry_completion_set_text_column (completion, 1);
-
-        gtk_entry_completion_set_popup_completion (completion, TRUE);
-        gtk_entry_completion_set_inline_selection (completion, TRUE);
-        gtk_entry_completion_set_popup_set_width (completion, FALSE);
-        gtk_entry_completion_set_minimum_key_length (completion, 1);
-//??        g_signal_connect(G_OBJECT(completion), "match-selected", (GCallback) gtv_sr_match_selected_cb, view);
-        g_object_unref (completion);
-
-        //Copy the string in the GtkEntry for later comparison
-        g_object_set_data_full (G_OBJECT (cr), "current-string", g_strdup (gtk_entry_get_text (entry)), g_free);
-
-        g_signal_connect (G_OBJECT (entry), "insert_text", (GCallback) gtv_sr_acct_cb, view);
-
-//??        g_signal_connect (G_OBJECT (cr), "changed", (GCallback) gtv_sr_changed_cb, view);
-        g_signal_connect (G_OBJECT (editable), "remove-widget", (GCallback) gtv_sr_remove_edit_combo, view);
-
-        DEBUG("Current String tv is '%s'", gtk_entry_get_text (entry));
-    }
-
-    /* NUMBER / ACTION COLUMN */
-    else if (viewcol == COL_NUMACT)
-    {
-        if ((depth == TRANS1) || ((depth == TRANS2) && (qof_book_use_split_action_for_num_field (gnc_get_current_book()))))
-        {
-            entry = GTK_ENTRY (editable);
-
-            //Copy the string in the GtkEntry for later comparison
-            g_object_set_data_full (G_OBJECT (cr), "current-string", g_strdup (gtk_entry_get_text (entry)), g_free);
-
-            g_signal_connect (G_OBJECT (GTK_ENTRY (entry)), "insert_text", (GCallback) gtv_sr_num_cb, view);
-
-            view->priv->fo_handler_id = g_signal_connect (G_OBJECT (editable), "focus-out-event", (GCallback) gtv_sr_focus_out_cb, view);
-
-            g_signal_connect (G_OBJECT (editable), "remove-widget", (GCallback) gtv_sr_remove_edit_entry, view);
-
-//??        g_signal_connect (G_OBJECT (cr), "changed", (GCallback)gtv_sr_changed_cb, view);
-            DEBUG("Current String num is '%s'", gtk_entry_get_text (entry));
-        }
-
-        if ((depth == SPLIT3) || ((depth == TRANS2) && (!qof_book_use_split_action_for_num_field (gnc_get_current_book()))))
-        {
-            gnc_tree_model_split_reg_update_action_list (model);
-
-            entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (editable)));
-
-            //Copy the string in the GtkEntry for later comparison
-            g_object_set_data_full (G_OBJECT (cr), "current-string", g_strdup (gtk_entry_get_text (entry)), g_free);
-
-//??          g_signal_connect (G_OBJECT (cr), "changed", (GCallback) gtv_sr_changed_cb, view);
-            g_signal_connect (G_OBJECT (editable), "remove-widget", (GCallback) gtv_sr_remove_edit_combo, view);
-
-            DEBUG("Current String action is '%s'", gtk_entry_get_text (entry));
-        }
-    }
-
-    /* DESCRIPTION / NOTES / MEMO COLUMN */
-    else if (viewcol == COL_DESCNOTES)
-    {
-        entry = GTK_ENTRY (editable);
-
-        // Update the auto completion lists.
-        gnc_tree_model_split_reg_update_completion (model);
-
-        //Data used for completion is set based on if editing split or not
-        if (depth == TRANS1)
-        {
-            gtk_entry_set_completion (entry, completion);
-            gtk_entry_completion_set_model (completion, GTK_TREE_MODEL (description_list));
-            gtk_entry_completion_set_text_column (completion, 0);
-        }
-        else if (depth == TRANS2)
-        {
-            gtk_entry_set_completion (entry, completion);
-            gtk_entry_completion_set_model (completion, GTK_TREE_MODEL (notes_list));
-            gtk_entry_completion_set_text_column (completion, 0);
-        }
-        else if (depth == SPLIT3)
-        {
-            gtk_entry_set_completion (entry, completion);
-            gtk_entry_completion_set_model (completion, GTK_TREE_MODEL (memo_list));
-            gtk_entry_completion_set_text_column (completion, 0);
-        }
-
-        //To emit "match-selected" signal we need to have a list of matches to
-        //select from instead of using inline autocompletion
-        gtk_entry_completion_set_popup_completion (completion, TRUE);
-        gtk_entry_completion_set_inline_selection (completion, TRUE);
-        gtk_entry_completion_set_minimum_key_length (completion, view->priv->key_length);
-//??        g_signal_connect (G_OBJECT (completion), "match-selected", (GCallback) gtv_sr_match_selected_cb, view);
-
-        g_object_unref (completion);
-
-        //Copy the string in the GtkEntry for later comparison
-        g_object_set_data_full (G_OBJECT (cr), "current-string", g_strdup (gtk_entry_get_text (entry)), g_free);
-
-        view->priv->fo_handler_id = g_signal_connect (G_OBJECT (editable), "focus-out-event", (GCallback) gtv_sr_focus_out_cb, view);
-
-        g_signal_connect (G_OBJECT (editable), "remove-widget", (GCallback) gtv_sr_remove_edit_entry, view);
-
-        DEBUG("Current String dnm is '%s'", gtk_entry_get_text (entry));
-    }
-
-    /* RECN COLUMN */
-    else if (viewcol == COL_RECN)
-    {
-        entry = GTK_ENTRY (editable);
-
-        //Copy the string in the GtkEntry for later comparison
-        g_object_set_data_full (G_OBJECT (cr), "current-string", g_strdup (gtk_entry_get_text (entry)), g_free);
-
-        g_signal_connect (G_OBJECT (GTK_ENTRY (editable)), "insert_text", (GCallback)gtv_sr_recn_cb, view);
-
-        view->priv->fo_handler_id = g_signal_connect (G_OBJECT (editable), "focus-out-event", (GCallback) gtv_sr_focus_out_cb, view);
-
-        g_signal_connect (G_OBJECT (editable), "remove-widget", (GCallback) gtv_sr_remove_edit_entry, view);
-
-//??        g_signal_connect (G_OBJECT (cr), "changed", (GCallback) gtv_sr_changed_cb, view);
-        DEBUG("Current String recn is '%s'", gtk_entry_get_text (entry));
-    }
-
-    /* TYPE COLUMN */
-    else if (viewcol == COL_TYPE)
-    {
-        entry = GTK_ENTRY (editable);
-
-        //Copy the string in the GtkEntry for later comparison
-        g_object_set_data_full (G_OBJECT (cr), "current-string", g_strdup (gtk_entry_get_text (entry)), g_free);
-
-        g_signal_connect (G_OBJECT (GTK_ENTRY (editable)), "insert_text", (GCallback)gtv_sr_type_cb, view);
-
-        view->priv->fo_handler_id = g_signal_connect (G_OBJECT (editable), "focus-out-event", (GCallback) gtv_sr_focus_out_cb, view);
-
-        g_signal_connect (G_OBJECT (editable), "remove-widget", (GCallback) gtv_sr_remove_edit_entry, view);
-
-//??        g_signal_connect (G_OBJECT (cr), "changed", (GCallback) gtv_sr_changed_cb, view);
-        DEBUG("Current String type is '%s'", gtk_entry_get_text (entry));
-    }
-
-    /* THE REST OF THE COLUMNS */
-    else
-    {
-        entry = GTK_ENTRY (editable);
-
-        //Copy the string in the GtkEntry for later comparison
-        g_object_set_data_full (G_OBJECT (cr), "current-string", g_strdup (gtk_entry_get_text (entry)), g_free);
-
-        view->priv->fo_handler_id = g_signal_connect (G_OBJECT (editable), "focus-out-event", (GCallback) gtv_sr_focus_out_cb, view);
-
-        g_signal_connect (G_OBJECT (editable), "remove-widget", (GCallback) gtv_sr_remove_edit_entry, view);
-
-//??        g_signal_connect (G_OBJECT (cr), "changed", (GCallback)gtv_sr_changed_cb, view);
-        DEBUG("Current String rest is '%s'", gtk_entry_get_text (entry));
-    }
-
-    /* Lets change the background of the entry widgets */
-    {
-        GdkColor     color;
-        const gchar *row_color;
-        gboolean     is_trow1 = FALSE;
-        gboolean     is_trow2 = FALSE;
-        gboolean     is_split = FALSE;
-
-        if (depth == TRANS1)
-            is_trow1 = TRUE;
-        if (depth == TRANS2)
-            is_trow2 = TRUE;
-        if (depth == SPLIT3)
-            is_split = TRUE;
-
-        row_color = gnc_tree_model_split_reg_get_row_color (model, is_trow1, is_trow2, is_split, indices[0]);
-
-        if (gdk_color_parse (row_color, &color))
-        {
-            if (entry != NULL)
-                gtk_widget_modify_base (GTK_WIDGET (entry), GTK_STATE_NORMAL, &color);
-        }
-    }
-
-    gtv_sr_help (view, cr, viewcol, depth);
-    gtk_tree_path_free (spath);
-
-    view->priv->temp_cr = cr;
-    view->editing_now = TRUE;
-
-    DEBUG("Temp Cell Rend %p", view->priv->temp_cr);
-
-    //Add edit-canceled property to cr so we can distinguish between
-    //cancelled and actual changes
-    g_object_set_data (G_OBJECT (cr), "edit-canceled", GINT_TO_POINTER (FALSE));
-    LEAVE(" ");
-}
-
-
-// Handle the "match-selected" signal
-static void
-gtv_sr_match_selected_cb (GtkEntryCompletion *widget, GtkTreeModel *model,
-                        GtkTreeIter *iter, gpointer user_data)
-{
-    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-
-//FIXME g_print("gtv_sr_match_selected_cb\n\n");
-
-/* Not sure what I am going to put in here yet if anything */
-
-}
-
-
-// Handle the "changed" signal
-static void
-gtv_sr_changed_cb (GtkCellRendererCombo *widget, gchar *path_string,
-                        GtkTreeIter *iter, gpointer user_data)
-{
-    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-
-//FIXME g_print("gtv_sr_changed_cb path string is '%s'\n\n", path_string);
-
-/* Not sure what I am going to put in here yet if anything */
-
-}
-
-
-// Handle the "editing-canceled" signal
-static void
-gtv_sr_editing_canceled_cb (GtkCellRenderer *cr, gpointer user_data)
-{
-    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-
-    if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (view), "data-edited")) == FALSE) // Not edited, reset edit path
-    {
-        view->priv->dirty_trans = NULL;
-    }
-
-    /* Reset stop_cell_move */
-    if (view->priv->stop_cell_move == TRUE)
-    {
-        view->priv->stop_cell_move = FALSE;
-
-        /* this will populate cell with original value */
-        g_idle_add ((GSourceFunc) gtv_sr_idle_transfer, view);
-    }
-
-    /* Reset Help text */
-    if (view->help_text)
-        g_free (view->help_text);
-    view->help_text = g_strdup (" ");
-    g_signal_emit_by_name (view, "help_signal", NULL);
-
-    //Set edit-canceled property
-    g_object_set_data (G_OBJECT (cr), "edit-canceled", GINT_TO_POINTER (TRUE));	
-}
-
-/*####################################################################
-          ^^^^   gtv function call backs    ^^^^
-#####################################################################*/
-
-/* Scroll the view to show selected row based on sort direction */
-gboolean
-gnc_tree_view_split_reg_scroll_to_cell (GncTreeViewSplitReg *view)
-{
-    GncTreeModelSplitReg *model;
-    GtkTreePath *mpath, *spath;
-
-    PINFO("#### Start Scroll to Cell ####");
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    mpath = gnc_tree_view_split_reg_get_current_path (view);
-    spath = gnc_tree_view_split_reg_get_sort_path_from_model_path (view, mpath);
-
-    if (view->sort_direction == -1)
-    {
-        gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (view), spath, NULL, TRUE, 0.5, 0.0); //0.0
-    }
-    else
-    {
-        if (model->use_double_line)
-        {
-            gtk_tree_path_down (spath); // move to the second row of transaction
-            gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (view), spath, NULL, TRUE, 1.0, 0.0); //1.0
-        }
-        else
-        {
-            gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (view), spath, NULL, TRUE, 1.0, 0.0); //1.0
-        }
-    }
-
-    gtk_tree_path_free (mpath);
-    gtk_tree_path_free (spath);
-
-    PINFO("#### End Scroll to Cell ####");
-
-    return (FALSE);
-}
-
-
-/* Scroll the view to show the blank split with least movement */
-gboolean
-gnc_tree_view_split_reg_scroll_to_bsplit (GncTreeViewSplitReg *view)
-{
-    GncTreeModelSplitReg *model;
-    GtkTreePath *bsplit_mpath, *bsplit_spath;
-    Split *bsplit;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    /* Get the blank split spath */
-    bsplit = gnc_tree_model_split_get_blank_split (model);
-    bsplit_mpath = gnc_tree_model_split_reg_get_path_to_split_and_trans (model, bsplit, NULL);
-    bsplit_spath = gnc_tree_view_split_reg_get_sort_path_from_model_path (view, bsplit_mpath);
-
-    gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (view), bsplit_spath, NULL, FALSE, 1.0, 0.0);
-
-    gtk_tree_path_free (bsplit_mpath);
-    gtk_tree_path_free (bsplit_spath);
-    return (FALSE);
-}
-
-
-/* Returns the Transaction at the current selected position */
-Transaction *
-gnc_tree_view_split_reg_get_current_trans (GncTreeViewSplitReg *view)
-{
-    return view->priv->current_trans;
-}
-
-
-/* Returns the Split at the current selected position or NULL */
-Split *
-gnc_tree_view_split_reg_get_current_split (GncTreeViewSplitReg *view)
-{
-    return view->priv->current_split;
-}
-
-
-/* Returns the depth of the selected row */
-RowDepth
-gnc_tree_view_reg_get_selected_row_depth (GncTreeViewSplitReg *view)
-{
-    return view->priv->current_depth;
-}
-
-
-/* Returns the dirty_trans or NULL */
-Transaction *
-gnc_tree_view_split_reg_get_dirty_trans (GncTreeViewSplitReg *view)
-{
-    return view->priv->dirty_trans;
-}
-
-
-/* Sets dirty_trans to trans or NULL to clear */
-void
-gnc_tree_view_split_reg_set_dirty_trans (GncTreeViewSplitReg *view, Transaction *trans)
-{
-    GncTreeModelSplitReg *model;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    if (trans == NULL)
-    {
-        g_object_set_data (G_OBJECT (view), "data-edited", GINT_TO_POINTER (FALSE));
-        view->priv->dirty_trans = NULL;
-    }
-    else
-    {
-        g_object_set_data (G_OBJECT (view), "data-edited", GINT_TO_POINTER (TRUE));
-        view->priv->dirty_trans = trans;
-    }
-}
-
-
-/* Returns the current path, or NULL if the current path is the blank split. */
-GtkTreePath *
-gnc_tree_view_split_reg_get_current_path (GncTreeViewSplitReg *view)
-{
-    if (!view->priv->current_ref)
-        return NULL;
-    return gtk_tree_row_reference_get_path (view->priv->current_ref);
-}
-
-
-/* Sets the current path reference to path */
-void
-gnc_tree_view_split_reg_set_current_path (GncTreeViewSplitReg *view, GtkTreePath *mpath)
-{
-    GncTreeModelSplitReg *model;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    if (view->priv->current_ref != NULL)
-    {
-        gtk_tree_row_reference_free (view->priv->current_ref);
-        view->priv->current_ref = NULL;
-    }
-    view->priv->current_ref = gtk_tree_row_reference_new (GTK_TREE_MODEL (model), mpath);
-}
-
-
-/* Reinit transaction / delete the splits */
-void
-gnc_tree_view_split_reg_reinit_trans (GncTreeViewSplitReg *view)
-{
-    Transaction           *trans;
-    RowDepth               depth;
-
-    /* Make sure we have stopped editing */
-    gnc_tree_view_split_reg_finish_edit (view);
-
-    trans = view->priv->current_trans;
-
-    // Lets get out of the way, move selection to trans - selection is blocked
-    gnc_tree_control_split_reg_goto_rel_trans_row (view, 0);
-
-    depth = view->priv->current_depth;
-
-    if (trans && (depth != SPLIT3))
-    {
-        Split *s;
-        int i = 0;
-
-        if (!xaccTransIsOpen (trans))
-            xaccTransBeginEdit (trans);
-
-        gnc_tree_view_split_reg_set_dirty_trans (view, trans);
-
-        while ((s = xaccTransGetSplit (trans, i)) != NULL)
-        {
-            if (xaccTransGetRateForCommodity (trans, view->priv->reg_comm, s, NULL))
-                xaccSplitDestroy (s);
-            else i++;
-        }
-    }
-}
-
-
-/* Delete the current split */
-void
-gnc_tree_view_split_reg_delete_current_split (GncTreeViewSplitReg *view)
-{
-    Transaction           *trans;
-    Split                 *split;
-
-    /* Make sure we have stopped editing */
-    gnc_tree_view_split_reg_finish_edit (view);
-
-    trans = view->priv->current_trans;
-    split = view->priv->current_split;
-
-    if (!xaccTransIsOpen (trans))
-        xaccTransBeginEdit (trans);
-
-    gnc_tree_view_split_reg_set_dirty_trans (view, trans);
-
-    // Lets get out of the way, move selection to trans - selection is blocked
-    gnc_tree_control_split_reg_goto_rel_trans_row (view, 0);
-
-    xaccSplitDestroy (split);
-}
-
-
-/* Delete the current transaction */
-void
-gnc_tree_view_split_reg_delete_current_trans (GncTreeViewSplitReg *view)
-{
-    Transaction           *trans;
-
-    /* We do not use the normal confirmation with this one as we have
-       all ready asked the user to confirm delete */
-
-    /* Make sure we have stopped editing */
-    gnc_tree_view_split_reg_finish_edit (view);
-
-    trans = view->priv->current_trans;
-
-    /* We need to go back one to select the next transaction */
-    gnc_tree_control_split_reg_goto_rel_trans_row (view, 1);
-
-    if (!xaccTransIsOpen (trans))
-        xaccTransBeginEdit (trans);
-    gnc_tree_view_split_reg_set_dirty_trans (view, trans);
-
-    xaccTransDestroy (trans);
-    xaccTransCommitEdit (trans);
-
-    gnc_tree_view_split_reg_set_dirty_trans (view, NULL);
-}
-
-
-/* Record changes */
-gboolean
-gnc_tree_view_split_reg_enter (GncTreeViewSplitReg *view)
-{
-    GncTreeModelSplitReg  *model;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    /* Make sure we have stopped editing */
-    gnc_tree_view_split_reg_finish_edit (view);
-
-    // Test for transaction changed
-    if (gtv_sr_transaction_changed (view))
-        return FALSE;
-
-    // Return FALSE on discard
-    if (view->priv->trans_confirm == DISCARD)
-        return FALSE;
-
-    return TRUE;
-}
-
-
-/* Cancel the edit and rollback changes */
-void
-gnc_tree_view_split_reg_cancel_edit (GncTreeViewSplitReg *view, gboolean reg_closing)
-{
-    GncTreeModelSplitReg *model;
-    Transaction          *trans = view->priv->dirty_trans;
-    Split                *split;
-
-    ENTER("gnc_tree_view_split_reg_cancel_edit view is %p and reg_closing is %d", view, reg_closing);
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    if (trans && xaccTransIsOpen (trans))
-    {
-        // Move selection to trans - selection is blocked
-        gnc_tree_control_split_reg_goto_rel_trans_row (view, 0);
-
-        // Remove the split before rollback.
-        gnc_tree_model_split_reg_set_blank_split_parent (model, trans, TRUE);
-
-        g_object_set_data (G_OBJECT (view), "data-edited", GINT_TO_POINTER (FALSE));
-        xaccTransRollbackEdit (view->priv->dirty_trans);
-
-        // Add the split after rollback so it is last in list.
-        gnc_tree_model_split_reg_set_blank_split_parent (model, trans, FALSE);
-
-        // Set the transaction to show correct view
-        gnc_tree_view_split_reg_format_trans (view, view->priv->dirty_trans);
-
-        gnc_tree_view_split_reg_set_dirty_trans (view, NULL);
-
-        split = gnc_tree_model_split_get_blank_split (model);
-        xaccSplitReinit (split); // Clear the blank split
-    }
-    /* Reset allow changes for reconciled transctions */
-    view->change_allowed = FALSE;
-
-    view->priv->auto_complete = FALSE; // reset auto_complete has run flag
-
-    /* This updates the plugin page gui */
-    gnc_tree_view_split_reg_call_uiupdate_cb(view);
-
-    LEAVE(" ");
-}
-
-
-/* Make sure we have stopped editing */
-void
-gnc_tree_view_split_reg_finish_edit (GncTreeViewSplitReg *view)
-{
-    gtv_sr_finish_edit (view);
-
-    /* give gtk+ a chance to handle pending events */
-    while (gtk_events_pending ())
-       gtk_main_iteration ();
-}
-
-
-/* Returns whether the splits are revealed for the transaction or current position
-   if transaction is NULL */
-gboolean
-gnc_tree_view_split_reg_trans_expanded (GncTreeViewSplitReg *view, Transaction *trans)
-{
-    GncTreeModelSplitReg *model;
-    GtkTreePath *mpath, *spath;
-    gboolean expanded;
-
-    /* if trans is NULL use priv->expanded */
-    if (trans == NULL)
-        expanded = view->priv->expanded;
-    else
-    {
-        model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-        mpath = gnc_tree_model_split_reg_get_path_to_split_and_trans (model, NULL, trans);
-
-        spath = gnc_tree_view_split_reg_get_sort_path_from_model_path (view, mpath);
-
-        gtk_tree_path_down (spath); /* Move the path down to trow2 */
-
-        expanded = gtk_tree_view_row_expanded (GTK_TREE_VIEW (view), spath);
-
-        gtk_tree_path_free (mpath);
-        gtk_tree_path_free (spath);
-    }
-    return expanded;
-}
-
-
-/* Collapse the transaction, if trans is NULL, use current_ref */
-void
-gnc_tree_view_split_reg_collapse_trans (GncTreeViewSplitReg *view, Transaction *trans)
-{
-    GncTreeModelSplitReg *model;
-    GtkTreePath *temp_spath, *mpath, *spath;
-    GtkTreeIter m_iter;
-    gint *indices;
-    RowDepth depth;
-
-    ENTER("gnc_tree_view_split_reg_collapse_trans and trans is %p", trans);
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    /* Make sure we have stopped editing */
-    gnc_tree_view_split_reg_finish_edit (view);
-
-    /* if trans is NULL use current_ref */
-    if (trans == NULL)
-        mpath = gtk_tree_row_reference_get_path (view->priv->current_ref);
-    else
-        mpath = gnc_tree_model_split_reg_get_path_to_split_and_trans (model, NULL, trans);
-
-    spath = gnc_tree_view_split_reg_get_sort_path_from_model_path (view, mpath);
-
-    /* Collapse the view back to the transaction */
-    indices = gtk_tree_path_get_indices (spath);
-    depth = gtk_tree_path_get_depth (spath);
-
-    if (model->use_double_line)
-        temp_spath = gtk_tree_path_new_from_indices (indices[0], 0, -1);
-    else
-        temp_spath = gtk_tree_path_new_from_indices (indices[0], -1);
-
-    /* if trans is NULL, collapse and update current_ref */
-    if (trans == NULL)
-    {
-        GtkTreePath *temp_mpath;
-
-        gnc_tree_view_split_reg_block_selection (view, TRUE);
-
-        /* Change the selection to last available row of transaction - double */
-        if ((model->use_double_line) && (depth == SPLIT3))
-            gtk_tree_selection_select_path (gtk_tree_view_get_selection (GTK_TREE_VIEW (view)), temp_spath);
-
-        /* Change the selection to last available row of transaction - single */
-        if ((!model->use_double_line) && (depth != TRANS1))
-            gtk_tree_selection_select_path (gtk_tree_view_get_selection (GTK_TREE_VIEW (view)), temp_spath);
-
-        gtk_tree_view_collapse_row (GTK_TREE_VIEW (view), temp_spath);
-
-        /* Get the selection */
-        if (gtv_sr_get_model_iter_from_selection (view, gtk_tree_view_get_selection (GTK_TREE_VIEW (view)), &m_iter))
-        {
-            temp_mpath = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &m_iter);
-
-            /* Update the tree view titles */
-            gtv_sr_titles (view, gtk_tree_path_get_depth (temp_mpath));
-
-            /* Save the new model path to path ref */
-            gnc_tree_view_split_reg_set_current_path (view, temp_mpath);
-
-            gtk_tree_path_free (temp_mpath);
-        }
-        gnc_tree_view_split_reg_block_selection (view, FALSE);
-    }
-    else
-        gtk_tree_view_collapse_row (GTK_TREE_VIEW (view), temp_spath);
-
-    gtk_tree_path_free (temp_spath);
-    gtk_tree_path_free (mpath);
-    gtk_tree_path_free (spath);
-
-    view->priv->expanded = FALSE;
-
-    /* This updates the plugin page gui */
-    gnc_tree_view_split_reg_call_uiupdate_cb(view);
-
-    LEAVE(" ");
-}
-
-
-/* Expands the transaction or the current transaction if NULL */
-void
-gnc_tree_view_split_reg_expand_trans (GncTreeViewSplitReg *view, Transaction *trans)
-{
-    GncTreeModelSplitReg *model;
-    GtkTreePath *mpath, *spath;
-    GtkTreePath *start_path, *end_path;
-    gint *indices_spath;
-    gint num_splits;
-
-    ENTER("gnc_tree_view_split_reg_expand_trans and trans is %p", trans);
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    /* Make sure we have stopped editing */
-    gnc_tree_view_split_reg_finish_edit (view);
-
-    if (trans == NULL)
-        mpath = gtk_tree_row_reference_get_path (view->priv->current_ref);
-    else
-        mpath = gnc_tree_model_split_reg_get_path_to_split_and_trans (model, NULL, trans);
-
-    spath = gnc_tree_view_split_reg_get_sort_path_from_model_path (view, mpath);
-
-    gtk_tree_view_expand_row (GTK_TREE_VIEW (view), spath, TRUE);
-
-    view->priv->expanded = TRUE;
-
-    if (view->priv->selection_to_blank_on_expand && (model->style != REG2_STYLE_JOURNAL))
-        gtv_sr_selection_to_blank (view);
-
-    /* Get spath indices and the number of splits */
-    indices_spath = gtk_tree_path_get_indices (spath);
-    num_splits = xaccTransCountSplits (view->priv->current_trans);
-
-    if (gtk_tree_view_get_visible_range (GTK_TREE_VIEW (view), &start_path, &end_path))
-    {
-        gint *indices_start, *indices_end;
-        gint lines = 0;
-
-        /* The first and last visible path */
-        indices_start = gtk_tree_path_get_indices (start_path);
-        indices_end = gtk_tree_path_get_indices (end_path);
-
-        if (model->use_double_line)
-            lines = (indices_end[0] - indices_spath[0])*2;
-        else
-            lines = indices_end[0] - indices_spath[0];
-
-        if ((num_splits + 1) > lines)
-        {
-            /* scroll window to show selection when view is idle */
-            g_idle_add ((GSourceFunc) gnc_tree_view_split_reg_scroll_to_bsplit, view );
-        }
-        gtk_tree_path_free (start_path);
-        gtk_tree_path_free (end_path);
-    }
-    gtk_tree_path_free (mpath);
-    gtk_tree_path_free (spath);
-
-    /* This updates the plugin page gui */
-    gnc_tree_view_split_reg_call_uiupdate_cb(view);
-
-    LEAVE(" ");
-}
-
-
-/* Return the credit and debit titles of those columns */
-const char *
-gnc_tree_view_split_reg_get_credit_debit_string (GncTreeViewSplitReg *view, gboolean credit)
-{
-    GtkCellRenderer *cr0;
-    GList *renderers;
-    GList *columns;
-    GList  *column;
-    gint i;
-    const char *title = NULL;
-
-    columns = gtk_tree_view_get_columns (GTK_TREE_VIEW (view));
-
-    for ( column = columns, i = 1; column; column = g_list_next (column), i++)
-    {
-        GtkTreeViewColumn *tvc;
-        ViewCol viewcol;
-
-        tvc = column->data;
-
-        // Get the first renderer, it has the view-column value.
-        renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (tvc));
-        cr0 = g_list_nth_data (renderers, 0);
-        g_list_free (renderers);
-
-        viewcol = GPOINTER_TO_INT (g_object_get_data (G_OBJECT(cr0), "view_column"));
-
-        DEBUG("viewcol is %d", viewcol);
-
-        if (viewcol == COL_CREDIT && credit)
-            title = gtk_tree_view_column_get_title (tvc);
-
-        if (viewcol == COL_DEBIT && !credit)
-            title = gtk_tree_view_column_get_title (tvc);
-    }
-    g_list_free (columns);
-    return title;
-}
-
-
-/* Returns the parent Window */
-GtkWidget *
-gnc_tree_view_split_reg_get_parent (GncTreeViewSplitReg *view)
-{
-    GncTreeModelSplitReg *model;
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-    return gnc_tree_model_split_reg_get_parent (model);
-}
-
-
-/* This sets up the page gui update from the tree view motion callback */
-void
-gnc_tree_view_split_reg_set_uiupdate_cb (GncTreeViewSplitReg *view, GFunc cb, gpointer cb_data)
-{
-    view->uiupdate_cb = cb;
-    view->uiupdate_cb_data = cb_data;
-}
-
-/** Call the moved_cb callback that is used to update the page ui, if it is
-set. If it is not set, this function does nothing.
-
-\return FALSE so that this function can be used in g_idle_add() */
-gboolean gnc_tree_view_split_reg_call_uiupdate_cb(GncTreeViewSplitReg *view)
-{
-    g_assert(view);
-    if (view->uiupdate_cb)
-        (view->uiupdate_cb)(view, view->uiupdate_cb_data);
-    return FALSE;
-}
-

Deleted: gnucash/trunk/src/gnome-utils/gnc-tree-view-split-reg.h
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-view-split-reg.h	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-view-split-reg.h	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,190 +0,0 @@
-/********************************************************************\
- * gnc-tree-view-split-reg.h -- GtkTreeView implementation to       *
- *                     display registers   in a GtkTreeView.        *
- *                                                                  *
- * Copyright (C) 2006-2007 Chris Shoemaker <c.shoemaker at cox.net>    *
- * Copyright (C) 2012 Robert Fewell                                 *
- *                                                                  *
- * 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_TREE_VIEW_SPLIT_REG_H
-#define __GNC_TREE_VIEW_SPLIT_REG_H
-
-#include <gtk/gtk.h>
-#include "gnc-tree-view.h"
-
-#include "gnc-tree-model-split-reg.h"
-#include "gnc-ui-util.h"
-
-G_BEGIN_DECLS
-
-#define GNC_TYPE_TREE_VIEW_SPLIT_REG            (gnc_tree_view_split_reg_get_type ())
-#define GNC_TREE_VIEW_SPLIT_REG(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_TREE_VIEW_SPLIT_REG, GncTreeViewSplitReg))
-#define GNC_TREE_VIEW_SPLIT_REG_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_TREE_VIEW_SPLIT_REG, GncTreeViewSplitRegClass))
-#define GNC_IS_TREE_VIEW_SPLIT_REG(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_TREE_VIEW_SPLIT_REG))
-#define GNC_IS_TREE_VIEW_SPLIT_REG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_TREE_VIEW_SPLIT_REG))
-#define GNC_TREE_VIEW_SPLIT_REG_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_TREE_VIEW_SPLIT_REG, GncTreeViewSplitRegClass))
-
-/* typedefs & structures */
-typedef struct GncTreeViewSplitRegPrivate GncTreeViewSplitRegPrivate;
-
-typedef struct
-{
-    GncTreeView                 gnc_tree_view;
-    GncTreeViewSplitRegPrivate *priv;
-    int                         stamp;
-
-    GtkWidget                  *window;                   // Parent Window.
-    GFunc                       uiupdate_cb;                 // Used for page gui update
-    gpointer                    uiupdate_cb_data;            // Used for page gui update
-
-    gchar                      *help_text;                // This is the help text to be displayed.
-    gint                        sort_depth;               // This is the row the sort direction is based on.
-    gint                        sort_col;                 // This is the column the sort direction is based on.
-    gint                        sort_direction;           // This is the direction of sort, 1 for ascending or -1 rest
-    gboolean                    reg_closing;              // This is set when closing the register.
-    gboolean                    change_allowed;           // This is set when we allow the reconciled split to change.
-    gboolean                    editing_now;              // This is set while editing of a cell.
-    gboolean                    show_extra_dates;         // Show the entered date below the posted date and reconciled date on split row
-
-
-} GncTreeViewSplitReg;
-
-typedef struct
-{
-    GncTreeViewClass gnc_tree_view;
-
-    /* This signal is emitted when we update the view */
-    void (*update_signal) (GncTreeViewSplitReg *view, gpointer user_data);
-
-    /* This signal is emitted when we update the help text */
-    void (*help_signal) (GncTreeViewSplitReg *view, gpointer user_data);
-
-} GncTreeViewSplitRegClass;
-
-typedef enum {
-    TOP,    //0
-    TRANS1, //1
-    TRANS2, //2
-    SPLIT3, //3
-}RowDepth;
-
-typedef enum {
-    COL_END_OF_LIST = -1,
-    COL_CONTROL,      //0 TreeView Control columns
-    COL_DATE,         //1
-    COL_DUEDATE,      //2
-    COL_NUMACT,       //3
-    COL_DESCNOTES,    //4
-    COL_TRANSFERVOID, //5
-    COL_RECN,         //6
-    COL_TYPE,         //7
-    COL_VALUE,        //8
-    COL_AMOUNT,       //9
-    COL_AMTVAL,       //10
-    COL_RATE,         //11
-    COL_PRICE,        //12
-    COL_DEBIT,        //13
-    COL_CREDIT,       //14
-    COL_BALANCE,      //15
-    COL_STATUS,       //16
-    COL_COMM,         //17
-} ViewCol;
-
-/* Standard g_object type */
-GType gnc_tree_view_split_reg_get_type (void);
-
-GncTreeViewSplitReg *gnc_tree_view_split_reg_new_with_model (GncTreeModelSplitReg *model);
-
-void gnc_tree_view_split_reg_block_selection (GncTreeViewSplitReg *view, gboolean block);
-
-void gnc_tree_view_split_reg_default_selection (GncTreeViewSplitReg *view);
-
-gboolean gnc_tree_view_split_reg_set_format (GncTreeViewSplitReg *view);
-
-void gnc_tree_view_split_reg_set_read_only (GncTreeViewSplitReg *view, gboolean read_only);
-
-void gnc_tree_view_split_reg_set_dirty_trans (GncTreeViewSplitReg *view, Transaction *trans);
-
-Transaction * gnc_tree_view_split_reg_get_current_trans (GncTreeViewSplitReg *view);
-
-Split * gnc_tree_view_split_reg_get_current_split (GncTreeViewSplitReg *view);
-
-Transaction * gnc_tree_view_split_reg_get_dirty_trans (GncTreeViewSplitReg *view);
-
-GtkTreePath * gnc_tree_view_split_reg_get_current_path (GncTreeViewSplitReg *view);
-
-void gnc_tree_view_split_reg_set_current_path (GncTreeViewSplitReg *view, GtkTreePath *mpath);
-
-RowDepth gnc_tree_view_reg_get_selected_row_depth (GncTreeViewSplitReg *view);
-
-void gnc_tree_view_split_reg_set_uiupdate_cb (GncTreeViewSplitReg *view, GFunc cb, gpointer cb_data);
-
-gboolean gnc_tree_view_split_reg_call_uiupdate_cb(GncTreeViewSplitReg *view);
-
-void gnc_tree_view_split_reg_refresh_from_prefs (GncTreeViewSplitReg *view);
-
-GtkWidget * gnc_tree_view_split_reg_get_parent (GncTreeViewSplitReg *view);
-
-gboolean gnc_tree_view_split_reg_trans_expanded (GncTreeViewSplitReg *view, Transaction *trans);
-
-void gnc_tree_view_split_reg_expand_trans (GncTreeViewSplitReg *view, Transaction *trans);
-
-void gnc_tree_view_split_reg_collapse_trans (GncTreeViewSplitReg *view, Transaction *trans);
-
-const char * gnc_tree_view_split_reg_get_credit_debit_string (GncTreeViewSplitReg *view, gboolean credit);
-
-gnc_commodity * gnc_tree_view_split_reg_get_reg_commodity (GncTreeViewSplitReg *view);
-
-/*************************************************************************************/
-/* Get sort model path from the model path */
-GtkTreePath * gnc_tree_view_split_reg_get_sort_path_from_model_path (GncTreeViewSplitReg *view, GtkTreePath *mpath);
-
-/* Get model path from the sort model path */
-GtkTreePath * gnc_tree_view_split_reg_get_model_path_from_sort_path (GncTreeViewSplitReg *view, GtkTreePath *spath);
-
-/* Get model from the view */
-GncTreeModelSplitReg * gnc_tree_view_split_reg_get_model_from_view (GncTreeViewSplitReg *view);
-
-/* Scroll the view to the current transaction */
-gboolean gnc_tree_view_split_reg_scroll_to_cell (GncTreeViewSplitReg *view);
-
-/* Scroll the view to the blank split */
-gboolean gnc_tree_view_split_reg_scroll_to_bsplit (GncTreeViewSplitReg *view);
-
-/*************************************************************************************/
-
-void gnc_tree_view_split_reg_delete_current_split (GncTreeViewSplitReg *view);
-
-void gnc_tree_view_split_reg_delete_current_trans (GncTreeViewSplitReg *view);
-
-void gnc_tree_view_split_reg_reinit_trans (GncTreeViewSplitReg *view);
-
-gboolean gnc_tree_view_split_reg_enter (GncTreeViewSplitReg *view);
-
-void gnc_tree_view_split_reg_cancel_edit (GncTreeViewSplitReg *view, gboolean reg_closing);
-
-void gnc_tree_view_split_reg_finish_edit (GncTreeViewSplitReg *view);
-
-
-G_END_DECLS
-
-#endif /* __GNC_TREE_VIEW_SPLIT_REG_H */

Modified: gnucash/trunk/src/gnome-utils/gtkbuilder/dialog-preferences.glade
===================================================================
--- gnucash/trunk/src/gnome-utils/gtkbuilder/dialog-preferences.glade	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/gnome-utils/gtkbuilder/dialog-preferences.glade	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1312,6 +1312,57 @@
                   <placeholder/>
                 </child>
                 <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
                   <object class="GtkLabel" id="label50">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
@@ -1783,15 +1834,6 @@
                   </packing>
                 </child>
                 <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
                   <object class="GtkLabel" id="label84">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
@@ -1859,48 +1901,6 @@
                   </packing>
                 </child>
                 <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
                   <object class="GtkCheckButton" id="pref/general/save-on-close-expires">
                     <property name="label" translatable="yes">Enable timeout on "Save changes on closing" question</property>
                     <property name="visible">True</property>
@@ -1920,6 +1920,12 @@
                   </packing>
                 </child>
                 <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
                   <object class="GtkLabel" id="label15">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
@@ -1988,12 +1994,6 @@
                   <placeholder/>
                 </child>
                 <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
                   <object class="GtkLabel" id="label19">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
@@ -2563,7 +2563,7 @@
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="border_width">6</property>
-                <property name="n_rows">15</property>
+                <property name="n_rows">10</property>
                 <property name="n_columns">4</property>
                 <child>
                   <placeholder/>
@@ -2590,12 +2590,6 @@
                   <placeholder/>
                 </child>
                 <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
                   <object class="GtkLabel" id="label63">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
@@ -2811,131 +2805,6 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkLabel" id="label14">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">Number of _characters for auto complete:</property>
-                    <property name="use_underline">True</property>
-                    <property name="mnemonic_widget">pref/general.register/key-length</property>
-                  </object>
-                  <packing>
-                    <property name="top_attach">10</property>
-                    <property name="bottom_attach">11</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"/>
-                    <property name="x_padding">12</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkSpinButton" id="pref/general.register/key-length">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="has_tooltip">True</property>
-                    <property name="tooltip_markup">This sets the number of characters before auto complete starts for description, notes and memo fields.</property>
-                    <property name="tooltip_text" translatable="yes">This sets the number of characters before auto complete starts for description, notes and memo fields.</property>
-                    <property name="invisible_char">●</property>
-                    <property name="invisible_char_set">True</property>
-                    <property name="primary_icon_activatable">False</property>
-                    <property name="secondary_icon_activatable">False</property>
-                    <property name="primary_icon_sensitive">True</property>
-                    <property name="secondary_icon_sensitive">True</property>
-                    <property name="adjustment">key_length_adj</property>
-                    <property name="climb_rate">1</property>
-                    <property name="snap_to_ticks">True</property>
-                    <property name="numeric">True</property>
-                    <property name="update_policy">if-valid</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">3</property>
-                    <property name="right_attach">4</property>
-                    <property name="top_attach">10</property>
-                    <property name="bottom_attach">11</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkCheckButton" id="pref/general.register/show-extra-dates">
-                    <property name="label" translatable="yes">Show the _entered and reconcile dates</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="tooltip_markup">Show the date when the transaction was entered below the posted date and reconciled date on split row.</property>
-                    <property name="tooltip_text" translatable="yes">Show the date when the transaction was entered below the posted date and reconciled date on split row.</property>
-                    <property name="use_underline">True</property>
-                    <property name="draw_indicator">True</property>
-                  </object>
-                  <packing>
-                    <property name="right_attach">4</property>
-                    <property name="top_attach">11</property>
-                    <property name="bottom_attach">12</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"/>
-                    <property name="x_padding">12</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkCheckButton" id="pref/general.register/show-calendar-buttons">
-                    <property name="label" translatable="yes">Show the calendar b_uttons</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="tooltip_markup">Show the calendar buttons Cancel, Today and Select.</property>
-                    <property name="tooltip_text" translatable="yes">Show the calendar buttons Cancel, Today and Select.</property>
-                    <property name="use_underline">True</property>
-                    <property name="draw_indicator">True</property>
-                  </object>
-                  <packing>
-                    <property name="right_attach">4</property>
-                    <property name="top_attach">13</property>
-                    <property name="bottom_attach">14</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"/>
-                    <property name="x_padding">12</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkCheckButton" id="pref/general.register/selection-to-blank-on-expand">
-                    <property name="label" translatable="yes">_Move the selection to the blank split on expand</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="tooltip_markup">This will move the selection to the blank split when the transaction is expanded.</property>
-                    <property name="tooltip_text" translatable="yes">This will move the selection to the blank split when the transaction is expanded.</property>
-                    <property name="use_underline">True</property>
-                    <property name="draw_indicator">True</property>
-                  </object>
-                  <packing>
-                    <property name="right_attach">4</property>
-                    <property name="top_attach">14</property>
-                    <property name="bottom_attach">15</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"/>
-                    <property name="x_padding">12</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkCheckButton" id="pref/general.register/show-extra-dates-on-selection">
-                    <property name="label" translatable="yes">_Show entered and reconciled dates on selection</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="tooltip_markup">Show the entered date and reconciled date on transaction selection.</property>
-                    <property name="tooltip_text" translatable="yes">Show the entered date and reconciled date on transaction selection.</property>
-                    <property name="use_underline">True</property>
-                    <property name="draw_indicator">True</property>
-                  </object>
-                  <packing>
-                    <property name="right_attach">4</property>
-                    <property name="top_attach">12</property>
-                    <property name="bottom_attach">13</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"/>
-                    <property name="x_padding">12</property>
-                  </packing>
-                </child>
-                <child>
                   <placeholder/>
                 </child>
                 <child>

Modified: gnucash/trunk/src/import-export/aqbanking/gnc-plugin-aqbanking.c
===================================================================
--- gnucash/trunk/src/import-export/aqbanking/gnc-plugin-aqbanking.c	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/import-export/aqbanking/gnc-plugin-aqbanking.c	2013-10-22 18:26:55 UTC (rev 23314)
@@ -46,7 +46,6 @@
 #include "gnc-plugin-manager.h"
 #include "gnc-plugin-page-account-tree.h"
 #include "gnc-plugin-page-register.h"
-#include "gnc-plugin-page-register2.h"
 #include "gnc-main-window.h"
 #include "gnc-prefs.h"
 #include "gnc-ui-util.h" // for gnc_get_current_book
@@ -445,12 +444,6 @@
         account = gnc_plugin_page_register_get_account(
                       GNC_PLUGIN_PAGE_REGISTER(page));
     }
-    else if (strcmp(page_name, GNC_PLUGIN_PAGE_REGISTER2_NAME) == 0)
-    {
-        DEBUG("register2 page");
-        account = gnc_plugin_page_register2_get_account(
-                      GNC_PLUGIN_PAGE_REGISTER2(page));
-    }
     else if (strcmp(page_name, GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME) == 0)
     {
         DEBUG("account tree page");

Modified: gnucash/trunk/src/register/ledger-core/Makefile.am
===================================================================
--- gnucash/trunk/src/register/ledger-core/Makefile.am	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/register/ledger-core/Makefile.am	2013-10-22 18:26:55 UTC (rev 23314)
@@ -4,7 +4,6 @@
 
 libgncmod_ledger_core_la_SOURCES = \
   gnc-ledger-display.c \
-  gnc-ledger-display2.c \
   gncmod-ledger-core.c \
   split-register.c \
   split-register-control.c \
@@ -16,7 +15,6 @@
 
 noinst_HEADERS = \
   gnc-ledger-display.h \
-  gnc-ledger-display2.h \
   split-register.h \
   split-register-control.h \
   split-register-layout.h \

Deleted: gnucash/trunk/src/register/ledger-core/gnc-ledger-display2.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/gnc-ledger-display2.c	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/register/ledger-core/gnc-ledger-display2.c	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,1039 +0,0 @@
-/********************************************************************\
- * gnc-ledger-display.c -- utilities for dealing with multiple      *
- *                         register/ledger windows in GnuCash       *
- *                                                                  *
- * Copyright (C) 1997 Robin D. Clark                                *
- * Copyright (C) 1997, 1998 Linas Vepstas                           *
- * Copyright (C) 2012 Robert Fewell                                 *
- *                                                                  *
- * 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"
-
-#include <time.h>
-
-#include "Account.h"
-#include "Query.h"
-#include "qof.h"
-#include "SX-book.h"
-#include "Transaction.h"
-#include "gnc-component-manager.h"
-#include "gnc-date.h"
-#include "gnc-engine.h"
-#include "gnc-event.h"
-#include "gnc-ledger-display2.h"
-#include "gnc-prefs.h"
-#include "gnc-ui-util.h"
-
-#include "split-register-control.h"
-#include "split-register-model.h"
-
-#include "gnc-tree-model-split-reg.h"
-
-
-#define REGISTER_SINGLE_CM_CLASS     "register-single"
-#define REGISTER_SUBACCOUNT_CM_CLASS "register-subaccount"
-#define REGISTER_GL_CM_CLASS         "register-gl"
-#define REGISTER_TEMPLATE_CM_CLASS   "register-template"
-
-#define GNC_PREF_DOUBLE_LINE_MODE         "double-line-mode"
-#define GNC_PREF_MAX_TRANS                "max-transactions"
-#define GNC_PREF_DEFAULT_STYLE_LEDGER     "default-style-ledger"
-#define GNC_PREF_DEFAULT_STYLE_AUTOLEDGER "default-style-autoledger"
-#define GNC_PREF_DEFAULT_STYLE_JOURNAL    "default-style-journal"
-
-
-struct gnc_ledger_display2
-{
-    GncGUID leader;
-
-    Query *query;
-
-    GNCLedgerDisplay2Type ld_type;
-
-    GncTreeModelSplitReg *model; //FIXME Might get rid of this and use function to find.
-    GncTreeViewSplitReg *view;
-
-    gboolean refresh_ok;
-
-    gboolean loading;
-    gboolean use_double_line_default;
-
-    GNCLedgerDisplay2Destroy destroy;
-    GNCLedgerDisplay2GetParent get_parent;
-
-    gpointer user_data;
-
-    gint component_id;
-};
-
-
-/** GLOBALS *********************************************************/
-static QofLogModule log_module = GNC_MOD_LEDGER;
-
-
-/** Declarations ****************************************************/
-static GNCLedgerDisplay2 *
-gnc_ledger_display2_internal (Account *lead_account, Query *q,
-                             GNCLedgerDisplay2Type ld_type,
-                             SplitRegisterType2 reg_type,
-                             SplitRegisterStyle2 style,
-                             gboolean use_double_line,
-                             gboolean is_template);
-
-static void gnc_ledger_display2_refresh_internal (GNCLedgerDisplay2 *ld, GList *splits);
-
-static void gnc_ledger_display2_refresh_cb (GncTreeModelSplitReg *model, gpointer item, gpointer user_data);
-
-/** Implementations *************************************************/
-
-Account *
-gnc_ledger_display2_leader (GNCLedgerDisplay2 *ld)
-{
-    if (!ld)
-        return NULL;
-
-    return xaccAccountLookup (&ld->leader, gnc_get_current_book ());
-}
-
-GNCLedgerDisplay2Type
-gnc_ledger_display2_type (GNCLedgerDisplay2 *ld)
-{
-    if (!ld)
-        return -1;
-
-    return ld->ld_type;
-}
-
-void
-gnc_ledger_display2_set_user_data (GNCLedgerDisplay2 *ld, gpointer user_data)
-{
-    if (!ld)
-        return;
-
-    ld->user_data = user_data;
-}
-
-gpointer
-gnc_ledger_display2_get_user_data (GNCLedgerDisplay2 *ld)
-{
-    if (!ld)
-        return NULL;
-
-    return ld->user_data;
-}
-
-void
-gnc_ledger_display2_set_handlers (GNCLedgerDisplay2 *ld,
-                                 GNCLedgerDisplay2Destroy destroy,
-                                 GNCLedgerDisplay2GetParent get_parent)
-{
-    if (!ld)
-        return;
-
-    ld->destroy = destroy;
-    ld->get_parent = get_parent;
-}
-
-GncTreeModelSplitReg *
-gnc_ledger_display2_get_split_model_register (GNCLedgerDisplay2 *ld)
-{
-    if (!ld)
-        return NULL;
-
-    return ld->model;
-}
-
-Query *
-gnc_ledger_display2_get_query (GNCLedgerDisplay2 *ld)
-{
-    if (!ld)
-        return NULL;
-
-    return ld->query;
-}
-
-static gboolean
-find_by_leader (gpointer find_data, gpointer user_data)
-{
-    Account *account = find_data;
-    GNCLedgerDisplay2 *ld = user_data;
-
-    if (!account || !ld)
-        return FALSE;
-
-    return (account == gnc_ledger_display2_leader (ld));
-}
-
-static gboolean
-find_by_query (gpointer find_data, gpointer user_data)
-{
-    Query *q = find_data;
-    GNCLedgerDisplay2 *ld = user_data;
-
-    if (!q || !ld)
-        return FALSE;
-
-    return ld->query == q;
-}
-
-
-static gboolean
-find_by_reg (gpointer find_data, gpointer user_data)
-{
-    GncTreeModelSplitReg *model = find_data;
-    GNCLedgerDisplay2 *ld = user_data;
-
-    if (!model || !ld)
-        return FALSE;
-
-    return ld->model == model;
-}
-
-static SplitRegisterStyle
-gnc_get_default_register_style (GNCAccountType type)
-{
-    SplitRegisterStyle new_style = REG2_STYLE_LEDGER;
-
-    if (gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER,
-                            GNC_PREF_DEFAULT_STYLE_JOURNAL))
-        new_style = REG2_STYLE_JOURNAL;
-    else if (gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER,
-                                 GNC_PREF_DEFAULT_STYLE_AUTOLEDGER))
-        new_style = REG2_STYLE_AUTO_LEDGER;
-
-    return new_style;
-}
-
-static gpointer
-look_for_portfolio_cb (Account *account, gpointer data)
-{
-    return xaccAccountIsPriced(account) ? (gpointer) PORTFOLIO_LEDGER2 : NULL;
-}
-
-static SplitRegisterType2
-gnc_get_reg_type (Account *leader, GNCLedgerDisplay2Type ld_type)
-{
-    GNCAccountType account_type;
-    SplitRegisterType2 reg_type;
-
-    if (ld_type == LD2_GL)
-        return GENERAL_LEDGER2;
-
-    account_type = xaccAccountGetType (leader);
-
-    if (ld_type == LD2_SINGLE)
-    {
-        switch (account_type)
-        {
-        case ACCT_TYPE_BANK:
-            return BANK_REGISTER2;
-
-        case ACCT_TYPE_CASH:
-            return CASH_REGISTER2;
-
-        case ACCT_TYPE_ASSET:
-            return ASSET_REGISTER2;
-
-        case ACCT_TYPE_CREDIT:
-            return CREDIT_REGISTER2;
-
-        case ACCT_TYPE_LIABILITY:
-            return LIABILITY_REGISTER2;
-
-        case ACCT_TYPE_PAYABLE:
-            return PAYABLE_REGISTER2;
-
-        case ACCT_TYPE_RECEIVABLE:
-            return RECEIVABLE_REGISTER2;
-
-        case ACCT_TYPE_STOCK:
-        case ACCT_TYPE_MUTUAL:
-            return STOCK_REGISTER2;
-
-        case ACCT_TYPE_INCOME:
-            return INCOME_REGISTER2;
-
-        case ACCT_TYPE_EXPENSE:
-            return EXPENSE_REGISTER2;
-
-        case ACCT_TYPE_EQUITY:
-            return EQUITY_REGISTER2;
-
-        case ACCT_TYPE_CURRENCY:
-            return CURRENCY_REGISTER2;
-
-        case ACCT_TYPE_TRADING:
-            return TRADING_REGISTER2;
-
-        default:
-            PERR ("unknown account type %d\n", account_type);
-            return BANK_REGISTER2;
-        }
-    }
-
-    if (ld_type != LD2_SUBACCOUNT)
-    {
-        PERR ("unknown ledger type %d\n", ld_type);
-        return BANK_REGISTER2;
-    }
-
-    switch (account_type)
-    {
-    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 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_LEDGER2;
-
-        ret = gnc_account_foreach_descendant_until(leader, look_for_portfolio_cb, NULL);
-        if (ret) reg_type = PORTFOLIO_LEDGER2;
-        break;
-    }
-
-    case ACCT_TYPE_STOCK:
-    case ACCT_TYPE_MUTUAL:
-    case ACCT_TYPE_CURRENCY:
-        reg_type = PORTFOLIO_LEDGER2;
-        break;
-
-    case ACCT_TYPE_INCOME:
-    case ACCT_TYPE_EXPENSE:
-        reg_type = INCOME_LEDGER2;
-        break;
-
-    case ACCT_TYPE_EQUITY:
-    case ACCT_TYPE_TRADING:
-        reg_type = GENERAL_LEDGER2;
-        break;
-
-    default:
-        PERR ("unknown account type:%d", account_type);
-        reg_type = GENERAL_LEDGER2;
-        break;
-    }
-
-    return reg_type;
-}
-
-/* Returns a boolean of whether this display should be single or double lined
- * mode by default */
-gboolean
-gnc_ledger_display2_default_double_line (GNCLedgerDisplay2 *gld)
-{
-    return (gld->use_double_line_default ||
-            gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_DOUBLE_LINE_MODE));
-}
-
-/* Opens up a register window to display a single account */
-GNCLedgerDisplay2 *
-gnc_ledger_display2_simple (Account *account)
-{
-    SplitRegisterType2 reg_type;
-    GNCAccountType acc_type = xaccAccountGetType (account);
-    gboolean use_double_line;
-    GNCLedgerDisplay2 *ld;
-
-    ENTER("account=%p", account);
-
-    switch (acc_type)
-    {
-    case ACCT_TYPE_PAYABLE:
-    case ACCT_TYPE_RECEIVABLE:
-        use_double_line = TRUE;
-        break;
-    default:
-        use_double_line = FALSE;
-        break;
-    }
-
-    reg_type = gnc_get_reg_type (account, LD2_SINGLE);
-
-    ld = gnc_ledger_display2_internal (account, NULL, LD2_SINGLE, reg_type,
-                                      gnc_get_default_register_style(acc_type),
-                                      use_double_line, FALSE);
-    LEAVE("%p", ld);
-    return ld;
-}
-
-/* Opens up a register window to display an account, and all of its
- *   children, in the same window */
-GNCLedgerDisplay2 *
-gnc_ledger_display2_subaccounts (Account *account)
-{
-    SplitRegisterType2 reg_type;
-    GNCLedgerDisplay2 *ld;
-
-    ENTER("account=%p", account);
-
-    reg_type = gnc_get_reg_type (account, LD2_SUBACCOUNT);
-
-    ld = gnc_ledger_display2_internal (account, NULL, LD2_SUBACCOUNT,
-                                      reg_type, REG2_STYLE_JOURNAL, FALSE,
-                                      FALSE);
-    LEAVE("%p", ld);
-    return ld;
-}
-
-/* Opens up a general ledger window. */
-GNCLedgerDisplay2 *
-gnc_ledger_display2_gl (void)
-{
-    Query *query;
-    time64 start;
-    struct tm tm;
-    GNCLedgerDisplay2 *ld;
-
-    ENTER(" ");
-
-    query = qof_query_create_for (GNC_ID_SPLIT);
-
-    qof_query_set_book (query, gnc_get_current_book());
-
-    /* In lieu of not "mis-using" some portion of the infrastructure by writing
-     * a bunch of new code, we just filter out the accounts of the template
-     * transactions.  While these are in a seperate Account trees just for this
-     * reason, the query engine makes no distinction between Account trees.
-     * See Gnome Bug 86302.
-     *         -- jsled */
-    {
-        Account *tRoot;
-        GList *al;
-
-        tRoot = gnc_book_get_template_root( gnc_get_current_book() );
-        al = gnc_account_get_descendants( tRoot );
-        xaccQueryAddAccountMatch( query, al, QOF_GUID_MATCH_NONE, QOF_QUERY_AND );
-        g_list_free (al);
-        al = NULL;
-        tRoot = NULL;
-    }
-
-    gnc_tm_get_today_start(&tm);
-    tm.tm_mon--; /* Default the register to the last month's worth of transactions. */
-    start = gnc_mktime (&tm);
-    xaccQueryAddDateMatchTT (query,
-                             TRUE, start,
-                             FALSE, 0,
-                             QOF_QUERY_AND);
-
-    ld = gnc_ledger_display2_internal (NULL, query, LD2_GL, GENERAL_LEDGER2,
-                                      REG2_STYLE_JOURNAL, FALSE, FALSE);
-    LEAVE("%p", ld);
-    return ld;
-}
-
-/**
- * @param id: The string version of the GncGUID of the context of template
- * transaction being edited in this template GL.  As used by scheduled
- * transactions, this is the GncGUID of the SX itself which is magically the
- * *name* of the (template) account which contains the transactions for this
- * scheduled transaction.  That's right.  The stringified GncGUID of the SX is
- * the name of the SX'es template account.
- **/
-GNCLedgerDisplay2 *
-gnc_ledger_display2_template_gl (char *id)
-{
-    QofBook *book;
-    Query *q;
-    GNCLedgerDisplay2 *ld;
-    GncTreeModelSplitReg *model;
-    Account *root, *acct;
-    gboolean isTemplateModeTrue;
-
-    ENTER("id=%s", id ? id : "(null)");
-
-    acct = NULL;
-    isTemplateModeTrue = TRUE;
-
-    q = qof_query_create_for(GNC_ID_SPLIT);
-
-    book = gnc_get_current_book ();
-    qof_query_set_book (q, book);
-
-    if ( id != NULL )
-    {
-        root = gnc_book_get_template_root (book);
-        acct = gnc_account_lookup_by_name(root, id);
-        g_assert( acct );
-        xaccQueryAddSingleAccountMatch (q, acct, QOF_QUERY_AND);
-    }
-
-    ld = gnc_ledger_display2_internal (NULL, q, LD2_GL,
-                                      SEARCH_LEDGER2,
-                                      REG2_STYLE_JOURNAL,
-                                      FALSE,
-                                      isTemplateModeTrue);
-
-
-    model = gnc_ledger_display2_get_split_model_register (ld);
-    if ( acct )
-    {
-        gnc_tree_model_split_reg_set_template_account (model, acct);
-    }
-
-    LEAVE("%p", ld);
-    return ld;
-}
-
-GtkWidget *
-gnc_ledger_display2_get_parent( GNCLedgerDisplay2 *ld )
-{
-    if ( ld == NULL )
-        return NULL;
-
-    if ( ld->get_parent == NULL )
-        return NULL;
-
-    return ld->get_parent( ld );
-}
-
-static GtkWidget *
-gnc_ledger_display2_parent (void *user_data)
-{
-    GNCLedgerDisplay2 *ld = user_data;
-    return gnc_ledger_display2_get_parent( ld );
-}
-
-static void
-gnc_ledger_display2_set_watches (GNCLedgerDisplay2 *ld, GList *splits)
-{
-    GList *node;
-
-    gnc_gui_component_clear_watches (ld->component_id);
-
-    gnc_gui_component_watch_entity_type (ld->component_id,
-                                         GNC_ID_ACCOUNT,
-                                         QOF_EVENT_MODIFY | QOF_EVENT_DESTROY
-                                         | GNC_EVENT_ITEM_CHANGED);
-
-    for (node = splits; node; node = node->next)
-    {
-        Split *split = node->data;
-        Transaction *trans = xaccSplitGetParent (split);
-
-        gnc_gui_component_watch_entity (ld->component_id,
-                                        xaccTransGetGUID (trans),
-                                        QOF_EVENT_MODIFY);
-    }
-}
-
-static void
-refresh_handler (GHashTable *changes, gpointer user_data)
-{
-    GNCLedgerDisplay2 *ld = user_data;
-    const EventInfo *info;
-    gboolean has_leader;
-    GList *splits;
-
-    ENTER("changes=%p, user_data=%p", changes, user_data);
-
-    if (ld->loading)
-    {
-        LEAVE("already loading");
-        return;
-    }
-
-    has_leader = (ld->ld_type == LD2_SINGLE || ld->ld_type == LD2_SUBACCOUNT);
-
-    if (has_leader)
-    {
-        Account *leader = gnc_ledger_display2_leader (ld);
-        if (!leader)
-        {
-            gnc_close_gui_component (ld->component_id);
-            LEAVE("no leader");
-            return;
-        }
-    }
-
-    if (changes && has_leader)
-    {
-        info = gnc_gui_get_entity_events (changes, &ld->leader);
-        if (info && (info->event_mask & QOF_EVENT_DESTROY))
-        {
-            gnc_close_gui_component (ld->component_id);
-            LEAVE("destroy");
-            return;
-        }
-    }
-
-    /* Its not clear if we should re-run the query, or if we should
-     * just use qof_query_last_run().  Its possible that the dates
-     * changed, requiring a full new query.  Similar considerations
-     * needed for multi-user mode.
-     */
-    splits = qof_query_run (ld->query);
-
-//FIXME Not Needed ?    gnc_ledger_display2_set_watches (ld, splits);
-//    gnc_ledger_display2_set_watches (ld, splits);
-
-    //preference changes come this way
-    gnc_ledger_display2_refresh_internal (ld, splits);
-
-    LEAVE(" ");
-}
-
-static void
-close_handler (gpointer user_data)
-{
-    GNCLedgerDisplay2 *ld = user_data;
-
-    if (!ld)
-        return;
-
-    ENTER(" ");
-
-    gnc_unregister_gui_component (ld->component_id);
-
-    if (ld->destroy)
-        ld->destroy (ld);
-
-    gnc_tree_model_split_reg_destroy (ld->model);
-    ld->model = NULL;
-    ld->view = NULL;
-
-    qof_query_destroy (ld->query);
-    ld->query = NULL;
-
-    LEAVE(" ");
-    g_free (ld);
-}
-
-static void
-gnc_ledger_display2_make_query (GNCLedgerDisplay2 *ld,
-                               gint limit,
-                               SplitRegisterType2 type)
-{
-    Account *leader;
-    GList *accounts;
-
-    if (!ld)
-        return;
-
-    switch (ld->ld_type)
-    {
-    case LD2_SINGLE:
-    case LD2_SUBACCOUNT:
-        break;
-
-    case LD2_GL:
-        return;
-
-    default:
-        PERR ("unknown ledger type: %d", ld->ld_type);
-        return;
-    }
-
-    qof_query_destroy (ld->query);
-    ld->query = qof_query_create_for(GNC_ID_SPLIT);
-
-    /* This is a bit of a hack. The number of splits should be
-     * configurable, or maybe we should go back a time range instead
-     * of picking a number, or maybe we should be able to exclude
-     * based on reconciled status. Anyway, this works for now. */
-    if ((limit != 0) && (type != SEARCH_LEDGER2))
-        qof_query_set_max_results (ld->query, limit);
-
-    qof_query_set_book (ld->query, gnc_get_current_book());
-
-    leader = gnc_ledger_display2_leader (ld);
-
-    if (ld->ld_type == LD2_SUBACCOUNT)
-        accounts = gnc_account_get_descendants (leader);
-    else
-        accounts = NULL;
-
-    accounts = g_list_prepend (accounts, leader);
-
-    xaccQueryAddAccountMatch (ld->query, accounts,
-                              QOF_GUID_MATCH_ANY, QOF_QUERY_AND);
-
-    g_list_free (accounts);
-}
-
-/* Opens up a ledger window for an arbitrary query. */
-GNCLedgerDisplay2 *
-gnc_ledger_display2_query (Query *query, SplitRegisterType2 type,
-                          SplitRegisterStyle2 style)
-{
-    GNCLedgerDisplay2 *ld;
-
-    ENTER("query=%p", query);
-
-    ld = gnc_ledger_display2_internal (NULL, query, LD2_GL, type, style,
-                                      FALSE, FALSE);
-    LEAVE("%p", ld);
-    return ld;
-}
-
-static GNCLedgerDisplay2 *
-gnc_ledger_display2_internal (Account *lead_account, Query *q,
-                             GNCLedgerDisplay2Type ld_type,
-                             SplitRegisterType2 reg_type,
-                             SplitRegisterStyle2 style,
-                             gboolean use_double_line,
-                             gboolean is_template )
-{
-    GNCLedgerDisplay2 *ld;
-    gint limit;
-    const char *class;
-    GList *splits;
-
-    switch (ld_type)
-    {
-    case LD2_SINGLE:
-        class = REGISTER_SINGLE_CM_CLASS;
-
-        if (reg_type >= NUM_SINGLE_REGISTER_TYPES2)
-        {
-            PERR ("single-account register with wrong split register type");
-            return NULL;
-        }
-
-        if (!lead_account)
-        {
-            PERR ("single-account register with no account specified");
-            return NULL;
-        }
-
-        if (q)
-        {
-            PWARN ("single-account register with external query");
-            q = NULL;
-        }
-
-        ld = gnc_find_first_gui_component (class, find_by_leader, lead_account);
-        if (ld)
-            return ld;
-
-        break;
-
-    case LD2_SUBACCOUNT:
-        class = REGISTER_SUBACCOUNT_CM_CLASS;
-
-        if (!lead_account)
-        {
-            PERR ("sub-account register with no lead account");
-            return NULL;
-        }
-
-        if (q)
-        {
-            PWARN ("account register with external query");
-            q = NULL;
-        }
-
-        ld = gnc_find_first_gui_component (class, find_by_leader, lead_account);
-        if (ld)
-            return ld;
-
-        break;
-
-    case LD2_GL:
-        class = REGISTER_GL_CM_CLASS;
-
-        if (!q)
-        {
-            PWARN ("general ledger with no query");
-        }
-
-        break;
-
-    default:
-        PERR ("bad ledger type: %d", ld_type);
-        return NULL;
-
-    }
-
-    ld = g_new (GNCLedgerDisplay2, 1);
-
-    ld->leader = *xaccAccountGetGUID (lead_account);
-    ld->query = NULL;
-    ld->ld_type = ld_type;
-    ld->loading = FALSE;
-    ld->refresh_ok = FALSE;
-    ld->destroy = NULL;
-    ld->get_parent = NULL;
-    ld->user_data = NULL;
-
-    limit = gnc_prefs_get_float(GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_MAX_TRANS);
-
-    /* set up the query filter */
-    if (q)
-        ld->query = qof_query_copy (q);
-    else
-        gnc_ledger_display2_make_query (ld, limit, reg_type);
-
-    ld->component_id = gnc_register_gui_component (class,
-                       refresh_handler,
-                       close_handler, ld);
-
-    /******************************************************************\
-     * The main register window itself                                *
-    \******************************************************************/
-
-    ld->use_double_line_default = use_double_line;
-
-    ld->model = gnc_tree_model_split_reg_new (reg_type, style, use_double_line, is_template);
-
-    gnc_tree_model_split_reg_set_data (ld->model, ld, gnc_ledger_display2_parent);
-
-//FIXME We should get the load filter and sort here so we run query once on load....
-
-    gnc_tree_model_split_reg_set_display (ld->model, ((ld_type == LD2_SUBACCOUNT)?TRUE:FALSE), ((ld_type == LD2_GL)?TRUE:FALSE));
-
-    gnc_tree_model_split_reg_default_query (ld->model, lead_account, ld->query);
-
-    // This sets up a call back to reload after changes
-    g_signal_connect (G_OBJECT (ld->model), "refresh_trans",
-                      G_CALLBACK (gnc_ledger_display2_refresh_cb), ld );
-
-    splits = qof_query_run (ld->query);
-
-//FIXME Not Needed ?    gnc_ledger_display2_set_watches (ld, splits);
-//    gnc_ledger_display2_set_watches (ld, splits);
-
-    gnc_ledger_display2_refresh_internal (ld, splits);
-
-    return ld;
-}
-
-void
-gnc_ledger_display2_set_split_view_register (GNCLedgerDisplay2 *ledger_display, GncTreeViewSplitReg *view)
-{
-    if (!ledger_display)
-        return;
-
-    ledger_display->view = view;
-}
-
-GncTreeViewSplitReg *
-gnc_ledger_display2_get_split_view_register (GNCLedgerDisplay2 *ledger_display)
-{
-    if (!ledger_display)
-        return NULL;
-
-    return ledger_display->view;
-}
-
-void
-gnc_ledger_display2_set_query (GNCLedgerDisplay2 *ledger_display, Query *q)
-{
-    if (!ledger_display || !q)
-        return;
-
-    g_return_if_fail (ledger_display->ld_type == LD2_GL);
-
-    qof_query_destroy (ledger_display->query);
-    ledger_display->query = qof_query_copy (q);
-}
-
-GNCLedgerDisplay2 *
-gnc_ledger_display2_find_by_query (Query *q)
-{
-    GNCLedgerDisplay2 *ledger_display;
-    GncTreeModelSplitReg *model;
-
-    if (!q)
-        return NULL;
-
-    ledger_display = gnc_find_first_gui_component (REGISTER_GL_CM_CLASS, find_by_query, q);
-
-    if (ledger_display)
-    {
-        model = ledger_display->model;
-        // To get a new search page from a general ledger, search register is a LD2_GL also.
-        if (model->type == GENERAL_LEDGER2)
-            ledger_display = NULL;
-    }
-    return ledger_display;
-}
-
-/********************************************************************\
- * refresh only the indicated register window                       *
-\********************************************************************/
-
-static void
-gnc_ledger_display2_refresh_internal (GNCLedgerDisplay2 *ld, GList *splits)
-{
-    GtkTreeModel *s_model, *model;
-
-    if (!ld || ld->loading)
-        return;
-
-    if (!(ld->refresh_ok)) // We use this to test for the view available
-    {
-        ld->loading = TRUE;
-        gnc_tree_model_split_reg_load (ld->model, splits, gnc_ledger_display2_leader (ld));
-        ld->loading = FALSE;
-    }
-    else
-    {
-	/* This is used for the reloading of registers to refresh them and to update the search_ledger */
-        ld->loading = TRUE;
-
-	s_model = gtk_tree_view_get_model (GTK_TREE_VIEW (ld->view)); // this is the sort model
-        model = gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT (s_model)); // this is the model
-
-        g_object_ref (s_model);
-        g_object_ref (model);
-
-        gnc_tree_view_split_reg_block_selection (ld->view, TRUE); // This blocks the tree selection
-        gtk_tree_view_set_model (GTK_TREE_VIEW (ld->view), NULL); // Detach sort model from view
-        gnc_tree_model_split_reg_load (ld->model, splits, gnc_ledger_display2_leader (ld)); //reload splits
-        gtk_tree_view_set_model (GTK_TREE_VIEW (ld->view), GTK_TREE_MODEL (s_model)); // Re-attach sort model to view
-        gnc_tree_view_split_reg_block_selection (ld->view, FALSE); // This unblocks the tree selection
-
-        g_object_unref (model);
-        g_object_unref (s_model);
-
-        /* Set the default selection start position */
-        gnc_tree_view_split_reg_default_selection (ld->view);
-
-        ld->loading = FALSE;
-    }
-}
-
-void
-gnc_ledger_display2_refilter (GNCLedgerDisplay2 *ld)
-{
-    ENTER("ld=%p", ld);
-
-    /* Set the default selection start position and refilter */
-    gnc_tree_view_split_reg_default_selection (ld->view);
-
-    LEAVE(" ");
-}
-
-void
-gnc_ledger_display2_refresh_sched (GNCLedgerDisplay2 *ld, GList *splits)
-{
-    ENTER("ld=%p", ld);
-
-    if (!ld)
-    {
-        LEAVE("no display");
-        return;
-    }
-
-    if (ld->loading)
-    {
-        LEAVE("already loading");
-        return;
-    }
-    gnc_ledger_display2_refresh_internal (ld, splits);
-    LEAVE(" ");
-}
-
-void
-gnc_ledger_display2_refresh (GNCLedgerDisplay2 *ld)
-{
-    ENTER("ld=%p", ld);
-
-    if (!ld)
-    {
-        LEAVE("no display");
-        return;
-    }
-
-    if (ld->loading)
-    {
-        LEAVE("already loading");
-        return;
-    }
-
-    // Update the query before refresh
-    gnc_tree_model_split_reg_update_query (ld->model, ld->query);
-    gnc_ledger_display2_refresh_internal (ld, qof_query_run (ld->query));
-    LEAVE(" ");
-}
-
-void
-gnc_ledger_display2_refresh_by_split_register (GncTreeModelSplitReg *model)
-{
-    GNCLedgerDisplay2 *ld;
-
-    if (!model)
-        return;
-
-    ld = gnc_find_first_gui_component (REGISTER_SINGLE_CM_CLASS,
-                                       find_by_reg, model);
-    if (ld)
-    {
-        gnc_ledger_display2_refresh (ld);
-        return;
-    }
-
-    ld = gnc_find_first_gui_component (REGISTER_SUBACCOUNT_CM_CLASS,
-                                       find_by_reg, model);
-    if (ld)
-    {
-        gnc_ledger_display2_refresh (ld);
-        return;
-    }
-
-    ld = gnc_find_first_gui_component (REGISTER_GL_CM_CLASS,
-                                       find_by_reg, model);
-    if (ld)
-    {
-        gnc_ledger_display2_refresh (ld);
-        return;
-    }
-
-    ld = gnc_find_first_gui_component (REGISTER_TEMPLATE_CM_CLASS,
-                                       find_by_reg, model);
-    if (ld)
-    {
-        gnc_ledger_display2_refresh (ld);
-    }
-}
-
-void
-gnc_ledger_display2_set_split_view_refresh (GNCLedgerDisplay2 *ld, gboolean ok)
-{
-    if (!ld)
-        return;
-
-    ld->refresh_ok = ok;
-}
-
-/* This is used to reload after any changes made */
-static void
-gnc_ledger_display2_refresh_cb (GncTreeModelSplitReg *model, gpointer item, gpointer user_data)
-{
-    GNCLedgerDisplay2 *ld = user_data;
-
-    /* Refresh the view when idle */
-    g_idle_add ((GSourceFunc)gnc_ledger_display2_refresh, ld);
-}
-
-void
-gnc_ledger_display2_close (GNCLedgerDisplay2 *ld)
-{
-    if (!ld)
-        return;
-
-    gnc_close_gui_component (ld->component_id);
-}

Deleted: gnucash/trunk/src/register/ledger-core/gnc-ledger-display2.h
===================================================================
--- gnucash/trunk/src/register/ledger-core/gnc-ledger-display2.h	2013-10-22 16:30:02 UTC (rev 23313)
+++ gnucash/trunk/src/register/ledger-core/gnc-ledger-display2.h	2013-10-22 18:26:55 UTC (rev 23314)
@@ -1,144 +0,0 @@
-/********************************************************************\
- * gnc-ledger-display.h -- utilities for dealing with multiple      *
- *                         register/ledger windows in GnuCash       *
- *                                                                  *
- * Copyright (C) 1997 Robin D. Clark                                *
- * Copyright (C) 1997, 1998 Linas Vepstas                           *
- * Copyright (C) 2001 Linux Developers Group                        *
- * Copyright (C) 2012 Robert Fewell                                 *
- *                                                                  *
- * 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.        *
- *                                                                  *
-\********************************************************************/
-
-#ifndef GNC_LEDGER_DISPLAY2_H
-#define GNC_LEDGER_DISPLAY2_H
-
-#include <glib.h>
-
-#include "Account.h"
-#include "Query.h"
-
-#include "split-register.h" 
-
-#include "SchedXaction.h"
-#include "Transaction.h"
-#include "gnc-tree-model-split-reg.h"
-#include "gnc-tree-view-split-reg.h"
-
-/** Definitions *****************************************************/
-
-/* The GNCLedgerDisplay2 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_display2 GNCLedgerDisplay2;
-
-typedef void (*GNCLedgerDisplay2Destroy) (GNCLedgerDisplay2 *ld);
-typedef GtkWidget *(*GNCLedgerDisplay2GetParent) (GNCLedgerDisplay2 *ld);
-typedef void (*GNCLedgerDisplay2SetHelp) (GNCLedgerDisplay2 *ld,
-        const char *help_str);
-
-
-typedef enum
-{
-    LD2_SINGLE,
-    LD2_SUBACCOUNT,
-    LD2_GL,
-} GNCLedgerDisplay2Type;
-
-
-/** Prototypes ******************************************************/
-
-/* returns the 'lead' account of a ledger display, or NULL if none. */
-Account * gnc_ledger_display2_leader (GNCLedgerDisplay2 *ld);
-
-GNCLedgerDisplay2Type gnc_ledger_display2_type (GNCLedgerDisplay2 *ld);
-
-/* get and set the user data associated with the ledger */
-void gnc_ledger_display2_set_user_data (GNCLedgerDisplay2 *ld,
-                                       gpointer user_data);
-gpointer gnc_ledger_display2_get_user_data (GNCLedgerDisplay2 *ld);
-
-/* set the handlers used by the ledger display */
-void gnc_ledger_display2_set_handlers (GNCLedgerDisplay2 *ld,
-                                      GNCLedgerDisplay2Destroy destroy,
-                                      GNCLedgerDisplay2GetParent get_parent);
-
-/* Set and Get the tree view used by the ledger display */
-void gnc_ledger_display2_set_split_view_register (GNCLedgerDisplay2 *ld, GncTreeViewSplitReg *view);
-GncTreeViewSplitReg * gnc_ledger_display2_get_split_view_register (GNCLedgerDisplay2 *ld);
-
-void gnc_ledger_display2_set_split_view_refresh (GNCLedgerDisplay2 *ld, gboolean ok);
-
-/** Returns the parent of a given ledger display */
-GtkWidget *gnc_ledger_display2_get_parent( GNCLedgerDisplay2 *ld );
-
-/* return the split register associated with a ledger display */
-GncTreeModelSplitReg * gnc_ledger_display2_get_split_model_register (GNCLedgerDisplay2 *ld);
-
-/* opens up a register window to display a single account */
-GNCLedgerDisplay2 * gnc_ledger_display2_simple (Account *account);
-
-/* opens up a register window to display the parent account and all of
- * its children. */
-GNCLedgerDisplay2 * gnc_ledger_display2_subaccounts (Account *account);
-
-/* opens up a general ledger window */
-GNCLedgerDisplay2 * gnc_ledger_display2_gl (void);
-
-/**
- * Displays a template ledger.
- * This lists template Splits from the given ScheduledTransaction.
- *
- * Really, requires a GList of scheduled transactions and kvp-frame
- * data.
- **/
-GNCLedgerDisplay2 * gnc_ledger_display2_template_gl (char *id);
-
-/* display a general ledger for an arbitrary query */
-GNCLedgerDisplay2 * gnc_ledger_display2_query (Query *query,
-        SplitRegisterType2 type,
-        SplitRegisterStyle2 style);
-
-/* Set the query used for a register. */
-void gnc_ledger_display2_set_query (GNCLedgerDisplay2 *ledger_display,
-                                   Query *q);
-
-/* return the query associated with a ledger */
-Query * gnc_ledger_display2_get_query (GNCLedgerDisplay2 *ld);
-
-/* If the given ledger display still exists, return it. Otherwise,
- * return NULL */
-GNCLedgerDisplay2 * gnc_ledger_display2_find_by_query (Query *q);
-
-/* redisplay/redraw only the indicated window. Both routines do same
- * thing, they differ only by the argument they take. */
-void gnc_ledger_display2_refresh (GNCLedgerDisplay2 * ledger_display);
-void gnc_ledger_display2_refresh_by_split_register (GncTreeModelSplitReg *model);
-
-/* This is used to load the register for the schedule */
-void gnc_ledger_display2_refresh_sched (GNCLedgerDisplay2 *ld, GList *splits);
-
-/* Refilter the register */
-void gnc_ledger_display2_refilter (GNCLedgerDisplay2 *ld);
-
-/* close the window */
-void gnc_ledger_display2_close (GNCLedgerDisplay2 * ledger_display);
-
-/* Returns a boolean of whether this display should be single or double lined
- * mode by default */
-gboolean gnc_ledger_display2_default_double_line (GNCLedgerDisplay2 *gld);
-
-#endif



More information about the gnucash-changes mailing list