[Gnucash-changes] Remove files that are no longer needed in the g2 branch.

David Hampton hampton at cvs.gnucash.org
Fri Jun 3 02:45:33 EDT 2005


Log Message:
-----------
Remove files that are no longer needed in the g2 branch.

Tags:
----
gnucash-gnome2-dev

Modified Files:
--------------
    gnucash:
        ChangeLog

Removed Files:
-------------
    gnucash/src/gnome:
        window-main.c
        window-main.h
        window-register.c
        window-register.h

Revision Data
-------------
Index: ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/ChangeLog,v
retrieving revision 1.1487.2.211
retrieving revision 1.1487.2.212
diff -LChangeLog -LChangeLog -u -r1.1487.2.211 -r1.1487.2.212
--- ChangeLog
+++ ChangeLog
@@ -1,7 +1,25 @@
+2005-06-03  David Hampton  <hampton at employees.org>
+
+	* src/gnome/gnc-main-window.[ch]: Move one function out of
+	window-main.c.  This may be a temporary home.
+
+	* src/gnome/window-main.[ch]:
+	* src/gnome/window-register.[ch]: Remove files that are no longer
+	needed in the g2 branch.
+
+	* src/gnome/Makefile.am:
+	* src/gnome/dialog-scheduledxaction.c:
+	* src/gnome/gnc-plugin-page-account-tree.c:
+	* src/gnome/gnc-split-reg.c:
+	* src/gnome/gw-gnc-spec.scm:
+	* src/gnome/top-level.[ch]:
+	* src/gnome/window-main-summarybar.c: Remove references to these
+	files.
+
 2005-06-02  David Hampton  <hampton at employees.org>
 
 	* src/business/business-gnome/dialog-customer.c: Eliminate a
-	double free of memory.
+	memory corruption bug.
 
 	* src/business/business-gnome/dialog-customer.c:
 	* src/business/business-gnome/dialog-employee.c:
--- src/gnome/window-main.c
+++ /dev/null
@@ -1,1089 +0,0 @@
-/********************************************************************
- * window-main.c -- open/close/configure GNOME MDI main window      *
- * Copyright (C) 1998,1999 Jeremy Collins	                          *
- * Copyright (C) 1998,1999,2000 Linas Vepstas <linas at linas.org>     *
- * Copyright (C) 2001 Bill Gribble                                  *
- *                                                                  *
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652       *
- * Boston, MA  02111-1307,  USA       gnu at gnu.org                   *
- ********************************************************************/
-
-#include "config.h"
-
-#include <errno.h>
-#include <gnome.h>
-#include <gconf/gconf-client.h>
-#include <libguile.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "dialog-account.h"
-#include "dialog-fincalc.h"
-#include "dialog-find-transactions.h"
-#include "dialog-options.h"
-#include "dialog-scheduledxaction.h"
-#include "dialog-sxsincelast.h"
-#include "dialog-transfer.h"
-#include "dialog-utils.h"
-#include "druid-acct-period.h"
-#include "druid-loan.h"
-#include "gfec.h"
-#include "global-options.h"
-#include "gnc-engine.h"
-#include "gnc-engine-util.h"
-#include "gnc-file-dialog.h"
-#include "gnc-file.h"
-#include "gnc-gui-query.h"
-#include "gnc-menu-extensions.h"
-#include "gnc-split-reg.h"
-#include "gnc-ui.h"
-#include "gnc-version.h"
-#include "guile-util.h"
-#include "option-util.h"
-#include "top-level.h"
-#include "window-main-summarybar.h"
-#include "window-main.h"
-#include "window-reconcile.h"
-#include "window-register.h"
-#include "window-report.h"
-#include "messages.h"
-#include "guile-mappings.h"
-
-
-/* static short module = MOD_GUI; */
-
-#if INCLUDE_GNOME1_BASED_ROUTINES
-static void gnc_main_window_create_menus(GNCMDIInfo * maininfo);
-static GnomeUIInfo * gnc_main_window_toolbar_prefix (void);
-static GnomeUIInfo * gnc_main_window_toolbar_suffix (void);
-
-/**
- * gnc_main_window_get_mdi_child
- *
- * This routine grovels through the mdi data structures and finds the
- * GNCMDIChildInfo data structure for the view currently at the top of
- * the stack.
- *
- * returns: A pointer to the GNCMDIChildInfo data structure for the
- * current view, or NULL in cast of error.
- */
-static GNCMDIChildInfo *
-gnc_main_window_get_mdi_child (void)
-{
-  GNCMDIChildInfo *child_info;
-  GNCMDIInfo *main_info;
-  GnomeMDIChild *child;
-  GnomeMDI *mdi;
-  GnomeApp *app;
-  GtkWidget *view;
-
-  ENTER(" ");
-  main_info = gnc_mdi_get_current ();
-  if (!main_info) {
-    LEAVE("main_info is NULL");
-    return(NULL);
-  }
-
-  mdi = main_info->mdi;
-  if (!mdi) {
-    LEAVE("null mdi");
-    return NULL;
-  }
-
-  child = gnome_mdi_get_active_child(mdi);
-  if (child) {
-//    child_info = return g_object_get_data (G_OBJECT (mdi->active_child), "gnc-mdi-child-info");
-    child_info = gtk_object_get_user_data(GTK_OBJECT(child));
-    LEAVE("child=%p", child_info);
-    return(child_info);
-  }
-
-  /* Grrr. There should have been an active child but the MDI code has
-   * some rough edges, to put it politely.  If we hit this case and
-   * the user has more than one child window, this code may or may not
-   * select the right child.  There's absolutely no way to tell from
-   * the available data which view is in front. */
-  DEBUG("mdi=%p, mdi->active_child=%p", mdi, child);
-  app = gnome_mdi_get_active_window(mdi);
-  if (app) {
-    /* Force the MDI to have a valid view. */
-    view = gnome_mdi_get_view_from_window (mdi, app);
-    gnome_mdi_set_active_view (mdi, view);
-
-    child_info = gnc_mdi_child_find_by_app(app);
-    LEAVE("child=%p", child_info);
-    return(child_info);
-  }
-
-  LEAVE("oops. No valid no child or app");
-  return(NULL);
-}
-#endif
-
-/********************************************************************
- * gnc_shutdown
- * close down gnucash from the C side...
- ********************************************************************/
-void
-gnc_shutdown (int exit_status)
-{
-  /*SCM scm_shutdown = gnc_scm_lookup("gnucash bootstrap", "gnc:shutdown");*/
-  SCM scm_shutdown = scm_c_eval_string("gnc:shutdown");
-
-  if(scm_procedure_p(scm_shutdown) != SCM_BOOL_F)
-  {
-    SCM scm_exit_code = scm_long2num(exit_status);    
-    scm_call_1(scm_shutdown, scm_exit_code);
-  }
-  else
-  {
-    /* Either guile is not running, or for some reason we
-       can't find gnc:shutdown. Either way, just exit. */
-    g_warning("couldn't find gnc:shutdown -- exiting anyway.");
-    exit(exit_status);
-  }
-}
-
-#if 0
-/********************************************************************
- * gnc_main_window_app_created_cb()
- * called when a new top-level GnomeApp is created.  
- ********************************************************************/
-
-static void
-gnc_main_window_app_created_cb(GnomeMDI * mdi, GnomeApp * app, 
-                               gpointer data) {
-  GtkWidget * summarybar;
-  GtkWidget * statusbar;
-  GConfClient * client;
-
-  /* add the summarybar */
-  ENTER(" ");
-  summarybar = gnc_main_window_summary_new();
-
-  {
-    BonoboDockItemBehavior behavior;
-    GtkWidget *item;
-
-    /* This is essentially gnome_app_add_docked, but without using
-     * gnome_app_add_dock_item because it emits the layout_changed
-     * signal which creates a new layout and writes it over the saved
-     * layout config before we've had a chance to read it.
-     */
-
-    behavior = (BONOBO_DOCK_ITEM_BEH_EXCLUSIVE |
-                BONOBO_DOCK_ITEM_BEH_NEVER_VERTICAL);
-    client = gconf_client_get_default ();
-    if (!gnc_gconf_toolbar_detachable()))
-      behavior |= BONOBO_DOCK_ITEM_BEH_LOCKED;
-    g_object_unref(client);
-
-    item = bonobo_dock_item_new("Summary Bar", behavior);
-    gtk_container_add( GTK_CONTAINER (item), summarybar );
-
-    if (app->layout) {
-      bonobo_dock_layout_add_item( app->layout,
-                                  BONOBO_DOCK_ITEM(item),
-                                  BONOBO_DOCK_TOP,
-                                  2, 0, 0 );
-    }
-    else {
-      bonobo_dock_add_item( BONOBO_DOCK(app->dock),
-                           BONOBO_DOCK_ITEM(item),
-                           BONOBO_DOCK_TOP,
-                           2, 0, 0, FALSE );
-    }
-  }
-
-  /* add the statusbar */ 
-  statusbar = gnome_appbar_new(TRUE, TRUE, GNOME_PREFERENCES_USER);
-  gnome_app_set_statusbar(app, statusbar);
-
-  /* set up extensions menu and hints */
-  gnc_extensions_menu_setup (app, WINDOW_NAME_MAIN);
-
-  /* make sure the file history is shown */ 
-  gnc_history_update_menu (GTK_WIDGET (app));
-  LEAVE(" ");
-}
-
-static void
-gnc_refresh_main_window_info (void)
-{
-  GList *containers = gtk_window_list_toplevels ();
-  GList *containerstop = containers;
-
-  ENTER(" ");
-  while (containers)
-  {
-    GtkWidget *w = containers->data;
-
-    if (GNOME_IS_APP (w))
-    {
-      gnc_app_set_title (GNOME_APP (w));
-      gnc_history_update_menu (w);
-    }
-
-    containers = containers->next;
-  }
-  g_list_free (containerstop);
-  LEAVE(" ");
-}
-
-
-/********************************************************************
- * gnc_main_window_create_child()
- * open an MDI child given a config string (URL).  This is used at 
- * MDI session restore time 
- ********************************************************************/
-
-static GnomeMDIChild * 
-gnc_main_window_create_child(const gchar * configstring)
-{
-  GnomeMDIChild *child;
-  URLType type;
-  char * location;
-  char * label;
-
-  ENTER(" ");
-  if (!configstring)
-  {
-    LEAVE("no configstring");
-    return NULL;
-  }
-
-  type = gnc_html_parse_url(NULL, configstring, &location, &label);
-  g_free(location);
-  g_free(label);
-
-  if (!safe_strcmp (type, URL_TYPE_REPORT)) {
-    child = gnc_report_window_create_child(configstring);
-
-  } else {
-    child = NULL;
-  }
-
-  LEAVE(" ");
-  return child;
-}
-
-/********************************************************************
- * gnc_main_window_can_*()
- ********************************************************************/
-
-static gboolean
-gnc_main_window_can_restore_cb (const char * filename)
-{
-  return !gnc_commodity_table_has_namespace (gnc_get_current_commodities (),
-                                             GNC_COMMODITY_NS_LEGACY);
-}
-
-/**
- * gnc_main_window_flip_toolbar_cb
- *
- * @widget: A pointer to the menu item selected. (ignored)
- * @data: The user data for this menu item. This is a pointer to a
- * GNCMDIInfo data structure. (ignored)
- *
- * This routine flips the state of the toolbar, hiding it if currently
- * visible, and showing it if not.  This routine has to grovel through
- * the mdi related data structures to find the current child data
- * structure (because there are potentially many windows).  The
- * callback data should point to the right mdi child data structure,
- * but doesn't appear to.
- */
-static void
-gnc_main_window_flip_toolbar_cb(GtkWidget * widget, gpointer data)
-{
-  GNCMDIChildInfo * mc;
-  gboolean toolbar_visibility = !gnc_mdi_get_toolbar_visibility();
-
-  ENTER("widget=%p, data=%p", widget, data);
-  mc = gnc_main_window_get_mdi_child();
-  if (!mc) {
-    LEAVE("oops");
-    return;
-  }
-  gnc_mdi_set_toolbar_visibility(toolbar_visibility);
-  gnc_mdi_show_toolbar(mc);
-  LEAVE("flipped");
-}
-
-/**
- * gnc_main_window_flip_status_bar_cb
- *
- * @widget: A pointer to the menu item selected. (ignored)
- * @data: The user data for this menu item. (ignored)
- *
- * This routine flips the state of the status bar, hiding it if
- * currently visible, and showing it if not.  This routine has to
- * grovel through the mdi related data structures to find the current
- * child data structure (because there are potentially many windows).
- * The callback data should point to the right mdi child data
- * structure, but doesn't appear to.
- */
-static void
-gnc_main_window_flip_status_bar_cb(GtkWidget * widget, gpointer data)
-{
-  GNCMDIChildInfo * mc;
-  gboolean statusbar_visibility = !gnc_mdi_get_statusbar_visibility();
-
-  ENTER(" ");
-  mc = gnc_main_window_get_mdi_child();
-  if (!mc) {
-    LEAVE("oops");
-    return;
-  }
-  gnc_mdi_set_statusbar_visibility(statusbar_visibility);
-  gnc_mdi_show_statusbar(mc);
-  LEAVE("flipped");
-}
-
-/**
- * gnc_main_window_flip_summary_bar_cb
- *
- * @widget: A pointer to the menu item selected. (ignored)
- * @data: The user data for this menu item. (ignored)
- *
- * This routine flips the state of the summary bar, hiding it if
- * currently visible, and showing it if not.  This routine has to
- * grovel through the mdi related data structures to find the current
- * child data structure (because there are potentially many windows).
- * The callback data should point to the right mdi child data
- * structure, but doesn't appear to.
- */
-static void
-gnc_main_window_flip_summary_bar_cb(GtkWidget * widget, gpointer data)
-{
-  GNCMDIChildInfo * mc;
-  gboolean summarybar_visibility = !gnc_mdi_get_summarybar_visibility();
-
-  ENTER(" ");
-  mc = gnc_main_window_get_mdi_child();
-  if (!mc) {
-    LEAVE("oops");
-    return;
-  }
-  gnc_mdi_set_summarybar_visibility(summarybar_visibility);
-  gnc_mdi_show_summarybar(mc);
-  LEAVE("flipped");
-}
-
-/* GNOME 2 Port */
-static gboolean
-gnc_main_window_add_child_cb (GnomeMDI *mdi, GnomeMDIChild *child, gpointer data)
-{
-	return TRUE;
-}
-
-static gboolean
-gnc_main_window_add_view_cb (GnomeMDI *mdi, GtkWidget *widget, gpointer data)
-{
-	return TRUE;
-}
-
-/********************************************************************
- * gnc_main_window_new()
- * initialize the Gnome MDI system
- ********************************************************************/
-
-GNCMDIInfo * 
-gnc_main_window_new (void)
-{
-  GNCMDIInfo * retval;
-
-  ENTER(" ");
-  retval = gnc_mdi_new ("GnuCash", "GnuCash",
-                        gnc_main_window_toolbar_prefix (),
-                        gnc_main_window_toolbar_suffix (),
-                        gnc_shutdown,
-                        gnc_main_window_can_restore_cb,
-                        gnc_main_window_create_child);
-
-  g_return_val_if_fail (retval != NULL, NULL);
-
-  /* these menu and toolbar options are the ones that are always 
-   * available */ 
-  gnc_main_window_create_menus (retval);
-
-  /* set up the position where the child menus/toolbars will be 
-   * inserted  */
-  gnome_mdi_set_child_menu_path(GNOME_MDI(retval->mdi),
-                                "_Edit");
-  gnome_mdi_set_child_list_path(GNOME_MDI(retval->mdi),
-                                "_Windows/");
-
-  /* GNOME 2 Port (tmp fix) */
-  g_signal_connect (G_OBJECT(retval->mdi), "add-child",
-                    G_CALLBACK(gnc_main_window_add_child_cb),
-                     retval);
-  g_signal_connect (G_OBJECT(retval->mdi), "add-view",
-                    G_CALLBACK(gnc_main_window_add_view_cb),
-                     retval);
-
-  /* handle top-level signals */
-  g_signal_connect (G_OBJECT(retval->mdi), "app-created",
-                    G_CALLBACK(gnc_main_window_app_created_cb),
-                     retval);
-
-  LEAVE(" ");
-  return retval;
-}
-#endif
-
-/********************************************************************
- * menu/toolbar data structures and callbacks 
- * these are the "templates" that are installed in every top level
- * MDI window
- ********************************************************************/
-#if INCLUDE_GNOME1_BASED_ROUTINES
-static void
-gnc_main_window_options_cb(GtkWidget *widget, gpointer data)
-{
-  gnc_show_options_dialog();
-}
-
-static void
-gnc_main_window_file_new_file_cb(GtkWidget * widget, gpointer data)
-{
-  gnc_file_new ();
-  gnc_refresh_main_window_info ();
-}
-
-static void
-gnc_main_window_file_new_window_cb(GtkWidget * widget, gpointer data)
-{
-  GNCMDIInfo *main_info;
-  GnomeMDI *mdi;
-
-  main_info = gnc_mdi_get_current ();
-  if (!main_info) return;
-
-  mdi = main_info->mdi;
-  if (!mdi) return;
-
-  if (mdi->active_child && mdi->active_view)
-  {
-    if (!strcmp(mdi->active_child->name, _("Accounts")))
-    {
-    }
-    else
-    {
-      GnomeMDIChild * child = mdi->active_child;
-      gnome_mdi_remove_view(mdi, mdi->active_view, FALSE);
-      gnome_mdi_add_toplevel_view(mdi, child);
-    }
-  }
-}
-
-static void
-gnc_main_window_file_open_cb(GtkWidget * widget, gpointer data)
-{
-  gnc_file_open ();
-  gnc_refresh_main_window_info ();
-}
-
-void
-gnc_main_window_file_save_cb(GtkWidget * widget, gpointer data)
-{
-  gnc_file_save ();
-  gnc_refresh_main_window_info ();
-}
-
-void
-gnc_main_window_file_save_as_cb(GtkWidget * widget, gpointer data)
-{
-  gnc_file_save_as ();
-  gnc_refresh_main_window_info ();
-}
-
-static void
-gnc_main_window_file_export_cb(GtkWidget * widget, gpointer data)
-{
-  gnc_file_export_file(NULL);
-  gnc_refresh_main_window_info ();
-}
-
-static void
-gnc_main_window_file_shutdown_cb(GtkWidget * widget, gpointer data)
-{
-  gnc_shutdown (0);
-}
-
-/**
- * gnc_main_window_dispatch_cb
- *
- * @widget: A pointer to the menu item selected. (ignored)
- * @data: The user data for this menu item. (ignored)
- *
- * The main menubar has several items that must react differently
- * depending upon what window is in front when they are selected.
- * These menus all point to this dispatch routine, which uses the user
- * data associated with the menu item to determine which function was
- * requested. If then calls the appropriate dispatch function (and
- * data) registered for this item and saved in the GNCMDIChildInfo
- * data structure.
- *
- * Again, this routine has to grovel through the mdi related data
- * structures to find the current child data structure (because there
- * are potentially many windows).  The callback data should point to
- * the right mdi child data structure, but doesn't appear to.
- */
-static void
-gnc_main_window_dispatch_cb(GtkWidget * widget, gpointer data)
-{
-  GNCMDIChildInfo *mc;
-  GNCMDIDispatchType type;
-  gpointer *uidata;
-
-  /* How annoying. MDI overrides the user data. Get it the hard way. */
-  uidata = g_object_get_data (G_OBJECT(widget), GNOMEUIINFO_KEY_UIDATA);
-  type = (GNCMDIDispatchType)GPOINTER_TO_UINT(uidata);
-  g_return_if_fail(type < GNC_DISP_LAST);
-
-  mc = gnc_main_window_get_mdi_child();
-  if (mc && mc->dispatch_callback[type])
-    mc->dispatch_callback[type](widget, mc->dispatch_data[type]);
-}
-
-/**
- * gnc_main_window_tax_info_cb
- *
- * @widget: A pointer to the menu item selected. (ignored)
- * @unused: The user data for this menu item. (ignored)
- *
- * Bring up the window for editing tax data.
- */
-static void
-gnc_main_window_tax_info_cb (GtkWidget * widget, gpointer unused) {
-  GNCMDIChildInfo * mc;
-
-  mc = gnc_main_window_get_mdi_child();
-  if (!mc || !mc->app)
-    return;
-  gnc_tax_info_dialog(GTK_WIDGET(mc->app));
-}
-
-static void
-gnc_main_window_file_close_cb(GtkWidget * widget, gpointer data)
-{
-  GNCMDIInfo *main_info;
-  GnomeMDI *mdi;
-  GNCMDIChildInfo * inf;
-
-  main_info = gnc_mdi_get_current ();
-  if (!main_info) return;
-
-  mdi = main_info->mdi;
-  if (!mdi) return;
-
-  inf = gtk_object_get_user_data(GTK_OBJECT(mdi->active_child));
-
-  if (mdi->active_child)
-  {
-    if (inf->toolbar)
-    {
-      gtk_widget_destroy (GTK_WIDGET(inf->toolbar)->parent);
-      inf->toolbar = NULL;
-    }
-
-    gnome_mdi_remove_child (mdi, mdi->active_child, FALSE);
-  }  
-  else
-  {
-    gnc_warning_dialog (GTK_WIDGET(inf->app),
-			_("Select \"Exit\" to exit GnuCash."));
-  }
-}
-
-void
-gnc_main_window_fincalc_cb(GtkWidget *widget, gpointer data)
-{
-  gnc_ui_fincalc_dialog_create();
-}
-
-static void
-gnc_main_window_books_druid_cb(GtkWidget *widget, gpointer data)
-{
-	gnc_acct_period_dialog();
-}
-
-void
-gnc_main_window_gl_cb(GtkWidget *widget, gpointer data)
-{
-  GNCLedgerDisplay *ld;
-  GNCSplitReg *gsr;
-  RegWindow *regData;
-
-  ld = gnc_ledger_display_gl ();
-  gsr = gnc_ledger_display_get_user_data( ld );
-  if ( ! gsr ) {
-    regData = regWindowLedger (ld);
-    gnc_register_raise (regData);
-  } else {
-    gnc_split_reg_raise( gsr );
-  }
-}
-
-void
-gnc_main_window_prices_cb(GtkWidget *widget, gpointer data)
-{
-  gnc_prices_dialog (NULL);
-}
-
-
-void
-gnc_main_window_find_transactions_cb (GtkWidget *widget, gpointer data)
-{
-  gnc_ui_find_transactions_dialog_create(NULL);
-}
-
-void
-gnc_main_window_sched_xaction_cb (GtkWidget *widget, gpointer data)
-{
-  gnc_ui_scheduled_xaction_dialog_create();
-}
-
-static
-void
-gnc_main_window_sched_xaction_slr_cb (GtkWidget *widget, gpointer data)
-{
-  gint ret;
-  
-  const char *nothing_to_do_msg =
-    _( "There are no Scheduled Transactions to be entered at this time." );
-
-  ret = gnc_ui_sxsincelast_dialog_create();
-  if ( ret == 0 ) {
-    gnc_info_dialog(NULL, nothing_to_do_msg );
-  } else if ( ret < 0 ) {
-    gnc_info_dialog
-      (NULL, ngettext 
-       /* Translators: %d is the number of transactions. This is a
-	  ngettext(3) message. */
-       ("There are no Scheduled Transactions to be entered at this time.\n"
-	"(%d transaction automatically created)",
-	"There are no Scheduled Transactions to be entered at this time.\n"
-	"(%d transactions automatically created)",
-	-(ret)),
-       -(ret));
-  } /* else { this else [>0 means dialog was created] intentionally left
-     * blank. } */
-}
-
-static
-void
-gnc_main_window_sx_loan_druid_cb( GtkWidget *widget, gpointer data)
-{
-  gnc_ui_sx_loan_druid_create();
-}
-
-void
-gnc_main_window_about_cb (GtkWidget *widget, gpointer data)
-{
-  GtkWidget *about;
-  const gchar *message = _("The GnuCash personal finance manager.\n"
-                           "The GNU way to manage your money!\n"
-                           "http://www.gnucash.org/");
-  const gchar *copyright = "(C) 1998-2002 Linas Vepstas";
-  const gchar *authors[] = {
-    "Derek Atkins <derek at ihtfp.com>",
-    "Rob Browning <rlb at cs.utexas.edu>",
-    "Bill Gribble <grib at billgribble.com>",
-    "David Hampton <hampton at employees.org>",
-    "James LewisMoss <dres at debian.org>",
-    "Robert Graham Merkel <rgmerk at mira.net>",
-    "Dave Peticolas <dave at krondo.com>",
-    "Joshua Sled <jsled at asynchronous.org>",
-    "Christian Stimming <stimming at tuhh.de>",
-    "Linas Vepstas <linas at linas.org>",
-    NULL
-  };
-  gchar *ver_string;
-
-#ifdef GNUCASH_CVS
-  ver_string = g_strdup_printf("%s cvs (built %s)", VERSION, GNUCASH_BUILD_DATE);
-#else
-  ver_string = strdup(VERSION);
-#endif
-  /* GNOME 2 Port (Add Documenters and Translators) */
-  about = gnome_about_new ("GnuCash", ver_string, copyright, message,
-                           authors, NULL, NULL, NULL);
-  g_free(ver_string);
-
-  gnome_dialog_set_parent (GNOME_DIALOG(about),
-                           GTK_WINDOW(gnc_ui_get_toplevel()));
-
-  gnome_dialog_run_and_close (GNOME_DIALOG(about));
-}
-
-void
-gnc_main_window_commodities_cb(GtkWidget *widget, gpointer data)
-{
-  gnc_commodities_dialog (NULL);
-}
-
-
-void
-gnc_main_window_tutorial_cb (GtkWidget *widget, gpointer data)
-{
-  gnc_gnome_help(HF_GUIDE, NULL);
-}
-
-void
-gnc_main_window_totd_cb (GtkWidget *widget, gpointer data)
-
-{
-  return;
-}
-
-void
-gnc_main_window_help_cb (GtkWidget *widget, gpointer data)
-{
-  gnc_gnome_help(HF_HELP, NULL);
-}
-
-void
-gnc_main_window_exit_cb (GtkWidget *widget, gpointer data)
-{
-  gnc_shutdown(0);
-}
-
-static void
-gnc_main_window_file_new_account_tree_cb(GtkWidget * w, gpointer data)
-{
-}
-
-
-static void
-gnc_main_window_create_menus(GNCMDIInfo * maininfo)
-{
-  static GnomeUIInfo gnc_file_recent_files_submenu_template[] =
-  {
-    GNOMEUIINFO_END
-  };
-
-  static GnomeUIInfo gnc_file_import_submenu_template[] =
-  {
-    GNOMEUIINFO_END
-  };
-
-  static GnomeUIInfo gnc_file_export_submenu_template[] =
-  {
-    {
-      GNOME_APP_UI_ITEM,
-      N_("Export _Accounts..."),
-      N_("Export the account hierarchy to a new file"),
-      gnc_main_window_file_export_cb, NULL, NULL,
-      GNOME_APP_PIXMAP_NONE, NULL,
-      0, 0, NULL
-    },
-    GNOMEUIINFO_END
-  };
-
-  static GnomeUIInfo gnc_file_menu_template[] = 
-  {
-    GNOMEUIINFO_MENU_NEW_ITEM(N_("_New File"),
-                              N_("Create a new file"),
-                              gnc_main_window_file_new_file_cb, NULL),
-    {
-      GNOME_APP_UI_ITEM,
-      N_("New Account _Tree"),
-      N_("Open a new account tree view"),
-      gnc_main_window_file_new_account_tree_cb, NULL, NULL, 
-      GNOME_APP_PIXMAP_NONE, NULL, 0, 0, NULL
-    },    
-    GNOMEUIINFO_SEPARATOR,
-    GNOMEUIINFO_MENU_OPEN_ITEM(gnc_main_window_file_open_cb, NULL),
-    {
-      GNOME_APP_UI_ITEM,
-      N_("Open in a New Window"),
-      N_("Open a new top-level GnuCash window for the current view"),
-      gnc_main_window_file_new_window_cb, NULL, NULL, 
-      GNOME_APP_PIXMAP_NONE, NULL, 0, 0, NULL
-    },    
-    GNOMEUIINFO_SUBTREE( N_("Open _Recent"),
-                         gnc_file_recent_files_submenu_template ),
-    GNOMEUIINFO_SEPARATOR,
-    GNOMEUIINFO_MENU_SAVE_ITEM(gnc_main_window_file_save_cb, NULL),
-    GNOMEUIINFO_MENU_SAVE_AS_ITEM(gnc_main_window_file_save_as_cb, NULL),
-    GNOMEUIINFO_SEPARATOR,
-    GNOMEUIINFO_SUBTREE( N_("_Import"),
-                         gnc_file_import_submenu_template ),
-    GNOMEUIINFO_SUBTREE( N_("_Export"),
-                         gnc_file_export_submenu_template ),
-    GNOMEUIINFO_SEPARATOR,
-    GNOMEUIINFO_MENU_PRINT_ITEM(gnc_main_window_dispatch_cb,
-				GUINT_TO_POINTER(GNC_DISP_PRINT)),
-    GNOMEUIINFO_SEPARATOR,
-    GNOMEUIINFO_MENU_CLOSE_ITEM(gnc_main_window_file_close_cb, NULL),
-    GNOMEUIINFO_MENU_EXIT_ITEM(gnc_main_window_file_shutdown_cb, NULL),
-    GNOMEUIINFO_END
-  };
-  
-  static GnomeUIInfo gnc_edit_menu_template[] = 
-  {
-    GNOMEUIINFO_MENU_CUT_ITEM(gnc_main_window_dispatch_cb,
-				GUINT_TO_POINTER(GNC_DISP_CUT)),
-    GNOMEUIINFO_MENU_COPY_ITEM(gnc_main_window_dispatch_cb,
-				GUINT_TO_POINTER(GNC_DISP_COPY)),
-    GNOMEUIINFO_MENU_PASTE_ITEM(gnc_main_window_dispatch_cb,
-				GUINT_TO_POINTER(GNC_DISP_PASTE)),
-    GNOMEUIINFO_SEPARATOR,
-    GNOMEUIINFO_MENU_PREFERENCES_ITEM(gnc_main_window_options_cb, NULL),
-    { GNOME_APP_UI_ITEM,
-      N_("Ta_x Options"),
-      N_("Setup tax information for all income and expense accounts"),
-      gnc_main_window_tax_info_cb, NULL, NULL,
-      GNOME_APP_PIXMAP_NONE, NULL,
-      0, 0, NULL
-    },
-    GNOMEUIINFO_END
-  };
-
-  static GnomeUIInfo gnc_view_menu_template[] = 
-  {
-    { GNOME_APP_UI_ITEM,
-      N_("_Refresh"),
-      N_("Refresh this window"),
-      gnc_main_window_dispatch_cb, GUINT_TO_POINTER(GNC_DISP_REFRESH), NULL,
-      GNOME_APP_PIXMAP_NONE, NULL,
-      0, 0, NULL
-    },
-    GNOMEUIINFO_SEPARATOR,
-    { GNOME_APP_UI_TOGGLEITEM,
-      N_("_Toolbar"),
-      N_("Show/hide the toolbar on this window"),
-      gnc_main_window_flip_toolbar_cb, NULL, NULL,
-      GNOME_APP_PIXMAP_NONE, NULL,
-      0, 0, NULL
-    },
-    { GNOME_APP_UI_TOGGLEITEM,
-      N_("S_ummary Bar"),
-      N_("Show/hide the summary bar on this window"),
-      gnc_main_window_flip_summary_bar_cb, NULL, NULL,
-      GNOME_APP_PIXMAP_NONE, NULL,
-      0, 0, NULL
-    },
-    { GNOME_APP_UI_TOGGLEITEM,
-      N_("_Status Bar"),
-      N_("Show/Hide the status bar on this window"),
-      gnc_main_window_flip_status_bar_cb, NULL, NULL,
-      GNOME_APP_PIXMAP_NONE, NULL,
-      0, 0, NULL
-    },
-    GNOMEUIINFO_END
-  };
-
-  static GnomeUIInfo gnc_sched_xaction_tools_submenu_template[] = 
-  {
-    { GNOME_APP_UI_ITEM,
-      N_("_Scheduled Transaction Editor"),
-      N_("The list of Scheduled Transactions"),
-      gnc_main_window_sched_xaction_cb, NULL, NULL,
-      GNOME_APP_PIXMAP_NONE, NULL,
-      0, 0, NULL
-    },
-    { GNOME_APP_UI_ITEM,
-      N_("_Since Last Run..."),
-      N_("Create Scheduled Transactions since the last time run."),
-      gnc_main_window_sched_xaction_slr_cb, NULL, NULL,
-      GNOME_APP_PIXMAP_NONE, NULL,
-      0, 0, NULL
-    },
-    GNOMEUIINFO_SEPARATOR,
-    { GNOME_APP_UI_ITEM,
-      N_( "_Mortgage & Loan Repayment..." ),
-      N_( "Setup scheduled transactions for repayment of a loan" ),
-      gnc_main_window_sx_loan_druid_cb, NULL, NULL,
-      GNOME_APP_PIXMAP_NONE, NULL,
-      0, 0, NULL
-    },
-    GNOMEUIINFO_END
-  };
-  
-  static GnomeUIInfo gnc_actions_menu_template[] =
-  {
-    GNOMEUIINFO_SUBTREE( N_("_Scheduled Transactions"),
-                         gnc_sched_xaction_tools_submenu_template ),
-    {
-      GNOME_APP_UI_ITEM,
-      N_("Close Books"),
-      N_("Archive old data using accounting periods"),
-      gnc_main_window_books_druid_cb, NULL, NULL,
-      GNOME_APP_PIXMAP_NONE, NULL,
-      0, 0, NULL
-    },
-    GNOMEUIINFO_END
-  };
-  static GnomeUIInfo gnc_tools_menu_template[] =
-  {
-    {
-      GNOME_APP_UI_ITEM,
-      N_("_General Ledger"),
-      N_("Open a general ledger window"),
-      gnc_main_window_gl_cb, NULL, NULL,
-      GNOME_APP_PIXMAP_NONE, NULL,
-      0, 0, NULL
-    },
-    {
-      GNOME_APP_UI_ITEM,
-      N_("_Price Editor"),
-      N_("View and edit the prices for stocks and mutual funds"),
-      gnc_main_window_prices_cb, NULL, NULL,
-      GNOME_APP_PIXMAP_NONE, NULL,
-      0, 0, NULL
-    },
-    {
-      GNOME_APP_UI_ITEM,
-      N_("Commodity _Editor"),
-      N_("View and edit the commodities for stocks and mutual funds"),
-      gnc_main_window_commodities_cb, NULL, NULL,
-      GNOME_APP_PIXMAP_NONE, NULL,
-      0, 0, NULL
-    },
-    {
-      GNOME_APP_UI_ITEM,
-      N_("Financial _Calculator"),
-      N_("Use the financial calculator"),
-      gnc_main_window_fincalc_cb, NULL, NULL,
-      GNOME_APP_PIXMAP_NONE, NULL,
-      0, 0, NULL
-    },
-    { GNOME_APP_UI_ITEM,
-      N_("_Find Transactions"),
-      N_("Find transactions with a search"),
-      gnc_main_window_find_transactions_cb, NULL, NULL,
-      GNOME_APP_PIXMAP_NONE, NULL,
-      'f', GDK_CONTROL_MASK, NULL
-    },
-    GNOMEUIINFO_END
-  };
-  
-  static GnomeUIInfo gnc_help_menu_template[] =
-  {
-    {
-      GNOME_APP_UI_ITEM,
-      N_("Tutorial and Concepts _Guide"),
-      N_("Open the GnuCash Tutorial"),
-      gnc_main_window_tutorial_cb, NULL, NULL,
-      GNOME_APP_PIXMAP_NONE, NULL,
-      0, 0, NULL
-    },
-    {
-      GNOME_APP_UI_ITEM,
-      N_("_Tips Of The Day"),
-      N_("View the Tips of the Day"),
-      gnc_main_window_totd_cb, NULL, NULL,
-      GNOME_APP_PIXMAP_NONE, NULL,
-      0, 0, NULL
-    },
-    {
-      GNOME_APP_UI_ITEM,
-      N_("_Help"),
-      N_("Open the GnuCash Help"),
-      gnc_main_window_help_cb, NULL, NULL,
-      GNOME_APP_PIXMAP_NONE, NULL,
-      0, 0, NULL
-    },
-    
-    GNOMEUIINFO_MENU_ABOUT_ITEM(gnc_main_window_about_cb, NULL),
-
-    GNOMEUIINFO_END
-  };
-
-  static GnomeUIInfo gnc_windows_menu_template[] =
-  {
-    GNOMEUIINFO_END
-  };
-
-  static GnomeUIInfo gnc_main_menu_template[] =
-  {
-    GNOMEUIINFO_MENU_FILE_TREE(gnc_file_menu_template),
-    GNOMEUIINFO_MENU_EDIT_TREE(gnc_edit_menu_template),
-    GNOMEUIINFO_MENU_VIEW_TREE(gnc_view_menu_template),
-    GNOMEUIINFO_SUBTREE(N_("_Actions"), gnc_actions_menu_template),
-    GNOMEUIINFO_SUBTREE(N_("_Tools"), gnc_tools_menu_template),
-    GNOMEUIINFO_SUBTREE(N_("_Windows"), gnc_windows_menu_template),    
-    GNOMEUIINFO_MENU_HELP_TREE(gnc_help_menu_template),
-    GNOMEUIINFO_END
-  };
-
-  ENTER(" ");
-  gnome_mdi_set_menubar_template(GNOME_MDI(maininfo->mdi),
-                                 gnc_main_menu_template);
-  LEAVE(" ");
-}
-
-static GnomeUIInfo *
-gnc_main_window_toolbar_prefix (void)
-{
-  static GnomeUIInfo prefix[] = 
-  {
-    { GNOME_APP_UI_ITEM,
-      N_("Save"),
-      N_("Save the file to disk"),
-      gnc_main_window_file_save_cb,
-      NULL,
-      NULL,
-      GNOME_APP_PIXMAP_STOCK, 
-      GNOME_STOCK_PIXMAP_SAVE,
-      0, 0, NULL
-    },
-    { GNOME_APP_UI_ITEM,
-      N_("Close"),
-      N_("Close the current notebook page"),
-      gnc_main_window_file_close_cb,
-      NULL,
-      NULL,
-      GNOME_APP_PIXMAP_STOCK, 
-      GNOME_STOCK_PIXMAP_CLOSE,
-      0, 0, NULL
-    },
-    GNOMEUIINFO_SEPARATOR,
-    GNOMEUIINFO_END
-  };
-
-  return prefix;
-}
-
-static GnomeUIInfo *
-gnc_main_window_toolbar_suffix (void)
-{
-  static GnomeUIInfo suffix[] = 
-  {
-    GNOMEUIINFO_SEPARATOR,
-    { GNOME_APP_UI_ITEM,
-      N_("Exit"),
-      N_("Exit GnuCash"),
-      gnc_main_window_exit_cb, 
-      NULL,
-      NULL,
-      GNOME_APP_PIXMAP_STOCK,
-      GNOME_STOCK_PIXMAP_QUIT,
-      0, 0, NULL
-    },
-    GNOMEUIINFO_END
-  };
-
-  return suffix;
-}
-
-#endif
--- src/gnome/window-register.c
+++ /dev/null
@@ -1,1771 +0,0 @@
-/*******************************************************************\
- * window-register.c -- the register window for GnuCash             *
- * 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.                                *
- *                                                                  *
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652       *
- * Boston, MA  02111-1307,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-#define _GNU_SOURCE
-
-#include "config.h"
-
-#include <gnome.h>
-#include <time.h>
-#include <g-wrap-wct.h>
-
-#include "Scrub.h"
-#include "dialog-account.h"
-#include "dialog-fincalc.h"
-#include "dialog-find-transactions.h"
-#include "dialog-transfer.h"
-#include "dialog-utils.h"
-#include "druid-stock-split.h"
-#include "global-options.h"
-#include "gnc-component-manager.h"
-#include "gnc-date-edit.h"
-#include "gnc-engine-util.h"
-#include "gnc-euro.h"
-#include "gnc-gconf-utils.h"
-#include "gnc-gui-query.h"
-#include "gnc-ledger-display.h"
-#include "gnc-menu-extensions.h"
-#include "gnc-pricedb.h"
-#include "gnc-split-reg.h"
-#include "gnc-ui-util.h"
-#include "gnc-ui.h"
-#include "gnucash-sheet.h"
-#include "lot-viewer.h"
-#include "messages.h"
-#include "table-allgui.h"
-#include "window-main.h"
-#include "window-reconcile.h"
-#include "window-register.h"
-#include "window-report.h"
-#include "top-level.h"
-#include "guile-mappings.h"
-
-typedef struct _RegDateWindow RegDateWindow;
-struct _RegDateWindow
-{
-  GtkWidget * window;
-
-  GtkWidget * show_earliest;
-  GtkWidget * start_date;
-
-  GtkWidget * show_latest;
-  GtkWidget * end_date;
-  GtkWidget * today_button;
-
-  GtkWidget * set_button;
-};
-
-/* The RegWindow struct contains info needed by an instance of an open 
- * register.  Any state info for the regWindow goes here. */
-struct _RegWindow
-{
-  gint width;
-
-  GtkWidget *window;
-  GtkWidget *toolbar_dock;
-  GtkWidget *summarybar_dock;
-  GtkWidget *statusbar;
-
-  GNCLedgerDisplay *ledger;
-  GNCSplitReg *gsr;
-
-  RegDateWindow *date_window;
-  gboolean read_only;
-
-  GtkWidget *reconciled_menu_item;
-  GtkWidget *cleared_menu_item;
-  GtkWidget *voided_menu_item;
-  GtkWidget *frozen_menu_item;
-  GtkWidget *unreconciled_menu_item;
-  gint component_id;
-};
-
-GtkWidget *gnc_RegWindow_window (RegWindow *data)
-{
-  g_assert(data);
-  return data->window;
-}
-
-GNCLedgerDisplay *gnc_RegWindow_ledger (RegWindow *data)
-{
-  g_assert(data);
-  return data->ledger;
-}
-
-
-/* This static indicates the debugging module that this .o belongs to.   */
-/* static short module = MOD_GUI; */
-//static short module = MOD_SX; /* for the moment... */
-
-static int last_width = 0;
-static int last_stock_width = 0;
-
-/** PROTOTYPES ******************************************************/
-
-static void gnc_register_help_changed_cb( GNCSplitReg *gsr, gpointer data );
-
-void gnc_register_start_recn_cb(GtkWidget *w, gpointer data);
-void gnc_register_xfer_cb(GtkWidget *w, gpointer data);
-void gnc_register_stock_split_cb (GtkWidget * w, gpointer data);
-void gnc_register_lots_cb(GtkWidget *w, gpointer data);
-void gnc_register_edit_cb(GtkWidget *w, gpointer data);
-void gnc_register_new_account_cb(GtkWidget * w, gpointer data);
-
-void gnc_register_void_trans_cb(GtkWidget *w, gpointer data);
-void gnc_register_unvoid_trans_cb(GtkWidget *w, gpointer data);
-void gnc_register_close_cb(GtkWidget *w, gpointer data);
-void gnc_register_report_account_cb(GtkWidget *w, gpointer data);
-void gnc_register_report_trans_cb(GtkWidget *w, gpointer data);
-void gnc_register_print_cb(GtkWidget *w, gpointer data);
-void gnc_register_show_all_status_cb(GtkWidget *widget, gpointer data);
-void gnc_register_show_one_status_cb(GtkWidget *widget, gpointer data);
-void gnc_register_date_cb(GtkWidget *widget, gpointer data);
-void gnc_register_date_show_all_cb(GtkWidget *w, gpointer data);
-void gnc_register_today_cb(GtkWidget *w, gpointer data);
-void gnc_register_date_toggle_cb(GtkToggleButton *toggle, gpointer data);
-void gnc_register_date_range_cb(GtkWidget *w, gpointer data);
-
-void gnc_register_print_check_cb(GtkWidget * widget, gpointer data);
-void gnc_ui_find_transactions_cb (GtkWidget *widget, gpointer data);
-
-void gnc_register_toolbar_cb(GtkWidget *widget, gpointer data);
-void gnc_register_summarybar_cb(GtkWidget *widget, gpointer data);
-void gnc_register_statusbar_cb(GtkWidget *widget, gpointer data);
-
-void gnc_register_gl_cb(GtkWidget *widget, gpointer data);
-void gnc_register_prices_cb(GtkWidget *widget, gpointer data);
-void gnc_register_commodities_cb(GtkWidget *widget, gpointer data);
-void gnc_register_fincalc_cb(GtkWidget *widget, gpointer data);
-
-void gnc_register_scrub_all_cb (GtkWidget *widget, gpointer data);
-void gnc_register_scrub_current_cb (GtkWidget *widget, gpointer data);
-
-gboolean gnc_register_delete_cb(GtkWidget *widget, GdkEvent *event, gpointer data);
-void gnc_register_destroy_cb(GtkWidget *widget, gpointer data);
-void gnc_register_size_allocate (GtkWidget *widget, GtkAllocation *allocation, gpointer user_data);
-
-static void gnc_register_setup_menu_widgets( RegWindow *regData, GladeXML *xml );
-static GtkWidget* gnc_register_setup_toolbar( RegWindow *regData );
-
-static void gnc_register_insert_cloned_toolbar_elt( GtkToolbar *dstToolbar,
-                                                    GtkToolbar *srcToolbar,
-                                                    GtkWidget *srcWidget,
-                                                    gchar *tooltip,
-                                                    gpointer callback,
-                                                    gpointer user_data,
-                                                    gint idx );
-
-static gboolean gnc_register_include_date(RegWindow *regData, time_t date);
-static void gnc_register_include_date_adapter( GNCSplitReg *gsr,
-                                               time_t date,
-                                               gpointer user_data );
-
-static void gnc_register_set_read_only( RegWindow *regData );
-
-static void gnc_reg_save_size (RegWindow *regData);
-
-
-/********************************************************************\
- * regWindowSimple                                                  *
- *   opens up a register window for Account account                 *
- *                                                                  *
- * Args:   account - the account associated with this register      *
- * Return: regData - the register window instance                   *
-\********************************************************************/
-GNCSplitReg*
-regWindowSimple (Account *account)
-{
-  GNCSplitReg *gsr;
-  GNCLedgerDisplay * ledger = gnc_ledger_display_simple( account );
-
-  if (ledger == NULL)
-    return NULL;
-
-  gsr = gnc_ledger_display_get_user_data( ledger ); 
-  if ( !gsr ) {
-    RegWindow *rw = regWindowLedger( ledger );
-    gsr = rw->gsr;
-  }
-
-  return gsr;
-}
-
-
-/********************************************************************\
- * regWindowAccGroup                                                *
- *   opens up a register window for a group of Accounts             *
- *                                                                  *
- * Args:   account - the account associated with this register      *
- * Return: regData - the register window instance                   *
-\********************************************************************/
-GNCSplitReg*
-regWindowAccGroup (Account *account)
-{
-  GNCSplitReg *gsr;
-  GNCLedgerDisplay * ledger = gnc_ledger_display_subaccounts (account);
-
-  if (ledger == NULL)
-    return NULL;
-
-  gsr = gnc_ledger_display_get_user_data( ledger );
-  if ( !gsr ) {
-    RegWindow *rw;
-    rw = regWindowLedger (ledger);
-    gsr = rw->gsr;
-  }
-
-  return gsr;
-}
-
-/**
- * Raise an existing register window to the front.
- **/
-void
-gnc_register_raise (RegWindow *regData)
-{
-  if (regData == NULL)
-    return;
-
-  if (regData->window == NULL)
-    return;
-
-  gtk_window_present( GTK_WINDOW(regData->window) );
-}
-
-static void
-gnc_date_range_set_sensitivities(RegWindow *regData)
-{
-  RegDateWindow *regDateData;
-  GtkToggleButton *toggle;
-  Query *query;
-
-  if (!regData)
-    return;
-
-  if (!regData->ledger)
-    return;
-
-  query = gnc_ledger_display_get_query (regData->ledger);
-  if (!query)
-    return;
-
-  regDateData = regData->date_window;
-  if (regDateData == NULL)
-    return;
-
-  toggle = GTK_TOGGLE_BUTTON(regDateData->show_earliest);
-  if (gtk_toggle_button_get_active(toggle))
-    gtk_widget_set_sensitive(regDateData->start_date, FALSE);
-  else
-    gtk_widget_set_sensitive(regDateData->start_date, TRUE);
-
-  toggle = GTK_TOGGLE_BUTTON(regDateData->show_latest);
-  if (gtk_toggle_button_get_active(toggle))
-  {
-    gtk_widget_set_sensitive(regDateData->end_date, FALSE);
-    gtk_widget_set_sensitive(regDateData->today_button, FALSE);
-  }
-  else
-  {
-    gtk_widget_set_sensitive(regDateData->end_date, TRUE);
-    gtk_widget_set_sensitive(regDateData->today_button, TRUE);
-  }
-}
-
-static void
-gnc_register_show_status(RegWindow *regData)
-{
-  RegDateWindow *regDateData;
-  GSList *param_list = NULL;
-  cleared_match_t how = 0;
-  Query *query;
-
-  if (!regData)
-    return;
-
-  if (!regData->ledger)
-    return;
-
-  if (GTK_CHECK_MENU_ITEM(regData->reconciled_menu_item)->active)
-    how |= CLEARED_RECONCILED;
-  if (GTK_CHECK_MENU_ITEM(regData->cleared_menu_item)->active)
-    how |= CLEARED_CLEARED;
-  if (GTK_CHECK_MENU_ITEM(regData->voided_menu_item)->active)
-    how |= CLEARED_VOIDED;
-  if (GTK_CHECK_MENU_ITEM(regData->frozen_menu_item)->active)
-    how |= CLEARED_FROZEN;
-  if (GTK_CHECK_MENU_ITEM(regData->unreconciled_menu_item)->active)
-    how |= CLEARED_NO;
-
-  query = gnc_ledger_display_get_query( regData->ledger );
-  if (!query)
-    return;
-
-  regDateData = regData->date_window;
-  if (regDateData == NULL)
-    return;
-
-  param_list = gncQueryBuildParamList (SPLIT_RECONCILE, NULL);
-  gncQueryPurgeTerms (query, param_list);
-  if (how == CLEARED_ALL)
-    return;
-
-  xaccQueryAddClearedMatch(query, how, QUERY_AND);
-}
-
-void
-gnc_register_show_one_status_cb(GtkWidget *widget, gpointer data)
-{
-  RegWindow *regData = data;
-
-  gnc_register_show_status(regData);
-
-  gnc_ledger_display_refresh (regData->ledger);
-}
-
-void
-gnc_register_show_all_status_cb(GtkWidget *widget, gpointer data)
-{
-  RegWindow *regData = data;
-
-  /* 
-   * Don't call gtk_check_menu_item_set_active() because this would
-   * just generate a callback that would then need to be blocked. Set
-   * the bit directly so the menu items will be displayed correctly
-   * next time around.
-   */
-  GTK_CHECK_MENU_ITEM(regData->reconciled_menu_item)->active = TRUE;
-  GTK_CHECK_MENU_ITEM(regData->cleared_menu_item)->active = TRUE;
-  GTK_CHECK_MENU_ITEM(regData->voided_menu_item)->active = TRUE;
-  GTK_CHECK_MENU_ITEM(regData->frozen_menu_item)->active = TRUE;
-  GTK_CHECK_MENU_ITEM(regData->unreconciled_menu_item)->active = TRUE;
-  gnc_register_show_status(regData);
-
-  gnc_ledger_display_refresh (regData->ledger);
-}
-
-static void
-gnc_register_set_date_range(RegWindow *regData)
-{
-  RegDateWindow *regDateData;
-  GtkToggleButton *toggle;
-  GSList *date_param;
-  Query *query;
-
-  if (!regData)
-    return;
-
-  if (!regData->ledger)
-    return;
-
-  query = gnc_ledger_display_get_query( regData->ledger );
-  if (!query)
-    return;
-
-  regDateData = regData->date_window;
-  if (regDateData == NULL)
-    return;
-
-  gtk_widget_set_sensitive(regDateData->set_button, FALSE);
-
-  toggle = GTK_TOGGLE_BUTTON(regDateData->show_earliest);
-
-  date_param = gncQueryBuildParamList(SPLIT_TRANS, TRANS_DATE_POSTED, NULL);
-  gncQueryPurgeTerms (query, date_param);
-  g_slist_free(date_param);
-
-  if (!gtk_toggle_button_get_active(toggle))
-  {
-    time_t start;
-
-    start = gnc_date_edit_get_date(GNC_DATE_EDIT(regDateData->start_date));
-    start = gnc_timet_get_day_start(start);
-
-    xaccQueryAddDateMatchTT(query, 
-                            TRUE, start, 
-                            FALSE, 0, 
-                            QUERY_AND);
-  }
-
-  toggle = GTK_TOGGLE_BUTTON(regDateData->show_latest);
-  if (!gtk_toggle_button_get_active(toggle))
-  {
-    time_t end;
-
-    end = gnc_date_edit_get_date(GNC_DATE_EDIT(regDateData->end_date));
-    end = gnc_timet_get_day_end(end);
-
-    xaccQueryAddDateMatchTT(query, 
-                            FALSE, 0,
-                            TRUE, end,                            
-                            QUERY_AND);
-  }
-
-  gnc_date_range_set_sensitivities(regData);
-}
-
-void
-gnc_register_date_cb(GtkWidget *widget, gpointer data)
-{
-  RegWindow *regData = data;
-
-  gnc_register_set_date_range(regData);
-
-  gnc_ledger_display_refresh (regData->ledger);
-}
-
-void
-gnc_register_date_show_all_cb(GtkWidget *widget, gpointer data)
-{
-  RegWindow *regData = data;
-  RegDateWindow *regDateData;
-  GtkToggleButton *toggle;
-
-  g_return_if_fail(regData != NULL);
-
-  regDateData = regData->date_window;
-  if (regDateData == NULL)
-    return;
-
-  toggle = GTK_TOGGLE_BUTTON(regDateData->show_earliest);
-  gtk_toggle_button_set_active(toggle, TRUE);
-
-  toggle = GTK_TOGGLE_BUTTON(regDateData->show_latest);
-  gtk_toggle_button_set_active(toggle, TRUE);
-
-  gnc_register_date_cb(widget, data);
-}
-
-void
-gnc_register_today_cb(GtkWidget *widget, gpointer data)
-{
-  RegWindow *regData = data;
-  RegDateWindow *regDateData;
-
-  g_return_if_fail(regData != NULL);
-
-  regDateData = regData->date_window;
-  gnc_date_edit_set_time(GNC_DATE_EDIT(regDateData->end_date), time(NULL));
-
-  gtk_widget_set_sensitive(regData->date_window->set_button, TRUE);
-}
-
-void
-gnc_register_date_toggle_cb(GtkToggleButton *toggle, gpointer data)
-{
-  RegWindow *regData = data;
-
-  gtk_widget_set_sensitive(regData->date_window->set_button, TRUE);
-
-  gnc_date_range_set_sensitivities(regData);
-}
-
-static void
-gnc_register_date_changed_cb(GtkWidget *widget, gpointer data)
-{
-  RegWindow *regData = data;
-
-  gtk_widget_set_sensitive(regData->date_window->set_button, TRUE);
-}
-
-static void
-gnc_register_show_date_window(RegWindow *regData)
-{
-  RegDateWindow *regDateData;
-
-  if (regData == NULL)
-    return;
-
-  regDateData = regData->date_window;
-  if (regDateData == NULL)
-    return;
-
-  if (regDateData->window == NULL)
-    return;
-
-  gtk_window_present(GTK_WINDOW(regDateData->window));
-}
-
-static RegDateWindow *
-gnc_register_date_window (RegWindow *regData, gboolean show_all)
-{
-  RegDateWindow *regDateData;
-  GtkWidget *dialog;
-  GladeXML *xml;
-
-  regDateData = g_new0(RegDateWindow, 1);
-  regData->date_window = regDateData;
-
-  xml = gnc_glade_xml_new ("register.glade", "Date Range");
-  dialog = glade_xml_get_widget (xml, "Date Range");
-  regDateData->window = dialog;
-
-  glade_xml_signal_autoconnect_full(xml, gnc_glade_autoconnect_full_func,
-				    regData);
-  gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (regData->window));
-
-  /*
-   * Get/create all the widgets up front to prevent callback errors
-   * when opening the General Ledger.
-   */
-  regDateData->show_earliest = glade_xml_get_widget(xml, "start_earliest");
-  regDateData->show_latest = glade_xml_get_widget(xml, "end_latest");
-  regDateData->today_button = glade_xml_get_widget(xml, "today");
-  regDateData->set_button = glade_xml_get_widget(xml, "set_range");
-  regDateData->start_date = gnc_date_edit_new(time(NULL), FALSE, FALSE);
-  regDateData->end_date = gnc_date_edit_new(time(NULL), FALSE, FALSE);
-
-  {
-    GtkWidget *calendar;
-    GtkWidget *entry;
-    GtkWidget *radio;
-    GtkWidget *date;
-    GtkWidget *hbox;
-    time_t time_val;
-
-    /* Starting Date */
-    radio = regDateData->show_earliest;
-    if (show_all)
-      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio), TRUE);
-
-    radio = glade_xml_get_widget(xml, "start_date");
-    if (!show_all)
-      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio), TRUE);
-
-    hbox = glade_xml_get_widget(xml, "start_date_entry");
-    date = regDateData->start_date;
-    gtk_box_pack_start(GTK_BOX(hbox), date, FALSE, FALSE, 0);
-
-    time_val = xaccQueryGetEarliestDateFound
-      (gnc_ledger_display_get_query (regData->ledger));
-    if (time_val < time(NULL))
-      gnc_date_edit_set_time(GNC_DATE_EDIT(date), time_val);
-
-    g_signal_connect (G_OBJECT (date), "date-changed",
-                      G_CALLBACK (gnc_register_date_changed_cb), regData);
-
-    calendar = GNC_DATE_EDIT(date)->calendar;
-    g_signal_connect (G_OBJECT (calendar), "day_selected_double_click",
-		      G_CALLBACK (gnc_register_date_changed_cb), regData);
-
-    entry = GNC_DATE_EDIT(date)->date_entry;
-    g_signal_connect (G_OBJECT (entry), "activate",
-		      G_CALLBACK (gnc_register_date_changed_cb), regData);
-    g_signal_connect (G_OBJECT (entry), "changed",
-		      G_CALLBACK (gnc_register_date_changed_cb), regData);
-
-
-    /* Ending Date */
-
-    radio = regDateData->show_latest;
-    if (show_all)
-      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio), TRUE);
-
-    radio = glade_xml_get_widget(xml, "end_date");
-    if (!show_all)
-      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio), TRUE);
-
-    hbox = glade_xml_get_widget(xml, "end_date_entry");
-    date = regDateData->end_date;
-    gtk_box_pack_start(GTK_BOX(hbox), date, FALSE, FALSE, 0);
-
-    g_signal_connect (G_OBJECT (date), "date-changed",
-                      G_CALLBACK (gnc_register_date_changed_cb), regData);
-
-    calendar = GNC_DATE_EDIT(date)->calendar;
-    g_signal_connect (G_OBJECT (calendar), "day_selected_double_click",
-		      G_CALLBACK (gnc_register_date_changed_cb), regData);
-
-    entry = GNC_DATE_EDIT(date)->date_entry;
-    g_signal_connect (G_OBJECT (entry), "activate",
-		      G_CALLBACK (gnc_register_date_changed_cb), regData);
-    g_signal_connect (G_OBJECT (entry), "changed",
-		      G_CALLBACK (gnc_register_date_changed_cb), regData);
-  }
-  gtk_widget_show_all(glade_xml_get_widget(xml, "main_frame"));
-
-  return regDateData;
-}
-
-void
-gnc_ui_find_transactions_cb (GtkWidget *widget, gpointer data)
-{
-  RegWindow * regData = data;
-  SplitRegister *reg;
-
-  reg = gnc_ledger_display_get_split_register (regData->ledger);
-
-  if (reg->type == SEARCH_LEDGER)
-    gnc_ui_find_transactions_dialog_create (regData->ledger);
-  else
-    gnc_ui_find_transactions_dialog_create (NULL);
-}
-
-void
-gnc_register_print_check_cb(GtkWidget * widget, gpointer data)
-{
-  g_assert_not_reached();
-}
-
-void
-gnc_register_scrub_all_cb (GtkWidget *widget, gpointer data)
-{
-  RegWindow *regData = data;
-  Query *query = gnc_ledger_display_get_query (regData->ledger);
-  AccountGroup *root;
-  GList *node;
-
-  if (query == NULL)
-    return;
-
-  gnc_suspend_gui_refresh ();
-  root = gnc_get_current_group ();
-
-  for (node = xaccQueryGetSplits (query); node; node = node->next)
-  {
-    Split *split = node->data;
-    Transaction *trans = xaccSplitGetParent (split);
-
-    xaccTransScrubOrphans (trans);
-    xaccTransScrubImbalance (trans, root, NULL);
-  }
-
-  gnc_resume_gui_refresh ();
-}
-
-void
-gnc_register_scrub_current_cb (GtkWidget *widget, gpointer data)
-{
-  RegWindow *regData = data;
-  SplitRegister *reg;
-  Transaction *trans;
-  AccountGroup *root;
-
-  reg = gnc_ledger_display_get_split_register (regData->ledger);
-  trans = gnc_split_register_get_current_trans (reg);
-
-  if (!trans)
-    return;
-
-  gnc_suspend_gui_refresh ();
-  root = gnc_get_current_group ();
-  xaccTransScrubOrphans (trans);
-  xaccTransScrubImbalance (trans, root, NULL);
-  gnc_resume_gui_refresh ();
-}
-
-gboolean
-gnc_register_delete_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
-{
-  RegWindow *regData = data;
-
-  if ( NULL == regData )  return TRUE;
-
-  gnc_reg_save_size( regData );
-
-  if (gnc_split_reg_check_close(regData->gsr) != FALSE) 
-  {
-    gnc_ledger_display_close (regData->ledger);
-    return FALSE;
-  }
-
-  return TRUE; /* don't close */
-}
-
-void
-gnc_register_destroy_cb(GtkWidget *widget, gpointer data)
-{
-  RegWindow *regData = data;
-
-  gnc_unregister_gui_component (regData->component_id);
-
-  if (regData->date_window != NULL)
-  {
-    if (regData->date_window->window != NULL)
-      gtk_widget_destroy(regData->date_window->window);
-
-    g_free(regData->date_window);
-    regData->date_window = NULL;
-  }
-
-  gtk_widget_destroy( regData->window );
-
-  g_free(regData);
-}
-
-static char *
-gnc_reg_get_name (RegWindow *regData, gboolean for_window)
-{
-  Account *leader;
-  SplitRegister *reg;
-  gchar *account_name;
-  gchar *reg_name;
-  gchar *name;
-  GNCLedgerDisplayType ledger_type;
-
-  if (regData == NULL)
-    return NULL;
-
-  reg = gnc_ledger_display_get_split_register (regData->ledger);
-  ledger_type = gnc_ledger_display_type (regData->ledger);
-
-  switch (reg->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_display_leader (regData->ledger);
-
-  if ((leader != NULL) && (ledger_type != LD_GL))
-  {
-    account_name = xaccAccountGetFullName (leader,
-                                           gnc_get_account_separator ());
-
-    if (ledger_type == LD_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 void
-gnc_reg_set_window_name (RegWindow *regData)
-{
-  gchar *windowname;
-
-  if (regData == NULL)
-    return;
-
-  windowname = gnc_reg_get_name( regData, TRUE );
-  gtk_window_set_title( GTK_WINDOW(regData->window), windowname );
-  g_free( windowname );
-}
-
-void
-gnc_register_size_allocate (GtkWidget *widget,
-			    GtkAllocation *allocation,
-			    gpointer user_data)
-{
-  RegWindow *regData = user_data;
-
-  /* HACK ALERT. this seems to be the only thing to get the
-   * freekin register window to stop freekin resizing itself
-   * all the freekin time. */
-
-  if (regData->width == allocation->width)
-    return;
-
-  regData->width = allocation->width;
-  gtk_window_set_default_size( GTK_WINDOW(regData->window), regData->width, 0 );
-}
-
-static void
-refresh_handler (GHashTable *changes, gpointer user_data)
-{
-  RegWindow *regData = user_data;
-
-  gnc_reg_set_window_name (regData);
-}
-
-static void
-close_handler (gpointer user_data)
-{
-  RegWindow *regData = user_data;
-
-  if (!regData)
-    return;
-
-  gnc_register_delete_cb(NULL, NULL, regData);
-  gnc_register_destroy_cb(NULL, regData);
-}
-
-/********************************************************************\
- * regWindowLedger                                                  *
- *   opens up a ledger window for the account list                  *
- *                                                                  *
- * Args:   ledger - ledger data structure                           *
- * Return: regData - the register window instance                   *
-\********************************************************************/
-RegWindow *
-regWindowLedger( GNCLedgerDisplay *ledger )
-{
-  SplitRegister *reg;
-  RegWindow *regData;
-  GtkWidget *gsr;
-  GtkWidget *register_window;
-  GtkWidget *table_frame;
-  gboolean show_all;
-  gboolean has_date;
-  GladeXML *xml;
-  gint numRows;
-
-  /* FIXME: This no longer holds, but something like it [attaching the window
-   * as user_data to the split_reg] should exist. */
-  reg = gnc_ledger_display_get_split_register (ledger);
-
-  regData = g_new0( RegWindow, 1 );
-  regData->ledger = ledger;
-
-  xml = gnc_glade_xml_new( "register.glade", "Check Register" );
-  register_window = glade_xml_get_widget( xml, "Check Register" );
-  regData->window = register_window;
-
-  glade_xml_signal_autoconnect_full( xml,
-                                     gnc_glade_autoconnect_full_func,
-                                     regData );
-
-  numRows = (guint)gnc_lookup_number_option ( "_+Advanced",
-                                              "Number of Rows", 20.0 );
-
-  gsr = gnc_split_reg_new( ledger,
-                           GTK_WINDOW(register_window),
-                           numRows,
-                           ( CREATE_TOOLBAR
-                             | CREATE_MENUS
-                             | CREATE_POPUP
-                             | CREATE_SUMMARYBAR ),
-                           0 );
-  regData->gsr = GNC_SPLIT_REG(gsr);
-
-  /* libglade should do this next line */
-  GNOME_APP(register_window)->menubar = glade_xml_get_widget( xml, "gnc_register_menubar" );
-
-  gnc_reg_set_window_name( regData );
-  if ( gnc_split_reg_get_read_only( regData->gsr ) ) {
-    gnc_register_set_read_only( regData );
-  }
-
-  show_all = gnc_lookup_boolean_option( "_+Advanced",
-                                        "Show All Transactions",
-                                        TRUE );
-
-  {
-    GSList *date_param = gncQueryBuildParamList(SPLIT_TRANS, TRANS_DATE_POSTED,
-						NULL);
-    Query *q = gnc_ledger_display_get_query (regData->ledger);
-    has_date = gncQueryHasTermType (q, date_param);
-    g_slist_free(date_param);
-  }
-
-  if (has_date)
-    show_all = FALSE;
-
-  regData->date_window = gnc_register_date_window( regData, show_all );
-
-  if (reg->type != SEARCH_LEDGER && !has_date)
-    gnc_register_set_date_range( regData );
-
-  /* Now that we have a date range, remove any existing
-   * maximum on the number of splits returned. */
-  xaccQuerySetMaxSplits( gnc_ledger_display_get_query(regData->ledger), -1 );
-
-  /* The status bar */
-  regData->statusbar = glade_xml_get_widget( xml, "appbar" );
-  g_signal_connect (G_OBJECT (regData->gsr), "help-changed",
-                    G_CALLBACK ( gnc_register_help_changed_cb ),
-                      regData );
-  gtk_signal_connect(GTK_OBJECT(regData->gsr), "void_txn",
-		     GTK_SIGNAL_FUNC(gnc_register_void_trans_cb), regData);
-
-  gtk_signal_connect(GTK_OBJECT(regData->gsr), "unvoid_txn",
-		     GTK_SIGNAL_FUNC(gnc_register_unvoid_trans_cb), regData);
-
-  /* The "include-date" and "read-only" signals. */
-  g_signal_connect (G_OBJECT (regData->gsr), "include-date",
-                    G_CALLBACK ( gnc_register_include_date_adapter ),
-                      regData );
-
-  regData->reconciled_menu_item = glade_xml_get_widget( xml, "show_reconciled" );
-  regData->cleared_menu_item = glade_xml_get_widget( xml, "show_cleared" );
-  regData->voided_menu_item = glade_xml_get_widget( xml, "show_voided" );
-  regData->frozen_menu_item = glade_xml_get_widget( xml, "show_frozen" );
-  regData->unreconciled_menu_item = glade_xml_get_widget( xml, "show_unreconciled" );
-
-  /* The menu bar. Menu extension setup needs to come *after* that. */
-  gnc_register_setup_menu_widgets( regData, xml );
-  /* -JSLED: this file is dead; avoid making calls to dead methods.
-  gnc_extensions_menu_setup_with_data( GNOME_APP(register_window),
-                                       WINDOW_NAME_REGISTER, regData );
-  */
-
-  /* The tool bar */
-  {
-    GtkWidget *toolbar = gnc_register_setup_toolbar( regData );
-    regData->toolbar_dock = glade_xml_get_widget( xml, "toolbar_dock" );
-    if ( toolbar ) {
-      /*
-       * Don't call gtk_widget_show_all() here. It overrides the users
-       * toolbar preference setting.
-       */
-      gtk_widget_show( toolbar );
-      gtk_container_add( GTK_CONTAINER(regData->toolbar_dock), toolbar );
-    }
-  }
-
-  /* The summary bar */
-  {
-    GtkWidget *summarybar = gnc_split_reg_get_summarybar( GNC_SPLIT_REG(gsr) );
-    regData->summarybar_dock = glade_xml_get_widget( xml, "summarybar_dock" );
-    if ( summarybar ) {
-      gtk_widget_show_all(summarybar);
-      gtk_container_add( GTK_CONTAINER(regData->summarybar_dock), summarybar );
-    }
-  }
-
-  /* The GNCSplitReg is a widget unto itself. */
-  table_frame = glade_xml_get_widget(xml, "table_frame");
-  gtk_container_add( GTK_CONTAINER(table_frame), GTK_WIDGET(regData->gsr) );
-
-  {
-    int *width;
-    char *prefix;
-
-    switch (reg->type)
-    {
-      case STOCK_REGISTER:
-      case PORTFOLIO_LEDGER:
-      case CURRENCY_REGISTER:
-        prefix = "reg_stock_win";
-        width = &last_stock_width;
-        break;
-
-      default:
-        prefix = "reg_win";
-        width = &last_width;
-        break;
-    }
-
-    gtk_window_set_default_size (GTK_WINDOW(regData->window), *width, 0);
-  }
-
-  gtk_widget_show_all( GTK_WIDGET(regData->window) );
-  gtk_widget_hide(regData->frozen_menu_item); // Is this state supported?
-  gnc_window_adjust_for_screen( GTK_WINDOW(regData->window) );
-
-  {
-    SplitRegister *sr = gnc_ledger_display_get_split_register( regData->ledger );
-    gnc_split_register_config( sr, sr->type, sr->style, sr->use_double_line );
-    gnc_ledger_display_refresh( regData->ledger );
-  }
-
-  /* Get event updates so we can check the window title */
-  regData->component_id = gnc_register_gui_component ("register-window",
-						      refresh_handler,
-						      close_handler, regData);
-
-  gnc_gui_component_watch_entity_type (regData->component_id,
-                                       GNC_ID_ACCOUNT,
-                                       GNC_EVENT_MODIFY);
-  return regData;
-}
-
-static
-void
-gnc_register_setup_menu_widgets( RegWindow *regData, GladeXML *xml )
-{
-  int adj = 0;
-  GtkWidget *mbar, *menu, *regMenu, *regMenuItem, *tmpMi;
-
-  /* Get our menu bar from glade. */
-  mbar = glade_xml_get_widget( xml, "gnc_register_menubar" );
-
-  /* General plan:
-   * . get the GNCSplitReg menu
-   * . get the RegWindow menu
-   * . get, remove the additional menu[item] from the RegWindow's menu
-   * . insert into the GNCSplitReg's menu.
-   * . remove the RegWindow menu from the menu bar, saving it's index.
-   * . insert the GNCSplitReg menu at the same index.
-   * . destroy now-unused widgets. */
-  if ( gnc_gconf_menus_have_tearoff() ) {
-    /* offset by one for the tearoff menu item. */
-    adj = 1;
-  }
-
-  /* Edit menu. */
-  menu = gnc_split_reg_get_edit_menu( regData->gsr );
-  regMenuItem = glade_xml_get_widget( xml, "gnc_register_edit_menu" );
-  regMenu = glade_xml_get_widget( xml, "gnc_register_edit_menu_menu" );
-  gtk_menu_shell_insert( GTK_MENU_SHELL(menu), gtk_menu_item_new(), (3 + adj));
-  tmpMi = glade_xml_get_widget( xml, "gnc_register_edit_mi" );
-  g_object_ref( G_OBJECT(tmpMi) );
-  gtk_container_remove( GTK_CONTAINER(regMenu), tmpMi );
-  gtk_menu_shell_insert( GTK_MENU_SHELL(menu), tmpMi, (4 + adj) );
-  g_object_unref( G_OBJECT(tmpMi) );
-  tmpMi = glade_xml_get_widget( xml, "gnc_register_find_mi" );
-  g_object_ref( G_OBJECT(tmpMi) );
-  gtk_container_remove( GTK_CONTAINER(regMenu), tmpMi );
-  gtk_menu_shell_append( GTK_MENU_SHELL(menu), tmpMi );
-  g_object_unref( G_OBJECT(tmpMi) );
-  gtk_menu_item_remove_submenu( GTK_MENU_ITEM(regMenuItem) );
-  gtk_menu_item_set_submenu( GTK_MENU_ITEM(regMenuItem), menu );
-
-  /* View menu */
-  menu = gnc_split_reg_get_view_menu( regData->gsr );
-  regMenuItem = glade_xml_get_widget( xml, "gnc_register_view_menu" );
-  regMenu = glade_xml_get_widget( xml, "gnc_register_view_menu_menu" );
-  tmpMi = glade_xml_get_widget( xml, "gnc_register_toolbar_mi" );
-  g_object_ref( G_OBJECT(tmpMi) );
-  gtk_container_remove( GTK_CONTAINER(regMenu), tmpMi );
-  gtk_menu_insert( GTK_MENU(menu), tmpMi, (0 + adj) );
-  g_object_unref( G_OBJECT(tmpMi) );
-  tmpMi = glade_xml_get_widget( xml, "gnc_register_summary_mi" );
-  g_object_ref( G_OBJECT(tmpMi) );
-  gtk_container_remove( GTK_CONTAINER(regMenu), tmpMi );
-  gtk_menu_insert( GTK_MENU(menu), tmpMi, (1 + adj) );
-  g_object_unref( G_OBJECT(tmpMi) );
-  tmpMi = glade_xml_get_widget( xml, "gnc_register_statusbar_mi" );
-  g_object_ref( G_OBJECT(tmpMi) );
-  gtk_container_remove( GTK_CONTAINER(regMenu), tmpMi );
-  gtk_menu_insert( GTK_MENU(menu), tmpMi, (2 + adj) );
-  g_object_unref( G_OBJECT(tmpMi) );
-  gtk_menu_insert( GTK_MENU(menu), gtk_menu_item_new(), (3 + adj) );
-  tmpMi = glade_xml_get_widget( xml, "gnc_register_select_trans_mi" );
-  g_object_ref( G_OBJECT(tmpMi) );
-  gtk_container_remove( GTK_CONTAINER(regMenu), tmpMi );
-  gtk_menu_insert( GTK_MENU(menu), tmpMi, (4 + adj) );
-  g_object_unref( G_OBJECT(tmpMi) );
-  gtk_menu_item_remove_submenu( GTK_MENU_ITEM(regMenuItem) );
-  gtk_menu_item_set_submenu( GTK_MENU_ITEM(regMenuItem), menu );
-
-  /* Actions menu */
-  menu = gnc_split_reg_get_action_menu( regData->gsr );
-  regMenuItem = glade_xml_get_widget( xml, "gnc_register_actions_menu" );
-  regMenu = glade_xml_get_widget( xml, "gnc_register_actions_menu_menu" );
-  tmpMi = glade_xml_get_widget( xml, "gnc_register_xfer_mi" );
-  g_object_ref( G_OBJECT(tmpMi) );
-  gtk_container_remove( GTK_CONTAINER(regMenu), tmpMi );
-  gtk_menu_insert( GTK_MENU(menu), tmpMi, (0 + adj) );
-  g_object_unref( G_OBJECT(tmpMi) );
-  tmpMi = glade_xml_get_widget( xml, "gnc_register_recn_mi" );
-  g_object_ref( G_OBJECT(tmpMi) );
-  gtk_container_remove( GTK_CONTAINER(regMenu), tmpMi );
-  gtk_menu_insert( GTK_MENU(menu), tmpMi, (1 + adj) );
-  g_object_unref( G_OBJECT(tmpMi) );
-  tmpMi = glade_xml_get_widget( xml, "gnc_register_stock_split_mi" );
-  g_object_ref( G_OBJECT(tmpMi) );
-  gtk_container_remove( GTK_CONTAINER(regMenu), tmpMi );
-  gtk_menu_insert( GTK_MENU(menu), tmpMi, (2 + adj) );
-  g_object_unref( G_OBJECT(tmpMi) );
-  tmpMi = glade_xml_get_widget( xml, "gnc_register_lots_mi" );
-  g_object_ref( G_OBJECT(tmpMi) );
-  gtk_container_remove( GTK_CONTAINER(regMenu), tmpMi );
-  gtk_menu_insert( GTK_MENU(menu), tmpMi, (3 + adj) );
-  g_object_unref( G_OBJECT(tmpMi) );
-
-  gtk_menu_insert( GTK_MENU(menu), gtk_menu_item_new(), (4 + adj) );
-  /* Base this off the end of the list for a bit more flexibility. */
-  gtk_menu_append( GTK_MENU(menu), gtk_menu_item_new() );
-  tmpMi = glade_xml_get_widget( xml, "gnc_register_scrub_mi" );
-  g_object_ref( G_OBJECT(tmpMi) );
-  gtk_container_remove( GTK_CONTAINER(regMenu), tmpMi );
-  gtk_menu_append( GTK_MENU(menu), tmpMi );
-  g_object_unref( G_OBJECT(tmpMi) );
-  gtk_menu_item_remove_submenu( GTK_MENU_ITEM(regMenuItem) );
-  gtk_menu_item_set_submenu( GTK_MENU_ITEM(regMenuItem), menu );
-
-  gtk_widget_show_all( mbar );
-}
-
-/**
- * Custom g_list_find_custom fn; returns 0 when the match is found.
- **/
-static
-gint
-gnc_register_find_toolbarchild( gconstpointer listEltData, gconstpointer data )
-{
-  return !( ((GtkToolbarChild*)listEltData)->widget == data );
-}
-
-/**
- * @param srcWidget A toolbar widget to clone [label, icon, button] and insert.
- * @param idx The index to insert at, or -1 for 'append to end'.
- **/
-static
-void
-gnc_register_insert_cloned_toolbar_elt( GtkToolbar *dstToolbar,
-                                        GtkToolbar *srcToolbar,
-                                        GtkWidget *srcWidget,
-                                        gchar *tooltip,
-                                        gpointer callback,
-                                        gpointer user_data,
-                                        gint idx )
-{
-  GtkToolbarChild *tchild;
-  GList *elt;
-  GtkWidget *iconCopy;
-  gchar *label, *labelCopy;
-
-  elt = g_list_find_custom( GTK_TOOLBAR(srcToolbar)->children,
-                            srcWidget,
-                            gnc_register_find_toolbarchild );
-  g_assert( elt );
-  tchild = (GtkToolbarChild*)(elt->data);
-  gtk_label_get( GTK_LABEL(tchild->label), &label );
-  labelCopy = g_strdup( label );
-  iconCopy = gtk_image_new_from_pixbuf (gtk_image_get_pixbuf (GTK_IMAGE (tchild->icon)));
-  if ( idx == -1 ) {
-    gtk_toolbar_append_element( dstToolbar,
-                                tchild->type,
-                                ( tchild->type == GTK_TOOLBAR_CHILD_RADIOBUTTON
-                                  ? tchild->widget : NULL ),
-                                labelCopy, tooltip, NULL, iconCopy,
-                                callback, user_data );
-  } else {
-    gtk_toolbar_insert_element( dstToolbar,
-                                tchild->type,
-                                ( tchild->type == GTK_TOOLBAR_CHILD_RADIOBUTTON
-                                  ? tchild->widget : NULL ),
-                                labelCopy, tooltip, NULL, iconCopy,
-                                callback, user_data, idx );
-  }
-}
-
-static
-GtkWidget*
-gnc_register_setup_toolbar( RegWindow *regData )
-{
-  GladeXML *xml;
-  GtkWidget *button;
-  GtkToolbar *tbar, *regTbar;
-
-#define CLOSE_TOOLBAR_TOOLTIP "Close this register window"
-#define XFER_TOOLBAR_TOOLTIP "Transfer funds from one account to another"
-#define FIND_TOOLBAR_TOOLTIP "Find transactions with a search"
-#define REPORT_TOOLBAR_TOOLTIP "Open a report window for this register"
-#define PRINT_TOOLBAR_TOOLTIP "Print a report for this register"
-
-  xml = gnc_glade_xml_new( "register.glade", "gnc_register_toolbar" );
-  g_assert( xml );
-  regTbar = GTK_TOOLBAR(glade_xml_get_widget( xml, "gnc_register_toolbar" ));
-  gtk_widget_hide( GTK_WIDGET(regTbar) );
-  g_assert( regTbar );
-  tbar = GTK_TOOLBAR(gnc_split_reg_get_toolbar( regData->gsr ));
-  g_assert( tbar );
-
-  /* General plan:
-   * . get the GNCSplitReg toolbar
-   * . get the gnc_register toolbar
-   * . pull buttons from the register toolbar
-   * . insert into GSR toolbar
-   * . destroy [now-]unused gnc_register_toolbar */
-
-  button = glade_xml_get_widget( xml, "gnc_register_close_b" );
-  gnc_register_insert_cloned_toolbar_elt( tbar, regTbar, button,
-                                          _(CLOSE_TOOLBAR_TOOLTIP),
-                                          gnc_register_close_cb, regData, 0 );
-  gtk_toolbar_append_space( tbar );
-  button = glade_xml_get_widget( xml, "gnc_register_xfer_b" );
-  gnc_register_insert_cloned_toolbar_elt( tbar, regTbar, button,
-                                          _(XFER_TOOLBAR_TOOLTIP),
-                                          gnc_register_xfer_cb, regData, -1 );
-  gtk_toolbar_append_space( tbar );
-  button = glade_xml_get_widget( xml, "gnc_register_find_b" );
-  gnc_register_insert_cloned_toolbar_elt( tbar, regTbar, button,
-                                          _(FIND_TOOLBAR_TOOLTIP),
-                                          gnc_ui_find_transactions_cb,
-                                          regData, -1 );
-  button = glade_xml_get_widget( xml, "gnc_register_report_b" );
-  gnc_register_insert_cloned_toolbar_elt( tbar, regTbar, button,
-                                          _(REPORT_TOOLBAR_TOOLTIP),
-                                          gnc_register_report_account_cb,
-                                          regData, -1 );
-  button = glade_xml_get_widget( xml, "gnc_register_print_b" );
-  gnc_register_insert_cloned_toolbar_elt( tbar, regTbar, button,
-                                          _(PRINT_TOOLBAR_TOOLTIP),
-                                          gnc_register_print_cb, regData, -1 );
-
-  gtk_widget_destroy( GTK_WIDGET(regTbar) );
-
-  /*
-   * Don't call gtk_widget_show_all() here. It overrides the users
-   * toolbar preference setting.
-   */
-  gtk_widget_show( GTK_WIDGET(tbar) );
-
-  return GTK_WIDGET(tbar);
-}
-
-static void
-gnc_register_help_changed_cb( GNCSplitReg *gsr, gpointer data )
-{
-  RegWindow *regData = data;
-  SplitRegister *reg;
-  const char *status;
-  char *help;
-
-  if (!regData)
-    return;
-
-  /* Get the text from the ledger */
-  reg = gnc_ledger_display_get_split_register( regData->ledger );
-  help = gnc_table_get_help( reg->table );
-  status = help ? help : "";
-  gnome_appbar_set_default( GNOME_APPBAR(regData->statusbar), status );
-  g_free( help );
-}
-
-static void
-gnc_reg_save_size (RegWindow *regData)
-{
-  SplitRegister *reg;
-  int *width;
-  char *prefix;
-
-  reg = gnc_ledger_display_get_split_register (regData->ledger);
-
-  switch (reg->type)
-  {
-    case STOCK_REGISTER:
-    case PORTFOLIO_LEDGER:
-    case CURRENCY_REGISTER:
-      prefix = "reg_stock_win";
-      width = &last_stock_width;
-      break;
-    default:
-      prefix = "reg_win";
-      width = &last_width;
-      break;
-  }
-
-  gdk_window_get_geometry (regData->window->window, NULL, NULL,
-                           width, NULL, NULL);
-}
-
-void 
-gnc_register_new_account_cb (GtkWidget * w, gpointer data)
-{
-  gnc_ui_new_account_window (NULL);
-}
-
-/********************************************************************\
- * gnc_register_xfer_cb -- open up the transfer window              *
- *                                                                  *
- * Args:   w    - the widget that called us                         *
- *         data - the data struct for this register                 *
- * Return: none                                                     *
-\********************************************************************/
-void 
-gnc_register_xfer_cb (GtkWidget * w, gpointer data)
-{
-  RegWindow *regData = data;
-
-  gnc_xfer_dialog (regData->window,
-                   gnc_ledger_display_leader (regData->ledger));
-}
-
-
-/********************************************************************\
- * gnc_register_stock_split_cb -- open up the stock split druid     *
- *                                                                  *
- * Args:   w    - the widget that called us                         *
- *         data - the data struct for this register                 *
- * Return: none                                                     *
-\********************************************************************/
-void
-gnc_register_stock_split_cb (GtkWidget * w, gpointer data)
-{
-  RegWindow *regData = data;
-
-  gnc_stock_split_dialog (NULL, gnc_ledger_display_leader (regData->ledger));
-}
-
-
-/********************************************************************\
- * gnc_register_lots_cb -- open up the lot viewer window            *
- *                                                                  *
- * Args:   w    - the widget that called us                         *
- *         data - the data struct for this register                 *
- * Return: none                                                     *
-\********************************************************************/
-void 
-gnc_register_lots_cb (GtkWidget * w, gpointer data)
-{
-  RegWindow *regData = data;
-
-  gnc_lot_viewer_dialog (gnc_ledger_display_leader (regData->ledger));
-}
-
-/********************************************************************\
- * gnc_register_edit_cb -- open up the account edit window          *
- *                                                                  *
- * Args:   w    - the widget that called us                         *
- *         data - the data struct for this register                 *
- * Return: none                                                     *
-\********************************************************************/
-void 
-gnc_register_edit_cb(GtkWidget * w, gpointer data)
-{
-  RegWindow *regData = data;
-  Account *account = gnc_ledger_display_leader (regData->ledger);
-
-  if (account == NULL)
-    return;
-
-  gnc_ui_edit_account_window(account);
-}
-
-
-/********************************************************************\
- * gnc_register_start_recn_cb -- open up the reconcile window...    *
- *                               called from menubar.               *
- *                                                                  *
- * Args:   w    - the widget that called us                         *
- *         data - the data struct for this register                 *
- * Return: none                                                     *
-\********************************************************************/
-void 
-gnc_register_start_recn_cb(GtkWidget * w, gpointer data)
-{
-  RegWindow *regData = data;
-  Account *account = gnc_ledger_display_leader (regData->ledger);
-
-  if (account == NULL)
-    return;
-
-  recnWindow(regData->window, account);
-}
-
-static
-void
-gnc_register_include_date_adapter( GNCSplitReg *gsr, time_t date, gpointer user_data )
-{
-  RegWindow *regData;
-  regData = (RegWindow*) user_data;
-  if ( gnc_register_include_date( regData, date ) ) {
-    gnc_ledger_display_refresh( gsr->ledger );
-  }
-}
-
-static gboolean
-gnc_register_include_date(RegWindow *regData, time_t date)
-{
-  RegDateWindow *regDateData;
-  time_t start, end;
-  gboolean changed = FALSE;
-
-  regDateData = regData->date_window;
-
-  start = gnc_date_edit_get_date(GNC_DATE_EDIT(regDateData->start_date));
-  end   = gnc_date_edit_get_date(GNC_DATE_EDIT(regDateData->end_date));
-
-  if (date < start)
-  {
-    gnc_date_edit_set_time(GNC_DATE_EDIT(regDateData->start_date), date);
-    changed = TRUE;
-  }
-
-  if (date > end)
-  {
-    gnc_date_edit_set_time(GNC_DATE_EDIT(regDateData->end_date), date);
-    changed = TRUE;
-  }
-
-  if (changed)
-    gnc_register_set_date_range(regData);
-
-  return changed;
-}
-
-static
-void
-gnc_register_set_read_only( RegWindow *regData )
-{
-  gchar old_title, *new_title;
-
-  g_object_get (G_OBJECT (regData->window), "title", &old_title, NULL);
-  new_title = g_strdup_printf(_("%s [Read-Only]"), &old_title);
-  gtk_window_set_title( GTK_WINDOW(regData->window), new_title );
-  g_free(new_title);
-
-  regData->read_only = TRUE;
-}
-
-/********************************************************************\
- * gnc_register_void_trans_cb                                       *
- *                                                                  *
- * Args:   widget - the widget that called us                       *
- *         data   - the data struct for this register               *
- * Return: none                                                     *
-\********************************************************************/
-void
-gnc_register_void_trans_cb(GtkWidget *w, gpointer data)
-{
-  RegWindow *regData = data;
-  SplitRegister *reg;
-  GtkWidget *dialog, *entry;
-  Transaction *trans;
-  GladeXML *xml;
-  const char *reason;
-  gint result;
-
-  reg = gnc_ledger_display_get_split_register (regData->ledger);
-  trans = gnc_split_register_get_current_trans (reg);
-  if (trans == NULL)
-    return;
-  if (xaccTransHasSplitsInState(trans, VREC)) {
-    gnc_error_dialog(regData->window,
-		     _("This transaction has already been voided."));
-    return;
-  }
-  if (xaccTransHasReconciledSplits(trans) || xaccTransHasSplitsInState(trans, CREC)) {
-    gnc_error_dialog(regData->window,
-		     _("You cannot void a transaction with reconciled or cleared splits."));
-    return;
-  }
-
-  xml = gnc_glade_xml_new ("register.glade", "Void Transaction");
-  dialog = glade_xml_get_widget (xml, "Void Transaction");
-  entry = glade_xml_get_widget (xml, "reason");
-
-  /* Keep around after closing so we can get the user's text out. */
-  gnome_dialog_close_hides (GNOME_DIALOG (dialog), TRUE);
-  result = gnome_dialog_run_and_close(GNOME_DIALOG(dialog));
-  if (result == 0)
-    return;
-
-  reason = gtk_entry_get_text(GTK_ENTRY(entry));
-  if (reason == NULL)
-    reason = "";
-  gnc_split_register_void_current_trans
-    (gnc_ledger_display_get_split_register (regData->ledger), reason);
-
-  /* All done. Get rid of it. */
-  gtk_widget_destroy(dialog);
-  g_free(xml);
-}
-
-
-/********************************************************************\
- * gnc_register_unvoid_trans_cb                                     *
- *                                                                  *
- * Args:   widget - the widget that called us                       *
- *         data   - the data struct for this register               *
- * Return: none                                                     *
-\********************************************************************/
-void
-gnc_register_unvoid_trans_cb(GtkWidget *w, gpointer data)
-{
-  RegWindow *regData = data;
-  SplitRegister *reg;
-  Transaction *trans;
-
-  reg = gnc_ledger_display_get_split_register (regData->ledger);
-  trans = gnc_split_register_get_current_trans (reg);
-  if (!xaccTransHasSplitsInState(trans, VREC)) {
-    gnc_error_dialog(regData->window, _("This transaction is not voided."));
-    return;
-  }
-  gnc_split_register_unvoid_current_trans
-    (gnc_ledger_display_get_split_register (regData->ledger));
-}
-
-
-/********************************************************************\
- * gnc_register_close_cb                                            *
- *                                                                  *
- * Args:   widget - the widget that called us                       *
- *         data - regData - the data struct for this register       *
- * Return: none                                                     *
-\********************************************************************/
-void
-gnc_register_close_cb (GtkWidget *widget, gpointer data)
-{
-  RegWindow *regData = data;
-
-  if (gnc_split_reg_check_close(regData->gsr) != FALSE)
-    gnc_ledger_display_close( regData->ledger );
-}
-
-static int
-report_helper (RegWindow *regData, Split *split, Query *query)
-{
-  SplitRegister *reg = gnc_ledger_display_get_split_register (regData->ledger);
-  Account *account;
-  char *str;
-  SCM qtype;
-  SCM args;
-  SCM func;
-  SCM arg;
-
-  args = SCM_EOL;
-
-  func = scm_c_eval_string ("gnc:register-report-create");
-  g_return_val_if_fail (SCM_PROCEDUREP (func), -1);
-
-  arg = scm_makfrom0str (gnc_split_register_get_credit_string (reg));
-  args = scm_cons (arg, args);
-
-  arg = scm_makfrom0str (gnc_split_register_get_debit_string (reg));
-  args = scm_cons (arg, args);
-
-  str = gnc_reg_get_name (regData, FALSE);
-  arg = scm_makfrom0str (str);
-  args = scm_cons (arg, args);
-  g_free (str);
-
-  arg = SCM_BOOL (reg->use_double_line);
-  args = scm_cons (arg, args);
-
-  arg = SCM_BOOL (reg->style == REG_STYLE_JOURNAL);
-  args = scm_cons (arg, args);
-
-  if (!query)
-  {
-    query = gnc_ledger_display_get_query (regData->ledger);
-    g_return_val_if_fail (query != NULL, -1);
-  }
-
-  qtype = scm_c_eval_string("<gnc:Query*>");
-  g_return_val_if_fail (qtype != SCM_UNDEFINED, -1);
-
-  arg = gw_wcp_assimilate_ptr (query, qtype);
-  args = scm_cons (arg, args);
-  g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
-
-
-  if (split)
-  {
-    qtype = scm_c_eval_string("<gnc:Split*>");
-    g_return_val_if_fail (qtype != SCM_UNDEFINED, -1);
-    arg = gw_wcp_assimilate_ptr (split, qtype);
-  }
-  else
-  {
-    arg = SCM_BOOL_F;
-  }
-  args = scm_cons (arg, args);
-  g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
-
-
-  qtype = scm_c_eval_string("<gnc:Account*>");
-  g_return_val_if_fail (qtype != SCM_UNDEFINED, -1);
-
-  account = gnc_ledger_display_leader (regData->ledger);
-  arg = gw_wcp_assimilate_ptr (account, qtype);
-  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_EXACTP (arg), -1);
-
-  return scm_num2int (arg, SCM_ARG1, __FUNCTION__);
-}
-
-/********************************************************************\
- * gnc_register_report_account_cb                                   *
- *                                                                  *
- * Args:   widget - the widget that called us                       *
- *         data - regData - the data struct for this register       *
- * Return: none                                                     *
-\********************************************************************/
-void
-gnc_register_report_account_cb (GtkWidget *widget, gpointer data)
-{
-  RegWindow *regData = data;
-  int id;
-
-  id = report_helper (regData, NULL, NULL);
-  if (id >= 0)
-    reportWindow (id);
-}
-
-/********************************************************************\
- * gnc_register_report_trans_cb                                     *
- *                                                                  *
- * Args:   widget - the widget that called us                       *
- *         data - regData - the data struct for this register       *
- * Return: none                                                     *
-\********************************************************************/
-void
-gnc_register_report_trans_cb (GtkWidget *widget, gpointer data)
-{
-  RegWindow *regData = data;
-  SplitRegister *reg;
-  Split *split;
-  Query *query;
-  int id;
-
-  reg = gnc_ledger_display_get_split_register (regData->ledger);
-
-  split = gnc_split_register_get_current_split (reg);
-  if (!split)
-    return;
-
-  query = xaccMallocQuery ();
-
-  xaccQuerySetBook (query, gnc_get_current_book ());
-
-  xaccQueryAddGUIDMatch (query, xaccSplitGetGUID (split),
-                         GNC_ID_SPLIT, QUERY_AND);
-
-  id = report_helper (regData, split, query);
-  if (id >= 0)
-    reportWindow (id);
-}
-
-/********************************************************************\
- * gnc_register_print_cb                                            *
- *                                                                  *
- * Args:   widget - the widget that called us                       *
- *         data - regData - the data struct for this register       *
- * Return: none                                                     *
-\********************************************************************/
-void
-gnc_register_print_cb (GtkWidget *widget, gpointer data)
-{
-  RegWindow *regData = data;
-  int id;
-
-  id = report_helper (regData, NULL, NULL);
-  if (id >= 0)
-    gnc_print_report (id);
-}
-
-/********************************************************************\
- * gnc_register_date_range_cb                                       *
- *                                                                  *
- * Args:   widget - the widget that called us                       *
- *         data - regData - the data struct for this register       *
- * Return: none                                                     *
-\********************************************************************/
-void
-gnc_register_date_range_cb (GtkWidget *widget, gpointer data)
-{
-  RegWindow *regData = data;
-
-  gnc_register_show_date_window(regData);
-}
-
-void
-gnc_register_gl_cb(GtkWidget *widget, gpointer data)
-{
-  GNCLedgerDisplay *ld;
-  RegWindow *regData;
-
-  ld = gnc_ledger_display_gl();
-  regData = regWindowLedger( ld );
-  gnc_split_reg_raise( regData->gsr );
-}
-
-void
-gnc_register_prices_cb(GtkWidget *widget, gpointer data)
-{
-  gnc_prices_dialog (NULL);
-}
-
-void
-gnc_register_commodities_cb(GtkWidget *widget, gpointer data)
-{
-  gnc_commodities_dialog (NULL);
-}
-
-void
-gnc_register_fincalc_cb(GtkWidget *widget, gpointer data)
-{
-  gnc_ui_fincalc_dialog_create();
-}
-
-void
-gnc_register_toolbar_cb( GtkWidget *widget, gpointer data )
-{
-  RegWindow *rw = data;
-  GtkCheckMenuItem *checkmenu = GTK_CHECK_MENU_ITEM(widget);
-
-  if (checkmenu->active) {
-    gtk_widget_show( rw->toolbar_dock );
-  } else {
-    gtk_widget_hide( rw->toolbar_dock );
-    gtk_widget_queue_resize( rw->toolbar_dock );
-  }
-}
-
-void
-gnc_register_summarybar_cb( GtkWidget *widget, gpointer data )
-{
-  RegWindow *rw = data;
-  GtkCheckMenuItem *checkmenu = GTK_CHECK_MENU_ITEM(widget);
-
-  if (checkmenu->active) {
-    gtk_widget_show( rw->summarybar_dock );
-  } else {
-    gtk_widget_hide( rw->summarybar_dock );
-    gtk_widget_queue_resize( rw->summarybar_dock );
-  }
-}
-
-void
-gnc_register_statusbar_cb( GtkWidget *widget, gpointer data )
-{
-  RegWindow *rw = data;
-  GtkCheckMenuItem *checkmenu = GTK_CHECK_MENU_ITEM(widget);
-
-  if (checkmenu->active) {
-    gtk_widget_show( rw->statusbar );
-  } else {
-    gtk_widget_hide( rw->statusbar );
-    gtk_widget_queue_resize( rw->statusbar );
-  }
-}
-
-
-/************************** END OF FILE **************************/
--- src/gnome/window-register.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************\
- * window-register.h -- public GnuCash register functions           *
- * Copyright (C) 1998,1999,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       *
- * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652       *
- * Boston, MA  02111-1307,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-#ifndef WINDOW_REGISTER_H
-#define WINDOW_REGISTER_H
-
-#include "gnc-ledger-display.h"
-#include "gnc-split-reg.h"
-
-/** STRUCTS *********************************************************/
-typedef struct _RegWindow RegWindow;
-/* Getters */
-GtkWidget *gnc_RegWindow_window (RegWindow *data);
-GNCLedgerDisplay *gnc_RegWindow_ledger (RegWindow *data);
-
-/** PROTOTYPES ******************************************************/
-GNCSplitReg* regWindowSimple(Account *account);
-GNCSplitReg* regWindowAccGroup(Account *account_group);
-
-RegWindow* regWindowLedger(GNCLedgerDisplay *ledger);
-
-void gnc_register_raise(RegWindow *regData);
-
-#endif
--- src/gnome/window-main.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/********************************************************************
- * window-main.h -- public GNOME main window functions              *
- * Copyright (C) 1998,1999 Linas Vepstas                            *
- * Copyright (C) 2001 Bill Gribble <grib at gnumatic.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       *
- * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652       *
- * Boston, MA  02111-1307,  USA       gnu at gnu.org                   *
- ********************************************************************/
-
-#ifndef WINDOW_MAIN_H
-#define WINDOW_MAIN_H
-
-#include "gnc-mdi-utils.h"
-
-/*GNCMDIInfo * gnc_main_window_new (void);*/
-void gnc_shutdown(int);
-
-/*
- * Functions used as callbacks from multiple dialogs.
- */
-void gnc_main_window_about_cb (GtkWidget *widget, gpointer data);
-void gnc_main_window_file_save_cb(GtkWidget * widget, gpointer data);
-void gnc_main_window_file_save_as_cb(GtkWidget * widget, gpointer data);
-void gnc_main_window_tutorial_cb (GtkWidget *widget, gpointer data);
-void gnc_main_window_totd_cb (GtkWidget *widget, gpointer data);
-void gnc_main_window_help_cb (GtkWidget *widget, gpointer data);
-void gnc_main_window_exit_cb (GtkWidget *widget, gpointer data);
-void gnc_main_window_file_save_cb(GtkWidget * widget, gpointer data);
-void gnc_main_window_file_save_as_cb(GtkWidget * widget, gpointer data);
-void gnc_main_window_fincalc_cb(GtkWidget *widget, gpointer data);
-void gnc_main_window_gl_cb(GtkWidget *widget, gpointer data);
-void gnc_main_window_prices_cb(GtkWidget *widget, gpointer data);
-void gnc_main_window_find_transactions_cb (GtkWidget *widget, gpointer data);
-void gnc_main_window_sched_xaction_cb (GtkWidget *widget, gpointer data);
-void gnc_main_window_commodities_cb(GtkWidget *widget, gpointer data);
-
-#endif


More information about the gnucash-changes mailing list