[Gnucash-changes] Restructure the code.

David Hampton hampton at cvs.gnucash.org
Mon Jun 6 01:17:48 EDT 2005


Log Message:
-----------
Restructure the code.  This moves the basic window/plugin
functionality from the src/gnome directory to the
src/gnome-utils directory.

Tags:
----
gnucash-gnome2-dev

Modified Files:
--------------
    gnucash:
        ChangeLog
        configure.in
    gnucash/src:
        gnc-ui.h
    gnucash/src/app-file:
        gnc-file.c
        gnc-file.h
        gncmod-app-file.c
    gnucash/src/gnome:
        Makefile.am
        top-level.c
    gnucash/src/gnome/ui:
        Makefile.am
    gnucash/src/gnome-utils:
        Makefile.am
    gnucash/src/report/stylesheets:
        Makefile.am

Added Files:
-----------
    gnucash/src/gnome:
        gnc-plugin-basic-commands.c
        gnc-plugin-basic-commands.h
    gnucash/src/gnome/ui:
        gnc-plugin-basic-commands-ui.xml
    gnucash/src/gnome-utils:
        gnc-embedded-window.c
        gnc-embedded-window.h
        gnc-main-window.c
        gnc-main-window.h
        gnc-plugin-manager.c
        gnc-plugin-manager.h
        gnc-plugin-menu-additions.c
        gnc-plugin-menu-additions.h
        gnc-plugin-page.c
        gnc-plugin-page.h
        gnc-plugin.c
        gnc-plugin.h
        gnc-window.c
        gnc-window.h
    gnucash/src/gnome-utils/ui:
        .cvsignore
        Makefile.am
        gnc-main-window-ui.xml

Removed Files:
-------------
    gnucash/src/gnome:
        gnc-embedded-window.c
        gnc-embedded-window.h
        gnc-main-window.c
        gnc-main-window.h
        gnc-plugin-manager.c
        gnc-plugin-manager.h
        gnc-plugin-menu-additions.c
        gnc-plugin-menu-additions.h
        gnc-plugin-page.c
        gnc-plugin-page.h
        gnc-plugin.c
        gnc-plugin.h
        gnc-window.c
        gnc-window.h
    gnucash/src/gnome/ui:
        gnc-main-window-ui.xml

Revision Data
-------------
Index: configure.in
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/configure.in,v
retrieving revision 1.359.2.50
retrieving revision 1.359.2.51
diff -Lconfigure.in -Lconfigure.in -u -r1.359.2.50 -r1.359.2.51
--- configure.in
+++ configure.in
@@ -1225,6 +1225,7 @@
 	  src/gnome/ui/Makefile
           src/gnome-utils/Makefile
 	  src/gnome-utils/test/Makefile
+	  src/gnome-utils/ui/Makefile
           src/gnome-search/Makefile
           src/import-export/Makefile
           src/import-export/test/Makefile
Index: ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/ChangeLog,v
retrieving revision 1.1487.2.215
retrieving revision 1.1487.2.216
diff -LChangeLog -LChangeLog -u -r1.1487.2.215 -r1.1487.2.216
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,42 @@
+2005-06-06  David Hampton  <hampton at employees.org>
+
+	Restructure the code.
+	
+	* src/gnome/gnc-embedded-window.[ch]:
+	* src/gnome/gnc-plugin-basic-commands.[ch]:
+	* src/gnome/gnc-plugin-manager.[ch]:
+	* src/gnome/gnc-plugin-menu-additions.[ch]:
+	* src/gnome/gnc-plugin-page.[ch]:
+	* src/gnome/gnc-plugin.[ch]:
+	* src/gnome/gnc-window.[ch]: These files were moved whole from
+	src/gnome to src/gnome-utils:
+
+	* src/gnome/gnc-main-window.[ch]:
+	* src/gnome/ui/gnc-main-window-ui.xml: These files were split into
+	two parts, and the part with the existing name was moved from
+	src/gnome to src/gnome-utils.  The parts left in src/gnome are
+	called gnc-plugin-basic-commands.[ch].
+
+	* src/app-file/gnc-file.[ch]:
+	* src/app-file/gncmod-app-file.c: Call gnc-main-window directly
+	now instead of through a function pointer loaded at runtime.
+
+	* src/gnome/top-level.c:
+
+	* gnucash/src/gnc-ui.h:
+	* src/report/stylesheets/Makefile.am: Revert temporary workaround.
+
+	(Now removed) Temporary workaround.
+	
+	* gnucash/src/gnc-ui.h:
+	* gnucash/src/gnome/gnc-main-window.h:
+	* gnucash/src/gnome/gnc-window.h:
+	* gnucash/src/gnome/gw-gnc-spec.scm:
+	* gnucash/src/gnome-utils/gw-gnome-utils-spec.scm:
+	* gnucash/src/report/report-gnome/gw-report-gnome-spec.scm:
+	* gnucash/src/report/stylesheets/ Makefile.am: Temporary
+	workaround to resolve circular build dependency:
+
 2005-06-05  David Hampton  <hampton at employees.org>
 
 	* src/gnome/gnc-plugin-page-register.c:
Index: gnc-file.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/app-file/gnc-file.c,v
retrieving revision 1.25.4.12
retrieving revision 1.25.4.13
diff -Lsrc/app-file/gnc-file.c -Lsrc/app-file/gnc-file.c -u -r1.25.4.12 -r1.25.4.13
--- src/app-file/gnc-file.c
+++ src/app-file/gnc-file.c
@@ -41,6 +41,7 @@
 #include "gnc-splash.h"
 #include "gnc-ui.h"
 #include "gnc-ui-util.h"
+#include "gnc-window.h"
 #include "gnc-gconf-utils.h"
 #include "qofbackend.h"
 #include "qofbook.h"
@@ -61,7 +62,6 @@
 static GNCHistoryGetLastFunc history_get_last_func = NULL;
 
 static GNCFileDialogFunc file_dialog_func = NULL;
-static GNCFilePercentageFunc file_percentage_func = NULL;
 
 
 void
@@ -75,12 +75,6 @@
 }
 
 void
-gnc_file_set_pct_handler (GNCFilePercentageFunc file_percentage_func_in)
-{
-  file_percentage_func = file_percentage_func_in;
-}
-
-void
 gnc_file_init (void)
 {
   /* Make sure we have a current session. */
@@ -574,13 +568,9 @@
     xaccLogSetBaseName (logpath);
     xaccLogDisable();
 
-    if (file_percentage_func) {
-      file_percentage_func(_("Reading file..."), 0.0);
-      qof_session_load (new_session, file_percentage_func);
-      file_percentage_func(NULL, -1.0);
-    } else {
-      qof_session_load (new_session, NULL);
-    }
+    gnc_window_show_progress(_("Reading file..."), 0.0);
+    qof_session_load (new_session, gnc_window_show_progress);
+    gnc_window_show_progress(NULL, -1.0);
     xaccLogEnable();
 
     /* check for i/o error, put up appropriate error dialog */
@@ -752,14 +742,10 @@
   /* use the current session to save to file */
   gnc_set_busy_cursor (NULL, TRUE);
   current_session = qof_session_get_current_session();
-  if (file_percentage_func) {
-    file_percentage_func(_("Exporting file..."), 0.0);
-    ok = qof_session_export (new_session, current_session,
-                             file_percentage_func);
-    file_percentage_func(NULL, -1.0);
-  } else {
-    ok = qof_session_export (new_session, current_session, NULL);
-  }
+  gnc_window_show_progress(_("Exporting file..."), 0.0);
+  ok = qof_session_export (new_session, current_session,
+			   gnc_window_show_progress);
+  gnc_window_show_progress(NULL, -1.0);
   gnc_unset_busy_cursor (NULL);
   xaccLogDisable();
   qof_session_destroy (new_session);
@@ -799,13 +785,9 @@
 
   /* use the current session to save to file */
   gnc_set_busy_cursor (NULL, TRUE);
-  if (file_percentage_func) {
-    file_percentage_func(_("Writing file..."), 0.0);
-    qof_session_save (session, file_percentage_func);
-    file_percentage_func(NULL, -1.0);
-  } else {
-    qof_session_save (session, NULL);
-  }
+  gnc_window_show_progress(_("Writing file..."), 0.0);
+  qof_session_save (session, gnc_window_show_progress);
+  gnc_window_show_progress(NULL, -1.0);
   gnc_unset_busy_cursor (NULL);
 
   /* Make sure everything's OK - disk could be full, file could have
Index: gnc-file.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/app-file/gnc-file.h,v
retrieving revision 1.6.4.2
retrieving revision 1.6.4.3
diff -Lsrc/app-file/gnc-file.h -Lsrc/app-file/gnc-file.h -u -r1.6.4.2 -r1.6.4.3
--- src/app-file/gnc-file.h
+++ src/app-file/gnc-file.h
@@ -136,9 +136,6 @@
 typedef gboolean (*GNCCanCancelSaveCB) (void);
 void gnc_file_set_can_cancel_callback (GNCCanCancelSaveCB cb);
 
-typedef void (*GNCFilePercentageFunc) (const char *message, double percent);
-void gnc_file_set_pct_handler (GNCFilePercentageFunc file_percentage_func);
-
 typedef void (*GNCShutdownCB) (int);
 void gnc_file_set_shutdown_callback (GNCShutdownCB cb);
 
Index: gncmod-app-file.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/app-file/gncmod-app-file.c,v
retrieving revision 1.8.4.3
retrieving revision 1.8.4.4
diff -Lsrc/app-file/gncmod-app-file.c -Lsrc/app-file/gncmod-app-file.c -u -r1.8.4.3 -r1.8.4.4
--- src/app-file/gncmod-app-file.c
+++ src/app-file/gncmod-app-file.c
@@ -84,7 +84,6 @@
   if(refcount == 0) 
   {
     gnc_file_set_handlers (NULL, NULL, NULL);
-    gnc_file_set_pct_handler (NULL);
   }
   return TRUE;
 }
--- /dev/null
+++ src/gnome-utils/gnc-window.h
@@ -0,0 +1,63 @@
+/* 
+ * gnc-window.h -- structure which represents a GnuCash window.
+ *
+ * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
+ * Copyright (C) 2003 David Hampton <hampton at employees.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, contact:
+ *
+ * Free Software Foundation           Voice:  +1-617-542-5942
+ * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
+ * Boston, MA  02111-1307,  USA       gnu at gnu.org
+ */
+
+#ifndef __GNC_WINDOW_H
+#define __GNC_WINDOW_H
+
+#include <gtk/gtkwindow.h>
+#include "gnc-plugin-page.h"
+
+G_BEGIN_DECLS
+
+#define PLUGIN_PAGE_LABEL "plugin-page"
+
+/* type macros */
+#define GNC_TYPE_WINDOW            (gnc_window_get_type ())
+#define GNC_WINDOW(o)            (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_WINDOW, GncWindow))
+#define GNC_IS_WINDOW(o)         (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_WINDOW))
+#define GNC_WINDOW_GET_IFACE(o)  (G_TYPE_INSTANCE_GET_INTERFACE ((o), GNC_TYPE_WINDOW, GncWindowIface))
+
+/* typedefs & structures */
+typedef struct GncWindow GncWindow; /* dummy typedef */
+
+typedef struct {
+	GTypeInterface parent;
+
+	/* Virtual Table */
+	GtkWidget * (* get_statusbar) (GncWindow *window);
+	GtkWidget * (* get_progressbar) (GncWindow *window);
+} GncWindowIface;
+
+/* function prototypes */
+GType          gnc_window_get_type (void);
+
+void           gnc_window_update_status (GncWindow *window, GncPluginPage *page);
+void           gnc_window_set_status (GncWindow *window, GncPluginPage *page, const gchar *message);
+
+void           gnc_window_set_progressbar_window (GncWindow *window);
+void           gnc_window_show_progress (const char *message, double percentage);
+
+G_END_DECLS
+
+#endif /* __GNC_WINDOW_H */
--- /dev/null
+++ src/gnome-utils/gnc-plugin-page.c
@@ -0,0 +1,333 @@
+/* 
+ * gnc-plugin_page.c -- 
+ *
+ * Copyright (C) 2003 Jan Arne Petersen
+ * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
+ * Copyright (C) 2003,2005 David Hampton <hampton at employees.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, contact:
+ *
+ * Free Software Foundation           Voice:  +1-617-542-5942
+ * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
+ * Boston, MA  02111-1307,  USA       gnu at gnu.org
+ */
+
+#include "config.h"
+
+#include <gtk/gtk.h>
+#include "gnc-plugin-page.h"
+
+static gpointer         parent_class = NULL;
+
+static void gnc_plugin_page_class_init (GncPluginPageClass *klass);
+static void gnc_plugin_page_init       (GncPluginPage *plugin_page);
+static void gnc_plugin_page_finalize   (GObject *object);
+
+enum {
+	INSERTED,
+	REMOVED,
+	SELECTED,
+	UNSELECTED,
+	LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
+struct GncPluginPagePrivate
+{
+	GList *books;
+};
+
+GType
+gnc_plugin_page_get_type (void)
+{
+	static GType gnc_plugin_page_type = 0;
+
+	if (gnc_plugin_page_type == 0) {
+		static const GTypeInfo our_info = {
+
+			sizeof (GncPluginPageClass),
+			NULL,		/* base_init */
+			NULL,		/* base_finalize */
+			(GClassInitFunc) gnc_plugin_page_class_init,
+			NULL,		/* class_finalize */
+			NULL,		/* class_data */
+			sizeof (GncPluginPage),
+			0,		/* n_preallocs */
+			(GInstanceInitFunc) gnc_plugin_page_init,
+		};
+
+		gnc_plugin_page_type = g_type_register_static (G_TYPE_OBJECT,
+							       "GncPluginPage",
+    							       &our_info, 0);
+	}
+
+	return gnc_plugin_page_type;
+}
+
+GtkWidget *
+gnc_plugin_page_create_widget (GncPluginPage *plugin_page)
+{
+	GncPluginPageClass *klass;
+	GtkWidget *widget;
+
+	g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page), NULL);
+
+	klass = GNC_PLUGIN_PAGE_GET_CLASS (plugin_page);
+	g_return_val_if_fail (klass != NULL, NULL);
+	g_return_val_if_fail (klass->create_widget != NULL, NULL);
+
+	widget = klass->create_widget (plugin_page);
+
+	/*
+	 * If there is a destroy function, add a ref so that the
+	 * widgets will exists when the destroy function is called.
+	 * Otherwise it will be destroyed when it is removed from the
+	 * main notebook for the window.
+	 */
+	if (klass->destroy_widget)
+		g_object_ref(widget);
+
+	return widget;
+}
+
+void
+gnc_plugin_page_destroy_widget (GncPluginPage *plugin_page)
+{
+	GncPluginPageClass *klass;
+
+	g_return_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page));
+
+	klass = GNC_PLUGIN_PAGE_GET_CLASS (plugin_page);
+	g_return_if_fail (klass != NULL);
+	g_return_if_fail (klass->destroy_widget != NULL);
+
+	return klass->destroy_widget (plugin_page);
+}
+
+void
+gnc_plugin_page_merge_actions (GncPluginPage *plugin_page,
+			       GtkUIManager *ui_merge)
+{
+	GncPluginPageClass *klass;
+
+	g_return_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page));
+
+	klass = GNC_PLUGIN_PAGE_GET_CLASS (plugin_page);
+	g_return_if_fail (klass != NULL);
+	g_return_if_fail (klass->merge_actions != NULL);
+
+	klass->merge_actions (plugin_page, ui_merge);
+}
+
+void
+gnc_plugin_page_unmerge_actions (GncPluginPage *plugin_page,
+				 GtkUIManager *ui_merge)
+{
+	GncPluginPageClass *klass;
+
+	g_return_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page));
+
+	klass = GNC_PLUGIN_PAGE_GET_CLASS (plugin_page);
+	g_return_if_fail (klass != NULL);
+	g_return_if_fail (klass->unmerge_actions != NULL);
+
+	klass->unmerge_actions (plugin_page, ui_merge);
+}
+
+const gchar *
+gnc_plugin_page_get_name (GncPluginPage *plugin_page)
+{
+	GncPluginPageClass *klass;
+
+	g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page), NULL);
+
+	klass = GNC_PLUGIN_PAGE_GET_CLASS (plugin_page);
+	g_return_val_if_fail (klass != NULL, NULL);
+
+	return (klass->plugin_name);
+}
+
+
+/* Signals */
+void
+gnc_plugin_page_inserted (GncPluginPage *plugin_page)
+{
+	g_return_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page));
+
+	g_signal_emit (G_OBJECT (plugin_page), signals[INSERTED], 0);
+}
+
+void
+gnc_plugin_page_removed (GncPluginPage *plugin_page)
+{
+	g_return_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page));
+
+	g_signal_emit (G_OBJECT (plugin_page), signals[REMOVED], 0);
+}
+
+void
+gnc_plugin_page_selected (GncPluginPage *plugin_page)
+{
+	g_return_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page));
+
+	g_signal_emit (G_OBJECT (plugin_page), signals[SELECTED], 0);
+}
+
+void
+gnc_plugin_page_unselected (GncPluginPage *plugin_page)
+{
+	g_return_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page));
+
+	g_signal_emit (G_OBJECT (plugin_page), signals[UNSELECTED], 0);
+}
+
+static void
+gnc_plugin_page_class_init (GncPluginPageClass *klass)
+{
+	GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+	parent_class = g_type_class_peek_parent (klass);
+	gobject_class->finalize = gnc_plugin_page_finalize;
+
+	klass->tab_icon    = NULL;
+	klass->plugin_name = NULL;
+
+ 	signals[INSERTED] = g_signal_new ("inserted",
+					  G_OBJECT_CLASS_TYPE (klass),
+					  G_SIGNAL_RUN_FIRST,
+					  G_STRUCT_OFFSET (GncPluginPageClass, inserted),
+					  NULL, NULL,
+					  g_cclosure_marshal_VOID__VOID,
+					  G_TYPE_NONE,
+					  0);
+	signals[REMOVED] = g_signal_new ("removed",
+					 G_OBJECT_CLASS_TYPE (klass),
+					 G_SIGNAL_RUN_FIRST,
+					 G_STRUCT_OFFSET (GncPluginPageClass, removed),
+					 NULL, NULL,
+					 g_cclosure_marshal_VOID__VOID,
+					 G_TYPE_NONE,
+					 0);
+	signals[SELECTED] = g_signal_new ("selected",
+					  G_OBJECT_CLASS_TYPE (klass),
+					  G_SIGNAL_RUN_FIRST,
+					  G_STRUCT_OFFSET (GncPluginPageClass, inserted),
+					  NULL, NULL,
+					  g_cclosure_marshal_VOID__VOID,
+					  G_TYPE_NONE,
+					  0);
+	signals[UNSELECTED] = g_signal_new ("unselected",
+					    G_OBJECT_CLASS_TYPE (klass),
+					    G_SIGNAL_RUN_FIRST,
+					    G_STRUCT_OFFSET (GncPluginPageClass, removed),
+					    NULL, NULL,
+					    g_cclosure_marshal_VOID__VOID,
+					    G_TYPE_NONE,
+					    0);
+}
+
+static void
+gnc_plugin_page_init (GncPluginPage *plugin_page)
+{
+	GncPluginPagePrivate *priv;
+
+	priv = plugin_page->priv = g_new0 (GncPluginPagePrivate, 1);
+
+	plugin_page->title       = NULL;
+	plugin_page->tab_name    = NULL;
+	plugin_page->uri         = NULL;
+
+	plugin_page->window      = NULL;
+	plugin_page->summarybar  = NULL;
+}
+
+static void
+gnc_plugin_page_finalize (GObject *object)
+{
+  GncPluginPagePrivate *priv;
+  GncPluginPage *page;
+  GList *item;
+
+  page = GNC_PLUGIN_PAGE (object);
+  if (page->statusbar_text)
+    g_free (page->statusbar_text);
+  if (page->title)
+	g_free(page->title);
+  if (page->tab_name)
+	g_free(page->tab_name);
+  if (page->uri)
+	g_free(page->uri);
+
+  priv = page->priv;
+  if (priv->books) {
+    for (item = priv->books; item; item = g_list_next(item)) {
+      guid_free (item->data);
+    }
+    g_list_free(priv->books);
+    priv->books = NULL;
+  }
+  g_free (priv);
+  page->priv = NULL;
+
+  if (page->summarybar) {
+    g_object_unref(G_OBJECT(page->summarybar));
+    page->summarybar = NULL;
+  }
+  page->window = NULL; // Don't need to free it.
+
+  G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+void
+gnc_plugin_page_add_book (GncPluginPage *page, QofBook *book)
+{
+  GncPluginPagePrivate *priv;
+  GUID *guid;
+
+  g_return_if_fail (GNC_IS_PLUGIN_PAGE (page));
+  g_return_if_fail (book != NULL);
+
+  priv = page->priv;
+
+  guid = guid_malloc();
+  *guid = *qof_book_get_guid(book);
+  priv->books = g_list_append(priv->books, guid);
+}
+
+gboolean
+gnc_plugin_page_has_book (GncPluginPage *page, GUID *entity)
+{
+  GncPluginPagePrivate *priv;
+  GList *item;
+
+  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), FALSE);
+  g_return_val_if_fail (entity != NULL, FALSE);
+
+  priv = page->priv;
+  for (item = priv->books; item; item = g_list_next(item)) {
+    if (guid_equal((GUID*)item->data, entity)) {
+      return TRUE;
+    }
+  }
+  return FALSE;
+}
+
+gboolean
+gnc_plugin_page_has_books (GncPluginPage *page)
+{
+  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), FALSE);
+
+  return (page->priv->books != NULL);
+}
--- /dev/null
+++ src/gnome-utils/gnc-main-window.h
@@ -0,0 +1,267 @@
+/* 
+ * gnc-main-window.h -- GtkWindow which represents the
+ *	GnuCash main window.
+ *
+ * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
+ * Copyright (C) 2003,2005 David Hampton <hampton at employees.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, contact:
+ *
+ * Free Software Foundation           Voice:  +1-617-542-5942
+ * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
+ * Boston, MA  02111-1307,  USA       gnu at gnu.org
+ */
+
+/** @addtogroup GUI
+    @{ */
+/** @addtogroup GuiWindow Main Window functions.
+    @{ */
+/** @file gnc-main-window.h
+    @brief Functions for adding content to a window.
+    @author Copyright (C) 2003,2005 David Hampton <hampton at employees.org>
+*/
+
+#ifndef __GNC_MAIN_WINDOW_H
+#define __GNC_MAIN_WINDOW_H
+
+#include <gtk/gtk.h>
+
+#include "gnc-plugin-page.h"
+
+G_BEGIN_DECLS
+
+#define PLUGIN_PAGE_LABEL "plugin-page"
+
+/* type macros */
+#define GNC_TYPE_MAIN_WINDOW            (gnc_main_window_get_type ())
+#define GNC_MAIN_WINDOW(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_MAIN_WINDOW, GncMainWindow))
+#define GNC_MAIN_WINDOW_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_MAIN_WINDOW, GncMainWindowClass))
+#define GNC_IS_MAIN_WINDOW(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_MAIN_WINDOW))
+#define GNC_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_MAIN_WINDOW))
+#define GNC_MAIN_WINDOW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_MAIN_WINDOW, GncMainWindowClass))
+
+/* typedefs & structures */
+typedef struct GncMainWindowPrivate GncMainWindowPrivate;
+
+typedef struct GncMainWindow {
+	GtkWindow parent;
+
+	GtkUIManager *ui_merge;
+
+	GncMainWindowPrivate *priv;
+} GncMainWindow;
+
+typedef struct {
+	GtkWindowClass parent;
+
+	/* callbacks */
+	void (*page_added)   (GncMainWindow *window,
+			      GncPluginPage *page);
+	void (*page_changed) (GncMainWindow *window,
+			      GncPluginPage *page);
+} GncMainWindowClass;
+
+typedef struct {
+	GncMainWindow *window;
+	gpointer data;
+} GncMainWindowActionData;
+
+typedef void (*GncMainWindowFunc) (GncMainWindow *window, GncPluginPage *page);
+
+/* function prototypes */
+
+/** Get the type of a gnc main window.
+ *
+ *  @return A GType.
+ */
+GType gnc_main_window_get_type (void);
+
+
+/** Create a new gnc main window plugin.
+ *
+ *  @return A pointer to the new object.
+ */
+GncMainWindow *gnc_main_window_new (void);
+
+
+/** Display a data plugin page in a window.  If the page already
+ *  exists in any window, then that window will be brought to the
+ *  front and the notebook switch to display the specified page.  If
+ *  the page is new then it will be added to the specified window.  If
+ *  the window is NULL, the new page will be added to the first
+ *  window.
+ *
+ *  @param window The window to display a new page in.
+ *
+ *  @param page The new page of data to be displayed, or the existing
+ *  page of data the should be brought to the top and displayed.
+ */
+void gnc_main_window_open_page (GncMainWindow *window,
+				GncPluginPage *page);
+
+
+/** Remove a data plugin page from a window and display the previous
+ *  page.  If the page removed was the last page in the window, and
+ *  there is more than one window open, then the entire window will be
+ *  destroyed.
+ *
+ *  @param page The page of data to be removed.
+ */
+void gnc_main_window_close_page (GncPluginPage *page);
+
+
+/** Retrieve a pointer to the page that is currently at the front of
+ *  the specified window.  Any plugin that needs to manipulate its
+ *  menus based upon the currently selected menu page should connect
+ *  to the "page_changed" signal on a window.  The callback function
+ *  from that signal can then call this function to obtain a pointer
+ *  to the current page.
+ *
+ *  @param window A pointer to the window whose front page should be
+ *  returned.
+ *
+ *  @return A pointer to the GncPluginPage currently at the front of
+ *  the specified window.  If the window pointer is invalid or the
+ *  window is empty, this function will return NULL.
+ */
+GncPluginPage *gnc_main_window_get_current_page (GncMainWindow *window);
+
+
+/** Manually add a set of actions to the specified window.  Plugins
+ *  whose user interface is not hard coded (e.g. the menu-additions *
+ *  plugin) must create their actions at run time, then use this *
+ *  function to install them into the window.
+ *
+ *  @param window A pointer to the window whose user interface should
+ *  be updated.
+ *
+ *  @param group_name The name for this set of actions.  This name
+ *  should be unique among all groups added to the window, and will be
+ *  needed to remove the actions from this window.
+ *
+ *  @param group A pointer to an array of GtkActions.  These are the
+ *  actions that will be added to the user interface.
+ *
+ *  @param merge_id A merge identifier retrieved from a call to
+ *  gtk_ui_manager_new_merge_id().
+ */
+void gnc_main_window_manual_merge_actions (GncMainWindow *window,
+					   const gchar *group_name,
+					   GtkActionGroup *group,
+					   guint merge_id);
+
+
+/** Add a set of actions to the specified window.  This function
+ *  should not need to be called directly by plugin implementors.
+ *  Correctly assigning values to the GncPluginClass fields during
+ *  plugin initialization will cause this routine to be automatically
+ *  called.
+ *
+ *  @param window A pointer to the window whose user interface should
+ *  be updated.
+ *
+ *  @param group_name The name for this set of actions.  This name
+ *  should be unique among all groups added to the window, and will be
+ *  needed to remove the actions from this window.
+ *
+ *  @param entries A pointer to an array of GtkActionEntries.  These
+ *  are the actions that will be added to the user interface.
+ *
+ *  @param n_entries The number of actions in the array.
+ *
+ *  @param filename The filename containing the user interface
+ *  definition that goes with this set of actions.
+ *
+ *  @param user_data The data to be provided to all callback
+ *  functions.
+ */
+void gnc_main_window_merge_actions (GncMainWindow *window,
+				    const gchar *group_name,
+				    GtkActionEntry *entries,
+				    guint n_entries,
+				    const gchar *filename,
+				    gpointer user_data);
+
+
+/** Remove a set of actions from the specified window.  This function
+ *  should not need to be called directly by plugin implementors.  It
+ *  will automatically be called when a plugin is removed from a
+ *  window.
+ *
+ *  @param window A pointer to the window whose user interface should
+ *  be updated.
+ *
+ *  @param group_name The name for this set of actions.  This must be
+ *  the same name provided when the actions were installed.
+ */
+void gnc_main_window_unmerge_actions (GncMainWindow *window,
+				      const gchar *group_name);
+
+
+/** Force a full update of the user interface for the specified
+ *  window.  This can be an expensive function, but is needed because
+ *  the gtk ui manager doesn't always seem to update properly when
+ *  actions are changed.
+ *
+ *  @param window A pointer to the window whose user interface should
+ *  be updated.
+ *
+ *  @comment Is this function still needed?
+ */
+void gnc_main_window_actions_updated (GncMainWindow *window);
+
+
+/** Retrieve a specific set of user interface actions from a window.
+ *  This function can be used to get an group of action to be
+ *  manipulated when the front page of a window has changed.
+ *
+ *  @param window The window to check when looking for the action group.
+ *
+ *  @param group_name The name of a set of actions.  This must be a
+ *  name provided when the actions were installed.
+ *
+ *  @return A pointer to a GtkActionGroup that was added with the
+ *  specified name.  If the name cannot be found, then NULL will be
+ *  returned.
+ */
+GtkActionGroup *gnc_main_window_get_action_group (GncMainWindow *window,
+						  const gchar *group_name);
+
+
+void gnc_main_window_update_title (GncMainWindow *window);
+
+
+/** Set the window where all progressbar updates should occur.  This
+ *  is a wrapper around the gnc_window_set_progressbar_window()
+ *  function.
+ *
+ *  @param window The window to use for all progressbar updates.
+ */
+void gnc_main_window_set_progressbar_window( GncMainWindow *window );
+
+
+/** Shutdown gnucash.  This function will call the Scheme side of
+ *  GnuCash to initiate an orderly shutdown, and when that has
+ *  finished it will exit the program.
+ *
+ *  @param exit_status The exit status for the program.
+ */
+void gnc_shutdown (int exit_status);
+
+G_END_DECLS
+
+#endif /* __GNC_MAIN_WINDOW_H */
+
+/** @} */
+/** @} */
--- /dev/null
+++ src/gnome-utils/gnc-plugin-menu-additions.h
@@ -0,0 +1,85 @@
+/* 
+ * gnc-plugin-menu-additions.h -- 
+ * Copyright (C) 2005 David Hampton <hampton at employees.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, contact:
+ *
+ * Free Software Foundation           Voice:  +1-617-542-5942
+ * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
+ * Boston, MA  02111-1307,  USA       gnu at gnu.org
+ */
+
+/** @addtogroup GUI
+    @{ */
+/** @addtogroup GuiImport Import GUI Utility functions.
+    @{ */
+/** @file gnc-plugin-menu-additions.h
+    @brief Utility functions for writing import modules.
+    @author Copyright (C) 2002 David Hampton <hampton at employees.org>
+*/
+
+#ifndef __GNC_PLUGIN_MENU_ADDITIONS_H
+#define __GNC_PLUGIN_MENU_ADDITIONS_H
+
+#include <gtk/gtk.h>
+#include "gnc-plugin.h"
+
+G_BEGIN_DECLS
+
+/* type macros */
+#define GNC_TYPE_PLUGIN_MENU_ADDITIONS            (gnc_plugin_menu_additions_get_type ())
+#define GNC_PLUGIN_MENU_ADDITIONS(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_MENU_ADDITIONS, GncPluginMenuAdditions))
+#define GNC_PLUGIN_MENU_ADDITIONS_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_MENU_ADDITIONS, GncPluginMenuAdditionsClass))
+#define GNC_IS_PLUGIN_MENU_ADDITIONS(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_MENU_ADDITIONS))
+#define GNC_IS_PLUGIN_MENU_ADDITIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_MENU_ADDITIONS))
+#define GNC_PLUGIN_MENU_ADDITIONS_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_MENU_ADDITIONS, GncPluginMenuAdditionsClass))
+
+#define GNC_PLUGIN_MENU_ADDITIONS_NAME "gnc-plugin-menu-additions"
+#define GNC_PLUGIN_HIDE_MENU_ADDITIONS_NAME "gnc-plugin-hide-menu-additions"
+
+/* typedefs & structures */
+typedef struct GncPluginMenuAdditionsPrivate GncPluginMenuAdditionsPrivate;
+
+typedef struct {
+	GncPlugin parent;
+	GncPluginMenuAdditionsPrivate *priv;
+} GncPluginMenuAdditions;
+
+typedef struct {
+	GncPluginClass parent;
+} GncPluginMenuAdditionsClass;
+
+/* function prototypes */
+
+
+/** Get the type of an extensions plugin.
+ *
+ *  @return A GType.
+ */
+GType gnc_plugin_menu_additions_get_type (void);
+
+
+/** Create a new menu_additions plugin.  This plugin attaches the menu
+ *  items from Scheme code to any window that is opened.
+ *
+ *  @return A pointer to the new object.
+ */
+GncPlugin *gnc_plugin_menu_additions_new (void);
+
+G_END_DECLS
+
+#endif /* __GNC_PLUGIN_MENU_ADDITIONS_H */
+
+/** @} */
+/** @} */
--- /dev/null
+++ src/gnome-utils/gnc-plugin.h
@@ -0,0 +1,199 @@
+/* 
+ * gnc-plugin.h -- A module or plugin which can add more
+ *	functionality to gnucash.
+ * Copyright (C) 2003 Jan Arne Petersen
+ * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, contact:
+ *
+ * Free Software Foundation           Voice:  +1-617-542-5942
+ * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
+ * Boston, MA  02111-1307,  USA       gnu at gnu.org
+ */
+
+/** @addtogroup GUI
+    @{ */
+/** @addtogroup Wwindow plugin functions.
+    @{ */
+/** @file gnc-plugin.h
+    @brief Functions for adding plugins to a Gnucash window.
+    @author Copyright (C) 2002 David Hampton <hampton at employees.org>
+*/
+
+#ifndef __GNC_PLUGIN_H
+#define __GNC_PLUGIN_H
+
+#include "gnc-main-window.h"
+#include "gnc-plugin-page.h"
+#include <gconf/gconf-client.h>
+
+G_BEGIN_DECLS
+
+/* type macros */
+#define GNC_TYPE_PLUGIN            (gnc_plugin_get_type ())
+#define GNC_PLUGIN(o)              (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_PLUGIN, GncPlugin))
+#define GNC_PLUGIN_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN, GncPluginClass))
+#define GNC_IS_PLUGIN(o)           (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_PLUGIN))
+#define GNC_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN))
+#define GNC_PLUGIN_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_PLUGIN, GncPluginClass))
+
+/* typedefs & structures */
+typedef struct GncPluginPrivate GncPluginPrivate;
+
+typedef struct {
+	GObject parent;
+	GncPluginPrivate *priv;
+} GncPlugin;
+
+typedef struct {
+	GObjectClass parent;
+	const gchar *plugin_name;
+
+	const gchar *actions_name;
+	GtkActionEntry *actions;
+	guint n_actions; 
+	const gchar *ui_filename;
+
+	const gchar* gconf_section;
+	void (* gconf_notifications) (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data);
+
+	/* Virtual Table */
+	void (* add_to_window) (GncPlugin *plugin, GncMainWindow *window, GQuark type);
+	void (* remove_from_window) (GncPlugin *plugin, GncMainWindow *window, GQuark type);
+
+	GncPluginPage *(* create_page) (GncPlugin *plugin, const gchar *uri);
+} GncPluginClass;
+
+/* function prototypes */
+
+/** Get the type of a gnc window plugin.
+ *
+ *  @return A GType.
+ */
+GType gnc_plugin_get_type (void);
+
+
+/** Add the specified plugin from the specified window.  This function
+ *  will add the page's user interface from the window, set up gconf
+ *  notifications if the page uses gconf, and call the plugin to
+ *  perform any plugin specific actions.
+ *
+ *  @param plugin The plugin to be added.
+ *
+ *  @param window Add the plugin to this window.
+ *
+ *  @param type An identifier for the type of window specified.
+ */
+void gnc_plugin_add_to_window (GncPlugin *plugin,
+			       GncMainWindow *window,
+			       GQuark type);
+
+
+/** Remove the specified plugin from the specified window.  This
+ *  function will call the plugin to perform any plugin specific
+ *  actions, remove any gconf notifications that were set up for the
+ *  page, and remove the page's user interface from the window.
+ *
+ *  @param plugin The plugin to be removed.
+ *
+ *  @param window The window the plugin should be removed from.
+ *
+ *  @param type An identifier for the type of window specified.
+ */
+void gnc_plugin_remove_from_window (GncPlugin *plugin,
+				    GncMainWindow *window,
+				    GQuark type);
+
+
+GncPluginPage *gnc_plugin_create_page (GncPlugin *plugin,
+				       const gchar *uri);
+
+
+/** Retrieve the name of a plugin.
+ *
+ *  @param plugin The plugin whose name should be returned.
+ *
+ *  @return  short_labels A pointer to a data structure containing
+ *  [action name, label string] string pairs.
+ */
+const gchar *gnc_plugin_get_name (GncPlugin *plugin);
+
+
+typedef struct {
+  const char *action_name;
+  const char *label;
+} action_short_labels;
+
+/** Add "short" labels to existing actions.  The "short" label is the
+ *  string used on toolbar buttons when the action is visible.
+ *
+ *  @param action_group The group of all actions associated with a
+ *  plugin or plugin page.  All actions to me modified must be in this
+ *  group.
+ *
+ *  @param short_labels A pointer to a data structure containing
+ *  [action name, label string] string pairs.
+ */
+void gnc_plugin_init_short_names (GtkActionGroup *action_group,
+				  action_short_labels *short_labels);
+
+
+/** Update a property on a set of existing GtkActions.  This function
+ *  can be easily used to make a list of actions visible, invisible,
+ *  sensitive, or insensitive.
+ *
+ *  @param action_group The group of all actions associated with a
+ *  plugin or plugin page.  All actions to be modified must be
+ *  contained in this group.
+ *
+ *  @param action_names A NULL terminated list of actions names that
+ *  should modified.
+ *
+ *  @param property_name The property name to be changed on the
+ *  specified actions. The only two GtkAction properties that it makes
+ *  sense to modify are "visible" and "sensitive".
+ *
+ *  @param value A boolean specifying the new state for the specified
+ *  property.
+ */
+void gnc_plugin_update_actions (GtkActionGroup *action_group,
+				const gchar **action_names,
+				const gchar *property_name,
+				gboolean value);
+
+
+/** Load a new set of actions into an existing UI.
+ *
+ *  @param ui_merge The existing set of merged actions. This is the ui
+ *  that a user sees.  The actions from the ui file will be added to
+ *  this ui.
+ *
+ *  @param action_group The local action group.  The actions from the
+ *  ui file will be added to this private action group.
+ *
+ *  @param filename The name of the ui file to load.  This file name
+ *  will be searched for in the ui directory.
+ *
+ *  @return The merge_id number for the newly merged UI.  If an error
+ *  occurred, the return value is 0.
+ */
+gint gnc_plugin_add_actions (GtkUIManager *ui_merge,
+			     GtkActionGroup *action_group,
+			     const gchar *filename);
+G_END_DECLS
+
+#endif /* __GNC_PLUGIN_H */
+
+/** @} */
+/** @} */
--- /dev/null
+++ src/gnome-utils/gnc-main-window.c
@@ -0,0 +1,1440 @@
+/* 
+ * gnc-main-window.c -- GtkWindow which represents the
+ *	GnuCash main window.
+ *
+ * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
+ * Copyright (C) 2003,2005 David Hampton <hampton at employees.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, contact:
+ *
+ * Free Software Foundation           Voice:  +1-617-542-5942
+ * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
+ * Boston, MA  02111-1307,  USA       gnu at gnu.org
+ */
+
+#include "config.h"
+
+#include <gdk/gdkpixbuf.h>
+#include <gtk/gtk.h>
+
+#include "gnc-plugin.h"
+#include "gnc-plugin-manager.h"
+#include "gnc-main-window.h"
+
+#include "dialog-options.h"
+#include "dialog-transfer.h"
+#include "gnc-component-manager.h"
+#include "gnc-engine-util.h"
+#include "gnc-gnome-utils.h"
+#include "gnc-gui-query.h"
+#include "gnc-session.h"
+#include "gnc-ui.h"
+#include "gnc-version.h"
+#include "gnc-window.h"
+#include "messages.h"
+#include "gnc-gconf-utils.h"
+// +JSLED
+#include "gnc-html.h"
+
+enum {
+  PAGE_ADDED,
+  PAGE_CHANGED,
+  LAST_SIGNAL
+};
+
+
+#define PLUGIN_PAGE_IMMUTABLE "page-immutable"
+
+#define DESKTOP_GNOME_INTERFACE "/desktop/gnome/interface"
+#define TOOLBAR_STYLE "/desktop/gnome/interface/toolbar_style"
+
+/** Static Globals *******************************************************/
+static short module = MOD_GUI;
+static GList *active_windows = NULL;
+
+/** Declarations *********************************************************/
+static void gnc_main_window_class_init (GncMainWindowClass *klass);
+static void gnc_main_window_init (GncMainWindow *window);
+static void gnc_main_window_finalize (GObject *object);
+
+static void gnc_main_window_setup_window (GncMainWindow *window);
+static void gnc_window_main_window_init (GncWindowIface *iface);
+
+/* Callbacks */
+static void gnc_main_window_add_widget (GtkUIManager *merge, GtkWidget *widget, GncMainWindow *window);
+static void gnc_main_window_switch_page (GtkNotebook *notebook, GtkNotebookPage *notebook_page, gint pos, GncMainWindow *window);
+static void gnc_main_window_plugin_added (GncPlugin *manager, GncPlugin *plugin, GncMainWindow *window);
+static void gnc_main_window_plugin_removed (GncPlugin *manager, GncPlugin *plugin, GncMainWindow *window);
+
+/* Command callbacks */
+static void gnc_main_window_cmd_file_open_new_window (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_file_print (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_file_properties (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_file_close (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_file_quit (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_edit_cut (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_edit_copy (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_edit_paste (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_edit_preferences (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_view_refresh (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_view_toolbar (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_view_summary (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_view_statusbar (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_help_tutorial (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_help_contents (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_help_about (GtkAction *action, GncMainWindow *window);
+
+static void gnc_main_window_cmd_test( GtkAction *action, GncMainWindow *window );
+
+struct GncMainWindowPrivate
+{
+	GtkWidget *menu_dock;
+	GtkWidget *toolbar_dock;
+	GtkWidget *notebook;
+	GtkWidget *statusbar;
+	GtkWidget *progressbar;
+
+	GtkWidget *summarybar_dock;
+	gboolean   show_summarybar;
+
+	GtkActionGroup *action_group;
+
+	GncPluginPage *current_page;
+	GList *installed_pages;
+	gint event_handler_id;
+
+
+	GHashTable *merged_actions_table;
+};
+
+typedef struct {
+	guint merge_id;
+	GtkActionGroup *action_group;
+} MergedActionEntry;
+
+static guint main_window_signals[LAST_SIGNAL] = { 0 };
+
+static GtkActionEntry gnc_menu_actions [] =
+{
+	/* Toplevel */
+	{ "FileAction", NULL, N_("_File"), NULL, NULL, NULL, },
+	{ "EditAction", NULL, N_("_Edit"), NULL, NULL, NULL },
+	{ "ViewAction", NULL, N_("_View"), NULL, NULL, NULL },
+	{ "ActionsAction", NULL, N_("_Actions"), NULL, NULL, NULL },
+	{ "ReportsAction", NULL, N_("_Reports"), NULL, NULL, NULL },
+	{ "ToolsAction", NULL, N_("_Tools"), NULL, NULL, NULL },
+	{ "ExtensionsAction", NULL, N_("E_xtensions"), NULL, NULL, NULL },
+	{ "HelpAction", NULL, N_("_Help"), NULL, NULL, NULL },
+	{ "MiscAction", NULL, N_("_Misc"), NULL, NULL, NULL },
+
+	{ "FileOpenNewWindowAction", NULL, N_("Move to a New Window"), NULL,
+	  N_("Open a new top-level GnuCash window for the current page."),
+	  G_CALLBACK (gnc_main_window_cmd_file_open_new_window) },
+	{ "FileImportAction", NULL, N_("_Import"), NULL, NULL, NULL },
+	{ "FileExportAction", NULL, N_("_Export"), NULL, NULL, NULL },
+	{ "FilePrintAction", GTK_STOCK_PRINT, N_("_Print..."), "<control>p",
+	  NULL,
+	  G_CALLBACK (gnc_main_window_cmd_file_print) },
+	{ "FilePropertiesAction", GTK_STOCK_PROPERTIES, N_("Properties..."), NULL,
+	  NULL,
+	  G_CALLBACK (gnc_main_window_cmd_file_properties) },
+	{ "FileCloseAction", GTK_STOCK_CLOSE, N_("_Close"), "<control>w",
+	  NULL,
+	  G_CALLBACK (gnc_main_window_cmd_file_close) },
+	{ "FileQuitAction", GTK_STOCK_QUIT, N_("_Quit"), NULL,
+	  NULL,
+	  G_CALLBACK (gnc_main_window_cmd_file_quit) },
+
+	/* Edit menu */
+	{ "EditCutAction", GTK_STOCK_CUT, N_("Cu_t"), "<control>x",
+	  NULL,
+	  G_CALLBACK (gnc_main_window_cmd_edit_cut) },
+	{ "EditCopyAction", GTK_STOCK_COPY, N_("_Copy"), "<control>c",
+	  NULL,
+	  G_CALLBACK (gnc_main_window_cmd_edit_copy) },
+	{ "EditPasteAction", GTK_STOCK_PASTE, N_("_Paste"), "<control>v",
+	  NULL,
+	  G_CALLBACK (gnc_main_window_cmd_edit_paste) },
+	{ "EditPreferencesAction", GTK_STOCK_PREFERENCES, N_("_Preferences"), NULL,
+	  NULL,
+	  G_CALLBACK (gnc_main_window_cmd_edit_preferences) },
+
+	/* View menu */
+	{ "ViewRefreshAction", GTK_STOCK_REFRESH, N_("_Refresh"), "<control>r",
+	  N_("Refresh this window"),
+	  G_CALLBACK (gnc_main_window_cmd_view_refresh) },
+
+	/* Help menu */
+	{ "HelpTutorialAction", GNOME_STOCK_BOOK_BLUE, N_("Tutorial and Concepts _Guide"), NULL,
+	  N_("Open the GnuCash Tutorial"),
+	  G_CALLBACK (gnc_main_window_cmd_help_tutorial) },
+	{ "HelpContentsAction", GTK_STOCK_HELP, N_("_Contents"), NULL,
+	  N_("Open the GnuCash Help"),
+	  G_CALLBACK (gnc_main_window_cmd_help_contents) },
+	{ "HelpAboutAction", GNOME_STOCK_ABOUT, N_("_About"), NULL,
+	  NULL,
+	  G_CALLBACK (gnc_main_window_cmd_help_about) },
+
+        /* Misc menu */
+        { "MiscTestAction", NULL, N_("TEST"), NULL,
+          N_("Testing stuff"), G_CALLBACK (gnc_main_window_cmd_test) },
+
+};
+static guint gnc_menu_n_actions = G_N_ELEMENTS (gnc_menu_actions);
+
+static GtkToggleActionEntry toggle_actions [] =
+{
+	{ "ViewToolbarAction", NULL, N_("_Toolbar"), "<shift><control>t",
+	  N_("Show/hide the toolbar on this window"),
+	  G_CALLBACK (gnc_main_window_cmd_view_toolbar), TRUE },
+	{ "ViewSummaryAction", NULL, N_("S_ummary Bar"), NULL,
+	  N_("Show/hide the summary bar on this window"),
+	  G_CALLBACK (gnc_main_window_cmd_view_summary), TRUE },
+	{ "ViewStatusbarAction", NULL, N_("_Status Bar"), NULL,
+	  N_("Show/hide the status bar on this window"),
+	  G_CALLBACK (gnc_main_window_cmd_view_statusbar), TRUE },
+};
+static guint n_toggle_actions = G_N_ELEMENTS (toggle_actions);
+
+static const gchar *immutable_account_actions[] = {
+	"FileCloseAction",
+	"FileOpenNewWindowAction",
+	NULL
+};
+
+static GObjectClass *parent_class = NULL;
+
+static GQuark window_type = 0;
+
+/************************************************************
+ *                                                          *
+ ************************************************************/
+
+static void
+gnc_main_window_save_window (GncMainWindow *window, gpointer session)
+{
+  DEBUG("window %p", window);
+}
+
+static void
+gnc_main_window_shutdown (gpointer session, gpointer user_data)
+{
+  DEBUG("session %p (%s)", session, qof_session_get_url (session));
+  g_list_foreach (active_windows, (GFunc)gnc_main_window_save_window, session);
+}
+
+
+/** Look through the list of pages installed in this window and see if
+ *  the specified page is there.
+ *
+ *  @param page The page to search for.
+ *
+ *  @return TRUE if the page is present in the window, FALSE otherwise.
+ */
+static gboolean
+gnc_main_window_page_exists (GncPluginPage *page)
+{
+	GncMainWindow *window;
+	GList *walker;
+
+	for (walker = active_windows; walker; walker = g_list_next(walker)) {
+	  window = walker->data;
+	  if (g_list_find(window->priv->installed_pages, page)) {
+	    return TRUE;
+	  }
+	}
+	return FALSE;
+}
+
+/** This function handles any event notifications from the engine.
+ *  The only event it currently cares about is the deletion of a book.
+ *  When a book is deleted, it runs through all installed pages
+ *  looking for pages that reference the just (about to be?) deleted
+ *  book.  It closes any page it finds so there are no dangling
+ *  references to the book.
+ *
+ *  @param entity     The guid the item being added, deleted, etc.
+ *
+ * @param type        The type of the item being added, deleted, etc. This
+ *                    function only cares about a type of GNC_ID_BOOK.
+ *
+ * @param event_type  The type of the event.  This function only cares
+ *                    about an event type of GNC_EVENT_DESTROY.
+ *
+ * @param user_data   A pointer to the window data structure.
+ */
+static void
+gnc_main_window_event_handler (GUID *entity, QofIdType type,
+			       GNCEngineEventType event_type,
+			       gpointer user_data)
+{
+	GncMainWindow *window;
+	GncPluginPage *page;
+	GList *item, *next;
+
+	/* hard failures */
+	g_return_if_fail(GNC_IS_MAIN_WINDOW(user_data));
+
+	/* soft failures */
+	if (safe_strcmp(type, GNC_ID_BOOK) != 0)
+	  return;
+	if (event_type !=  GNC_EVENT_DESTROY)
+	  return;
+
+	ENTER("entity %p of type %s, event %d, window %p",
+	      entity, type, event_type, user_data);
+	window = GNC_MAIN_WINDOW(user_data);
+
+	for (item = window->priv->installed_pages; item; item = next) {
+	  next = g_list_next(item);
+	  page = GNC_PLUGIN_PAGE(item->data);
+	  if (!gnc_plugin_page_has_book (page, entity))
+	    continue;
+	  gnc_main_window_close_page (page);
+	}
+	LEAVE(" ");
+}
+
+/************************************************************
+ *                   Widget Implementation                  *
+ ************************************************************/
+
+/*  Get the type of a gnc main window.
+ */
+GType
+gnc_main_window_get_type (void)
+{
+	static GType gnc_main_window_type = 0;
+
+	if (gnc_main_window_type == 0) {
+		static const GTypeInfo our_info = {
+			sizeof (GncMainWindowClass),
+			NULL,
+			NULL,
+			(GClassInitFunc) gnc_main_window_class_init,
+			NULL,
+			NULL,
+			sizeof (GncMainWindow),
+			0,
+			(GInstanceInitFunc) gnc_main_window_init
+		};
+
+		static const GInterfaceInfo plugin_info = {
+		  (GInterfaceInitFunc) gnc_window_main_window_init,
+		  NULL,
+		  NULL
+		};
+
+		gnc_main_window_type = g_type_register_static (GTK_TYPE_WINDOW,
+							       "GncMainWindow",
+							       &our_info, 0);
+		g_type_add_interface_static (gnc_main_window_type,
+					     GNC_TYPE_WINDOW,
+					     &plugin_info);
+	}
+
+	return gnc_main_window_type;
+}
+
+
+/** Initialize the class for the new gnucash main window.  This will
+ *  set up any function pointers that override functions in the parent
+ *  class, and also the signals that this class of widget can
+ *  generate.
+ *
+ *  @param klass The new class structure created by the object system.
+ *
+ *  @internal
+ */
+static void
+gnc_main_window_class_init (GncMainWindowClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	parent_class = g_type_class_peek_parent (klass);
+
+	window_type = g_quark_from_static_string ("gnc-main-window");
+
+	object_class->finalize = gnc_main_window_finalize;
+
+	/**
+	 * GncMainWindow::page_added:
+	 * @window: the #GncMainWindow
+	 * @page: the #GncPluginPage
+	 *
+	 * The "page_added" signal is emitted when a new page is added
+	 * to the notebook of a GncMainWindow.  This can be used to
+	 * attach a signal from the page so that menu actions can be
+	 * adjusted based upon events that occur within the page
+	 * (e.g. an account is selected.)
+	 */
+	main_window_signals[PAGE_ADDED] =
+	  g_signal_new ("page_added",
+			G_OBJECT_CLASS_TYPE (object_class),
+			G_SIGNAL_RUN_FIRST,
+			G_STRUCT_OFFSET (GncMainWindowClass, page_added),
+			NULL, NULL,
+			g_cclosure_marshal_VOID__OBJECT,
+			G_TYPE_NONE, 1,
+			G_TYPE_OBJECT);
+
+	/**
+	 * GncMainWindow::page_changed:
+	 * @window: the #GncMainWindow
+	 * @page: the #GncPluginPage
+	 *
+	 * The "page_changed" signal is emitted when a new page is
+	 * selected in the notebook of a GncMainWindow.  This can be
+	 * used to to adjust menu actions based upon which page is
+	 * currently displayed in a window.
+	 */
+	main_window_signals[PAGE_CHANGED] =
+	  g_signal_new ("page_changed",
+			G_OBJECT_CLASS_TYPE (object_class),
+			G_SIGNAL_RUN_FIRST,
+			G_STRUCT_OFFSET (GncMainWindowClass, page_changed),
+			NULL, NULL,
+			g_cclosure_marshal_VOID__OBJECT,
+			G_TYPE_NONE, 1,
+			G_TYPE_OBJECT);
+
+	qof_session_add_close_hook(gnc_main_window_shutdown, NULL);
+}
+
+
+/** Initialize a new instance of a gnucash main window.  This function
+ *  allocates and initializes the object private storage space.  It
+ *  also adds the new object to a list (for memory tracking purposes).
+ *
+ *  @param view The new object instance created by the object system.
+ *
+ *  @internal
+ */
+static void
+gnc_main_window_init (GncMainWindow *window)
+{
+	window->priv = g_new0 (GncMainWindowPrivate, 1);
+
+	window->priv->merged_actions_table =
+	  g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+
+	window->priv->event_handler_id =
+	  gnc_engine_register_event_handler(gnc_main_window_event_handler,
+					    window);
+
+	gnc_main_window_setup_window (window);
+}
+
+
+/** Finalize the GncMainWindow object.  This function is called from
+ *  the G_Object level to complete the destruction of the object.  It
+ *  should release any memory not previously released by the destroy
+ *  function (i.e. the private data structure), then chain up to the
+ *  parent's destroy function.
+ *
+ *  @param object The object being destroyed.
+ *
+ *  @internal
+ */
+static void
+gnc_main_window_finalize (GObject *object)
+{
+	GncMainWindow *window;
+
+	g_return_if_fail (object != NULL);
+	g_return_if_fail (GNC_IS_MAIN_WINDOW (object));
+
+	window = GNC_MAIN_WINDOW (object);
+	active_windows = g_list_remove (active_windows, window);
+
+	g_return_if_fail (window->priv != NULL);
+
+	gnc_gconf_remove_notification(G_OBJECT(window), DESKTOP_GNOME_INTERFACE);
+
+	gnc_engine_unregister_event_handler(window->priv->event_handler_id);
+	g_hash_table_destroy (window->priv->merged_actions_table);
+	g_free (window->priv);
+
+	G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+
+/*  Create a new gnc main window plugin.
+ */
+GncMainWindow *
+gnc_main_window_new (void)
+{
+	GncMainWindow *window;
+
+	window = g_object_new (GNC_TYPE_MAIN_WINDOW, NULL);
+	active_windows = g_list_append (active_windows, window);
+	return window;
+}
+
+/************************************************************
+ *                     Utility Functions                    *
+ ************************************************************/
+
+/** Connect a GncPluginPage to the window.  This function will insert
+ *  the page in to the window's notebook and its list of active pages.
+ *  It will also emit the "inserted" signal on the page, and the
+ *  "add_page" signal on the window.  This function does not connect
+ *  the page's summarybar widget (if any).  That will be connected in
+ *  a callback function generated by the page being inserted into the
+ *  notebook.
+ *
+ *  @param window The window where the new page should be added.
+ *
+ *  @param page The GncPluginPage that should be added to the window.
+ *  The visible widget for this plugin must have already been created.
+ *
+ *  @param tab_widget The widget that should be added into the
+ *  notebook tab for this page.  Generally this is a GtkLabel, but
+ *  could also be a GtkHBox containing an icon and a label.
+ *
+ *  @internal
+ */
+static void
+gnc_main_window_connect (GncMainWindow *window,
+			 GncPluginPage *page,
+			 GtkWidget *tab_widget)
+{
+	GtkNotebook *notebook;
+
+	page->window = GTK_WIDGET(window);
+	notebook = GTK_NOTEBOOK (window->priv->notebook);
+	gtk_notebook_append_page (notebook, page->notebook_page, tab_widget);
+	gnc_plugin_page_inserted (page);
+	gtk_notebook_set_current_page (notebook, -1);
+	window->priv->installed_pages =
+	  g_list_append (window->priv->installed_pages, page);
+	g_signal_emit (window, main_window_signals[PAGE_ADDED], 0, page);
+}
+
+
+/** Disconnect a GncPluginPage page from the window.  If this page is
+ *  currently foremost in the window's notebook, its user interface
+ *  actions will be disconnected and the page's summarybar widget (if
+ *  any) will be removed.  The page is then removed from the window's
+ *  notebook and its list of active pages.
+ *
+ *  @param window The window the page should be removed from.
+ *
+ *  @param page The GncPluginPage that should be removed from the
+ *  window.
+ *
+ *  @internal
+ */
+static void
+gnc_main_window_disconnect (GncMainWindow *window,
+			    GncPluginPage *page)
+{
+	GtkNotebook *notebook;
+	gint page_num;
+
+	/* Disconnect the page and summarybar from the window */
+	if (window->priv->current_page == page) {
+		gnc_plugin_page_unmerge_actions (page, window->ui_merge);
+		gnc_plugin_page_unselected (page);
+		window->priv->current_page = NULL;
+
+		if (page->summarybar) {
+			gtk_container_remove(GTK_CONTAINER(window->priv->summarybar_dock),
+					     page->summarybar);
+		}
+	}
+
+	/* Remove it from the list of pages in the window */
+	window->priv->installed_pages =
+	  g_list_remove (window->priv->installed_pages, page);
+
+
+	/* Remove the page from the notebook */
+	notebook = GTK_NOTEBOOK (window->priv->notebook);
+	page_num =  gtk_notebook_page_num(notebook, page->notebook_page);
+	gtk_notebook_remove_page (notebook, page_num);
+
+	if ( gtk_notebook_get_current_page(notebook) == -1) {
+	  /* Need to synthesize a page changed signal when the last
+	   * page is removed.  The notebook doesn't generate a signal
+	   * for this, therefore the switch_page code in this file
+	   * never gets called to generate this signal. */
+	  gnc_main_window_switch_page(notebook, NULL, -1, window);
+	  //g_signal_emit (window, main_window_signals[PAGE_CHANGED], 0, NULL);
+	}
+
+	gnc_plugin_page_removed (page);
+
+	gtk_ui_manager_ensure_update (window->ui_merge);
+	gnc_window_set_status (GNC_WINDOW(window), page, NULL);
+}
+
+
+/************************************************************
+ *                                                          *
+ ************************************************************/
+
+
+/*  Display a data plugin page in a window.  If the page already
+ *  exists in any window, then that window will be brought to the
+ *  front and the notebook switch to display the specified page.  If
+ *  the page is new then it will be added to the specified window.  If
+ *  the window is NULL, the new page will be added to the first
+ *  window.
+ */
+void
+gnc_main_window_open_page (GncMainWindow *window,
+			   GncPluginPage *page)
+{
+	GtkWidget *label_box;
+	GtkWidget *label;
+	const gchar *icon;
+	GtkWidget *image;
+	GtkNotebook *notebook;
+	gint page_num;
+
+	if (window)
+	  g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
+	g_return_if_fail (GNC_IS_PLUGIN_PAGE (page));
+	g_return_if_fail (gnc_plugin_page_has_books(page));
+
+	if (gnc_main_window_page_exists(page)) {
+	  window = GNC_MAIN_WINDOW (page->window);
+	  notebook = GTK_NOTEBOOK (window->priv->notebook);
+	  page_num = gtk_notebook_page_num(notebook, page->notebook_page);
+	  gtk_notebook_set_current_page (notebook, page_num);
+	  gtk_window_present(GTK_WINDOW(window));
+	  return;
+	}
+
+	if ((window == NULL) && active_windows)
+	  window = active_windows->data;
+
+	/* Is this the first page in the first window? */
+	if ((window == active_windows->data) &&
+	    (window->priv->installed_pages == NULL)) {
+	  g_object_set_data (G_OBJECT (page), PLUGIN_PAGE_IMMUTABLE,
+			     GINT_TO_POINTER(1));
+	}
+
+	page->notebook_page = gnc_plugin_page_create_widget (page);
+	g_object_set_data (G_OBJECT (page->notebook_page),
+			   PLUGIN_PAGE_LABEL, page);
+
+	icon = GNC_PLUGIN_PAGE_GET_CLASS(page)->tab_icon;
+	label = gtk_label_new (page->tab_name);
+	gtk_widget_show (label);
+
+	if (icon != NULL) {
+		/* FIXME */
+		label_box = gtk_hbox_new (FALSE, 6);
+		gtk_widget_show (label_box);
+		image = gtk_image_new_from_stock (icon, GTK_ICON_SIZE_MENU);
+		gtk_widget_show (image);
+		gtk_box_pack_start (GTK_BOX (label_box), image, FALSE, FALSE, 0);
+		gtk_box_pack_start (GTK_BOX (label_box), label, TRUE, TRUE, 0);
+	} else {
+		label_box = label;
+	}
+	
+	gnc_main_window_connect(window, page, label_box);
+}
+
+
+/*  Remove a data plugin page from a window and display the previous
+ *  page.  If the page removed was the last page in the window, and
+ *  there is more than one window open, then the entire window will be
+ *  destroyed.
+ */
+void
+gnc_main_window_close_page (GncPluginPage *page)
+{
+	GncMainWindow *window;
+
+	if (!page->notebook_page)
+		return;
+
+	window = GNC_MAIN_WINDOW (page->window);
+	if (!window) {
+	  g_warning("Page is not in a window.");
+	  return;
+	}
+
+	gnc_main_window_disconnect(window, page);
+	gnc_plugin_page_destroy_widget (page);
+	g_object_unref(page);
+
+	/* If this isn't the last window, go ahead and destroy the window. */
+	if (window->priv->installed_pages == NULL) {
+		if (g_list_length(active_windows) > 1) {
+			gtk_widget_destroy(GTK_WIDGET(window));
+		}
+	}
+}
+
+
+/*  Retrieve a pointer to the page that is currently at the front of
+ *  the specified window.  Any plugin that needs to manipulate its
+ *  menus based upon the currently selected menu page should connect
+ *  to the "page_changed" signal on a window.  The callback function
+ *  from that signal can then call this function to obtain a pointer
+ *  to the current page.
+ */
+GncPluginPage *
+gnc_main_window_get_current_page (GncMainWindow *window)
+{
+	return window->priv->current_page;
+}
+
+
+/*  Manually add a set of actions to the specified window.  Plugins
+ *  whose user interface is not hard coded (e.g. the menu-additions *
+ *  plugin) must create their actions at run time, then use this *
+ *  function to install them into the window.
+ */
+void
+gnc_main_window_manual_merge_actions (GncMainWindow *window,
+				      const gchar *group_name,
+				      GtkActionGroup *group,
+				      guint merge_id)
+{
+	MergedActionEntry *entry;
+
+	g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
+	g_return_if_fail (group_name != NULL);
+	g_return_if_fail (GTK_IS_ACTION_GROUP(group));
+	g_return_if_fail (merge_id > 0);
+
+	entry = g_new0 (MergedActionEntry, 1);
+	entry->action_group = group;
+	entry->merge_id = merge_id;
+	gtk_ui_manager_ensure_update (window->ui_merge);
+	g_hash_table_insert (window->priv->merged_actions_table, g_strdup (group_name), entry);
+}
+
+
+/*  Add a set of actions to the specified window.  This function
+ *  should not need to be called directly by plugin implementors.
+ *  Correctly assigning values to the GncPluginClass fields during
+ *  plugin initialization will cause this routine to be automatically
+ *  called.
+ */
+void
+gnc_main_window_merge_actions (GncMainWindow *window,
+			       const gchar *group_name,
+			       GtkActionEntry *actions,
+			       guint n_actions,
+			       const gchar *filename,
+			       gpointer user_data)
+{
+	GncMainWindowActionData *data;
+	MergedActionEntry *entry;
+	GError *error = NULL;
+	gchar *pathname;
+
+	g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
+	g_return_if_fail (group_name != NULL);
+	g_return_if_fail (actions != NULL);
+	g_return_if_fail (n_actions > 0);
+	g_return_if_fail (filename != NULL);
+
+	data = g_new0 (GncMainWindowActionData, 1);
+	data->window = window;
+	data->data = user_data;
+
+	pathname = gnc_gnome_locate_ui_file (filename);
+	if (pathname == NULL)
+	  return;
+
+	entry = g_new0 (MergedActionEntry, 1);
+	entry->action_group = gtk_action_group_new (group_name);
+	gtk_action_group_add_actions (entry->action_group, actions, n_actions, data);
+	gtk_ui_manager_insert_action_group (window->ui_merge, entry->action_group, 0);
+	entry->merge_id = gtk_ui_manager_add_ui_from_file (window->ui_merge, pathname, &error);
+	g_assert(entry->merge_id || error);
+	if (entry->merge_id) {
+	  gtk_ui_manager_ensure_update (window->ui_merge);
+	  g_hash_table_insert (window->priv->merged_actions_table, g_strdup (group_name), entry);
+	} else {
+	  g_critical("Failed to load ui file.\n  Filename %s\n  Error %s",
+		     filename, error->message);
+	  g_error_free(error);
+	  g_free(entry);
+	}
+	g_free(pathname);
+}
+
+
+/*  Remove a set of actions from the specified window.  This function
+ *  should not need to be called directly by plugin implementors.  It
+ *  will automatically be called when a plugin is removed from a
+ *  window.
+ */
+void
+gnc_main_window_unmerge_actions (GncMainWindow *window,
+				 const gchar *group_name)
+{
+	MergedActionEntry *entry;
+
+	g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
+	g_return_if_fail (group_name != NULL);
+
+	entry = g_hash_table_lookup (window->priv->merged_actions_table, group_name);
+
+	if (entry == NULL)
+		return;
+
+	gtk_ui_manager_remove_action_group (window->ui_merge, entry->action_group);
+	gtk_ui_manager_remove_ui (window->ui_merge, entry->merge_id);
+	gtk_ui_manager_ensure_update (window->ui_merge);
+
+	g_hash_table_remove (window->priv->merged_actions_table, group_name);
+}
+
+
+/*  Force a full update of the user interface for the specified
+ *  window.  This can be an expensive function, but is needed because
+ *  the gtk ui manager doesn't always seem to update properly when
+ *  actions are changed.
+ */
+void
+gnc_main_window_actions_updated (GncMainWindow *window)
+{
+	GtkActionGroup *force;
+
+	g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
+
+	/* Unfortunately gtk_ui_manager_ensure_update doesn't work
+	 * here.  Force a full update by adding and removing an empty
+	 * action group.
+	 */
+	force = gtk_action_group_new("force_update");
+	gtk_ui_manager_insert_action_group (window->ui_merge, force, 0);
+	gtk_ui_manager_ensure_update (window->ui_merge);
+	gtk_ui_manager_remove_action_group (window->ui_merge, force);
+	g_object_unref(force);
+}
+
+
+/*  Retrieve a specific set of user interface actions from a window.
+ *  This function can be used to get an group of action to be
+ *  manipulated when the front page of a window has changed.
+ */
+GtkActionGroup *
+gnc_main_window_get_action_group (GncMainWindow *window,
+				  const gchar *group_name)
+{
+	MergedActionEntry *entry;
+
+	g_return_val_if_fail (GNC_IS_MAIN_WINDOW (window), NULL);
+	g_return_val_if_fail (group_name != NULL, NULL);
+
+	entry = g_hash_table_lookup (window->priv->merged_actions_table, group_name);
+
+	if (entry == NULL)
+		return NULL;
+
+	return entry->action_group;
+}
+
+
+static void
+gnc_main_window_add_plugin (gpointer plugin,
+			    gpointer window)
+{
+	g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
+	g_return_if_fail (GNC_IS_PLUGIN (plugin));
+
+	gnc_plugin_add_to_window (GNC_PLUGIN (plugin),
+				  GNC_MAIN_WINDOW (window),
+				  window_type);
+}
+
+static void
+gnc_main_window_update_toolbar (GncMainWindow *window,
+				const gchar *style_name)
+{
+	GtkToolbarStyle style;
+	GSList *list;
+
+	ENTER("window %p, style %s", window, style_name);
+
+	style = gnc_enum_from_nick(GTK_TYPE_TOOLBAR_STYLE, style_name,
+				   GTK_TOOLBAR_BOTH);
+	list = gtk_ui_manager_get_toplevels(window->ui_merge, GTK_UI_MANAGER_TOOLBAR);
+	g_slist_foreach(list, (GFunc)gtk_toolbar_set_style, GINT_TO_POINTER(style));
+	g_slist_free(list);
+	LEAVE("");
+}
+
+static void
+gnc_main_window_gconf_changed (GConfClient *client,
+			       guint cnxn_id,
+			       GConfEntry *entry,
+			       gpointer user_data)
+{
+	GncMainWindow *window;
+	GConfValue *value;
+	const gchar *key;
+
+	window = GNC_MAIN_WINDOW(user_data);
+
+	key = gconf_entry_get_key(entry);
+	value = gconf_entry_get_value(entry);
+	if (!key || !value)
+	  return;
+
+	if (strcmp(key, TOOLBAR_STYLE) == 0) {
+	  gnc_main_window_update_toolbar(window, gconf_value_get_string(value));
+	  return;
+	}
+}
+
+static void
+gnc_main_window_setup_window (GncMainWindow *window)
+{
+	GncMainWindowPrivate *priv;
+	GtkWidget *main_vbox;
+	guint merge_id;
+	GncPluginManager *manager;
+	GList *plugins;
+	GError *error = NULL;
+	gchar *filename, *style;
+	SCM debugging;
+
+	/* Create widgets and add them to the window */
+	main_vbox = gtk_vbox_new (FALSE, 0);
+	gtk_widget_show (main_vbox);
+	gtk_container_add (GTK_CONTAINER (window), main_vbox);
+
+	priv = window->priv;
+	priv->menu_dock = gtk_vbox_new (FALSE, 0);
+	gtk_widget_show (priv->menu_dock);
+	gtk_box_pack_start (GTK_BOX (main_vbox), priv->menu_dock,
+			    FALSE, TRUE, 0);
+
+	priv->notebook = gtk_notebook_new ();
+	gtk_widget_show (priv->notebook);
+	g_signal_connect (G_OBJECT (priv->notebook), "switch-page",
+			  G_CALLBACK (gnc_main_window_switch_page), window);
+	gtk_box_pack_start (GTK_BOX (main_vbox), priv->notebook,
+			    TRUE, TRUE, 0);
+
+	priv->show_summarybar = TRUE;
+	priv->summarybar_dock = gtk_vbox_new (FALSE, 0);
+	gtk_widget_show (priv->summarybar_dock);
+	gtk_box_pack_start (GTK_BOX (main_vbox), priv->summarybar_dock,
+			    FALSE, TRUE, 0);
+
+	priv->statusbar = gtk_statusbar_new ();
+	gtk_widget_show (priv->statusbar);
+	gtk_box_pack_start (GTK_BOX (main_vbox), priv->statusbar,
+	                           FALSE, TRUE, 0);
+        gtk_statusbar_set_has_resize_grip( GTK_STATUSBAR(priv->statusbar), TRUE );
+
+	priv->progressbar = gtk_progress_bar_new ();
+	gtk_widget_show (priv->progressbar);
+	gtk_box_pack_start (GTK_BOX (priv->statusbar), priv->progressbar,
+			    FALSE, TRUE, 0);
+
+	window->ui_merge = gtk_ui_manager_new ();
+
+	/* Create menu and toolbar information */
+	priv->action_group = gtk_action_group_new ("MainWindowActions");
+	gtk_action_group_add_actions (priv->action_group, gnc_menu_actions,
+				      gnc_menu_n_actions, window);
+	gtk_action_group_add_toggle_actions (priv->action_group, 
+					     toggle_actions, n_toggle_actions, 
+					     window);
+	gtk_ui_manager_insert_action_group (window->ui_merge, priv->action_group, 0);
+
+	g_signal_connect (G_OBJECT (window->ui_merge), "add_widget",
+			  G_CALLBACK (gnc_main_window_add_widget), window);
+	filename = gnc_gnome_locate_ui_file("gnc-main-window-ui.xml");
+
+	/* Can't do much without a ui. */
+	g_assert (filename);
+
+	merge_id = gtk_ui_manager_add_ui_from_file (window->ui_merge,
+						    filename, &error);
+	g_assert(merge_id || error);
+	if (merge_id) {
+	  gtk_window_add_accel_group (GTK_WINDOW (window),
+				      gtk_ui_manager_get_accel_group(window->ui_merge));
+	  gtk_ui_manager_ensure_update (window->ui_merge);
+	} else {
+	  g_critical("Failed to load ui file.\n  Filename %s\n  Error %s",
+		     filename, error->message);
+	  g_error_free(error);
+	  g_assert(merge_id != 0);
+	}
+	g_free(filename);
+
+	gnc_gconf_add_notification(G_OBJECT(window), DESKTOP_GNOME_INTERFACE,
+				   gnc_main_window_gconf_changed);
+	style = gnc_gconf_get_string(TOOLBAR_STYLE, NULL, NULL);
+	gnc_main_window_update_toolbar(window, style);
+	g_free(style);
+
+        /* Testing */
+        {
+                guint new_merge_id;
+                GtkActionGroup *eag;
+                GtkActionEntry newEntry[] =
+                        {
+                          { "BarAction", NULL, N_("_GtkHtml3 test"), "<control>3", NULL, G_CALLBACK (gnc_main_window_cmd_test) }
+                        };
+
+                eag = gtk_action_group_new ("MainWindowActions2");
+
+                gtk_action_group_add_actions (eag, newEntry,
+                                              G_N_ELEMENTS (newEntry), window);
+                gtk_ui_manager_insert_action_group( window->ui_merge, eag, 0 );
+
+                new_merge_id = gtk_ui_manager_new_merge_id( window->ui_merge );
+
+                gtk_ui_manager_add_ui( window->ui_merge, new_merge_id,
+                                       // "/menubar/Actions", no
+                                       // "/menubar/Actions/ActionsPlaceholder", no
+                                       // "/menubar/AdditionalMenusPlaceholder/AReportAction", no 
+                                       "/menubar/AdditionalMenusPlaceholder", // winnah!
+                                       "BarAction",
+                                       "BarAction", GTK_UI_MANAGER_MENUITEM, FALSE );
+                gtk_ui_manager_ensure_update( window->ui_merge );
+        }
+
+	/* Now update the "eXtensions" menu */
+	debugging = scm_c_eval_string("(gnc:debugging?)");
+	if (debugging == SCM_BOOL_F) {
+	  GtkAction*  action;
+
+	  action = gtk_action_group_get_action(priv->action_group,"ExtensionsAction");
+	  g_object_set(G_OBJECT(action), "visible", FALSE, NULL);
+	}
+
+	/* GncPluginManager stuff */
+	manager = gnc_plugin_manager_get ();
+	plugins = gnc_plugin_manager_get_plugins (manager);
+	g_signal_connect (G_OBJECT (manager), "plugin-added",
+			  G_CALLBACK (gnc_main_window_plugin_added), window);
+	g_signal_connect (G_OBJECT (manager), "plugin-removed",
+			  G_CALLBACK (gnc_main_window_plugin_removed), window);
+	g_list_foreach (plugins, gnc_main_window_add_plugin, window);
+	g_list_free (plugins);
+
+}
+
+static void
+gnc_main_window_add_widget (GtkUIManager *merge,
+			    GtkWidget *widget,
+			    GncMainWindow *window)
+{
+	if (GTK_IS_TOOLBAR (widget)) {
+		window->priv->toolbar_dock = widget;
+	}
+
+	gtk_box_pack_start (GTK_BOX (window->priv->menu_dock), widget, FALSE, FALSE, 0);
+	gtk_widget_show (widget);
+}
+
+/** This function is invoked when the GtkNotebook switches pages.  It
+ *  is responsible for updating the rest of the window contents
+ *  outside of the notebook.  I.E. Updating the user interface, the
+ *  summary bar, etc.  This function also emits the "page_changed"
+ *  signal from the window so that any plugin can also learn about the
+ *  fact that the page has changed.
+ *
+ *  @internal
+ */
+static void
+gnc_main_window_switch_page (GtkNotebook *notebook,
+			     GtkNotebookPage *notebook_page,
+			     gint pos,
+			     GncMainWindow *window)
+{
+	GtkWidget *child, *summarybar, *summarybar_dock;
+	GncPluginPage *page;
+	gboolean immutable;
+
+	DEBUG("Notebook %p, page, %p, index %d, window %p",
+	       notebook, notebook_page, pos, window);
+	g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
+
+	summarybar_dock = window->priv->summarybar_dock;
+
+	if (window->priv->current_page != NULL) {
+		page = window->priv->current_page;
+		gnc_plugin_page_unmerge_actions (page, window->ui_merge);
+		gnc_plugin_page_unselected (page);
+
+		/* Remove old page's summarybar too */
+		if (page->summarybar) {
+			gtk_container_remove(GTK_CONTAINER(summarybar_dock),
+					     page->summarybar);
+		}
+	}
+
+	child = gtk_notebook_get_nth_page (notebook, pos);
+	if (child) {
+		page = g_object_get_data (G_OBJECT (child), PLUGIN_PAGE_LABEL);
+	} else {
+		page = NULL;
+	}
+
+	window->priv->current_page = page;
+
+	if (page != NULL) {
+		/* Update the user interface (e.g. menus and toolbars */
+		gnc_plugin_page_merge_actions (page, window->ui_merge);
+
+		/* install new summarybar (if any) */
+		summarybar = page->summarybar;
+		if (summarybar) {
+		  if (GTK_OBJECT_FLOATING(summarybar)) {
+		    /* Own this object. This will prevent it from being deleted by
+		     * gtk when it is removed from the summarybar. */
+		    g_object_ref (summarybar);
+		    gtk_object_sink (GTK_OBJECT (summarybar));
+		  }
+
+		  if (window->priv->show_summarybar)
+		    gtk_widget_show(summarybar);
+		  else
+		    gtk_widget_hide(summarybar);
+		  gtk_box_pack_start(GTK_BOX(summarybar_dock), summarybar,
+				     FALSE, TRUE, 0 );
+		}
+
+		/* Allow page specific actions */
+		gnc_plugin_page_selected (page);
+		gnc_window_update_status (GNC_WINDOW(window), page);
+	}
+
+	/* Update the menus based upon whether this is an "immutable" page. */
+	immutable = page &&
+	  g_object_get_data (G_OBJECT (page), PLUGIN_PAGE_IMMUTABLE);
+	gnc_plugin_update_actions(window->priv->action_group,
+				  immutable_account_actions,
+				  "sensitive", !immutable);
+
+	g_signal_emit (window, main_window_signals[PAGE_CHANGED], 0, page);
+}
+
+static void
+gnc_main_window_plugin_added (GncPlugin *manager,
+			      GncPlugin *plugin,
+			      GncMainWindow *window)
+{
+	g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
+	g_return_if_fail (GNC_IS_PLUGIN (plugin));
+
+	gnc_plugin_add_to_window (plugin, window, window_type);
+}
+
+static void
+gnc_main_window_plugin_removed (GncPlugin *manager,
+				GncPlugin *plugin,
+				GncMainWindow *window)
+{
+	g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
+	g_return_if_fail (GNC_IS_PLUGIN (plugin));
+
+	gnc_plugin_remove_from_window (plugin, window, window_type);
+}
+
+
+/* Command callbacks */
+static void
+gnc_main_window_cmd_file_open_new_window (GtkAction *action, GncMainWindow *window)
+{
+	GncMainWindowPrivate *priv;
+	GncMainWindow *new_window;
+	GncPluginPage *page;
+	GtkNotebook *notebook;
+	GtkWidget *tab_widget;
+
+	/* Setup */
+	priv = window->priv;
+	if (priv->current_page == NULL)
+		return;
+	notebook = GTK_NOTEBOOK (priv->notebook);
+	page = priv->current_page;
+	tab_widget = gtk_notebook_get_tab_label (notebook, page->notebook_page);
+
+	/* Ref the page components, then remove it from its old window */
+	g_object_ref(page);
+	g_object_ref(tab_widget);
+	g_object_ref(page->notebook_page);
+	gnc_main_window_disconnect(window, page);
+
+	/* Create the new window */
+	new_window = gnc_main_window_new ();
+	gtk_widget_show(GTK_WIDGET(new_window));
+
+	/* Now add the page to the new window */
+	gnc_main_window_connect (new_window, page, tab_widget);
+
+	/* Unref the page components now that we're done */
+	g_object_unref(page->notebook_page);
+	g_object_unref(tab_widget);
+	g_object_unref(page);
+
+	/* just a little debugging. :-) */
+	DEBUG("Moved page %p (sb %p) from window %p to new window %p",
+	      page, page->summarybar, window, new_window);
+	DEBUG("Old window current is %p, new window current is %p",
+	      window->priv->current_page, new_window->priv->current_page);
+}
+
+static void
+gnc_main_window_cmd_file_print (GtkAction *action, GncMainWindow *window)
+{
+}
+
+static void
+gnc_main_window_cmd_file_properties (GtkAction *action, GncMainWindow *window)
+{
+  SCM func = scm_c_eval_string("gnc:main-window-properties-cb");
+  if (!SCM_PROCEDUREP (func)) {
+      PERR ("not a procedure\n");
+      return;
+  }
+  scm_call_0(func);
+}
+
+static void
+gnc_main_window_cmd_file_close (GtkAction *action, GncMainWindow *window)
+{
+	g_return_if_fail(GNC_IS_MAIN_WINDOW(window));
+
+	if (window->priv->current_page != NULL) {
+		gnc_main_window_close_page (window->priv->current_page);
+	}
+}
+
+static void
+gnc_main_window_cmd_file_quit (GtkAction *action, GncMainWindow *window)
+{
+	gnc_shutdown (0);
+}
+
+static void
+gnc_main_window_cmd_edit_cut (GtkAction *action, GncMainWindow *window)
+{
+}
+
+static void
+gnc_main_window_cmd_edit_copy (GtkAction *action, GncMainWindow *window)
+{
+}
+
+static void
+gnc_main_window_cmd_edit_paste (GtkAction *action, GncMainWindow *window)
+{
+}
+
+static void
+gnc_main_window_cmd_edit_preferences (GtkAction *action, GncMainWindow *window)
+{
+	gnc_show_options_dialog ();
+}
+
+static void
+gnc_main_window_cmd_view_refresh (GtkAction *action, GncMainWindow *window)
+{
+}
+
+static void
+gnc_main_window_cmd_view_toolbar (GtkAction *action, GncMainWindow *window)
+{
+	if (gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action))) {
+		gtk_widget_show (window->priv->toolbar_dock);
+	} else {
+		gtk_widget_hide (window->priv->toolbar_dock);
+	}
+}
+
+static void
+gnc_main_window_cmd_view_summary (GtkAction *action, GncMainWindow *window)
+{
+	if (gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action))) {
+		gtk_widget_show (window->priv->summarybar_dock);
+	} else {
+		gtk_widget_hide (window->priv->summarybar_dock);
+	}
+}
+
+static void
+gnc_main_window_cmd_view_statusbar (GtkAction *action, GncMainWindow *window)
+{
+	if (gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action))) {
+		gtk_widget_show (window->priv->statusbar);
+	} else {
+		gtk_widget_hide (window->priv->statusbar);
+	}
+}
+
+static void
+gnc_main_window_cmd_help_tutorial (GtkAction *action, GncMainWindow *window)
+{
+	gnc_gnome_help (HF_GUIDE, NULL);
+}
+
+static void
+gnc_main_window_cmd_help_contents (GtkAction *action, GncMainWindow *window)
+{
+	gnc_gnome_help (HF_HELP, NULL);
+}
+
+static void
+gnc_main_window_cmd_test( GtkAction *action, GncMainWindow *window )
+{
+        GtkWindow *w = GTK_WINDOW(gtk_window_new( GTK_WINDOW_TOPLEVEL ));
+        gnc_html *gnchtml = gnc_html_new( w );
+        gchar *html = "<html><head><title>testing</title></head><body><h1>testing</h1><h2>testing 2</h2> <p>Tes<br />ting<object classid=\"gnc-guppi-pie\" width=\"300\" height=\"200\">No pie for you!</object></p></body></html>";
+        gtk_container_add( GTK_CONTAINER(w), GTK_WIDGET(gnc_html_get_widget(gnchtml)) );
+
+        gnc_html_show_data( gnchtml, html, strlen( html ) );
+        
+        gtk_widget_show_all( GTK_WIDGET(w) );
+}
+
+static void
+gnc_main_window_cmd_help_about (GtkAction *action, GncMainWindow *window)
+{
+	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 = "\xc2\xa9 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
+	};
+	const gchar *documenters[] = {
+		NULL
+	};
+	const gchar *translator_credits = _("translator_credits");
+	GdkPixbuf *logo;
+
+	logo = gnc_gnome_get_gdkpixbuf ("appicon.png");
+
+	about = gnome_about_new ("GnuCash", VERSION, copyright, message, authors, documenters,
+				 strcmp (translator_credits, "translator_credits") != 0 ? translator_credits : NULL,
+				 logo);
+
+	gdk_pixbuf_unref (logo);
+	gtk_dialog_run (GTK_DIALOG (about));
+}
+
+void
+gnc_main_window_update_title (GncMainWindow *window)
+{
+  const gchar *filename;
+  gchar *title, *ptr;
+
+  filename = gnc_session_get_url (gnc_get_current_session ());
+
+  if (!filename)
+    filename = _("<no file>");
+  else {
+    /* Recommended gnome naming scheme */
+    ptr = rindex(filename, '/');
+    if (ptr != NULL)
+      filename = ptr+1;
+  }
+  title = g_strdup_printf ("%s - Gnucash", filename);
+  gtk_window_set_title (GTK_WINDOW(&window->parent), title);
+  g_free(title);
+}
+
+static GtkWidget *
+gnc_main_window_get_statusbar (GncWindow *window_in)
+{
+  GncMainWindowPrivate *priv;
+  GncMainWindow *window;
+
+  g_return_val_if_fail (GNC_IS_MAIN_WINDOW (window_in), NULL);
+
+  window = GNC_MAIN_WINDOW(window_in);
+  priv = window->priv;
+  return priv->statusbar;
+}
+
+static GtkWidget *
+gnc_main_window_get_progressbar (GncWindow *window_in)
+{
+  GncMainWindowPrivate *priv;
+  GncMainWindow *window;
+
+  g_return_val_if_fail (GNC_IS_MAIN_WINDOW (window_in), NULL);
+
+  window = GNC_MAIN_WINDOW(window_in);
+  priv = window->priv;
+  return priv->progressbar;
+}
+
+static void
+gnc_window_main_window_init (GncWindowIface *iface)
+{
+	iface->get_statusbar   = gnc_main_window_get_statusbar;
+	iface->get_progressbar = gnc_main_window_get_progressbar;
+}
+
+
+/*  Set the window where all progressbar updates should occur.  This
+ *  is a wrapper around the gnc_window_set_progressbar_window()
+ *  function.
+ */
+void
+gnc_main_window_set_progressbar_window (GncMainWindow *window)
+{
+  GncWindow *gncwin;
+  gncwin = GNC_WINDOW(window);
+  gnc_window_set_progressbar_window(gncwin);
+}
+
+
+/*  Shutdown gnucash.  This function will call the Scheme side of
+ *  GnuCash to initiate an orderly shutdown, and when that has
+ *  finished it will exit the program.
+ */
+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);
+  }
+}
--- /dev/null
+++ src/gnome-utils/gnc-plugin.c
@@ -0,0 +1,370 @@
+/* 
+ * gnc-plugin.c -- 
+ *
+ * Copyright (C) 2003 Jan Arne Petersen
+ * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, contact:
+ *
+ * Free Software Foundation           Voice:  +1-617-542-5942
+ * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
+ * Boston, MA  02111-1307,  USA       gnu at gnu.org
+ */
+
+#include "config.h"
+
+#include "gnc-plugin.h"
+#include "gnc-trace.h"
+#include "gnc-gconf-utils.h"
+#include "gnc-gnome-utils.h"
+#include "messages.h"
+
+static gpointer parent_class = NULL;
+static short module = MOD_GUI;
+
+static void gnc_plugin_class_init (GncPluginClass *klass);
+static void gnc_plugin_init       (GncPlugin *plugin_page);
+static void gnc_plugin_finalize   (GObject *object);
+
+struct  GncPluginPrivate {
+	gpointer dummy;
+};
+
+
+/** Get the type of a gnc window plugin.
+ */
+GType
+gnc_plugin_get_type (void)
+{
+	static GType gnc_plugin_type = 0;
+
+	if (gnc_plugin_type == 0) {
+		static const GTypeInfo our_info = {
+			sizeof (GncPluginClass),
+			NULL,		/* base_init */
+			NULL,		/* base_finalize */
+			(GClassInitFunc) gnc_plugin_class_init,
+			NULL,		/* class_finalize */
+			NULL,		/* class_data */
+			sizeof (GncPlugin),
+			0,		/* n_preallocs */
+			(GInstanceInitFunc) gnc_plugin_init,
+		};
+
+		gnc_plugin_type = g_type_register_static (G_TYPE_OBJECT,
+							  "GncPlugin",
+							   &our_info, 0);
+	}
+
+	return gnc_plugin_type;
+}
+
+
+/** Initialize the class for the new gnucash plugin object.  This will
+ *  set up any function pointers that override functions in the parent
+ *  class, and also installs the proprieties that are unique to this
+ *  class.
+ *
+ *  @param klass The new class structure created by the object system.
+ *
+ *  @internal
+ */
+static void
+gnc_plugin_class_init (GncPluginClass *klass)
+{
+	GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+	parent_class = g_type_class_peek_parent (klass);
+	gobject_class->finalize = gnc_plugin_finalize;
+}
+
+
+/** Initialize a new instance of a gnucash plugin object.  This
+ *  function allocates and initializes the object private storage
+ *  space.
+ *
+ *  @param view The new object instance created by the object system.
+ *
+ *  @internal
+ */
+static void
+gnc_plugin_init (GncPlugin *plugin_page)
+{
+	GncPluginPrivate *priv;
+
+	priv = plugin_page->priv = g_new0 (GncPluginPrivate, 1);
+}
+
+
+/** Finalize the gnucash plugin object.  This function is called from
+ *  the G_Object level to complete the destruction of the object.  It
+ *  should release any memory not previously released by the destroy
+ *  function (i.e. the private data structure), then chain up to the
+ *  parent's destroy function.
+ *
+ *  @param object The object being destroyed.
+ *
+ *  @internal
+ */
+static void
+gnc_plugin_finalize (GObject *object)
+{
+	GncPlugin *plugin;
+
+	g_return_if_fail (GNC_IS_PLUGIN (object));
+
+	plugin = GNC_PLUGIN (object);
+	g_return_if_fail (plugin->priv != NULL);
+
+	g_free (plugin->priv);
+
+	G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+
+/** Add the specified plugin from the specified window.  This function
+ *  will add the page's user interface from the window, set up gconf
+ *  notifications if the page uses gconf, and call the plugin to
+ *  perform any plugin specific actions.
+ */
+void
+gnc_plugin_add_to_window (GncPlugin *plugin,
+			  GncMainWindow *window,
+			  GQuark type)
+{
+	GncPluginClass *class;
+
+	g_return_if_fail (GNC_IS_PLUGIN (plugin));
+	class = GNC_PLUGIN_GET_CLASS (plugin);
+	ENTER (": plugin %s(%p), window %p", gnc_plugin_get_name(plugin),
+	       plugin, window);
+
+	/*
+	 * Update window with additional UI items
+	 */
+	if (class->actions_name) {
+	  DEBUG ("%s: %d actions to merge with gui from %s",
+		 class->actions_name, class->n_actions, class->ui_filename);
+	  gnc_main_window_merge_actions (window, class->actions_name,
+					 class->actions, class->n_actions,
+					 class->ui_filename, plugin);
+	}
+
+	/*
+	 * Setup gconf notifications if requested
+	 */
+	if (class->gconf_section && class->gconf_notifications) {
+	  DEBUG ("Requesting notification for section %s", class->gconf_section);
+	  gnc_gconf_add_notification(G_OBJECT(window), class->gconf_section,
+				     class->gconf_notifications);
+	}
+
+	/*
+	 * Do plugin specific actions.
+	 */
+	if (GNC_PLUGIN_GET_CLASS (plugin)->add_to_window) {
+	  DEBUG ("Calling child class function %p", GNC_PLUGIN_GET_CLASS (plugin)->add_to_window);
+	  GNC_PLUGIN_GET_CLASS (plugin)->add_to_window (plugin, window, type);
+	}
+	LEAVE ("");
+}
+
+
+/*  Remove the specified plugin from the specified window.  This
+ *  function will call the plugin to perform any plugin specific
+ *  actions, remove any gconf notifications that were set up for the
+ *  page, and remove the page's user interface from the window.
+ */
+void
+gnc_plugin_remove_from_window (GncPlugin *plugin,
+			       GncMainWindow *window,
+			       GQuark type)
+{
+	GncPluginClass *class;
+
+	g_return_if_fail (GNC_IS_PLUGIN (plugin));
+	class = GNC_PLUGIN_GET_CLASS (plugin);
+	ENTER (": plugin %s(%p), window %p", gnc_plugin_get_name(plugin),
+	       plugin, window);
+
+	/*
+	 * Do plugin specific actions.
+	 */
+	if (GNC_PLUGIN_GET_CLASS (plugin)->remove_from_window) {
+	  DEBUG ("Calling child class function %p",
+		 GNC_PLUGIN_GET_CLASS (plugin)->remove_from_window);
+	  GNC_PLUGIN_GET_CLASS (plugin)->remove_from_window (plugin, window, type);
+	}
+
+	/*
+	 * Remove any gconf notifications
+	 */
+	if (class->gconf_section && class->gconf_notifications) {
+	  DEBUG ("Remove notification for section %s", class->gconf_section);
+	  gnc_gconf_remove_notification (G_OBJECT(window), class->gconf_section);
+	}
+
+	/*
+	 * Update window to remove UI items
+	 */
+	if (class->actions_name) {
+	  DEBUG ("%s: %d actions to unmerge",
+		 class->actions_name, class->n_actions);
+	  gnc_main_window_unmerge_actions (window, class->actions_name);
+	}
+	LEAVE ("");
+}
+
+
+GncPluginPage *
+gnc_plugin_create_page (GncPlugin *plugin,
+			const gchar *uri)
+{
+	g_return_val_if_fail (GNC_IS_PLUGIN (plugin), NULL);
+
+	if (!GNC_PLUGIN_GET_CLASS (plugin)->create_page)
+	  return NULL;
+	return GNC_PLUGIN_GET_CLASS (plugin)->create_page (plugin, uri);
+}
+
+
+/** Retrieve the name of a plugin.
+ */
+const gchar *
+gnc_plugin_get_name (GncPlugin *plugin)
+{
+	g_return_val_if_fail (GNC_IS_PLUGIN (plugin), NULL);
+	return (GNC_PLUGIN_GET_CLASS(plugin)->plugin_name);
+}
+
+
+/************************************************************
+ *                    Utility Functions                     *
+ ************************************************************/
+
+
+/** Add "short" labels to existing actions.  The "short" label is the
+ *  string used on toolbar buttons when the action is visible.*/
+void
+gnc_plugin_init_short_names (GtkActionGroup *action_group,
+			     action_short_labels *short_labels)
+{
+  GtkAction *action;
+  GValue value = { 0, };
+  gint i;
+
+  g_value_init (&value, G_TYPE_STRING);
+
+  for (i = 0; short_labels[i].action_name; i++) {
+    /* Add a couple of short labels for the toolbar */
+    action = gtk_action_group_get_action (action_group,
+					  short_labels[i].action_name);
+    g_value_set_static_string (&value, gettext(short_labels[i].label));
+    g_object_set_property (G_OBJECT(action), "short_label", &value);
+  }
+}
+
+
+/** Update the status of existing UI actions.  This function can
+ *  modify actions making them visible, invisible, sensitive, or
+ *  insensitive. */
+void
+gnc_plugin_update_actions (GtkActionGroup *action_group,
+			   const gchar **action_names,
+			   const gchar *property_name,
+			   gboolean value)
+{
+  GtkAction    *action;
+  GValue        gvalue = { 0 };
+  gint          i;
+
+  g_value_init (&gvalue, G_TYPE_BOOLEAN);
+  g_value_set_boolean (&gvalue, value);
+
+  for (i = 0; action_names[i]; i++) {
+    action = gtk_action_group_get_action (action_group, action_names[i]);
+    g_object_set_property (G_OBJECT(action), property_name, &gvalue);
+  }
+}
+
+
+/** Load a new set of actions into an existing UI. */
+gint
+gnc_plugin_add_actions (GtkUIManager *ui_merge,
+			GtkActionGroup *action_group,
+			const gchar *filename)
+{
+	GError *error = NULL;
+	gchar *pathname;
+	gint merge_id;
+	
+	ENTER("ui_merge %p, action_group %p, filename %s",
+	      ui_merge, action_group, filename);
+	g_return_val_if_fail (ui_merge, 0);
+	g_return_val_if_fail (action_group, 0);
+	g_return_val_if_fail (filename, 0);
+
+	gtk_ui_manager_insert_action_group (ui_merge, action_group, 0);
+
+	pathname = gnc_gnome_locate_ui_file (filename);
+	if (pathname == NULL)
+	  return 0;
+
+	merge_id = gtk_ui_manager_add_ui_from_file (ui_merge, pathname, &error);
+	DEBUG("merge_id is %d", merge_id);
+
+	g_assert(merge_id || error);
+	if (merge_id) {
+	  gtk_ui_manager_ensure_update (ui_merge);
+	} else {
+	  g_critical("Failed to load ui file.\n  Filename %s\n  Error %s",
+		     filename, error->message);
+	  g_error_free(error);
+	}
+
+	g_free(pathname);
+	LEAVE(" ");
+	return merge_id;
+}
+
+#if 0
+static void
+gnc_plugin_base_init (gpointer klass)
+{
+	static gboolean initialized = FALSE;
+
+	if (!initialized) {
+		initialized = TRUE;
+
+		signals[MERGE_ACTIONS] = g_signal_new ("merge-actions",
+						       G_OBJECT_CLASS_TYPE (klass),
+						       G_SIGNAL_RUN_FIRST,
+						       G_STRUCT_OFFSET (GncPluginClass, merge_actions),
+						       NULL, NULL,
+						       g_cclosure_marshal_VOID__POINTER,
+						       G_TYPE_NONE,
+						       1,
+						       GTK_TYPE_MENU_MERGE);
+		signals[UNMERGE_ACTIONS] = g_signal_new ("unmerge-actions",
+							 G_OBJECT_CLASS_TYPE (klass),
+							 G_SIGNAL_RUN_FIRST,
+							 G_STRUCT_OFFSET (GncPluginClass, unmerge_actions),
+							 NULL, NULL,
+							 g_cclosure_marshal_VOID__POINTER,
+							 G_TYPE_NONE,
+							 1,
+							 GTK_TYPE_MENU_MERGE);
+	}
+}
+#endif
--- /dev/null
+++ src/gnome-utils/gnc-embedded-window.c
@@ -0,0 +1,338 @@
+/* 
+ * gnc-main-window.c -- GtkWindow which represents the
+ *	GnuCash main window.
+ *
+ * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
+ * Copyright (C) 2003 David Hampton <hampton at employees.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, contact:
+ *
+ * Free Software Foundation           Voice:  +1-617-542-5942
+ * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
+ * Boston, MA  02111-1307,  USA       gnu at gnu.org
+ */
+
+#include "config.h"
+
+#include <gtk/gtk.h>
+
+#include "gnc-embedded-window.h"
+
+#include "gnc-engine.h"
+#include "gnc-engine-util.h"
+#include "gnc-gnome-utils.h"
+#include "gnc-dir.h"
+#include "gnc-gui-query.h"
+#include "gnc-plugin.h"
+#include "gnc-plugin-manager.h"
+#include "gnc-session.h"
+#include "gnc-ui.h"
+#include "gnc-window.h"
+#include "messages.h"
+
+/** Static Globals *******************************************************/
+static short module = MOD_GUI;
+
+/** Declarations *********************************************************/
+static void gnc_embedded_window_class_init (GncEmbeddedWindowClass *klass);
+static void gnc_embedded_window_init (GncEmbeddedWindow *window);
+static void gnc_embedded_window_finalize (GObject *object);
+static void gnc_embedded_window_dispose (GObject *object);
+
+static void gnc_window_embedded_window_init (GncWindowIface *iface);
+
+static void gnc_embedded_window_setup_window (GncEmbeddedWindow *window);
+
+
+struct GncEmbeddedWindowPrivate
+{
+  GtkWidget *menu_dock;
+  GtkWidget *toolbar_dock;
+  GtkWidget *statusbar;
+
+  GtkActionGroup *action_group;
+
+  GncPluginPage *page;
+  GtkWidget     *parent_window;
+};
+
+static GObjectClass *parent_class = NULL;
+
+GType
+gnc_embedded_window_get_type (void)
+{
+  static GType gnc_embedded_window_type = 0;
+
+  if (gnc_embedded_window_type == 0) {
+    static const GTypeInfo our_info = {
+      sizeof (GncEmbeddedWindowClass),
+      NULL,
+      NULL,
+      (GClassInitFunc) gnc_embedded_window_class_init,
+      NULL,
+      NULL,
+      sizeof (GncEmbeddedWindow),
+      0,
+      (GInstanceInitFunc) gnc_embedded_window_init
+    };
+
+    static const GInterfaceInfo plugin_info = {
+      (GInterfaceInitFunc) gnc_window_embedded_window_init,
+      NULL,
+      NULL
+    };
+
+    gnc_embedded_window_type = g_type_register_static (GTK_TYPE_VBOX,
+						       "GncEmbeddedWindow",
+						       &our_info, 0);
+    g_type_add_interface_static (gnc_embedded_window_type,
+				 GNC_TYPE_WINDOW,
+				 &plugin_info);
+  }
+
+  return gnc_embedded_window_type;
+}
+
+void
+gnc_embedded_window_open_page (GncEmbeddedWindow *window,
+			       GncPluginPage *page)
+{
+  ENTER("window %p, page %p", window, page);
+  g_return_if_fail (GNC_IS_EMBEDDED_WINDOW (window));
+  g_return_if_fail (GNC_IS_PLUGIN_PAGE (page));
+  g_return_if_fail (window->priv->page == NULL);
+
+  window->priv->page = page;
+  page->window = GTK_WIDGET(window);
+  page->notebook_page = gnc_plugin_page_create_widget (page);
+  g_object_set_data (G_OBJECT (page->notebook_page), PLUGIN_PAGE_LABEL, page);
+
+  gtk_box_pack_end(GTK_BOX(window), page->notebook_page, TRUE, TRUE, 2);
+  gnc_plugin_page_inserted (page);
+
+  gnc_plugin_page_merge_actions (page, window->ui_merge);
+  LEAVE(" ");
+}
+
+void
+gnc_embedded_window_close_page (GncEmbeddedWindow *window,
+				GncPluginPage *page)
+{
+  ENTER("window %p, page %p", window, page);
+  g_return_if_fail (GNC_IS_EMBEDDED_WINDOW (window));
+  g_return_if_fail (GNC_IS_PLUGIN_PAGE (page));
+
+  if (!page->notebook_page) {
+    LEAVE("no displayed widget");
+    return;
+  }
+
+  gtk_container_remove (GTK_CONTAINER(window), GTK_WIDGET(window->priv->page));
+  window->priv->page = NULL;
+  gnc_plugin_page_removed (page);
+
+  gnc_plugin_page_unmerge_actions (page, window->ui_merge);
+  gtk_ui_manager_ensure_update (window->ui_merge);
+
+  gnc_plugin_page_destroy_widget (page);
+  g_object_unref(page);
+  LEAVE(" ");
+}
+
+GncPluginPage *
+gnc_embedded_window_get_page (GncEmbeddedWindow *window)
+{
+  return window->priv->page;
+}
+
+
+static void
+gnc_embedded_window_class_init (GncEmbeddedWindowClass *klass)
+{
+  GObjectClass *object_class;
+  ENTER("klass %p", klass);
+  object_class = G_OBJECT_CLASS (klass);
+
+  parent_class = g_type_class_peek_parent (klass);
+
+  object_class->finalize = gnc_embedded_window_finalize;
+  object_class->dispose = gnc_embedded_window_dispose;
+  LEAVE(" ");
+}
+
+static void
+gnc_embedded_window_init (GncEmbeddedWindow *window)
+{
+  ENTER("window %p", window);
+  window->priv = g_new0 (GncEmbeddedWindowPrivate, 1);
+
+  gnc_embedded_window_setup_window (window);
+  LEAVE(" ");
+}
+
+static void
+gnc_embedded_window_finalize (GObject *object)
+{
+  GncEmbeddedWindow *window;
+
+  ENTER("object %p", object);
+  g_return_if_fail (object != NULL);
+  g_return_if_fail (GNC_IS_EMBEDDED_WINDOW (object));
+
+  window = GNC_EMBEDDED_WINDOW (object);
+
+  g_return_if_fail (window->priv != NULL);
+
+  g_free (window->priv);
+
+  G_OBJECT_CLASS (parent_class)->finalize (object);
+  LEAVE(" ");
+}
+
+static void
+gnc_embedded_window_dispose (GObject *object)
+{
+  GncEmbeddedWindow *window;
+
+  ENTER("object %p", object);
+  g_return_if_fail (object != NULL);
+  g_return_if_fail (GNC_IS_EMBEDDED_WINDOW (object));
+
+  window = GNC_EMBEDDED_WINDOW (object);
+  if (window->priv->page) {
+    DEBUG("unreffing page %p (count currently %d)", window->priv->page,
+	  G_OBJECT(window->priv->page)->ref_count);
+    g_object_unref(window->priv->page);
+    window->priv->page = NULL;
+  }
+
+  G_OBJECT_CLASS (parent_class)->dispose (object);
+  LEAVE(" ");
+}
+
+static void
+gnc_embedded_window_add_widget (GtkUIManager *merge,
+				GtkWidget *widget,
+				GncEmbeddedWindow *window)
+{
+  ENTER("merge %p, new widget %p, window %p", merge, widget, window);
+  if (GTK_IS_TOOLBAR (widget)) {
+    window->priv->toolbar_dock = widget;
+  }
+
+  gtk_box_pack_start (GTK_BOX (window->priv->menu_dock), widget, FALSE, FALSE, 0);
+  gtk_widget_show (widget);
+  LEAVE(" ");
+}
+
+static void
+gnc_embedded_window_setup_window (GncEmbeddedWindow *window)
+{
+  GncEmbeddedWindowPrivate *priv;
+
+  ENTER("window %p", window);
+  priv = window->priv;
+
+  /* Create widgets and add them to the window */
+  gtk_widget_show (GTK_WIDGET(window));
+
+  priv->menu_dock = gtk_vbox_new (FALSE, 0);
+  gtk_widget_show (priv->menu_dock);
+  gtk_box_pack_start (GTK_BOX (window), priv->menu_dock, TRUE, TRUE, 0);
+
+  priv->statusbar = gtk_statusbar_new ();
+  gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR(priv->statusbar), FALSE);
+  gtk_widget_show (priv->statusbar);
+  gtk_box_pack_end (GTK_BOX (window), priv->statusbar, FALSE, TRUE, 0);
+
+  window->ui_merge = gtk_ui_manager_new ();
+  g_signal_connect (G_OBJECT (window->ui_merge), "add_widget",
+		    G_CALLBACK (gnc_embedded_window_add_widget), window);
+
+  priv->action_group = NULL;
+  LEAVE(" ");
+}
+
+GncEmbeddedWindow *
+gnc_embedded_window_new (const gchar *action_group_name,
+			 GtkActionEntry *action_entries,
+			 gint n_action_entries,
+			 const gchar *ui_filename,
+			 GtkWidget *enclosing_win,
+			 gboolean add_accelerators,
+			 gpointer user_data)
+{
+  GncEmbeddedWindowPrivate *priv;
+  GncEmbeddedWindow *window;
+  gchar *ui_fullname;
+  GError *error = NULL;
+  guint merge_id;
+
+  ENTER("group %s, first %p, num %d, ui file %s, parent %p, add accelerators %d, user data %p",
+	action_group_name, action_entries, n_action_entries, ui_filename,
+	enclosing_win, add_accelerators, user_data);
+  window = g_object_new (GNC_TYPE_EMBEDDED_WINDOW, NULL);
+  priv = window->priv;
+
+  /* Determine the full pathname of the ui file */
+  ui_fullname = gnc_gnome_locate_ui_file(ui_filename);
+
+  /* Create menu and toolbar information */
+  priv->action_group = gtk_action_group_new (action_group_name);
+  gtk_action_group_add_actions (priv->action_group, action_entries,
+				n_action_entries, user_data);
+  gtk_ui_manager_insert_action_group (window->ui_merge, priv->action_group, 0);
+  merge_id = gtk_ui_manager_add_ui_from_file (window->ui_merge, ui_fullname,
+					      &error);
+
+  /* Error checking */
+  g_assert(merge_id || error);
+  if (error) {
+    g_critical("Failed to load ui file.\n  Filename %s\n  Error %s",
+	       ui_fullname, error->message);
+    g_error_free(error);
+    g_free(ui_fullname);
+    LEAVE("window %p", window);
+    return window;
+  }
+
+  /* Add accelerators (if wanted) */
+  if (add_accelerators)
+    gtk_window_add_accel_group (GTK_WINDOW(enclosing_win),
+				gtk_ui_manager_get_accel_group(window->ui_merge));
+
+  gtk_ui_manager_ensure_update (window->ui_merge);
+  g_free(ui_fullname);
+  LEAVE("window %p", window);
+  return window;
+}
+
+static GtkWidget *
+gnc_embedded_window_get_statusbar (GncWindow *window_in)
+{
+  GncEmbeddedWindowPrivate *priv;
+  GncEmbeddedWindow *window;
+
+  g_return_val_if_fail (GNC_IS_EMBEDDED_WINDOW (window_in), NULL);
+
+  window = GNC_EMBEDDED_WINDOW(window_in);
+  priv = window->priv;
+  return priv->statusbar;
+}
+
+static void
+gnc_window_embedded_window_init (GncWindowIface *iface)
+{
+	iface->get_statusbar = gnc_embedded_window_get_statusbar;
+}
--- /dev/null
+++ src/gnome-utils/gnc-embedded-window.h
@@ -0,0 +1,87 @@
+/* 
+ * gnc-embedded-window.h -- GtkWindow which represents an
+ *	emvedded GnuCash window.
+ *
+ * Copyright (C) 2003 Jan Arne Petersen
+ * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, contact:
+ *
+ * Free Software Foundation           Voice:  +1-617-542-5942
+ * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
+ * Boston, MA  02111-1307,  USA       gnu at gnu.org
+ */
+
+#ifndef __GNC_EMBEDDED_WINDOW_H
+#define __GNC_EMBEDDED_WINDOW_H
+
+#include <gtk/gtkwindow.h>
+
+#include "gnc-plugin-page.h"
+
+G_BEGIN_DECLS
+
+#define PLUGIN_PAGE_LABEL "plugin-page"
+
+/* type macros */
+#define GNC_TYPE_EMBEDDED_WINDOW            (gnc_embedded_window_get_type ())
+#define GNC_EMBEDDED_WINDOW(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_EMBEDDED_WINDOW, GncEmbeddedWindow))
+#define GNC_EMBEDDED_WINDOW_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_EMBEDDED_WINDOW, GncEmbeddedWindowClass))
+#define GNC_IS_EMBEDDED_WINDOW(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_EMBEDDED_WINDOW))
+#define GNC_IS_EMBEDDED_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_EMBEDDED_WINDOW))
+#define GNC_EMBEDDED_WINDOW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_EMBEDDED_WINDOW, GncEmbeddedWindowClass))
+
+/* typedefs & structures */
+typedef struct GncEmbeddedWindowPrivate GncEmbeddedWindowPrivate;
+
+typedef struct {
+	GtkVBox parent;
+
+	GncEmbeddedWindowPrivate *priv;
+
+	GtkUIManager   	 *ui_merge;
+} GncEmbeddedWindow;
+
+typedef struct {
+	GtkVBoxClass parent;
+} GncEmbeddedWindowClass;
+
+typedef struct gnc_embedded_window {
+	GtkUIManager   	 *ui_merge;
+	GtkActionGroup 	 *action_group;
+	GtkWidget        *main_vbox;
+	GtkWidget      	 *menu_dock;
+        GtkWidget      	 *toolbar_dock;
+} gnc_embedded_window;
+
+/* function prototypes */
+GType               gnc_embedded_window_get_type (void);
+
+GncEmbeddedWindow * gnc_embedded_window_new      (const gchar *action_group_name,
+						  GtkActionEntry *action_entries,
+						  gint n_action_entries,
+						  const gchar *ui_filename,
+						  GtkWidget *enclosing_win,
+						  gboolean add_accelerators,
+						  gpointer user_data);
+
+void            gnc_embedded_window_open_page    (GncEmbeddedWindow *window,
+						  GncPluginPage *page);
+void            gnc_embedded_window_close_page	 (GncEmbeddedWindow *window,
+						  GncPluginPage *page);
+GncPluginPage  *gnc_embedded_window_get_page     (GncEmbeddedWindow *window);
+
+G_END_DECLS
+
+#endif /* __GNC_EMBEDDED_WINDOW_H */
Index: Makefile.am
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome-utils/Makefile.am,v
retrieving revision 1.48.2.29
retrieving revision 1.48.2.30
diff -Lsrc/gnome-utils/Makefile.am -Lsrc/gnome-utils/Makefile.am -u -r1.48.2.29 -r1.48.2.30
--- src/gnome-utils/Makefile.am
+++ src/gnome-utils/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = . test
+SUBDIRS = . test ui
 PWD := $(shell pwd)
 
 pkglib_LTLIBRARIES = libgncmod-gnome-utils.la libgw-gnome-utils.la
@@ -55,29 +55,36 @@
   gnc-druid-provider-edge-gnome.c \
   gnc-druid-provider-file-gnome.c \
   gnc-druid-provider-multifile-gnome.c \
+  gnc-embedded-window.c \
   gnc-frequency.c \
   gnc-general-select.c \
   gnc-gnome-utils.c \
   gnc-gui-query.c \
-  gnc-html-history.c \
-  gnc-html-guppi.c \
   gnc-html-graph-gog.c \
+  gnc-html-guppi.c \
+  gnc-html-history.c \
   gnc-html.c \
   gnc-icons.c \
+  gnc-main-window.c \
   gnc-mdi-utils.c \
   gnc-menu-extensions.c \
+  gnc-plugin-manager.c \
+  gnc-plugin-menu-additions.c \
+  gnc-plugin-page.c \
+  gnc-plugin.c \
   gnc-query-list.c \
   gnc-splash.c \
-  gnc-tree-model-account.c \
   gnc-tree-model-account-types.c \
+  gnc-tree-model-account.c \
   gnc-tree-model-commodity.c \
   gnc-tree-model-example-account.c \
   gnc-tree-model-price.c \
   gnc-tree-model-selection.c \
-  gnc-tree-view.c \
   gnc-tree-view-account.c \
   gnc-tree-view-commodity.c \
   gnc-tree-view-price.c \
+  gnc-tree-view.c \
+  gnc-window.c \
   gncmod-gnome-utils.c \
   misc-gnome-utils.c \
   print-session.c \
@@ -95,9 +102,9 @@
   dialog-utils.h \
   druid-utils.h \
   gnc-account-sel.h \
+  gnc-amount-edit.h \
   gnc-budget-list-tree-model.h \
   gnc-budget-tree-model.h \
-  gnc-amount-edit.h \
   gnc-commodity-edit.h \
   gnc-currency-edit.h \
   gnc-date-delta.h \
@@ -105,29 +112,36 @@
   gnc-date-format.h \
   gnc-dense-cal.h \
   gnc-druid-gnome-ui.h \
+  gnc-embedded-window.h \
   gnc-frequency.h \
   gnc-general-select.h \
   gnc-gnome-utils.h \
   gnc-gui-query.h \
-  gnc-html-history.h \
-  gnc-html-guppi.h \
   gnc-html-graph-gog.h \
+  gnc-html-guppi.h \
+  gnc-html-history.h \
   gnc-html.h \
   gnc-icons.h \
+  gnc-main-window.h \
   gnc-mdi-utils.h \
   gnc-menu-extensions.h \
+  gnc-plugin-manager.h \
+  gnc-plugin-menu-additions.h \
+  gnc-plugin-page.h \
+  gnc-plugin.h \
   gnc-query-list.h \
   gnc-splash.h \
-  gnc-tree-model-account.h \
   gnc-tree-model-account-types.h \
+  gnc-tree-model-account.h \
   gnc-tree-model-commodity.h \
   gnc-tree-model-example-account.h \
   gnc-tree-model-price.h \
   gnc-tree-model-selection.h \
-  gnc-tree-view.h \
   gnc-tree-view-account.h \
   gnc-tree-view-commodity.h \
   gnc-tree-view-price.h \
+  gnc-tree-view.h \
+  gnc-window.h \
   misc-gnome-utils.h \
   print-session.h
 
--- /dev/null
+++ src/gnome-utils/gnc-plugin-manager.c
@@ -0,0 +1,213 @@
+/* 
+ * gnc-plugin-manager.c -- 
+ *
+ * Copyright (C) 2003 Jan Arne Petersen
+ * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, contact:
+ *
+ * Free Software Foundation           Voice:  +1-617-542-5942
+ * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
+ * Boston, MA  02111-1307,  USA       gnu at gnu.org
+ */
+
+#include "config.h"
+
+#include "gnc-plugin-manager.h"
+
+#include "messages.h"
+#include "gnc-trace.h"
+
+static short module = MOD_GUI;
+
+static void gnc_plugin_manager_class_init (GncPluginManagerClass *klass);
+static void gnc_plugin_manager_init (GncPluginManager *plugin);
+static void gnc_plugin_manager_finalize (GObject *object);
+
+struct GncPluginManagerPrivate
+{
+	GList *plugins;
+	GHashTable *plugins_table;
+};
+
+enum {
+	PLUGIN_ADDED,
+	PLUGIN_REMOVED,
+	LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+static GncPluginManager *singleton = NULL;
+
+static GObjectClass *parent_class = NULL;
+
+GType
+gnc_plugin_manager_get_type (void)
+{
+	static GType gnc_plugin_manager_type = 0;
+
+	if (gnc_plugin_manager_type == 0) {
+		static const GTypeInfo our_info = {
+			sizeof (GncPluginManagerClass),
+			NULL,
+			NULL,
+			(GClassInitFunc) gnc_plugin_manager_class_init,
+			NULL,
+			NULL,
+			sizeof (GncPluginManager),
+			0,
+			(GInstanceInitFunc) gnc_plugin_manager_init
+		};
+		
+		gnc_plugin_manager_type = g_type_register_static (G_TYPE_OBJECT,
+								  "GncPluginManager",
+								  &our_info, 0);
+	}
+
+	return gnc_plugin_manager_type;
+}
+
+GncPluginManager *
+gnc_plugin_manager_get (void)
+{
+	if (singleton == NULL) {
+		singleton = g_object_new (GNC_TYPE_PLUGIN_MANAGER,
+  					  NULL);
+	}
+
+	return singleton;
+}
+
+void
+gnc_plugin_manager_add_plugin (GncPluginManager *manager,
+			       GncPlugin *plugin)
+{
+	gint index;
+
+	ENTER (" ");
+	g_return_if_fail (GNC_IS_PLUGIN_MANAGER (manager));
+	g_return_if_fail (GNC_IS_PLUGIN (plugin));
+
+	index = g_list_index (manager->priv->plugins, plugin);
+
+	if (index >= 0)
+		return;
+
+	g_object_ref (plugin);
+
+	manager->priv->plugins = g_list_append (manager->priv->plugins, plugin);
+	g_hash_table_insert (manager->priv->plugins_table,
+			     g_strdup( GNC_PLUGIN_GET_CLASS(plugin)->plugin_name ),
+			     plugin);
+
+	g_signal_emit (G_OBJECT (manager), signals[PLUGIN_ADDED], 0, plugin);
+	LEAVE ("added %s to GncPluginManager", gnc_plugin_get_name(plugin));
+}
+
+void
+gnc_plugin_manager_remove_plugin (GncPluginManager *manager,
+				  GncPlugin *plugin)
+{
+	gint index;
+	
+	ENTER (" ");
+	g_return_if_fail (GNC_IS_PLUGIN_MANAGER (manager));
+	g_return_if_fail (GNC_IS_PLUGIN (plugin));
+
+	index = g_list_index (manager->priv->plugins, plugin);
+
+	if (index < 0)
+		return;
+
+	manager->priv->plugins = g_list_remove (manager->priv->plugins, plugin);
+	g_hash_table_remove (manager->priv->plugins_table,
+			     GNC_PLUGIN_GET_CLASS(plugin)->plugin_name);
+
+	g_signal_emit (G_OBJECT (manager), signals[PLUGIN_REMOVED], 0, plugin);
+
+	LEAVE ("removed %s from GncPluginManager", 
+	       gnc_plugin_get_name(plugin));
+	g_object_unref (plugin);
+}
+
+GList *
+gnc_plugin_manager_get_plugins (GncPluginManager *manager)
+{
+	g_return_val_if_fail (GNC_IS_PLUGIN_MANAGER (manager), NULL);
+	
+	return g_list_copy (manager->priv->plugins);
+}
+
+GncPlugin *
+gnc_plugin_manager_get_plugin (GncPluginManager *manager,
+			       const gchar *name)
+{
+	g_return_val_if_fail (GNC_IS_PLUGIN_MANAGER (manager), NULL);
+	g_return_val_if_fail (name != NULL, NULL);
+
+	return GNC_PLUGIN (g_hash_table_lookup (manager->priv->plugins_table, name));
+}
+
+
+static void
+gnc_plugin_manager_class_init (GncPluginManagerClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	parent_class = g_type_class_peek_parent (klass);
+
+	object_class->finalize = gnc_plugin_manager_finalize;
+
+	signals[PLUGIN_ADDED] = g_signal_new ("plugin-added",
+					      G_OBJECT_CLASS_TYPE (klass),
+					      G_SIGNAL_RUN_FIRST,
+					      G_STRUCT_OFFSET (GncPluginManagerClass, plugin_added),
+					      NULL, NULL,
+					      g_cclosure_marshal_VOID__POINTER,
+					      G_TYPE_NONE,
+					      1,
+					      GNC_TYPE_PLUGIN);
+	signals[PLUGIN_REMOVED] = g_signal_new ("plugin-removed",
+						G_OBJECT_CLASS_TYPE (klass),
+						G_SIGNAL_RUN_FIRST,
+						G_STRUCT_OFFSET (GncPluginManagerClass, plugin_removed),
+						NULL, NULL,
+						g_cclosure_marshal_VOID__POINTER,
+						G_TYPE_NONE,
+						1,
+						GNC_TYPE_PLUGIN);
+}
+
+static void
+gnc_plugin_manager_init (GncPluginManager *manager)
+{
+	manager->priv = g_new0 (GncPluginManagerPrivate, 1);
+
+	manager->priv->plugins_table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+}
+
+static void
+gnc_plugin_manager_finalize (GObject *object)
+{
+	GncPluginManager *manager = GNC_PLUGIN_MANAGER (object);
+
+	g_return_if_fail (GNC_IS_PLUGIN_MANAGER (manager));
+	g_return_if_fail (manager->priv != NULL);
+
+	g_list_free (manager->priv->plugins);
+	g_hash_table_destroy (manager->priv->plugins_table);
+	g_free (manager->priv);
+
+	G_OBJECT_CLASS (parent_class)->finalize (object);
+}
--- /dev/null
+++ src/gnome-utils/gnc-plugin-manager.h
@@ -0,0 +1,73 @@
+/* 
+ * gnc-plugin-manager.h -- Manage gnucash plugins.
+ *
+ * Copyright (C) 2003 Jan Arne Petersen
+ * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, contact:
+ *
+ * Free Software Foundation           Voice:  +1-617-542-5942
+ * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
+ * Boston, MA  02111-1307,  USA       gnu at gnu.org
+ */
+
+#ifndef __GNC_PLUGIN_MANAGER_H
+#define __GNC_PLUGIN_MANAGER_H
+
+#include "gnc-plugin.h"
+
+G_BEGIN_DECLS
+
+/* type macros */
+#define GNC_TYPE_PLUGIN_MANAGER            (gnc_plugin_manager_get_type ())
+#define GNC_PLUGIN_MANAGER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_MANAGER, GncPluginManager))
+#define GNC_PLUGIN_MANAGER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_MANAGER, GncPluginManagerClass))
+#define GNC_IS_PLUGIN_MANAGER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_MANAGER))
+#define GNC_IS_PLUGIN_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_MANAGER))
+#define GNC_PLUGIN_MANAGER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_MANAGER, GncPluginManagerClass))
+
+/* typedefs & structures */
+typedef struct GncPluginManagerPrivate GncPluginManagerPrivate;
+
+typedef struct {
+	GObject parent;
+
+	GncPluginManagerPrivate *priv;
+} GncPluginManager;
+
+typedef struct {
+	GObjectClass parent;
+
+	/* Signals */
+	void (* plugin_added) (GncPluginManager *plugin_manager, GncPlugin *plugin);
+	void (* plugin_removed) (GncPluginManager *plugin_manager, GncPlugin *plugin);
+} GncPluginManagerClass;
+
+/* function prototypes */
+GType             gnc_plugin_manager_get_type      (void);
+
+GncPluginManager *gnc_plugin_manager_get           (void);
+
+void              gnc_plugin_manager_add_plugin    (GncPluginManager *manager,
+						    GncPlugin *plugin);
+void		  gnc_plugin_manager_remove_plugin (GncPluginManager *manager,
+						    GncPlugin *plugin);
+
+GList            *gnc_plugin_manager_get_plugins   (GncPluginManager *manager);
+GncPlugin        *gnc_plugin_manager_get_plugin    (GncPluginManager *manager,
+						    const gchar *name);
+
+G_END_DECLS
+
+#endif /* __GNC_PLUGIN_MANAGER_H */
--- /dev/null
+++ src/gnome-utils/gnc-plugin-menu-additions.c
@@ -0,0 +1,396 @@
+/* 
+ * gnc-plugin-menu-additions.c -- 
+ * Copyright (C) 2005 David Hampton hampton at employees.org>
+ *
+ * From:
+ * gnc-menu-extensions.c -- functions to build dynamic menus
+ * Copyright (C) 1999 Rob Browning
+ *
+ * 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
+ */
+
+/** @addtogroup GUI
+    @{ */
+/** @addtogroup GuiImport Import GUI Utility functions.
+    @{ */
+/** @internal
+    @file gnc-plugin-menu-additions.c
+    @brief Utility functions for writing import modules.
+    @author Copyright (C) 2002 David Hampton <hampton at employees.org>
+*/
+
+#include "config.h"
+
+#include <string.h>
+#include <glib/gprintf.h>
+#include <libgnome/libgnome.h>
+#include <g-wrap-wct.h>
+
+#include "guile-util.h"
+#include "gnc-engine-util.h"
+#include "gnc-main-window.h"
+#include "gnc-plugin-menu-additions.h"
+#include "gnc-window.h"
+#include "gnc-trace.h"
+#include "messages.h"
+#include "gnc-gconf-utils.h"
+#include "gnc-ui.h"
+#include "gnc-menu-extensions.h"
+
+static GList *active_plugins = NULL;
+static GObjectClass *parent_class = NULL;
+
+static void gnc_plugin_menu_additions_class_init (GncPluginMenuAdditionsClass *klass);
+static void gnc_plugin_menu_additions_init (GncPluginMenuAdditions *plugin);
+static void gnc_plugin_menu_additions_finalize (GObject *object);
+
+static void gnc_plugin_menu_additions_add_to_window (GncPlugin *plugin, GncMainWindow *window, GQuark type);
+static void gnc_plugin_menu_additions_remove_from_window (GncPlugin *plugin, GncMainWindow *window, GQuark type);
+
+/* Callbacks on other objects */
+static void gnc_plugin_menu_additions_main_window_page_changed (GncMainWindow *window,
+								GncPluginPage *page);
+
+/* Command callbacks */
+
+/* This static indicates the debugging module that this .o belongs to.  */
+static short module = MOD_GUI;
+
+
+#define PLUGIN_ACTIONS_NAME "gnc-plugin-menu-additions-actions"
+
+struct GncPluginMenuAdditionsPrivate
+{
+  gpointer dummy;
+};
+
+typedef struct _GncPluginMenuAdditionsPerWindow
+{
+  GncMainWindow  *window;
+  GtkUIManager   *ui_manager;
+  GtkActionGroup *group;
+  gint merge_id;
+} GncPluginMenuAdditionsPerWindow;
+
+/************************************************************
+ *                  Object Implementation                   *
+ ************************************************************/
+
+GType
+gnc_plugin_menu_additions_get_type (void)
+{
+  static GType gnc_plugin_menu_additions_type = 0;
+
+  if (gnc_plugin_menu_additions_type == 0) {
+    static const GTypeInfo our_info = {
+      sizeof (GncPluginMenuAdditionsClass),
+      NULL,		/* base_init */
+      NULL,		/* base_finalize */
+      (GClassInitFunc) gnc_plugin_menu_additions_class_init,
+      NULL,		/* class_finalize */
+      NULL,		/* class_data */
+      sizeof (GncPluginMenuAdditions),
+      0,
+      (GInstanceInitFunc) gnc_plugin_menu_additions_init
+    };
+
+    gnc_plugin_menu_additions_type = g_type_register_static (GNC_TYPE_PLUGIN,
+							 "GncPluginMenuAdditions",
+							 &our_info, 0);
+  }
+
+  return gnc_plugin_menu_additions_type;
+}
+
+#if DEBUG_REFERENCE_COUNTING
+static void
+dump_model (GncPluginMenuAdditions *plugin, gpointer dummy)
+{
+  g_warning("GncPluginMenuAdditions %p still exists.", plugin);
+}
+
+static gint
+gnc_plugin_menu_additions_report_references (void)
+{
+  g_list_foreach(active_plugins, (GFunc)dump_model, NULL);
+  return 0;
+}
+#endif
+
+static void
+gnc_plugin_menu_additions_class_init (GncPluginMenuAdditionsClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+  GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass);
+
+  parent_class = g_type_class_peek_parent (klass);
+
+  object_class->finalize = gnc_plugin_menu_additions_finalize;
+
+  /* plugin info */
+  plugin_class->plugin_name   = GNC_PLUGIN_MENU_ADDITIONS_NAME;
+
+  /* function overrides */
+  plugin_class->add_to_window = gnc_plugin_menu_additions_add_to_window;
+  plugin_class->remove_from_window = gnc_plugin_menu_additions_remove_from_window;
+
+#if DEBUG_REFERENCE_COUNTING
+  gtk_quit_add (0,
+		(GtkFunction)gnc_plugin_menu_additions_report_references,
+		NULL);
+#endif
+}
+
+static void
+gnc_plugin_menu_additions_init (GncPluginMenuAdditions *plugin)
+{
+  ENTER("plugin %p", plugin);
+  plugin->priv = g_new0 (GncPluginMenuAdditionsPrivate, 1);
+
+  active_plugins = g_list_append (active_plugins, plugin);
+  LEAVE("");
+}
+
+static void
+gnc_plugin_menu_additions_finalize (GObject *object)
+{
+  GncPluginMenuAdditions *plugin;
+
+  g_return_if_fail (GNC_IS_PLUGIN_MENU_ADDITIONS (object));
+
+  plugin = GNC_PLUGIN_MENU_ADDITIONS (object);
+  ENTER("plugin %p", plugin);
+  active_plugins = g_list_remove (active_plugins, plugin);
+
+  g_return_if_fail (plugin->priv != NULL);
+  g_free (plugin->priv);
+
+  G_OBJECT_CLASS (parent_class)->finalize (object);
+  LEAVE("");
+}
+
+GncPlugin *
+gnc_plugin_menu_additions_new (void)
+{
+  GncPlugin *plugin_page = NULL;
+
+  ENTER("");
+  plugin_page = GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_MENU_ADDITIONS, NULL));
+  LEAVE("plugin %p", plugin_page);
+  return plugin_page;
+}
+
+/************************************************************
+ *              Plugin Function Implementation              *
+ ************************************************************/
+
+static SCM
+gnc_main_window_to_scm (GncMainWindow *window)
+{
+  static SCM main_window_type = SCM_UNDEFINED;
+
+  if (!window)
+    return SCM_BOOL_F;
+
+  if (main_window_type == SCM_UNDEFINED)
+  {
+    main_window_type = scm_c_eval_string ("<gnc:MainWindow*>");
+
+    /* don't really need this - types are bound globally anyway. */
+    if (main_window_type != SCM_UNDEFINED)
+      scm_gc_protect_object (main_window_type);
+  }
+  
+  return gw_wcp_assimilate_ptr ((void *)window, main_window_type);
+}
+
+/** The user has selected one of the items in the File History menu.
+ *  Close down the current session and start up a new one with the
+ *  requested file.
+ *
+ *  @param action A pointer to the action selected by the user.  This
+ *  action represents one of the items in the file history menu.
+ *
+ *  @param data A pointer to the gnc-main-window data to be used by
+ *  this function.  This is mainly to find out which window it was
+ *  that had a menu selected.  That's not really important for this
+ *  function and we're about to close all the windows anyway.
+ */
+static void
+gnc_plugin_menu_additions_action_cb (GtkAction *action,
+				     GncMainWindowActionData *data)
+{
+
+  g_return_if_fail(GTK_IS_ACTION(action));
+  g_return_if_fail(data != NULL);
+
+  gnc_extension_invoke_cb(data->data, gnc_main_window_to_scm(data->window));
+}
+
+static void
+gnc_menu_additions_menu_setup_one (ExtensionInfo *ext_info,
+				   GncPluginMenuAdditionsPerWindow *per_window)
+{
+  GncMainWindowActionData *cb_data;
+
+  DEBUG( "Adding %s/%s [%s] as [%s]\n", ext_info->path, ext_info->ae.label,
+	 ext_info->ae.name, ext_info->typeStr );
+
+  cb_data = g_new0 (GncMainWindowActionData, 1);
+  cb_data->window = per_window->window;
+  cb_data->data = ext_info->extension;
+
+  if (ext_info->type == GTK_UI_MANAGER_MENUITEM)
+    ext_info->ae.callback = (GCallback)gnc_plugin_menu_additions_action_cb;
+
+  gtk_action_group_add_actions_full(per_window->group, &ext_info->ae, 1,
+				    cb_data, g_free);
+  gtk_ui_manager_add_ui(per_window->ui_manager, per_window->merge_id,
+			ext_info->path, ext_info->ae.label, ext_info->ae.name,
+			ext_info->type, FALSE);
+  gtk_ui_manager_ensure_update(per_window->ui_manager);
+}
+
+/** Initialize the file history menu for a window.  This function is
+ *  called as part of the initialization of a window, after all the
+ *  plugin menu items have been added to the menu structure.  Its job
+ *  is to correctly initialize the file history menu.  It does this by
+ *  first calling a function that initializes the menu to the current
+ *  as maintained in gconf.  It then creates a gconf client that will
+ *  listens for any changes to the file history menu, and will update
+ *  the meny when they are signalled.
+ *
+ *  @param plugin A pointer to the gnc-plugin object responsible for
+ *  adding/removing the file history menu.
+ *
+ *  @param window A pointer the gnc-main-window that is being initialized.
+ *
+ *  @param type Unused
+ */
+static void
+gnc_plugin_menu_additions_add_to_window (GncPlugin *plugin,
+					 GncMainWindow *window,
+					 GQuark type)
+{
+  GncPluginMenuAdditionsPerWindow per_window;
+  GSList *menu_list;
+
+  ENTER(" ");
+
+  g_signal_connect (G_OBJECT(window), "page_changed",
+		    G_CALLBACK (gnc_plugin_menu_additions_main_window_page_changed),
+		    plugin);
+
+  per_window.window = window;
+  per_window.ui_manager = window->ui_merge;
+  per_window.group = gtk_action_group_new ("MenuAdditions" );
+  per_window.merge_id = gtk_ui_manager_new_merge_id(window->ui_merge);
+  gtk_ui_manager_insert_action_group(window->ui_merge, per_window.group, 0);
+
+  menu_list = gnc_extensions_get_menu_list();
+  g_slist_foreach(menu_list, (GFunc)gnc_menu_additions_menu_setup_one,
+		  &per_window);
+
+  /* Tell the window code about the actions that were just added
+   * behind its back (so to speak) */
+  gnc_main_window_manual_merge_actions (window, PLUGIN_ACTIONS_NAME,
+					per_window.group, per_window.merge_id);
+
+  LEAVE(" ");
+}
+
+
+/** Finalize the file history menu for this window.  This function is
+ *  called as part of the destruction of a window.
+ *
+ *  @param plugin A pointer to the gnc-plugin object responsible for
+ *  adding/removing the file history menu.  It stops the gconf
+ *  notifications for this window, and destroys the gconf client
+ *  object.
+ *
+ *  @param window A pointer the gnc-main-window that is being destroyed.
+ *
+ *  @param type Unused
+ */
+static void
+gnc_plugin_menu_additions_remove_from_window (GncPlugin *plugin,
+					      GncMainWindow *window,
+					      GQuark type)
+{
+  GtkActionGroup *group;
+
+  ENTER(" ");
+
+  g_signal_handlers_disconnect_by_func(G_OBJECT(window),
+				       G_CALLBACK (gnc_plugin_menu_additions_main_window_page_changed),
+				       plugin);
+
+  /* Have to remove our actions manually. Its only automatic if the
+   * actions name is installed into the plugin class. */
+  group = gnc_main_window_get_action_group(window, PLUGIN_ACTIONS_NAME);
+  if (group)
+    gtk_ui_manager_remove_action_group(window->ui_merge, group);
+
+  LEAVE(" ");
+}
+
+/************************************************************
+ *                     Object Callbacks                     *
+ ************************************************************/
+
+static void
+our_gtk_action_set_visible(GtkAction *action, gboolean visible)
+{
+  g_object_set(G_OBJECT(action), "visible", visible, NULL);
+}
+
+
+/** Whenever the current page has changed, update the reports menus based
+ *  upon the page that is currently selected. */
+static void
+gnc_plugin_menu_additions_main_window_page_changed (GncMainWindow *window,
+						    GncPluginPage *page)
+{
+  GtkActionGroup *action_group;
+  GList *action_list;
+  gboolean visible;
+  gpointer tmp;
+
+  ENTER("main window %p, page %p", window, page);
+  action_group = gnc_main_window_get_action_group(window,PLUGIN_ACTIONS_NAME);
+  if (action_group == NULL) {
+    LEAVE("Can't find action group");
+    return;
+  }
+
+  /* Does the now-visible page want menu-extensions to be visible? */
+  if (page) {
+    tmp = g_object_get_data(G_OBJECT(page),GNC_PLUGIN_HIDE_MENU_ADDITIONS_NAME);
+    visible = !GPOINTER_TO_INT(tmp);
+  } else {
+    visible = TRUE;
+  }
+
+  action_list = gtk_action_group_list_actions(action_group);
+  // Use the following line for gtk2.6
+  // g_list_foreach(action_list, (GFunc)gtk_action_set_visible, (gpointer)visible);
+  g_list_foreach(action_list, (GFunc)our_gtk_action_set_visible, (gpointer)visible);
+  g_list_free(action_list);
+
+  LEAVE(" ");
+}
--- /dev/null
+++ src/gnome-utils/gnc-plugin-page.h
@@ -0,0 +1,131 @@
+/* 
+ * gnc-plugin-page.h -- A page, which can be added to the
+ *	GnuCash main window.
+ *
+ * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
+ * Copyright (C) 2003,2005 David Hampton <hampton at employees.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, contact:
+ *
+ * Free Software Foundation           Voice:  +1-617-542-5942
+ * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
+ * Boston, MA  02111-1307,  USA       gnu at gnu.org
+ */
+
+#ifndef __GNC_PLUGIN_PAGE_H
+#define __GNC_PLUGIN_PAGE_H
+
+#include "guid.h"
+#include "qofbook.h"
+
+G_BEGIN_DECLS
+
+/* type macros */
+#define GNC_TYPE_PLUGIN_PAGE            (gnc_plugin_page_get_type ())
+#define GNC_PLUGIN_PAGE(o)              (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_PLUGIN_PAGE, GncPluginPage))
+#define GNC_PLUGIN_PAGE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_PAGE, GncPluginPageClass))
+#define GNC_IS_PLUGIN_PAGE(o)           (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_PLUGIN_PAGE))
+#define GNC_IS_PLUGIN_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_PAGE))
+#define GNC_PLUGIN_PAGE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_PLUGIN_PAGE, GncPluginPageClass))
+
+/* typedefs & structures */
+typedef struct GncPluginPagePrivate GncPluginPagePrivate;
+
+typedef struct GncPluginPage {
+	GObject parent;
+	GncPluginPagePrivate *priv;
+
+	GtkWidget *window;
+	GtkWidget *notebook_page;
+	GtkWidget *summarybar;
+
+	gchar *title;
+	gchar *tab_name;
+	gchar *uri;
+
+	gchar *statusbar_text;
+} GncPluginPage;
+
+typedef struct {
+	GObjectClass parent;
+
+	const gchar *tab_icon;
+	const gchar *plugin_name;
+
+	/* Signals */
+	void (* inserted) (GncPluginPage *plugin_page);
+	void (* removed) (GncPluginPage *plugin_page);
+	void (* selected) (GncPluginPage *plugin_page);
+	void (* unselected) (GncPluginPage *plugin_page);
+
+	/* Virtual Table */
+	GtkWidget *(* create_widget) (GncPluginPage *plugin_page);
+	void (* destroy_widget) (GncPluginPage *plugin_page);
+
+	void (* merge_actions) (GncPluginPage *plugin_page, GtkUIManager *merge);
+	void (* unmerge_actions) (GncPluginPage *plugin_page, GtkUIManager *merge);
+} GncPluginPageClass;
+
+/* function prototypes */
+GType                 gnc_plugin_page_get_type        (void);
+
+GtkWidget            *gnc_plugin_page_create_widget   (GncPluginPage *plugin_page);
+void                  gnc_plugin_page_destroy_widget  (GncPluginPage *plugin_page);
+
+void                  gnc_plugin_page_merge_actions   (GncPluginPage *plugin_page,
+                                                       GtkUIManager *merge);
+void                  gnc_plugin_page_unmerge_actions (GncPluginPage *plugin_page,
+                                                       GtkUIManager *merge);
+
+const gchar *         gnc_plugin_page_get_name        (GncPluginPage *plugin_page);
+
+/** Add a book reference to the specified page.
+ *
+ *  @param page The page to be modified.
+ *
+ *  @param book The book referenced by this page.
+ */
+void gnc_plugin_page_add_book (GncPluginPage *page, QofBook *book);
+
+/** Query a page to see if it has a reference to a given book.  This
+ *  function takes a guid instead of a QofBook because that's what the
+ *  engine event mechanism provides.
+ *
+ *  @param page The page to query.
+ *
+ *  @param book The guid of the book in question.
+ *
+ *  @return TRUE if the page refers to the specified book. FALSE
+ *  otherwise.
+ */
+gboolean              gnc_plugin_page_has_book        (GncPluginPage *page, GUID *book);
+
+/** Query a page to see if it has a reference to any book.
+ *
+ *  @param page The page to query.
+ *
+ *  @return TRUE if the page references any books. FALSE otherwise.
+ */
+gboolean              gnc_plugin_page_has_books       (GncPluginPage *page);
+
+
+/* Signals */
+void                  gnc_plugin_page_inserted        (GncPluginPage *plugin_page);
+void                  gnc_plugin_page_removed         (GncPluginPage *plugin_page);
+void                  gnc_plugin_page_selected        (GncPluginPage *plugin_page);
+void                  gnc_plugin_page_unselected      (GncPluginPage *plugin_page);
+
+G_END_DECLS
+
+#endif /* __GNC_PLUGIN_PAGE_H */
--- /dev/null
+++ src/gnome-utils/gnc-window.c
@@ -0,0 +1,177 @@
+/* 
+ * gnc-window.c -- structure which represents a GnuCash window.
+ *
+ * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
+ * Copyright (C) 2003 David Hampton <hampton at employees.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, contact:
+ *
+ * Free Software Foundation           Voice:  +1-617-542-5942
+ * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
+ * Boston, MA  02111-1307,  USA       gnu at gnu.org
+ */
+
+#include "config.h"
+
+#include <gtk/gtk.h>
+
+#include "gnc-trace.h"
+#include "gnc-mdi-utils.h"
+#include "gnc-plugin-page.h"
+#include "gnc-window.h"
+
+static short module = MOD_GUI;
+
+GType
+gnc_window_get_type (void)
+{
+  static GType gnc_window_type = 0;
+
+  if (gnc_window_type == 0) {
+    static const GTypeInfo our_info = {
+      sizeof (GncWindowIface),
+      NULL,
+      NULL,
+      NULL,
+      NULL,
+      NULL,
+      0,
+      0,
+      NULL
+    };
+
+    gnc_window_type = g_type_register_static (G_TYPE_INTERFACE,
+					      "GncWindow",
+					      &our_info, 0);
+    g_type_interface_add_prerequisite (gnc_window_type, G_TYPE_OBJECT);
+
+    gnc_mdi_set_progress_handler (gnc_window_show_progress);
+  }
+
+  return gnc_window_type;
+}
+
+/************************************************************
+ *                Interface access functions                *
+ ************************************************************/
+
+static GtkWidget *
+gnc_window_get_statusbar (GncWindow *window)
+{
+  g_return_val_if_fail(GNC_WINDOW (window), NULL);
+
+  /* mandatory */
+  g_return_val_if_fail(GNC_WINDOW_GET_IFACE (window)->get_statusbar, NULL);
+
+  return GNC_WINDOW_GET_IFACE (window)->get_statusbar (window);
+}
+
+static GtkWidget *
+gnc_window_get_progressbar (GncWindow *window)
+{
+  g_return_val_if_fail(GNC_WINDOW (window), NULL);
+
+  /* optional */
+  if (GNC_WINDOW_GET_IFACE (window)->get_progressbar == NULL)
+    return NULL;
+
+  return GNC_WINDOW_GET_IFACE (window)->get_progressbar (window);
+}
+
+/************************************************************
+ *              Auxiliary status bar functions              *
+ ************************************************************/
+
+void
+gnc_window_update_status (GncWindow *window, GncPluginPage *page)
+{
+  GtkWidget *statusbar;
+
+  g_return_if_fail(GNC_WINDOW (window));
+
+  statusbar = gnc_window_get_statusbar (window);
+  gtk_statusbar_pop(GTK_STATUSBAR(statusbar), 0);
+  gtk_statusbar_push(GTK_STATUSBAR(statusbar), 0,
+		     page->statusbar_text ? page->statusbar_text : "");
+}
+
+void
+gnc_window_set_status (GncWindow *window, GncPluginPage *page, const gchar *message)
+{
+  g_return_if_fail(GNC_WINDOW (window));
+  g_return_if_fail(GNC_PLUGIN_PAGE (page));
+
+  if (page->statusbar_text)
+    g_free(page->statusbar_text);
+  page->statusbar_text = g_strdup(message ? message : "");
+
+  gnc_window_update_status (window, page);
+}
+
+/************************************************************
+ *             Auxiliary progress bar functions             *
+ ************************************************************/
+
+/*
+ * Single threaded hack.  Otherwise the window value has to be passed
+ * all the way down to the backend and then back out again.  Not too
+ * bad from C, but also has to be done in Scheme.
+ */
+static GncWindow *progress_bar_hack_window = NULL;
+
+/*
+ * Must be set to a valid window or to NULL (no window).
+ */
+void
+gnc_window_set_progressbar_window (GncWindow *window)
+{
+  if (window != NULL) {
+    g_return_if_fail(GNC_WINDOW (window));
+  }
+
+  progress_bar_hack_window = window;
+}
+
+void
+gnc_window_show_progress (const char *message, double percentage)
+{
+  GncWindow *window;
+  GtkWidget *progressbar;
+
+  window = progress_bar_hack_window;
+  if (window == NULL) {
+    DEBUG( "no [progress_bar_hack]window" );
+    return;
+  }
+
+  progressbar = gnc_window_get_progressbar (window);
+  if (progressbar == NULL) {
+    DEBUG( "no progressbar in hack-window" );
+    return;
+  }
+
+  if (percentage < 0) {
+    gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progressbar), NULL);
+    gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progressbar), 0.0);
+  } else {
+    if (message)
+      gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progressbar), message);
+    gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progressbar), percentage/100);
+  }
+
+  /* make sure new text is up */
+  while (gtk_events_pending ())
+    gtk_main_iteration ();
+}
+
Index: gnc-ui.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnc-ui.h,v
retrieving revision 1.30.4.7
retrieving revision 1.30.4.8
diff -Lsrc/gnc-ui.h -Lsrc/gnc-ui.h -u -r1.30.4.7 -r1.30.4.8
--- src/gnc-ui.h
+++ src/gnc-ui.h
@@ -28,10 +28,6 @@
 #include "gnc-pricedb.h"
 
 
-/* Temporary workaround until restructuring is done. */
-typedef struct GncWindow GncWindow;
-typedef struct GncMainWindow GncMainWindow;
-
 /** Help Files ******************************************************/
 #define HF_USAGE             "gnucash-help/usage.html"
 #define HF_CUSTOM            "gnucash-help/custom-gnucash.html"
--- /dev/null
+++ src/gnome-utils/ui/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
--- /dev/null
+++ src/gnome-utils/ui/Makefile.am
@@ -0,0 +1,5 @@
+uidir = $(GNC_UI_DIR)
+ui_DATA = \
+	gnc-main-window-ui.xml
+
+EXTRA_DIST = $(ui_DATA)
--- /dev/null
+++ src/gnome-utils/ui/gnc-main-window-ui.xml
@@ -0,0 +1,86 @@
+<ui>
+  <menubar>
+    <menu name="File" action="FileAction">
+      <placeholder name="FileNewPlaceholder"/>
+      <separator name="FileSep1"/>
+      <placeholder name="FileOpenPlaceholder"/>
+      <menuitem name="FileOpenNewWindow" action="FileOpenNewWindowAction"/>
+      <placeholder name="FileOpenRecentPlaceholder"/>
+      <separator name="FileSep2"/>
+      <placeholder name="FileSavePlaceholder"/>
+      <separator name="FileSep3"/>
+      <menu name="FileImport" action="FileImportAction">
+        <placeholder name="FileImportPlaceholder"/>
+      </menu>
+      <menu name="FileExport" action="FileExportAction">
+        <placeholder name="FileExportPlaceholder"/>
+      </menu>
+      <separator name="FileSep4"/>
+      <menuitem name="FilePrint" action="FilePrintAction"/>
+      <placeholder name="FilePrintPlaceholder"/>
+      <separator name="FileSep5"/>
+      <menuitem name="FileProperties" action="FilePropertiesAction"/>
+      <separator name="FileSep6"/>
+      <menuitem name="FileClose" action="FileCloseAction"/>
+      <menuitem name="FileQuit" action="FileQuitAction"/>
+    </menu>
+  
+    <menu name="Edit" action="EditAction">
+      <menuitem name="EditCut" action="EditCutAction"/>
+      <menuitem name="EditCopy" action="EditCopyAction"/>
+      <menuitem name="EditPaste" action="EditPasteAction"/>
+      <separator name="EditSep1"/>
+      <placeholder name="EditPlaceholder"/>
+      <menuitem name="EditPreferences" action="EditPreferencesAction"/>
+      <placeholder name="EditPreferencesPlaceholder"/>
+      <placeholder name="EditStyleSheetsPlaceholder"/>
+    </menu>
+  
+    <menu name="View" action="ViewAction">
+      <menuitem name="ViewRefresh" action="ViewRefreshAction"/>
+      <separator name="ViewSep1"/>
+      <menuitem name="ViewToolbar" action="ViewToolbarAction"/>
+      <menuitem name="ViewSummary" action="ViewSummaryAction"/>
+      <menuitem name="ViewStatusbar" action="ViewStatusbarAction"/>
+      <separator name="ViewSep2"/>
+      <placeholder name="ViewPlaceholder"/>
+    </menu>
+  
+    <menu name="Actions" action="ActionsAction">
+      <placeholder name="ActionsPlaceholder"/>
+    </menu>
+  
+    <placeholder name="AdditionalMenusPlaceholder"/>
+
+    <menu name="Reports" action="ReportsAction">
+      <placeholder name="ReportsPlaceholder"/>
+    </menu>
+
+    <menu name="Tools" action="ToolsAction">
+      <placeholder name="ToolsPlaceholder"/>
+    </menu>
+
+    <menu name="Extensions" action="ExtensionsAction">
+      <placeholder name="ExtensionsPlaceholder"/>
+    </menu>
+
+    <menu name="Help" action="HelpAction">
+      <menuitem name="HelpTutorial" action="HelpTutorialAction"/>
+      <placeholder name="HelpPlaceholder1"/>
+      <menuitem name="HelpContents" action="HelpContentsAction"/>
+      <menuitem name="HelpAbout" action="HelpAboutAction"/>
+    </menu>
+
+    <menu name="Misc" action="MiscAction">
+      <menuitem name="MiscTest" action="MiscTestAction"/>
+    </menu>
+
+  </menubar>
+
+  <toolbar name="DefaultToolbar">
+    <placeholder name="ToolbarSavePlaceholder"/>
+    <toolitem name="ToolbarClose" action="FileCloseAction"/>
+    <separator name="ToolbarSep1"/>
+    <placeholder name="DefaultToolbarPlaceholder"/>
+  </toolbar>
+</ui>
--- src/gnome/gnc-plugin-page.c
+++ /dev/null
@@ -1,333 +0,0 @@
-/* 
- * gnc-plugin_page.c -- 
- *
- * Copyright (C) 2003 Jan Arne Petersen
- * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
- * Copyright (C) 2003,2005 David Hampton <hampton at employees.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, contact:
- *
- * Free Software Foundation           Voice:  +1-617-542-5942
- * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
- * Boston, MA  02111-1307,  USA       gnu at gnu.org
- */
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-#include "gnc-plugin-page.h"
-
-static gpointer         parent_class = NULL;
-
-static void gnc_plugin_page_class_init (GncPluginPageClass *klass);
-static void gnc_plugin_page_init       (GncPluginPage *plugin_page);
-static void gnc_plugin_page_finalize   (GObject *object);
-
-enum {
-	INSERTED,
-	REMOVED,
-	SELECTED,
-	UNSELECTED,
-	LAST_SIGNAL
-};
-
-static guint signals[LAST_SIGNAL] = { 0 };
-
-struct GncPluginPagePrivate
-{
-	GList *books;
-};
-
-GType
-gnc_plugin_page_get_type (void)
-{
-	static GType gnc_plugin_page_type = 0;
-
-	if (gnc_plugin_page_type == 0) {
-		static const GTypeInfo our_info = {
-
-			sizeof (GncPluginPageClass),
-			NULL,		/* base_init */
-			NULL,		/* base_finalize */
-			(GClassInitFunc) gnc_plugin_page_class_init,
-			NULL,		/* class_finalize */
-			NULL,		/* class_data */
-			sizeof (GncPluginPage),
-			0,		/* n_preallocs */
-			(GInstanceInitFunc) gnc_plugin_page_init,
-		};
-
-		gnc_plugin_page_type = g_type_register_static (G_TYPE_OBJECT,
-							       "GncPluginPage",
-    							       &our_info, 0);
-	}
-
-	return gnc_plugin_page_type;
-}
-
-GtkWidget *
-gnc_plugin_page_create_widget (GncPluginPage *plugin_page)
-{
-	GncPluginPageClass *klass;
-	GtkWidget *widget;
-
-	g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page), NULL);
-
-	klass = GNC_PLUGIN_PAGE_GET_CLASS (plugin_page);
-	g_return_val_if_fail (klass != NULL, NULL);
-	g_return_val_if_fail (klass->create_widget != NULL, NULL);
-
-	widget = klass->create_widget (plugin_page);
-
-	/*
-	 * If there is a destroy function, add a ref so that the
-	 * widgets will exists when the destroy function is called.
-	 * Otherwise it will be destroyed when it is removed from the
-	 * main notebook for the window.
-	 */
-	if (klass->destroy_widget)
-		g_object_ref(widget);
-
-	return widget;
-}
-
-void
-gnc_plugin_page_destroy_widget (GncPluginPage *plugin_page)
-{
-	GncPluginPageClass *klass;
-
-	g_return_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page));
-
-	klass = GNC_PLUGIN_PAGE_GET_CLASS (plugin_page);
-	g_return_if_fail (klass != NULL);
-	g_return_if_fail (klass->destroy_widget != NULL);
-
-	return klass->destroy_widget (plugin_page);
-}
-
-void
-gnc_plugin_page_merge_actions (GncPluginPage *plugin_page,
-			       GtkUIManager *ui_merge)
-{
-	GncPluginPageClass *klass;
-
-	g_return_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page));
-
-	klass = GNC_PLUGIN_PAGE_GET_CLASS (plugin_page);
-	g_return_if_fail (klass != NULL);
-	g_return_if_fail (klass->merge_actions != NULL);
-
-	klass->merge_actions (plugin_page, ui_merge);
-}
-
-void
-gnc_plugin_page_unmerge_actions (GncPluginPage *plugin_page,
-				 GtkUIManager *ui_merge)
-{
-	GncPluginPageClass *klass;
-
-	g_return_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page));
-
-	klass = GNC_PLUGIN_PAGE_GET_CLASS (plugin_page);
-	g_return_if_fail (klass != NULL);
-	g_return_if_fail (klass->unmerge_actions != NULL);
-
-	klass->unmerge_actions (plugin_page, ui_merge);
-}
-
-const gchar *
-gnc_plugin_page_get_name (GncPluginPage *plugin_page)
-{
-	GncPluginPageClass *klass;
-
-	g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page), NULL);
-
-	klass = GNC_PLUGIN_PAGE_GET_CLASS (plugin_page);
-	g_return_val_if_fail (klass != NULL, NULL);
-
-	return (klass->plugin_name);
-}
-
-
-/* Signals */
-void
-gnc_plugin_page_inserted (GncPluginPage *plugin_page)
-{
-	g_return_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page));
-
-	g_signal_emit (G_OBJECT (plugin_page), signals[INSERTED], 0);
-}
-
-void
-gnc_plugin_page_removed (GncPluginPage *plugin_page)
-{
-	g_return_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page));
-
-	g_signal_emit (G_OBJECT (plugin_page), signals[REMOVED], 0);
-}
-
-void
-gnc_plugin_page_selected (GncPluginPage *plugin_page)
-{
-	g_return_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page));
-
-	g_signal_emit (G_OBJECT (plugin_page), signals[SELECTED], 0);
-}
-
-void
-gnc_plugin_page_unselected (GncPluginPage *plugin_page)
-{
-	g_return_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page));
-
-	g_signal_emit (G_OBJECT (plugin_page), signals[UNSELECTED], 0);
-}
-
-static void
-gnc_plugin_page_class_init (GncPluginPageClass *klass)
-{
-	GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-
-	parent_class = g_type_class_peek_parent (klass);
-	gobject_class->finalize = gnc_plugin_page_finalize;
-
-	klass->tab_icon    = NULL;
-	klass->plugin_name = NULL;
-
- 	signals[INSERTED] = g_signal_new ("inserted",
-					  G_OBJECT_CLASS_TYPE (klass),
-					  G_SIGNAL_RUN_FIRST,
-					  G_STRUCT_OFFSET (GncPluginPageClass, inserted),
-					  NULL, NULL,
-					  g_cclosure_marshal_VOID__VOID,
-					  G_TYPE_NONE,
-					  0);
-	signals[REMOVED] = g_signal_new ("removed",
-					 G_OBJECT_CLASS_TYPE (klass),
-					 G_SIGNAL_RUN_FIRST,
-					 G_STRUCT_OFFSET (GncPluginPageClass, removed),
-					 NULL, NULL,
-					 g_cclosure_marshal_VOID__VOID,
-					 G_TYPE_NONE,
-					 0);
-	signals[SELECTED] = g_signal_new ("selected",
-					  G_OBJECT_CLASS_TYPE (klass),
-					  G_SIGNAL_RUN_FIRST,
-					  G_STRUCT_OFFSET (GncPluginPageClass, inserted),
-					  NULL, NULL,
-					  g_cclosure_marshal_VOID__VOID,
-					  G_TYPE_NONE,
-					  0);
-	signals[UNSELECTED] = g_signal_new ("unselected",
-					    G_OBJECT_CLASS_TYPE (klass),
-					    G_SIGNAL_RUN_FIRST,
-					    G_STRUCT_OFFSET (GncPluginPageClass, removed),
-					    NULL, NULL,
-					    g_cclosure_marshal_VOID__VOID,
-					    G_TYPE_NONE,
-					    0);
-}
-
-static void
-gnc_plugin_page_init (GncPluginPage *plugin_page)
-{
-	GncPluginPagePrivate *priv;
-
-	priv = plugin_page->priv = g_new0 (GncPluginPagePrivate, 1);
-
-	plugin_page->title       = NULL;
-	plugin_page->tab_name    = NULL;
-	plugin_page->uri         = NULL;
-
-	plugin_page->window      = NULL;
-	plugin_page->summarybar  = NULL;
-}
-
-static void
-gnc_plugin_page_finalize (GObject *object)
-{
-  GncPluginPagePrivate *priv;
-  GncPluginPage *page;
-  GList *item;
-
-  page = GNC_PLUGIN_PAGE (object);
-  if (page->statusbar_text)
-    g_free (page->statusbar_text);
-  if (page->title)
-	g_free(page->title);
-  if (page->tab_name)
-	g_free(page->tab_name);
-  if (page->uri)
-	g_free(page->uri);
-
-  priv = page->priv;
-  if (priv->books) {
-    for (item = priv->books; item; item = g_list_next(item)) {
-      guid_free (item->data);
-    }
-    g_list_free(priv->books);
-    priv->books = NULL;
-  }
-  g_free (priv);
-  page->priv = NULL;
-
-  if (page->summarybar) {
-    g_object_unref(G_OBJECT(page->summarybar));
-    page->summarybar = NULL;
-  }
-  page->window = NULL; // Don't need to free it.
-
-  G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-void
-gnc_plugin_page_add_book (GncPluginPage *page, QofBook *book)
-{
-  GncPluginPagePrivate *priv;
-  GUID *guid;
-
-  g_return_if_fail (GNC_IS_PLUGIN_PAGE (page));
-  g_return_if_fail (book != NULL);
-
-  priv = page->priv;
-
-  guid = guid_malloc();
-  *guid = *qof_book_get_guid(book);
-  priv->books = g_list_append(priv->books, guid);
-}
-
-gboolean
-gnc_plugin_page_has_book (GncPluginPage *page, GUID *entity)
-{
-  GncPluginPagePrivate *priv;
-  GList *item;
-
-  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), FALSE);
-  g_return_val_if_fail (entity != NULL, FALSE);
-
-  priv = page->priv;
-  for (item = priv->books; item; item = g_list_next(item)) {
-    if (guid_equal((GUID*)item->data, entity)) {
-      return TRUE;
-    }
-  }
-  return FALSE;
-}
-
-gboolean
-gnc_plugin_page_has_books (GncPluginPage *page)
-{
-  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE (page), FALSE);
-
-  return (page->priv->books != NULL);
-}
--- src/gnome/gnc-plugin-menu-additions.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* 
- * gnc-plugin-menu-additions.h -- 
- * Copyright (C) 2005 David Hampton <hampton at employees.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, contact:
- *
- * Free Software Foundation           Voice:  +1-617-542-5942
- * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
- * Boston, MA  02111-1307,  USA       gnu at gnu.org
- */
-
-/** @addtogroup GUI
-    @{ */
-/** @addtogroup GuiImport Import GUI Utility functions.
-    @{ */
-/** @file gnc-plugin-menu-additions.h
-    @brief Utility functions for writing import modules.
-    @author Copyright (C) 2002 David Hampton <hampton at employees.org>
-*/
-
-#ifndef __GNC_PLUGIN_MENU_ADDITIONS_H
-#define __GNC_PLUGIN_MENU_ADDITIONS_H
-
-#include <gtk/gtk.h>
-#include "gnc-plugin.h"
-
-G_BEGIN_DECLS
-
-/* type macros */
-#define GNC_TYPE_PLUGIN_MENU_ADDITIONS            (gnc_plugin_menu_additions_get_type ())
-#define GNC_PLUGIN_MENU_ADDITIONS(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_MENU_ADDITIONS, GncPluginMenuAdditions))
-#define GNC_PLUGIN_MENU_ADDITIONS_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_MENU_ADDITIONS, GncPluginMenuAdditionsClass))
-#define GNC_IS_PLUGIN_MENU_ADDITIONS(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_MENU_ADDITIONS))
-#define GNC_IS_PLUGIN_MENU_ADDITIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_MENU_ADDITIONS))
-#define GNC_PLUGIN_MENU_ADDITIONS_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_MENU_ADDITIONS, GncPluginMenuAdditionsClass))
-
-#define GNC_PLUGIN_MENU_ADDITIONS_NAME "gnc-plugin-menu-additions"
-#define GNC_PLUGIN_HIDE_MENU_ADDITIONS_NAME "gnc-plugin-hide-menu-additions"
-
-/* typedefs & structures */
-typedef struct GncPluginMenuAdditionsPrivate GncPluginMenuAdditionsPrivate;
-
-typedef struct {
-	GncPlugin parent;
-	GncPluginMenuAdditionsPrivate *priv;
-} GncPluginMenuAdditions;
-
-typedef struct {
-	GncPluginClass parent;
-} GncPluginMenuAdditionsClass;
-
-/* function prototypes */
-
-
-/** Get the type of an extensions plugin.
- *
- *  @return A GType.
- */
-GType gnc_plugin_menu_additions_get_type (void);
-
-
-/** Create a new menu_additions plugin.  This plugin attaches the menu
- *  items from Scheme code to any window that is opened.
- *
- *  @return A pointer to the new object.
- */
-GncPlugin *gnc_plugin_menu_additions_new (void);
-
-G_END_DECLS
-
-#endif /* __GNC_PLUGIN_MENU_ADDITIONS_H */
-
-/** @} */
-/** @} */
--- src/gnome/gnc-plugin.h
+++ /dev/null
@@ -1,199 +0,0 @@
-/* 
- * gnc-plugin.h -- A module or plugin which can add more
- *	functionality to gnucash.
- * Copyright (C) 2003 Jan Arne Petersen
- * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, contact:
- *
- * Free Software Foundation           Voice:  +1-617-542-5942
- * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
- * Boston, MA  02111-1307,  USA       gnu at gnu.org
- */
-
-/** @addtogroup GUI
-    @{ */
-/** @addtogroup Wwindow plugin functions.
-    @{ */
-/** @file gnc-plugin.h
-    @brief Functions for adding plugins to a Gnucash window.
-    @author Copyright (C) 2002 David Hampton <hampton at employees.org>
-*/
-
-#ifndef __GNC_PLUGIN_H
-#define __GNC_PLUGIN_H
-
-#include "gnc-main-window.h"
-#include "gnc-plugin-page.h"
-#include <gconf/gconf-client.h>
-
-G_BEGIN_DECLS
-
-/* type macros */
-#define GNC_TYPE_PLUGIN            (gnc_plugin_get_type ())
-#define GNC_PLUGIN(o)              (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_PLUGIN, GncPlugin))
-#define GNC_PLUGIN_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN, GncPluginClass))
-#define GNC_IS_PLUGIN(o)           (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_PLUGIN))
-#define GNC_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN))
-#define GNC_PLUGIN_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_PLUGIN, GncPluginClass))
-
-/* typedefs & structures */
-typedef struct GncPluginPrivate GncPluginPrivate;
-
-typedef struct {
-	GObject parent;
-	GncPluginPrivate *priv;
-} GncPlugin;
-
-typedef struct {
-	GObjectClass parent;
-	const gchar *plugin_name;
-
-	const gchar *actions_name;
-	GtkActionEntry *actions;
-	guint n_actions; 
-	const gchar *ui_filename;
-
-	const gchar* gconf_section;
-	void (* gconf_notifications) (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data);
-
-	/* Virtual Table */
-	void (* add_to_window) (GncPlugin *plugin, GncMainWindow *window, GQuark type);
-	void (* remove_from_window) (GncPlugin *plugin, GncMainWindow *window, GQuark type);
-
-	GncPluginPage *(* create_page) (GncPlugin *plugin, const gchar *uri);
-} GncPluginClass;
-
-/* function prototypes */
-
-/** Get the type of a gnc window plugin.
- *
- *  @return A GType.
- */
-GType gnc_plugin_get_type (void);
-
-
-/** Add the specified plugin from the specified window.  This function
- *  will add the page's user interface from the window, set up gconf
- *  notifications if the page uses gconf, and call the plugin to
- *  perform any plugin specific actions.
- *
- *  @param plugin The plugin to be added.
- *
- *  @param window Add the plugin to this window.
- *
- *  @param type An identifier for the type of window specified.
- */
-void gnc_plugin_add_to_window (GncPlugin *plugin,
-			       GncMainWindow *window,
-			       GQuark type);
-
-
-/** Remove the specified plugin from the specified window.  This
- *  function will call the plugin to perform any plugin specific
- *  actions, remove any gconf notifications that were set up for the
- *  page, and remove the page's user interface from the window.
- *
- *  @param plugin The plugin to be removed.
- *
- *  @param window The window the plugin should be removed from.
- *
- *  @param type An identifier for the type of window specified.
- */
-void gnc_plugin_remove_from_window (GncPlugin *plugin,
-				    GncMainWindow *window,
-				    GQuark type);
-
-
-GncPluginPage *gnc_plugin_create_page (GncPlugin *plugin,
-				       const gchar *uri);
-
-
-/** Retrieve the name of a plugin.
- *
- *  @param plugin The plugin whose name should be returned.
- *
- *  @return  short_labels A pointer to a data structure containing
- *  [action name, label string] string pairs.
- */
-const gchar *gnc_plugin_get_name (GncPlugin *plugin);
-
-
-typedef struct {
-  const char *action_name;
-  const char *label;
-} action_short_labels;
-
-/** Add "short" labels to existing actions.  The "short" label is the
- *  string used on toolbar buttons when the action is visible.
- *
- *  @param action_group The group of all actions associated with a
- *  plugin or plugin page.  All actions to me modified must be in this
- *  group.
- *
- *  @param short_labels A pointer to a data structure containing
- *  [action name, label string] string pairs.
- */
-void gnc_plugin_init_short_names (GtkActionGroup *action_group,
-				  action_short_labels *short_labels);
-
-
-/** Update a property on a set of existing GtkActions.  This function
- *  can be easily used to make a list of actions visible, invisible,
- *  sensitive, or insensitive.
- *
- *  @param action_group The group of all actions associated with a
- *  plugin or plugin page.  All actions to be modified must be
- *  contained in this group.
- *
- *  @param action_names A NULL terminated list of actions names that
- *  should modified.
- *
- *  @param property_name The property name to be changed on the
- *  specified actions. The only two GtkAction properties that it makes
- *  sense to modify are "visible" and "sensitive".
- *
- *  @param value A boolean specifying the new state for the specified
- *  property.
- */
-void gnc_plugin_update_actions (GtkActionGroup *action_group,
-				const gchar **action_names,
-				const gchar *property_name,
-				gboolean value);
-
-
-/** Load a new set of actions into an existing UI.
- *
- *  @param ui_merge The existing set of merged actions. This is the ui
- *  that a user sees.  The actions from the ui file will be added to
- *  this ui.
- *
- *  @param action_group The local action group.  The actions from the
- *  ui file will be added to this private action group.
- *
- *  @param filename The name of the ui file to load.  This file name
- *  will be searched for in the ui directory.
- *
- *  @return The merge_id number for the newly merged UI.  If an error
- *  occurred, the return value is 0.
- */
-gint gnc_plugin_add_actions (GtkUIManager *ui_merge,
-			     GtkActionGroup *action_group,
-			     const gchar *filename);
-G_END_DECLS
-
-#endif /* __GNC_PLUGIN_H */
-
-/** @} */
-/** @} */
--- /dev/null
+++ src/gnome/gnc-plugin-basic-commands.c
@@ -0,0 +1,444 @@
+/* 
+ * gnc-plugin-basic-commands.c -- 
+ *
+ * Copyright (C) 2005 David Hampton <hampton at employees.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, contact:
+ *
+ * Free Software Foundation           Voice:  +1-617-542-5942
+ * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
+ * Boston, MA  02111-1307,  USA       gnu at gnu.org
+ */
+
+#include "config.h"
+#include <string.h>
+
+#include "gnc-plugin-basic-commands.h"
+
+#include "dialog-budget-list.h"
+#include "dialog-chart-export.h"
+#include "dialog-fincalc.h"
+#include "dialog-find-transactions.h"
+#include "dialog-scheduledxaction.h"
+#include "dialog-sxsincelast.h"
+#include "dialog-totd.h"
+#include "druid-acct-period.h"
+#include "druid-loan.h"
+#include "druid-merge.h"
+#include "gnc-event.h"
+#include "gnc-file.h"
+#include "gnc-gui-query.h"
+#include "gnc-ui.h"
+#include "gnc-window.h"
+#include "messages.h"
+
+/* This static indicates the debugging module that this .o belongs to.  */
+static short module = MOD_GUI;
+
+static GList *active_plugins = NULL;
+
+static void gnc_plugin_basic_commands_class_init (GncPluginBasicCommandsClass *klass);
+static void gnc_plugin_basic_commands_init (GncPluginBasicCommands *plugin);
+static void gnc_plugin_basic_commands_finalize (GObject *object);
+
+/* Command callbacks */
+static void gnc_main_window_cmd_file_new (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_file_open (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_file_save (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_file_save_as (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_file_qsf_import (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_file_export_accounts (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_file_chart_export (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_edit_tax_options (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_actions_mortgage_loan (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_actions_scheduled_transaction_editor (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_actions_budget_workbench(GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_actions_since_last_run (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_actions_close_books (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_tools_financial_calculator (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_tools_find_transactions (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_tools_price_editor (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_tools_commodity_editor (GtkAction *action, GncMainWindow *window);
+static void gnc_main_window_cmd_help_totd (GtkAction *action, GncMainWindow *window);
+
+
+
+#define PLUGIN_ACTIONS_NAME "gnc-plugin-basic-commands-actions"
+#define PLUGIN_UI_FILENAME  "gnc-plugin-basic-commands-ui.xml"
+
+static GtkActionEntry gnc_plugin_actions [] = {
+
+  /* File menu */
+
+  { "FileNewAction", GTK_STOCK_NEW, N_("_New File"), "<control>n",
+    N_("Create a new file"),
+    G_CALLBACK (gnc_main_window_cmd_file_new) },
+  { "FileOpenAction", GTK_STOCK_OPEN, N_("_Open"), NULL,
+    NULL,
+    G_CALLBACK (gnc_main_window_cmd_file_open) },
+  { "FileSaveAction", GTK_STOCK_SAVE, N_("_Save"), "<control>s",
+    NULL,
+    G_CALLBACK (gnc_main_window_cmd_file_save) },
+  { "FileSaveAsAction", GTK_STOCK_SAVE_AS, N_("Save _As..."), "<shift><control>s",
+    NULL,
+    G_CALLBACK (gnc_main_window_cmd_file_save_as) },
+  { "FileImportQSFAction", GTK_STOCK_CONVERT,
+    N_("_QSF Import"), NULL,
+    N_("Import a QSF object file"),
+    G_CALLBACK (gnc_main_window_cmd_file_qsf_import) },
+  { "FileExportAccountsAction", GTK_STOCK_CONVERT,
+    N_("Export _Accounts"), NULL,
+    N_("Export the account hierarchy to a new file"),
+    G_CALLBACK (gnc_main_window_cmd_file_export_accounts) },
+  { "FileExportChartAction", GTK_STOCK_CONVERT,
+    N_("Export _Chart of Accounts"), NULL,
+    N_("Export the chart of accounts for a date with balances"),
+    G_CALLBACK (gnc_main_window_cmd_file_chart_export) },
+
+  /* Edit menu */
+
+  { "EditTaxOptionsAction", NULL, N_("Ta_x Options"), NULL,
+    N_("Setup tax information for all income and expense accounts"),
+    G_CALLBACK (gnc_main_window_cmd_edit_tax_options) },
+
+  /* Actions menu */
+
+  { "ActionsScheduledTransactionsAction", NULL, N_("_Scheduled Transactions"), NULL, NULL, NULL },
+  { "ActionsScheduledTransactionEditorAction", NULL, N_("_Scheduled Transaction Editor"), NULL,
+    N_("The list of Scheduled Transactions"),
+    G_CALLBACK (gnc_main_window_cmd_actions_scheduled_transaction_editor) },
+  { "ActionsSinceLastRunAction", NULL, N_("_Since Last Run..."), NULL,
+    N_("Create Scheduled Transactions since the last time run"),
+    G_CALLBACK (gnc_main_window_cmd_actions_since_last_run) },
+  { "ActionsMortgageLoanAction", NULL, N_("_Mortgage & Loan Repayment..."), NULL,
+    N_("Setup scheduled transactions for repayment of a loan"),
+    G_CALLBACK (gnc_main_window_cmd_actions_mortgage_loan) },
+  { "ActionsBudgetWorkbenchAction", NULL, N_("_Budget Workbench (Experimental)"), NULL, 
+    N_("Create, Manage, and Monitor Budgets." ),
+    G_CALLBACK(gnc_main_window_cmd_actions_budget_workbench) },
+  { "ActionsCloseBooksAction", NULL, N_("Close Books"), NULL,
+    N_("Archive old data using accounting periods"),
+    G_CALLBACK (gnc_main_window_cmd_actions_close_books) },
+
+  /* Tools menu */
+
+  { "ToolsPriceEditorAction", NULL, N_("_Price Editor"), NULL,
+    N_("View and edit the prices for stocks and mutual funds"),
+    G_CALLBACK (gnc_main_window_cmd_tools_price_editor) },
+  { "ToolsCommodityEditorAction", NULL, N_("Commodity _Editor"), NULL,
+    N_("View and edit the commodities for stocks and mutual funds"),
+    G_CALLBACK (gnc_main_window_cmd_tools_commodity_editor) },
+  { "ToolsFinancialCalculatorAction", NULL, N_("Financial _Calculator"), NULL,
+    N_("Use the financial calculator"),
+    G_CALLBACK (gnc_main_window_cmd_tools_financial_calculator) },
+  { "ToolsFindTransactionsAction", GTK_STOCK_FIND, N_("_Find Transactions"), "<control>f",
+    N_("Find transactions with a search"),
+    G_CALLBACK (gnc_main_window_cmd_tools_find_transactions) },
+
+  /* Help menu */
+
+  { "HelpTipsOfTheDayAction", NULL, N_("_Tips Of The Day"), NULL,
+    N_("View the Tips of the Day"),
+    G_CALLBACK (gnc_main_window_cmd_help_totd) },
+};
+static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
+
+
+struct GncPluginBasicCommandsPrivate
+{
+  gpointer dummy;
+};
+
+static GObjectClass *parent_class = NULL;
+
+GType
+gnc_plugin_basic_commands_get_type (void)
+{
+  static GType gnc_plugin_basic_commands_type = 0;
+
+  if (gnc_plugin_basic_commands_type == 0) {
+    static const GTypeInfo our_info = {
+      sizeof (GncPluginBasicCommandsClass),
+      NULL,		/* base_init */
+      NULL,		/* base_finalize */
+      (GClassInitFunc) gnc_plugin_basic_commands_class_init,
+      NULL,		/* class_finalize */
+      NULL,		/* class_data */
+      sizeof (GncPluginBasicCommands),
+      0,		/* n_preallocs */
+      (GInstanceInitFunc) gnc_plugin_basic_commands_init
+    };
+ 
+    gnc_plugin_basic_commands_type = g_type_register_static (GNC_TYPE_PLUGIN,
+							     "GncPluginBasicCommands",
+							     &our_info, 0);
+  }
+
+  return gnc_plugin_basic_commands_type;
+}
+
+GncPlugin *
+gnc_plugin_basic_commands_new (void)
+{
+  GncPluginBasicCommands *plugin;
+
+  plugin = g_object_new (GNC_TYPE_PLUGIN_BASIC_COMMANDS, NULL);
+
+  return GNC_PLUGIN (plugin);
+}
+
+#if DEBUG_REFERENCE_COUNTING
+static void
+dump_model (GncPluginBasicCommands *plugin, gpointer dummy)
+{
+  g_warning("GncPluginBasicCommands %p still exists.", plugin);
+}
+
+static gint
+gnc_plugin_basic_commands_report_references (void)
+{
+  g_list_foreach(active_plugins, (GFunc)dump_model, NULL);
+  return 0;
+}
+#endif
+
+static void
+gnc_plugin_basic_commands_class_init (GncPluginBasicCommandsClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+  GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass);
+
+  parent_class = g_type_class_peek_parent (klass);
+
+  object_class->finalize = gnc_plugin_basic_commands_finalize;
+
+  /* plugin info */
+  plugin_class->plugin_name  = GNC_PLUGIN_BASIC_COMMANDS_NAME;
+
+  /* widget addition/removal */
+  plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
+  plugin_class->actions      = gnc_plugin_actions;
+  plugin_class->n_actions    = gnc_plugin_n_actions;
+  plugin_class->ui_filename  = PLUGIN_UI_FILENAME;
+
+#if DEBUG_REFERENCE_COUNTING
+  gtk_quit_add (0,
+		(GtkFunction)gnc_plugin_basic_commands_report_references,
+		NULL);
+#endif
+}
+
+static void
+gnc_plugin_basic_commands_init (GncPluginBasicCommands *plugin)
+{
+  plugin->priv = g_new0 (GncPluginBasicCommandsPrivate, 1);
+
+  active_plugins = g_list_append (active_plugins, plugin);
+}
+
+static void
+gnc_plugin_basic_commands_finalize (GObject *object)
+{
+  GncPluginBasicCommands *plugin;
+
+  g_return_if_fail (GNC_IS_PLUGIN_BASIC_COMMANDS (object));
+
+  plugin = GNC_PLUGIN_BASIC_COMMANDS (object);
+  active_plugins = g_list_remove (active_plugins, plugin);
+
+  g_return_if_fail (plugin->priv != NULL);
+
+  g_free (plugin->priv);
+
+  G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+/************************************************************
+ *                    Command Callbacks                     *
+ ************************************************************/
+
+static void
+gnc_main_window_cmd_file_new (GtkAction *action, GncMainWindow *window)
+{
+  gnc_file_new ();
+  /* FIXME GNOME 2 Port (update the title etc.) */
+}
+
+static void
+gnc_main_window_cmd_file_open (GtkAction *action, GncMainWindow *window)
+{
+  gnc_window_set_progressbar_window (GNC_WINDOW(window));
+  gnc_file_open ();
+  gnc_window_set_progressbar_window (NULL);
+  gnc_main_window_update_title (window);
+  /* FIXME GNOME 2 Port (update the title etc.) */
+}
+
+static void
+gnc_main_window_cmd_file_save (GtkAction *action, GncMainWindow *window)
+{
+  gnc_window_set_progressbar_window (GNC_WINDOW(window));
+  gnc_file_save ();
+  gnc_window_set_progressbar_window (NULL);
+  /* FIXME GNOME 2 Port (update the title etc.) */
+}
+
+static void
+gnc_main_window_cmd_file_save_as (GtkAction *action, GncMainWindow *window)
+{
+  gnc_window_set_progressbar_window (GNC_WINDOW(window));
+  gnc_file_save_as ();
+  gnc_window_set_progressbar_window (NULL);
+  /* FIXME GNOME 2 Port (update the title etc.) */
+}
+
+static void
+qsf_file_select_ok(GtkWidget *w, GtkFileSelection *fs )
+{
+  QofSession *qsf_session, *first_session;
+  const gchar *filename;
+  QofBook *original;
+
+  ENTER (" ");
+  gnc_engine_suspend_events();
+  filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION (fs));
+  gtk_widget_destroy((GtkWidget*) fs);
+  first_session = qof_session_get_current_session();
+  original = qof_session_get_book(first_session);
+  qsf_session = qof_session_new();
+  qof_session_begin(qsf_session, filename, TRUE, FALSE);
+  qof_session_load(qsf_session, NULL);
+  gnc_engine_resume_events();
+  gnc_ui_qsf_import_merge_druid(first_session, qsf_session);
+  LEAVE (" ");
+}
+
+static void
+gnc_main_window_cmd_file_qsf_import (GtkAction *action, GncMainWindow *window)
+{
+  GtkWidget *file_select;
+
+  gnc_window_set_progressbar_window(GNC_WINDOW(window));
+  file_select = gtk_file_selection_new("Select the QSF file to import into GnuCash");
+  g_signal_connect (G_OBJECT (GTK_FILE_SELECTION (file_select)->ok_button),
+		    "clicked", G_CALLBACK (qsf_file_select_ok), (gpointer) file_select);
+  g_signal_connect_swapped (G_OBJECT (GTK_FILE_SELECTION (file_select)->cancel_button),
+			    "clicked", G_CALLBACK (gtk_widget_destroy), G_OBJECT (file_select));
+  gtk_widget_show (file_select);
+  gnc_window_set_progressbar_window(NULL);
+}
+
+static void
+gnc_main_window_cmd_file_export_accounts (GtkAction *action, GncMainWindow *window)
+{
+  gnc_window_set_progressbar_window (GNC_WINDOW(window));
+  gnc_file_export_file (NULL);
+  gnc_window_set_progressbar_window (NULL);
+  /* FIXME GNOME 2 Port (update the title etc.) */
+  /* gnc_refresh_main_window_info (); */
+}
+
+static void
+gnc_main_window_cmd_file_chart_export (GtkAction *action, GncMainWindow *window)
+{
+  gnc_window_set_progressbar_window (GNC_WINDOW(window));
+  gnc_main_window_chart_export();
+  gnc_window_set_progressbar_window (NULL);
+  /* FIXME GNOME 2 Port (update the title etc.) */
+  /* gnc_refresh_main_window_info (); */
+}
+
+static void
+gnc_main_window_cmd_edit_tax_options (GtkAction *action, GncMainWindow *window)
+{
+	gnc_tax_info_dialog (GTK_WIDGET (window));
+}
+
+static void
+gnc_main_window_cmd_actions_scheduled_transaction_editor (GtkAction *action, GncMainWindow *window)
+{
+  gnc_ui_scheduled_xaction_dialog_create ();
+}
+
+static void
+gnc_main_window_cmd_actions_since_last_run (GtkAction *action, GncMainWindow *window)
+{
+  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 (GTK_WIDGET(&window->parent), nothing_to_do_msg);
+  } else if ( ret < 0 ) {
+    gnc_info_dialog (GTK_WIDGET(&window->parent), 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_cmd_actions_mortgage_loan (GtkAction *action, GncMainWindow *window)
+{
+  gnc_ui_sx_loan_druid_create ();
+}
+
+static void 
+gnc_main_window_cmd_actions_budget_workbench(GtkAction *action, GncMainWindow *window)
+{
+  gnc_budget_list_dialog_create();
+}
+
+static void
+gnc_main_window_cmd_actions_close_books (GtkAction *action, GncMainWindow *window)
+{
+  gnc_acct_period_dialog();
+}
+
+static void
+gnc_main_window_cmd_tools_price_editor (GtkAction *action, GncMainWindow *window)
+{
+	gnc_prices_dialog (NULL);
+}
+
+static void
+gnc_main_window_cmd_tools_commodity_editor (GtkAction *action, GncMainWindow *window)
+{
+	gnc_commodities_dialog (NULL);
+}
+
+static void
+gnc_main_window_cmd_tools_financial_calculator (GtkAction *action, GncMainWindow *window)
+{
+  gnc_ui_fincalc_dialog_create();
+}
+
+static void
+gnc_main_window_cmd_tools_find_transactions (GtkAction *action, GncMainWindow *window)
+{
+  gnc_ui_find_transactions_dialog_create (NULL);
+}
+
+static void
+gnc_main_window_cmd_help_totd (GtkAction *action, GncMainWindow *window)
+{
+  gnc_totd_dialog(GTK_WINDOW(window), FALSE);
+}
--- src/gnome/gnc-plugin.c
+++ /dev/null
@@ -1,370 +0,0 @@
-/* 
- * gnc-plugin.c -- 
- *
- * Copyright (C) 2003 Jan Arne Petersen
- * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, contact:
- *
- * Free Software Foundation           Voice:  +1-617-542-5942
- * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
- * Boston, MA  02111-1307,  USA       gnu at gnu.org
- */
-
-#include "config.h"
-
-#include "gnc-plugin.h"
-#include "gnc-trace.h"
-#include "gnc-gconf-utils.h"
-#include "gnc-gnome-utils.h"
-#include "messages.h"
-
-static gpointer parent_class = NULL;
-static short module = MOD_GUI;
-
-static void gnc_plugin_class_init (GncPluginClass *klass);
-static void gnc_plugin_init       (GncPlugin *plugin_page);
-static void gnc_plugin_finalize   (GObject *object);
-
-struct  GncPluginPrivate {
-	gpointer dummy;
-};
-
-
-/** Get the type of a gnc window plugin.
- */
-GType
-gnc_plugin_get_type (void)
-{
-	static GType gnc_plugin_type = 0;
-
-	if (gnc_plugin_type == 0) {
-		static const GTypeInfo our_info = {
-			sizeof (GncPluginClass),
-			NULL,		/* base_init */
-			NULL,		/* base_finalize */
-			(GClassInitFunc) gnc_plugin_class_init,
-			NULL,		/* class_finalize */
-			NULL,		/* class_data */
-			sizeof (GncPlugin),
-			0,		/* n_preallocs */
-			(GInstanceInitFunc) gnc_plugin_init,
-		};
-
-		gnc_plugin_type = g_type_register_static (G_TYPE_OBJECT,
-							  "GncPlugin",
-							   &our_info, 0);
-	}
-
-	return gnc_plugin_type;
-}
-
-
-/** Initialize the class for the new gnucash plugin object.  This will
- *  set up any function pointers that override functions in the parent
- *  class, and also installs the proprieties that are unique to this
- *  class.
- *
- *  @param klass The new class structure created by the object system.
- *
- *  @internal
- */
-static void
-gnc_plugin_class_init (GncPluginClass *klass)
-{
-	GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-
-	parent_class = g_type_class_peek_parent (klass);
-	gobject_class->finalize = gnc_plugin_finalize;
-}
-
-
-/** Initialize a new instance of a gnucash plugin object.  This
- *  function allocates and initializes the object private storage
- *  space.
- *
- *  @param view The new object instance created by the object system.
- *
- *  @internal
- */
-static void
-gnc_plugin_init (GncPlugin *plugin_page)
-{
-	GncPluginPrivate *priv;
-
-	priv = plugin_page->priv = g_new0 (GncPluginPrivate, 1);
-}
-
-
-/** Finalize the gnucash plugin object.  This function is called from
- *  the G_Object level to complete the destruction of the object.  It
- *  should release any memory not previously released by the destroy
- *  function (i.e. the private data structure), then chain up to the
- *  parent's destroy function.
- *
- *  @param object The object being destroyed.
- *
- *  @internal
- */
-static void
-gnc_plugin_finalize (GObject *object)
-{
-	GncPlugin *plugin;
-
-	g_return_if_fail (GNC_IS_PLUGIN (object));
-
-	plugin = GNC_PLUGIN (object);
-	g_return_if_fail (plugin->priv != NULL);
-
-	g_free (plugin->priv);
-
-	G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-
-/** Add the specified plugin from the specified window.  This function
- *  will add the page's user interface from the window, set up gconf
- *  notifications if the page uses gconf, and call the plugin to
- *  perform any plugin specific actions.
- */
-void
-gnc_plugin_add_to_window (GncPlugin *plugin,
-			  GncMainWindow *window,
-			  GQuark type)
-{
-	GncPluginClass *class;
-
-	g_return_if_fail (GNC_IS_PLUGIN (plugin));
-	class = GNC_PLUGIN_GET_CLASS (plugin);
-	ENTER (": plugin %s(%p), window %p", gnc_plugin_get_name(plugin),
-	       plugin, window);
-
-	/*
-	 * Update window with additional UI items
-	 */
-	if (class->actions_name) {
-	  DEBUG ("%s: %d actions to merge with gui from %s",
-		 class->actions_name, class->n_actions, class->ui_filename);
-	  gnc_main_window_merge_actions (window, class->actions_name,
-					 class->actions, class->n_actions,
-					 class->ui_filename, plugin);
-	}
-
-	/*
-	 * Setup gconf notifications if requested
-	 */
-	if (class->gconf_section && class->gconf_notifications) {
-	  DEBUG ("Requesting notification for section %s", class->gconf_section);
-	  gnc_gconf_add_notification(G_OBJECT(window), class->gconf_section,
-				     class->gconf_notifications);
-	}
-
-	/*
-	 * Do plugin specific actions.
-	 */
-	if (GNC_PLUGIN_GET_CLASS (plugin)->add_to_window) {
-	  DEBUG ("Calling child class function %p", GNC_PLUGIN_GET_CLASS (plugin)->add_to_window);
-	  GNC_PLUGIN_GET_CLASS (plugin)->add_to_window (plugin, window, type);
-	}
-	LEAVE ("");
-}
-
-
-/*  Remove the specified plugin from the specified window.  This
- *  function will call the plugin to perform any plugin specific
- *  actions, remove any gconf notifications that were set up for the
- *  page, and remove the page's user interface from the window.
- */
-void
-gnc_plugin_remove_from_window (GncPlugin *plugin,
-			       GncMainWindow *window,
-			       GQuark type)
-{
-	GncPluginClass *class;
-
-	g_return_if_fail (GNC_IS_PLUGIN (plugin));
-	class = GNC_PLUGIN_GET_CLASS (plugin);
-	ENTER (": plugin %s(%p), window %p", gnc_plugin_get_name(plugin),
-	       plugin, window);
-
-	/*
-	 * Do plugin specific actions.
-	 */
-	if (GNC_PLUGIN_GET_CLASS (plugin)->remove_from_window) {
-	  DEBUG ("Calling child class function %p",
-		 GNC_PLUGIN_GET_CLASS (plugin)->remove_from_window);
-	  GNC_PLUGIN_GET_CLASS (plugin)->remove_from_window (plugin, window, type);
-	}
-
-	/*
-	 * Remove any gconf notifications
-	 */
-	if (class->gconf_section && class->gconf_notifications) {
-	  DEBUG ("Remove notification for section %s", class->gconf_section);
-	  gnc_gconf_remove_notification (G_OBJECT(window), class->gconf_section);
-	}
-
-	/*
-	 * Update window to remove UI items
-	 */
-	if (class->actions_name) {
-	  DEBUG ("%s: %d actions to unmerge",
-		 class->actions_name, class->n_actions);
-	  gnc_main_window_unmerge_actions (window, class->actions_name);
-	}
-	LEAVE ("");
-}
-
-
-GncPluginPage *
-gnc_plugin_create_page (GncPlugin *plugin,
-			const gchar *uri)
-{
-	g_return_val_if_fail (GNC_IS_PLUGIN (plugin), NULL);
-
-	if (!GNC_PLUGIN_GET_CLASS (plugin)->create_page)
-	  return NULL;
-	return GNC_PLUGIN_GET_CLASS (plugin)->create_page (plugin, uri);
-}
-
-
-/** Retrieve the name of a plugin.
- */
-const gchar *
-gnc_plugin_get_name (GncPlugin *plugin)
-{
-	g_return_val_if_fail (GNC_IS_PLUGIN (plugin), NULL);
-	return (GNC_PLUGIN_GET_CLASS(plugin)->plugin_name);
-}
-
-
-/************************************************************
- *                    Utility Functions                     *
- ************************************************************/
-
-
-/** Add "short" labels to existing actions.  The "short" label is the
- *  string used on toolbar buttons when the action is visible.*/
-void
-gnc_plugin_init_short_names (GtkActionGroup *action_group,
-			     action_short_labels *short_labels)
-{
-  GtkAction *action;
-  GValue value = { 0, };
-  gint i;
-
-  g_value_init (&value, G_TYPE_STRING);
-
-  for (i = 0; short_labels[i].action_name; i++) {
-    /* Add a couple of short labels for the toolbar */
-    action = gtk_action_group_get_action (action_group,
-					  short_labels[i].action_name);
-    g_value_set_static_string (&value, gettext(short_labels[i].label));
-    g_object_set_property (G_OBJECT(action), "short_label", &value);
-  }
-}
-
-
-/** Update the status of existing UI actions.  This function can
- *  modify actions making them visible, invisible, sensitive, or
- *  insensitive. */
-void
-gnc_plugin_update_actions (GtkActionGroup *action_group,
-			   const gchar **action_names,
-			   const gchar *property_name,
-			   gboolean value)
-{
-  GtkAction    *action;
-  GValue        gvalue = { 0 };
-  gint          i;
-
-  g_value_init (&gvalue, G_TYPE_BOOLEAN);
-  g_value_set_boolean (&gvalue, value);
-
-  for (i = 0; action_names[i]; i++) {
-    action = gtk_action_group_get_action (action_group, action_names[i]);
-    g_object_set_property (G_OBJECT(action), property_name, &gvalue);
-  }
-}
-
-
-/** Load a new set of actions into an existing UI. */
-gint
-gnc_plugin_add_actions (GtkUIManager *ui_merge,
-			GtkActionGroup *action_group,
-			const gchar *filename)
-{
-	GError *error = NULL;
-	gchar *pathname;
-	gint merge_id;
-	
-	ENTER("ui_merge %p, action_group %p, filename %s",
-	      ui_merge, action_group, filename);
-	g_return_val_if_fail (ui_merge, 0);
-	g_return_val_if_fail (action_group, 0);
-	g_return_val_if_fail (filename, 0);
-
-	gtk_ui_manager_insert_action_group (ui_merge, action_group, 0);
-
-	pathname = gnc_gnome_locate_ui_file (filename);
-	if (pathname == NULL)
-	  return 0;
-
-	merge_id = gtk_ui_manager_add_ui_from_file (ui_merge, pathname, &error);
-	DEBUG("merge_id is %d", merge_id);
-
-	g_assert(merge_id || error);
-	if (merge_id) {
-	  gtk_ui_manager_ensure_update (ui_merge);
-	} else {
-	  g_critical("Failed to load ui file.\n  Filename %s\n  Error %s",
-		     filename, error->message);
-	  g_error_free(error);
-	}
-
-	g_free(pathname);
-	LEAVE(" ");
-	return merge_id;
-}
-
-#if 0
-static void
-gnc_plugin_base_init (gpointer klass)
-{
-	static gboolean initialized = FALSE;
-
-	if (!initialized) {
-		initialized = TRUE;
-
-		signals[MERGE_ACTIONS] = g_signal_new ("merge-actions",
-						       G_OBJECT_CLASS_TYPE (klass),
-						       G_SIGNAL_RUN_FIRST,
-						       G_STRUCT_OFFSET (GncPluginClass, merge_actions),
-						       NULL, NULL,
-						       g_cclosure_marshal_VOID__POINTER,
-						       G_TYPE_NONE,
-						       1,
-						       GTK_TYPE_MENU_MERGE);
-		signals[UNMERGE_ACTIONS] = g_signal_new ("unmerge-actions",
-							 G_OBJECT_CLASS_TYPE (klass),
-							 G_SIGNAL_RUN_FIRST,
-							 G_STRUCT_OFFSET (GncPluginClass, unmerge_actions),
-							 NULL, NULL,
-							 g_cclosure_marshal_VOID__POINTER,
-							 G_TYPE_NONE,
-							 1,
-							 GTK_TYPE_MENU_MERGE);
-	}
-}
-#endif
Index: top-level.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/top-level.c,v
retrieving revision 1.140.4.18
retrieving revision 1.140.4.19
diff -Lsrc/gnome/top-level.c -Lsrc/gnome/top-level.c -u -r1.140.4.18 -r1.140.4.19
--- src/gnome/top-level.c
+++ src/gnome/top-level.c
@@ -49,6 +49,7 @@
 #include "gnc-menu-extensions.h"
 #include "gnc-plugin-menu-additions.h" /* FIXME Remove this line*/
 #include "gnc-plugin-account-tree.h" /* FIXME Remove this line*/
+#include "gnc-plugin-basic-commands.h" /* FIXME Remove this line*/
 #include "gnc-plugin-file-history.h" /* FIXME Remove this line*/
 #include "gnc-plugin-register.h" /* FIXME Remove this line*/
 #include "gnc-plugin-page-register.h"
@@ -390,6 +391,7 @@
 
     /* FIXME Remove this test code */
     gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), gnc_plugin_account_tree_new ());
+    gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), gnc_plugin_basic_commands_new ());
     gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), gnc_plugin_file_history_new ());
     gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), gnc_plugin_menu_additions_new ());
     gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), gnc_plugin_register_new ());
--- src/gnome/gnc-embedded-window.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* 
- * gnc-embedded-window.h -- GtkWindow which represents an
- *	emvedded GnuCash window.
- *
- * Copyright (C) 2003 Jan Arne Petersen
- * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, contact:
- *
- * Free Software Foundation           Voice:  +1-617-542-5942
- * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
- * Boston, MA  02111-1307,  USA       gnu at gnu.org
- */
-
-#ifndef __GNC_EMBEDDED_WINDOW_H
-#define __GNC_EMBEDDED_WINDOW_H
-
-#include <gtk/gtkwindow.h>
-
-#include "gnc-plugin-page.h"
-
-G_BEGIN_DECLS
-
-#define PLUGIN_PAGE_LABEL "plugin-page"
-
-/* type macros */
-#define GNC_TYPE_EMBEDDED_WINDOW            (gnc_embedded_window_get_type ())
-#define GNC_EMBEDDED_WINDOW(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_EMBEDDED_WINDOW, GncEmbeddedWindow))
-#define GNC_EMBEDDED_WINDOW_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_EMBEDDED_WINDOW, GncEmbeddedWindowClass))
-#define GNC_IS_EMBEDDED_WINDOW(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_EMBEDDED_WINDOW))
-#define GNC_IS_EMBEDDED_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_EMBEDDED_WINDOW))
-#define GNC_EMBEDDED_WINDOW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_EMBEDDED_WINDOW, GncEmbeddedWindowClass))
-
-/* typedefs & structures */
-typedef struct GncEmbeddedWindowPrivate GncEmbeddedWindowPrivate;
-
-typedef struct {
-	GtkVBox parent;
-
-	GncEmbeddedWindowPrivate *priv;
-
-	GtkUIManager   	 *ui_merge;
-} GncEmbeddedWindow;
-
-typedef struct {
-	GtkVBoxClass parent;
-} GncEmbeddedWindowClass;
-
-typedef struct gnc_embedded_window {
-	GtkUIManager   	 *ui_merge;
-	GtkActionGroup 	 *action_group;
-	GtkWidget        *main_vbox;
-	GtkWidget      	 *menu_dock;
-        GtkWidget      	 *toolbar_dock;
-} gnc_embedded_window;
-
-/* function prototypes */
-GType               gnc_embedded_window_get_type (void);
-
-GncEmbeddedWindow * gnc_embedded_window_new      (const gchar *action_group_name,
-						  GtkActionEntry *action_entries,
-						  gint n_action_entries,
-						  const gchar *ui_filename,
-						  GtkWidget *enclosing_win,
-						  gboolean add_accelerators,
-						  gpointer user_data);
-
-void            gnc_embedded_window_open_page    (GncEmbeddedWindow *window,
-						  GncPluginPage *page);
-void            gnc_embedded_window_close_page	 (GncEmbeddedWindow *window,
-						  GncPluginPage *page);
-GncPluginPage  *gnc_embedded_window_get_page     (GncEmbeddedWindow *window);
-
-G_END_DECLS
-
-#endif /* __GNC_EMBEDDED_WINDOW_H */
--- src/gnome/gnc-plugin-manager.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/* 
- * gnc-plugin-manager.c -- 
- *
- * Copyright (C) 2003 Jan Arne Petersen
- * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, contact:
- *
- * Free Software Foundation           Voice:  +1-617-542-5942
- * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
- * Boston, MA  02111-1307,  USA       gnu at gnu.org
- */
-
-#include "config.h"
-
-#include "gnc-plugin-manager.h"
-
-#include "messages.h"
-#include "gnc-trace.h"
-
-static short module = MOD_GUI;
-
-static void gnc_plugin_manager_class_init (GncPluginManagerClass *klass);
-static void gnc_plugin_manager_init (GncPluginManager *plugin);
-static void gnc_plugin_manager_finalize (GObject *object);
-
-struct GncPluginManagerPrivate
-{
-	GList *plugins;
-	GHashTable *plugins_table;
-};
-
-enum {
-	PLUGIN_ADDED,
-	PLUGIN_REMOVED,
-	LAST_SIGNAL
-};
-
-static guint signals[LAST_SIGNAL] = { 0 };
-static GncPluginManager *singleton = NULL;
-
-static GObjectClass *parent_class = NULL;
-
-GType
-gnc_plugin_manager_get_type (void)
-{
-	static GType gnc_plugin_manager_type = 0;
-
-	if (gnc_plugin_manager_type == 0) {
-		static const GTypeInfo our_info = {
-			sizeof (GncPluginManagerClass),
-			NULL,
-			NULL,
-			(GClassInitFunc) gnc_plugin_manager_class_init,
-			NULL,
-			NULL,
-			sizeof (GncPluginManager),
-			0,
-			(GInstanceInitFunc) gnc_plugin_manager_init
-		};
-		
-		gnc_plugin_manager_type = g_type_register_static (G_TYPE_OBJECT,
-								  "GncPluginManager",
-								  &our_info, 0);
-	}
-
-	return gnc_plugin_manager_type;
-}
-
-GncPluginManager *
-gnc_plugin_manager_get (void)
-{
-	if (singleton == NULL) {
-		singleton = g_object_new (GNC_TYPE_PLUGIN_MANAGER,
-  					  NULL);
-	}
-
-	return singleton;
-}
-
-void
-gnc_plugin_manager_add_plugin (GncPluginManager *manager,
-			       GncPlugin *plugin)
-{
-	gint index;
-
-	ENTER (" ");
-	g_return_if_fail (GNC_IS_PLUGIN_MANAGER (manager));
-	g_return_if_fail (GNC_IS_PLUGIN (plugin));
-
-	index = g_list_index (manager->priv->plugins, plugin);
-
-	if (index >= 0)
-		return;
-
-	g_object_ref (plugin);
-
-	manager->priv->plugins = g_list_append (manager->priv->plugins, plugin);
-	g_hash_table_insert (manager->priv->plugins_table,
-			     g_strdup( GNC_PLUGIN_GET_CLASS(plugin)->plugin_name ),
-			     plugin);
-
-	g_signal_emit (G_OBJECT (manager), signals[PLUGIN_ADDED], 0, plugin);
-	LEAVE ("added %s to GncPluginManager", gnc_plugin_get_name(plugin));
-}
-
-void
-gnc_plugin_manager_remove_plugin (GncPluginManager *manager,
-				  GncPlugin *plugin)
-{
-	gint index;
-	
-	ENTER (" ");
-	g_return_if_fail (GNC_IS_PLUGIN_MANAGER (manager));
-	g_return_if_fail (GNC_IS_PLUGIN (plugin));
-
-	index = g_list_index (manager->priv->plugins, plugin);
-
-	if (index < 0)
-		return;
-
-	manager->priv->plugins = g_list_remove (manager->priv->plugins, plugin);
-	g_hash_table_remove (manager->priv->plugins_table,
-			     GNC_PLUGIN_GET_CLASS(plugin)->plugin_name);
-
-	g_signal_emit (G_OBJECT (manager), signals[PLUGIN_REMOVED], 0, plugin);
-
-	LEAVE ("removed %s from GncPluginManager", 
-	       gnc_plugin_get_name(plugin));
-	g_object_unref (plugin);
-}
-
-GList *
-gnc_plugin_manager_get_plugins (GncPluginManager *manager)
-{
-	g_return_val_if_fail (GNC_IS_PLUGIN_MANAGER (manager), NULL);
-	
-	return g_list_copy (manager->priv->plugins);
-}
-
-GncPlugin *
-gnc_plugin_manager_get_plugin (GncPluginManager *manager,
-			       const gchar *name)
-{
-	g_return_val_if_fail (GNC_IS_PLUGIN_MANAGER (manager), NULL);
-	g_return_val_if_fail (name != NULL, NULL);
-
-	return GNC_PLUGIN (g_hash_table_lookup (manager->priv->plugins_table, name));
-}
-
-
-static void
-gnc_plugin_manager_class_init (GncPluginManagerClass *klass)
-{
-	GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
-	parent_class = g_type_class_peek_parent (klass);
-
-	object_class->finalize = gnc_plugin_manager_finalize;
-
-	signals[PLUGIN_ADDED] = g_signal_new ("plugin-added",
-					      G_OBJECT_CLASS_TYPE (klass),
-					      G_SIGNAL_RUN_FIRST,
-					      G_STRUCT_OFFSET (GncPluginManagerClass, plugin_added),
-					      NULL, NULL,
-					      g_cclosure_marshal_VOID__POINTER,
-					      G_TYPE_NONE,
-					      1,
-					      GNC_TYPE_PLUGIN);
-	signals[PLUGIN_REMOVED] = g_signal_new ("plugin-removed",
-						G_OBJECT_CLASS_TYPE (klass),
-						G_SIGNAL_RUN_FIRST,
-						G_STRUCT_OFFSET (GncPluginManagerClass, plugin_removed),
-						NULL, NULL,
-						g_cclosure_marshal_VOID__POINTER,
-						G_TYPE_NONE,
-						1,
-						GNC_TYPE_PLUGIN);
-}
-
-static void
-gnc_plugin_manager_init (GncPluginManager *manager)
-{
-	manager->priv = g_new0 (GncPluginManagerPrivate, 1);
-
-	manager->priv->plugins_table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
-}
-
-static void
-gnc_plugin_manager_finalize (GObject *object)
-{
-	GncPluginManager *manager = GNC_PLUGIN_MANAGER (object);
-
-	g_return_if_fail (GNC_IS_PLUGIN_MANAGER (manager));
-	g_return_if_fail (manager->priv != NULL);
-
-	g_list_free (manager->priv->plugins);
-	g_hash_table_destroy (manager->priv->plugins_table);
-	g_free (manager->priv);
-
-	G_OBJECT_CLASS (parent_class)->finalize (object);
-}
--- /dev/null
+++ src/gnome/gnc-plugin-basic-commands.h
@@ -0,0 +1,65 @@
+/* 
+ * gnc-plugin-basic-commands.h -- 
+ *
+ * Copyright (C) 2005 David Hampton <hampton at employees.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, contact:
+ *
+ * Free Software Foundation           Voice:  +1-617-542-5942
+ * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
+ * Boston, MA  02111-1307,  USA       gnu at gnu.org
+ */
+
+#ifndef __GNC_PLUGIN_BASIC_COMMANDS_H
+#define __GNC_PLUGIN_BASIC_COMMANDS_H
+
+#include <gtk/gtkwindow.h>
+
+#include "gnc-plugin.h"
+
+G_BEGIN_DECLS
+
+/* type macros */
+#define GNC_TYPE_PLUGIN_BASIC_COMMANDS            (gnc_plugin_basic_commands_get_type ())
+#define GNC_PLUGIN_BASIC_COMMANDS(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_BASIC_COMMANDS, GncPluginBasicCommands))
+#define GNC_PLUGIN_BASIC_COMMANDS_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_BASIC_COMMANDS, GncPluginBasicCommandsClass))
+#define GNC_IS_PLUGIN_BASIC_COMMANDS(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_BASIC_COMMANDS))
+#define GNC_IS_PLUGIN_BASIC_COMMANDS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_BASIC_COMMANDS))
+#define GNC_PLUGIN_BASIC_COMMANDS_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_BASIC_COMMANDS, GncPluginBasicCommandsClass))
+
+#define GNC_PLUGIN_BASIC_COMMANDS_NAME "gnc-plugin-basic-commands"
+
+/* typedefs & structures */
+typedef struct GncPluginBasicCommandsPrivate GncPluginBasicCommandsPrivate;
+
+typedef struct {
+	GncPlugin parent;
+
+	GncPluginBasicCommandsPrivate *priv;
+} GncPluginBasicCommands;
+
+typedef struct {
+	GncPluginClass parent;
+} GncPluginBasicCommandsClass;
+
+/* function prototypes */
+GType      gnc_plugin_basic_commands_get_type (void);
+
+GncPlugin *gnc_plugin_basic_commands_new      (void);
+
+void       gnc_new_basic_commands             (GncMainWindow *window);
+
+G_END_DECLS
+
+#endif /* __GNC_PLUGIN_BASIC_COMMANDS_H */
--- src/gnome/gnc-window.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/* 
- * gnc-window.c -- structure which represents a GnuCash window.
- *
- * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
- * Copyright (C) 2003 David Hampton <hampton at employees.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, contact:
- *
- * Free Software Foundation           Voice:  +1-617-542-5942
- * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
- * Boston, MA  02111-1307,  USA       gnu at gnu.org
- */
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-
-#include "gnc-trace.h"
-#include "gnc-file.h"
-#include "gnc-mdi-utils.h"
-#include "gnc-plugin-page.h"
-#include "gnc-window.h"
-
-static short module = MOD_GUI;
-
-GType
-gnc_window_get_type (void)
-{
-  static GType gnc_window_type = 0;
-
-  if (gnc_window_type == 0) {
-    static const GTypeInfo our_info = {
-      sizeof (GncWindowIface),
-      NULL,
-      NULL,
-      NULL,
-      NULL,
-      NULL,
-      0,
-      0,
-      NULL
-    };
-
-    gnc_window_type = g_type_register_static (G_TYPE_INTERFACE,
-					      "GncWindow",
-					      &our_info, 0);
-    g_type_interface_add_prerequisite (gnc_window_type, G_TYPE_OBJECT);
-
-    gnc_file_set_pct_handler (gnc_window_show_progress);
-    gnc_mdi_set_progress_handler (gnc_window_show_progress);
-  }
-
-  return gnc_window_type;
-}
-
-/************************************************************
- *                Interface access functions                *
- ************************************************************/
-
-static GtkWidget *
-gnc_window_get_statusbar (GncWindow *window)
-{
-  g_return_val_if_fail(GNC_WINDOW (window), NULL);
-
-  /* mandatory */
-  g_return_val_if_fail(GNC_WINDOW_GET_IFACE (window)->get_statusbar, NULL);
-
-  return GNC_WINDOW_GET_IFACE (window)->get_statusbar (window);
-}
-
-static GtkWidget *
-gnc_window_get_progressbar (GncWindow *window)
-{
-  g_return_val_if_fail(GNC_WINDOW (window), NULL);
-
-  /* optional */
-  if (GNC_WINDOW_GET_IFACE (window)->get_progressbar == NULL)
-    return NULL;
-
-  return GNC_WINDOW_GET_IFACE (window)->get_progressbar (window);
-}
-
-/************************************************************
- *              Auxiliary status bar functions              *
- ************************************************************/
-
-void
-gnc_window_update_status (GncWindow *window, GncPluginPage *page)
-{
-  GtkWidget *statusbar;
-
-  g_return_if_fail(GNC_WINDOW (window));
-
-  statusbar = gnc_window_get_statusbar (window);
-  gtk_statusbar_pop(GTK_STATUSBAR(statusbar), 0);
-  gtk_statusbar_push(GTK_STATUSBAR(statusbar), 0,
-		     page->statusbar_text ? page->statusbar_text : "");
-}
-
-void
-gnc_window_set_status (GncWindow *window, GncPluginPage *page, const gchar *message)
-{
-  g_return_if_fail(GNC_WINDOW (window));
-  g_return_if_fail(GNC_PLUGIN_PAGE (page));
-
-  if (page->statusbar_text)
-    g_free(page->statusbar_text);
-  page->statusbar_text = g_strdup(message ? message : "");
-
-  gnc_window_update_status (window, page);
-}
-
-/************************************************************
- *             Auxiliary progress bar functions             *
- ************************************************************/
-
-/*
- * Single threaded hack.  Otherwise the window value has to be passed
- * all the way down to the backend and then back out again.  Not too
- * bad from C, but also has to be done in Scheme.
- */
-static GncWindow *progress_bar_hack_window = NULL;
-
-/*
- * Must be set to a valid window or to NULL (no window).
- */
-void
-gnc_window_set_progressbar_window (GncWindow *window)
-{
-  if (window != NULL) {
-    g_return_if_fail(GNC_WINDOW (window));
-  }
-
-  progress_bar_hack_window = window;
-}
-
-void
-gnc_window_show_progress (const char *message, double percentage)
-{
-  GncWindow *window;
-  GtkWidget *progressbar;
-
-  window = progress_bar_hack_window;
-  if (window == NULL) {
-    DEBUG( "no [progress_bar_hack]window" );
-    return;
-  }
-
-  progressbar = gnc_window_get_progressbar (window);
-  if (progressbar == NULL) {
-    DEBUG( "no progressbar in hack-window" );
-    return;
-  }
-
-  if (percentage < 0) {
-    gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progressbar), NULL);
-    gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progressbar), 0.0);
-  } else {
-    if (message)
-      gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progressbar), message);
-    gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progressbar), percentage/100);
-  }
-
-  /* make sure new text is up */
-  while (gtk_events_pending ())
-    gtk_main_iteration ();
-}
-
--- src/gnome/gnc-window.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* 
- * gnc-window.h -- structure which represents a GnuCash window.
- *
- * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
- * Copyright (C) 2003 David Hampton <hampton at employees.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, contact:
- *
- * Free Software Foundation           Voice:  +1-617-542-5942
- * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
- * Boston, MA  02111-1307,  USA       gnu at gnu.org
- */
-
-#ifndef __GNC_WINDOW_H
-#define __GNC_WINDOW_H
-
-#include <gtk/gtkwindow.h>
-#include "gnc-ui.h"
-#include "gnc-plugin-page.h"
-
-G_BEGIN_DECLS
-
-#define PLUGIN_PAGE_LABEL "plugin-page"
-
-/* type macros */
-#define GNC_TYPE_WINDOW            (gnc_window_get_type ())
-#define GNC_WINDOW(o)            (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_WINDOW, GncWindow))
-#define GNC_IS_WINDOW(o)         (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_WINDOW))
-#define GNC_WINDOW_GET_IFACE(o)  (G_TYPE_INSTANCE_GET_INTERFACE ((o), GNC_TYPE_WINDOW, GncWindowIface))
-
-/* typedefs & structures */
-//typedef struct GncWindow GncWindow; /* dummy typedef */
-
-typedef struct {
-	GTypeInterface parent;
-
-	/* Virtual Table */
-	GtkWidget * (* get_statusbar) (GncWindow *window);
-	GtkWidget * (* get_progressbar) (GncWindow *window);
-} GncWindowIface;
-
-/* function prototypes */
-GType          gnc_window_get_type (void);
-
-void           gnc_window_update_status (GncWindow *window, GncPluginPage *page);
-void           gnc_window_set_status (GncWindow *window, GncPluginPage *page, const gchar *message);
-
-void           gnc_window_set_progressbar_window (GncWindow *window);
-void           gnc_window_show_progress (const char *message, double percentage);
-
-G_END_DECLS
-
-#endif /* __GNC_WINDOW_H */
--- src/gnome/gnc-main-window.h
+++ /dev/null
@@ -1,268 +0,0 @@
-/* 
- * gnc-main-window.h -- GtkWindow which represents the
- *	GnuCash main window.
- *
- * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
- * Copyright (C) 2003,2005 David Hampton <hampton at employees.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, contact:
- *
- * Free Software Foundation           Voice:  +1-617-542-5942
- * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
- * Boston, MA  02111-1307,  USA       gnu at gnu.org
- */
-
-/** @addtogroup GUI
-    @{ */
-/** @addtogroup GuiWindow Main Window functions.
-    @{ */
-/** @file gnc-main-window.h
-    @brief Functions for adding content to a window.
-    @author Copyright (C) 2003,2005 David Hampton <hampton at employees.org>
-*/
-
-#ifndef __GNC_MAIN_WINDOW_H
-#define __GNC_MAIN_WINDOW_H
-
-#include <gtk/gtk.h>
-
-#include "gnc-ui.h"
-#include "gnc-plugin-page.h"
-
-G_BEGIN_DECLS
-
-#define PLUGIN_PAGE_LABEL "plugin-page"
-
-/* type macros */
-#define GNC_TYPE_MAIN_WINDOW            (gnc_main_window_get_type ())
-#define GNC_MAIN_WINDOW(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_MAIN_WINDOW, GncMainWindow))
-#define GNC_MAIN_WINDOW_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_MAIN_WINDOW, GncMainWindowClass))
-#define GNC_IS_MAIN_WINDOW(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_MAIN_WINDOW))
-#define GNC_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_MAIN_WINDOW))
-#define GNC_MAIN_WINDOW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_MAIN_WINDOW, GncMainWindowClass))
-
-/* typedefs & structures */
-typedef struct GncMainWindowPrivate GncMainWindowPrivate;
-
-struct GncMainWindow {
-	GtkWindow parent;
-
-	GtkUIManager *ui_merge;
-
-	GncMainWindowPrivate *priv;
-};
-
-typedef struct {
-	GtkWindowClass parent;
-
-	/* callbacks */
-	void (*page_added)   (GncMainWindow *window,
-			      GncPluginPage *page);
-	void (*page_changed) (GncMainWindow *window,
-			      GncPluginPage *page);
-} GncMainWindowClass;
-
-typedef struct {
-	GncMainWindow *window;
-	gpointer data;
-} GncMainWindowActionData;
-
-typedef void (*GncMainWindowFunc) (GncMainWindow *window, GncPluginPage *page);
-
-/* function prototypes */
-
-/** Get the type of a gnc main window.
- *
- *  @return A GType.
- */
-GType gnc_main_window_get_type (void);
-
-
-/** Create a new gnc main window plugin.
- *
- *  @return A pointer to the new object.
- */
-GncMainWindow *gnc_main_window_new (void);
-
-
-/** Display a data plugin page in a window.  If the page already
- *  exists in any window, then that window will be brought to the
- *  front and the notebook switch to display the specified page.  If
- *  the page is new then it will be added to the specified window.  If
- *  the window is NULL, the new page will be added to the first
- *  window.
- *
- *  @param window The window to display a new page in.
- *
- *  @param page The new page of data to be displayed, or the existing
- *  page of data the should be brought to the top and displayed.
- */
-void gnc_main_window_open_page (GncMainWindow *window,
-				GncPluginPage *page);
-
-
-/** Remove a data plugin page from a window and display the previous
- *  page.  If the page removed was the last page in the window, and
- *  there is more than one window open, then the entire window will be
- *  destroyed.
- *
- *  @param page The page of data to be removed.
- */
-void gnc_main_window_close_page (GncPluginPage *page);
-
-
-/** Retrieve a pointer to the page that is currently at the front of
- *  the specified window.  Any plugin that needs to manipulate its
- *  menus based upon the currently selected menu page should connect
- *  to the "page_changed" signal on a window.  The callback function
- *  from that signal can then call this function to obtain a pointer
- *  to the current page.
- *
- *  @param window A pointer to the window whose front page should be
- *  returned.
- *
- *  @return A pointer to the GncPluginPage currently at the front of
- *  the specified window.  If the window pointer is invalid or the
- *  window is empty, this function will return NULL.
- */
-GncPluginPage *gnc_main_window_get_current_page (GncMainWindow *window);
-
-
-/** Manually add a set of actions to the specified window.  Plugins
- *  whose user interface is not hard coded (e.g. the menu-additions *
- *  plugin) must create their actions at run time, then use this *
- *  function to install them into the window.
- *
- *  @param window A pointer to the window whose user interface should
- *  be updated.
- *
- *  @param group_name The name for this set of actions.  This name
- *  should be unique among all groups added to the window, and will be
- *  needed to remove the actions from this window.
- *
- *  @param group A pointer to an array of GtkActions.  These are the
- *  actions that will be added to the user interface.
- *
- *  @param merge_id A merge identifier retrieved from a call to
- *  gtk_ui_manager_new_merge_id().
- */
-void gnc_main_window_manual_merge_actions (GncMainWindow *window,
-					   const gchar *group_name,
-					   GtkActionGroup *group,
-					   guint merge_id);
-
-
-/** Add a set of actions to the specified window.  This function
- *  should not need to be called directly by plugin implementors.
- *  Correctly assigning values to the GncPluginClass fields during
- *  plugin initialization will cause this routine to be automatically
- *  called.
- *
- *  @param window A pointer to the window whose user interface should
- *  be updated.
- *
- *  @param group_name The name for this set of actions.  This name
- *  should be unique among all groups added to the window, and will be
- *  needed to remove the actions from this window.
- *
- *  @param entries A pointer to an array of GtkActionEntries.  These
- *  are the actions that will be added to the user interface.
- *
- *  @param n_entries The number of actions in the array.
- *
- *  @param filename The filename containing the user interface
- *  definition that goes with this set of actions.
- *
- *  @param user_data The data to be provided to all callback
- *  functions.
- */
-void gnc_main_window_merge_actions (GncMainWindow *window,
-				    const gchar *group_name,
-				    GtkActionEntry *entries,
-				    guint n_entries,
-				    const gchar *filename,
-				    gpointer user_data);
-
-
-/** Remove a set of actions from the specified window.  This function
- *  should not need to be called directly by plugin implementors.  It
- *  will automatically be called when a plugin is removed from a
- *  window.
- *
- *  @param window A pointer to the window whose user interface should
- *  be updated.
- *
- *  @param group_name The name for this set of actions.  This must be
- *  the same name provided when the actions were installed.
- */
-void gnc_main_window_unmerge_actions (GncMainWindow *window,
-				      const gchar *group_name);
-
-
-/** Force a full update of the user interface for the specified
- *  window.  This can be an expensive function, but is needed because
- *  the gtk ui manager doesn't always seem to update properly when
- *  actions are changed.
- *
- *  @param window A pointer to the window whose user interface should
- *  be updated.
- *
- *  @comment Is this function still needed?
- */
-void gnc_main_window_actions_updated (GncMainWindow *window);
-
-
-/** Retrieve a specific set of user interface actions from a window.
- *  This function can be used to get an group of action to be
- *  manipulated when the front page of a window has changed.
- *
- *  @param window The window to check when looking for the action group.
- *
- *  @param group_name The name of a set of actions.  This must be a
- *  name provided when the actions were installed.
- *
- *  @return A pointer to a GtkActionGroup that was added with the
- *  specified name.  If the name cannot be found, then NULL will be
- *  returned.
- */
-GtkActionGroup *gnc_main_window_get_action_group (GncMainWindow *window,
-						  const gchar *group_name);
-
-
-void gnc_main_window_update_title (GncMainWindow *window);
-
-
-/** Set the window where all progressbar updates should occur.  This
- *  is a wrapper around the gnc_window_set_progressbar_window()
- *  function.
- *
- *  @param window The window to use for all progressbar updates.
- */
-void gnc_main_window_set_progressbar_window( GncMainWindow *window );
-
-
-/** Shutdown gnucash.  This function will call the Scheme side of
- *  GnuCash to initiate an orderly shutdown, and when that has
- *  finished it will exit the program.
- *
- *  @param exit_status The exit status for the program.
- */
-void gnc_shutdown (int exit_status);
-
-G_END_DECLS
-
-#endif /* __GNC_MAIN_WINDOW_H */
-
-/** @} */
-/** @} */
--- src/gnome/gnc-main-window.c
+++ /dev/null
@@ -1,1710 +0,0 @@
-/* 
- * gnc-main-window.c -- GtkWindow which represents the
- *	GnuCash main window.
- *
- * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
- * Copyright (C) 2003,2005 David Hampton <hampton at employees.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, contact:
- *
- * Free Software Foundation           Voice:  +1-617-542-5942
- * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
- * Boston, MA  02111-1307,  USA       gnu at gnu.org
- */
-
-#include "config.h"
-
-#include <gdk/gdkpixbuf.h>
-#include <gtk/gtk.h>
-
-#include "gnc-main-window.h"
-
-#include "dialog-budget-list.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 "druid-acct-period.h"
-#include "druid-loan.h"
-#include "gnc-component-manager.h"
-#include "gnc-engine-util.h"
-#include "gnc-gnome-utils.h"
-#include "gnc-file.h"
-#include "gnc-gui-query.h"
-#include "gnc-plugin.h"
-#include "gnc-plugin-manager.h"
-#include "gnc-session.h"
-#include "dialog-totd.h"
-#include "gnc-ui.h"
-#include "gnc-version.h"
-#include "gnc-window.h"
-#include "messages.h"
-#include "druid-merge.h"
-#include "dialog-chart-export.h"
-#include "gnc-gconf-utils.h"
-// +JSLED
-#include "gnc-html.h"
-
-enum {
-  PAGE_ADDED,
-  PAGE_CHANGED,
-  LAST_SIGNAL
-};
-
-
-#define PLUGIN_PAGE_IMMUTABLE "page-immutable"
-
-#define DESKTOP_GNOME_INTERFACE "/desktop/gnome/interface"
-#define TOOLBAR_STYLE "/desktop/gnome/interface/toolbar_style"
-
-/** Static Globals *******************************************************/
-static short module = MOD_GUI;
-static GList *active_windows = NULL;
-
-/** Declarations *********************************************************/
-static void gnc_main_window_class_init (GncMainWindowClass *klass);
-static void gnc_main_window_init (GncMainWindow *window);
-static void gnc_main_window_finalize (GObject *object);
-
-static void gnc_main_window_setup_window (GncMainWindow *window);
-static void gnc_window_main_window_init (GncWindowIface *iface);
-
-/* Callbacks */
-static void gnc_main_window_add_widget (GtkUIManager *merge, GtkWidget *widget, GncMainWindow *window);
-static void gnc_main_window_switch_page (GtkNotebook *notebook, GtkNotebookPage *notebook_page, gint pos, GncMainWindow *window);
-static void gnc_main_window_plugin_added (GncPlugin *manager, GncPlugin *plugin, GncMainWindow *window);
-static void gnc_main_window_plugin_removed (GncPlugin *manager, GncPlugin *plugin, GncMainWindow *window);
-
-/* Command callbacks */
-static void gnc_main_window_cmd_file_new (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_file_open (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_file_open_new_window (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_file_save (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_file_save_as (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_file_qsf_import (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_file_export_accounts (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_chart_export (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_file_print (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_file_properties (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_file_close (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_file_quit (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_edit_cut (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_edit_copy (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_edit_paste (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_edit_preferences (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_edit_tax_options (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_view_refresh (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_view_toolbar (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_view_summary (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_view_statusbar (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_actions_scheduled_transaction_editor (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_actions_budget_workbench(GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_actions_since_last_run (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_actions_mortgage_loan (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_actions_close_books (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_tools_price_editor (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_tools_commodity_editor (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_tools_financial_calculator (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_tools_find_transactions (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_help_tutorial (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_help_totd (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_help_contents (GtkAction *action, GncMainWindow *window);
-static void gnc_main_window_cmd_help_about (GtkAction *action, GncMainWindow *window);
-
-static void gnc_main_window_cmd_test( GtkAction *action, GncMainWindow *window );
-
-struct GncMainWindowPrivate
-{
-	GtkWidget *menu_dock;
-	GtkWidget *toolbar_dock;
-	GtkWidget *notebook;
-	GtkWidget *statusbar;
-	GtkWidget *progressbar;
-
-	GtkWidget *summarybar_dock;
-	gboolean   show_summarybar;
-
-	GtkActionGroup *action_group;
-
-	GncPluginPage *current_page;
-	GList *installed_pages;
-	gint event_handler_id;
-
-
-	GHashTable *merged_actions_table;
-};
-
-typedef struct {
-	guint merge_id;
-	GtkActionGroup *action_group;
-} MergedActionEntry;
-
-static guint main_window_signals[LAST_SIGNAL] = { 0 };
-
-static GtkActionEntry gnc_menu_entries [] =
-{
-	/* Toplevel */
-	{ "FileAction", NULL, N_("_File"), NULL, NULL, NULL, },
-	{ "EditAction", NULL, N_("_Edit"), NULL, NULL, NULL },
-	{ "ViewAction", NULL, N_("_View"), NULL, NULL, NULL },
-	{ "ActionsAction", NULL, N_("_Actions"), NULL, NULL, NULL },
-	{ "ReportsAction", NULL, N_("_Reports"), NULL, NULL, NULL },
-	{ "ToolsAction", NULL, N_("_Tools"), NULL, NULL, NULL },
-	{ "ExtensionsAction", NULL, N_("E_xtensions"), NULL, NULL, NULL },
-	{ "HelpAction", NULL, N_("_Help"), NULL, NULL, NULL },
-	{ "MiscAction", NULL, N_("_Misc"), NULL, NULL, NULL },
-
-	/* File menu */
-	{ "FileNewAction", GTK_STOCK_NEW, N_("_New File"), "<control>n",
-	  N_("Create a new file"),
-	  G_CALLBACK (gnc_main_window_cmd_file_new) },
-	{ "FileOpenAction", GTK_STOCK_OPEN, N_("_Open"), NULL,
-	  NULL,
-	  G_CALLBACK (gnc_main_window_cmd_file_open) },
-	{ "FileOpenNewWindowAction", NULL, N_("Move to a New Window"), NULL,
-	  N_("Open a new top-level GnuCash window for the current page."),
-	  G_CALLBACK (gnc_main_window_cmd_file_open_new_window) },
-	{ "FileSaveAction", GTK_STOCK_SAVE, N_("_Save"), "<control>s",
-	  NULL,
-	  G_CALLBACK (gnc_main_window_cmd_file_save) },
-	{ "FileSaveAsAction", GTK_STOCK_SAVE_AS, N_("Save _As..."), "<shift><control>s",
-	  NULL,
-	  G_CALLBACK (gnc_main_window_cmd_file_save_as) },
-	{ "FileImportAction", NULL, N_("_Import"), NULL, NULL, NULL },
-	{ "FileImportQSFAction", GTK_STOCK_CONVERT,
-		N_("_QSF Import"), NULL,
-		N_("Import a QSF object file"),
-		G_CALLBACK (gnc_main_window_cmd_file_qsf_import) },
-	{ "FileExportAction", NULL, N_("_Export"), NULL, NULL, NULL },
-	{ "FileExportAccountsAction", GTK_STOCK_CONVERT,
-		N_("Export _Accounts"), NULL,
-		N_("Export the account hierarchy to a new file"),
-		G_CALLBACK (gnc_main_window_cmd_file_export_accounts) },
-	{ "FileExportChartAction", GTK_STOCK_CONVERT,
-		N_("Export _Chart of Accounts"), NULL,
-		N_("Export the chart of accounts for a date with balances"),
-		G_CALLBACK (gnc_main_window_cmd_chart_export) },
-	{ "FilePrintAction", GTK_STOCK_PRINT, N_("_Print..."), "<control>p",
-	  NULL,
-	  G_CALLBACK (gnc_main_window_cmd_file_print) },
-	{ "FilePropertiesAction", GTK_STOCK_PROPERTIES, N_("Properties..."), NULL,
-	  NULL,
-	  G_CALLBACK (gnc_main_window_cmd_file_properties) },
-	{ "FileCloseAction", GTK_STOCK_CLOSE, N_("_Close"), "<control>w",
-	  NULL,
-	  G_CALLBACK (gnc_main_window_cmd_file_close) },
-	{ "FileQuitAction", GTK_STOCK_QUIT, N_("_Quit"), NULL,
-	  NULL,
-	  G_CALLBACK (gnc_main_window_cmd_file_quit) },
-
-	/* Edit menu */
-	{ "EditCutAction", GTK_STOCK_CUT, N_("Cu_t"), "<control>x",
-	  NULL,
-	  G_CALLBACK (gnc_main_window_cmd_edit_cut) },
-	{ "EditCopyAction", GTK_STOCK_COPY, N_("_Copy"), "<control>c",
-	  NULL,
-	  G_CALLBACK (gnc_main_window_cmd_edit_copy) },
-	{ "EditPasteAction", GTK_STOCK_PASTE, N_("_Paste"), "<control>v",
-	  NULL,
-	  G_CALLBACK (gnc_main_window_cmd_edit_paste) },
-	{ "EditPreferencesAction", GTK_STOCK_PREFERENCES, N_("_Preferences"), NULL,
-	  NULL,
-	  G_CALLBACK (gnc_main_window_cmd_edit_preferences) },
-	{ "EditTaxOptionsAction", NULL, N_("Ta_x Options"), NULL,
-	  N_("Setup tax information for all income and expense accounts"),
-	  G_CALLBACK (gnc_main_window_cmd_edit_tax_options) },
-
-	/* View menu */
-	{ "ViewRefreshAction", GTK_STOCK_REFRESH, N_("_Refresh"), "<control>r",
-	  N_("Refresh this window"),
-	  G_CALLBACK (gnc_main_window_cmd_view_refresh) },
-
-	/* Actions menu */
-	{ "ActionsScheduledTransactionsAction", NULL, N_("_Scheduled Transactions"), NULL, NULL, NULL },
-	{ "ActionsScheduledTransactionEditorAction", NULL, N_("_Scheduled Transaction Editor"), NULL,
-	  N_("The list of Scheduled Transactions"),
-	  G_CALLBACK (gnc_main_window_cmd_actions_scheduled_transaction_editor) },
-	{ "ActionsSinceLastRunAction", NULL, N_("_Since Last Run..."), NULL,
-	  N_("Create Scheduled Transactions since the last time run"),
-	  G_CALLBACK (gnc_main_window_cmd_actions_since_last_run) },
-	{ "ActionsMortgageLoanAction", NULL, N_("_Mortgage & Loan Repayment..."), NULL,
-	  N_("Setup scheduled transactions for repayment of a loan"),
-	  G_CALLBACK (gnc_main_window_cmd_actions_mortgage_loan) },
-	{ "ActionsBudgetWorkbenchAction", NULL, N_("_Budget Workbench (Experimental)"), NULL, 
-      N_("Create, Manage, and Monitor Budgets." ),
-      G_CALLBACK(gnc_main_window_cmd_actions_budget_workbench) },
-	{ "ActionsCloseBooksAction", NULL, N_("Close Books"), NULL,
-	  N_("Archive old data using accounting periods"),
-	  G_CALLBACK (gnc_main_window_cmd_actions_close_books) },
-
-	/* Tools menu */
-	{ "ToolsPriceEditorAction", NULL, N_("_Price Editor"), NULL,
-	  N_("View and edit the prices for stocks and mutual funds"),
-	  G_CALLBACK (gnc_main_window_cmd_tools_price_editor) },
-	{ "ToolsCommodityEditorAction", NULL, N_("Commodity _Editor"), NULL,
-	  N_("View and edit the commodities for stocks and mutual funds"),
-	  G_CALLBACK (gnc_main_window_cmd_tools_commodity_editor) },
-	{ "ToolsFinancialCalculatorAction", NULL, N_("Financial _Calculator"), NULL,
-	  N_("Use the financial calculator"),
-	  G_CALLBACK (gnc_main_window_cmd_tools_financial_calculator) },
-	{ "ToolsFindTransactionsAction", GTK_STOCK_FIND, N_("_Find Transactions"), "<control>f",
-	  N_("Find transactions with a search"),
-	  G_CALLBACK (gnc_main_window_cmd_tools_find_transactions) },
-
-	/* Extensions menu */
-
-	/* Help menu */
-	{ "HelpTutorialAction", GNOME_STOCK_BOOK_BLUE, N_("Tutorial and Concepts _Guide"), NULL,
-	  N_("Open the GnuCash Tutorial"),
-	  G_CALLBACK (gnc_main_window_cmd_help_tutorial) },
-	{ "HelpTipsOfTheDayAction", NULL, N_("_Tips Of The Day"), NULL,
-	  N_("View the Tips of the Day"),
-	  G_CALLBACK (gnc_main_window_cmd_help_totd) },
-	{ "HelpContentsAction", GTK_STOCK_HELP, N_("_Contents"), NULL,
-	  N_("Open the GnuCash Help"),
-	  G_CALLBACK (gnc_main_window_cmd_help_contents) },
-	{ "HelpAboutAction", GNOME_STOCK_ABOUT, N_("_About"), NULL,
-	  NULL,
-	  G_CALLBACK (gnc_main_window_cmd_help_about) },
-
-        /* Misc menu */
-        { "MiscTestAction", NULL, N_("TEST"), NULL,
-          N_("Testing stuff"), G_CALLBACK (gnc_main_window_cmd_test) },
-
-};
-static guint gnc_menu_n_entries = G_N_ELEMENTS (gnc_menu_entries);
-
-static GtkToggleActionEntry toggle_entries [] =
-{
-	{ "ViewToolbarAction", NULL, N_("_Toolbar"), "<shift><control>t",
-	  N_("Show/hide the toolbar on this window"),
-	  G_CALLBACK (gnc_main_window_cmd_view_toolbar), TRUE },
-	{ "ViewSummaryAction", NULL, N_("S_ummary Bar"), NULL,
-	  N_("Show/hide the summary bar on this window"),
-	  G_CALLBACK (gnc_main_window_cmd_view_summary), TRUE },
-	{ "ViewStatusbarAction", NULL, N_("_Status Bar"), NULL,
-	  N_("Show/hide the status bar on this window"),
-	  G_CALLBACK (gnc_main_window_cmd_view_statusbar), TRUE },
-};
-static guint n_toggle_entries = G_N_ELEMENTS (toggle_entries);
-
-static const gchar *immutable_account_actions[] = {
-	"FileCloseAction",
-	"FileOpenNewWindowAction",
-	NULL
-};
-
-static GObjectClass *parent_class = NULL;
-
-static GQuark window_type = 0;
-
-/************************************************************
- *                                                          *
- ************************************************************/
-
-static void
-gnc_main_window_save_window (GncMainWindow *window, gpointer session)
-{
-  DEBUG("window %p", window);
-}
-
-static void
-gnc_main_window_shutdown (gpointer session, gpointer user_data)
-{
-  DEBUG("session %p (%s)", session, qof_session_get_url (session));
-  g_list_foreach (active_windows, (GFunc)gnc_main_window_save_window, session);
-}
-
-
-/** Look through the list of pages installed in this window and see if
- *  the specified page is there.
- *
- *  @param page The page to search for.
- *
- *  @return TRUE if the page is present in the window, FALSE otherwise.
- */
-static gboolean
-gnc_main_window_page_exists (GncPluginPage *page)
-{
-	GncMainWindow *window;
-	GList *walker;
-
-	for (walker = active_windows; walker; walker = g_list_next(walker)) {
-	  window = walker->data;
-	  if (g_list_find(window->priv->installed_pages, page)) {
-	    return TRUE;
-	  }
-	}
-	return FALSE;
-}
-
-/** This function handles any event notifications from the engine.
- *  The only event it currently cares about is the deletion of a book.
- *  When a book is deleted, it runs through all installed pages
- *  looking for pages that reference the just (about to be?) deleted
- *  book.  It closes any page it finds so there are no dangling
- *  references to the book.
- *
- *  @param entity     The guid the item being added, deleted, etc.
- *
- * @param type        The type of the item being added, deleted, etc. This
- *                    function only cares about a type of GNC_ID_BOOK.
- *
- * @param event_type  The type of the event.  This function only cares
- *                    about an event type of GNC_EVENT_DESTROY.
- *
- * @param user_data   A pointer to the window data structure.
- */
-static void
-gnc_main_window_event_handler (GUID *entity, QofIdType type,
-			       GNCEngineEventType event_type,
-			       gpointer user_data)
-{
-	GncMainWindow *window;
-	GncPluginPage *page;
-	GList *item, *next;
-
-	/* hard failures */
-	g_return_if_fail(GNC_IS_MAIN_WINDOW(user_data));
-
-	/* soft failures */
-	if (safe_strcmp(type, GNC_ID_BOOK) != 0)
-	  return;
-	if (event_type !=  GNC_EVENT_DESTROY)
-	  return;
-
-	ENTER("entity %p of type %s, event %d, window %p",
-	      entity, type, event_type, user_data);
-	window = GNC_MAIN_WINDOW(user_data);
-
-	for (item = window->priv->installed_pages; item; item = next) {
-	  next = g_list_next(item);
-	  page = GNC_PLUGIN_PAGE(item->data);
-	  if (!gnc_plugin_page_has_book (page, entity))
-	    continue;
-	  gnc_main_window_close_page (page);
-	}
-	LEAVE(" ");
-}
-
-/************************************************************
- *                   Widget Implementation                  *
- ************************************************************/
-
-/*  Get the type of a gnc main window.
- */
-GType
-gnc_main_window_get_type (void)
-{
-	static GType gnc_main_window_type = 0;
-
-	if (gnc_main_window_type == 0) {
-		static const GTypeInfo our_info = {
-			sizeof (GncMainWindowClass),
-			NULL,
-			NULL,
-			(GClassInitFunc) gnc_main_window_class_init,
-			NULL,
-			NULL,
-			sizeof (GncMainWindow),
-			0,
-			(GInstanceInitFunc) gnc_main_window_init
-		};
-
-		static const GInterfaceInfo plugin_info = {
-		  (GInterfaceInitFunc) gnc_window_main_window_init,
-		  NULL,
-		  NULL
-		};
-
-		gnc_main_window_type = g_type_register_static (GTK_TYPE_WINDOW,
-							       "GncMainWindow",
-							       &our_info, 0);
-		g_type_add_interface_static (gnc_main_window_type,
-					     GNC_TYPE_WINDOW,
-					     &plugin_info);
-	}
-
-	return gnc_main_window_type;
-}
-
-
-/** Initialize the class for the new gnucash main window.  This will
- *  set up any function pointers that override functions in the parent
- *  class, and also the signals that this class of widget can
- *  generate.
- *
- *  @param klass The new class structure created by the object system.
- *
- *  @internal
- */
-static void
-gnc_main_window_class_init (GncMainWindowClass *klass)
-{
-	GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
-	parent_class = g_type_class_peek_parent (klass);
-
-	window_type = g_quark_from_static_string ("gnc-main-window");
-
-	object_class->finalize = gnc_main_window_finalize;
-
-	/**
-	 * GncMainWindow::page_added:
-	 * @window: the #GncMainWindow
-	 * @page: the #GncPluginPage
-	 *
-	 * The "page_added" signal is emitted when a new page is added
-	 * to the notebook of a GncMainWindow.  This can be used to
-	 * attach a signal from the page so that menu actions can be
-	 * adjusted based upon events that occur within the page
-	 * (e.g. an account is selected.)
-	 */
-	main_window_signals[PAGE_ADDED] =
-	  g_signal_new ("page_added",
-			G_OBJECT_CLASS_TYPE (object_class),
-			G_SIGNAL_RUN_FIRST,
-			G_STRUCT_OFFSET (GncMainWindowClass, page_added),
-			NULL, NULL,
-			g_cclosure_marshal_VOID__OBJECT,
-			G_TYPE_NONE, 1,
-			G_TYPE_OBJECT);
-
-	/**
-	 * GncMainWindow::page_changed:
-	 * @window: the #GncMainWindow
-	 * @page: the #GncPluginPage
-	 *
-	 * The "page_changed" signal is emitted when a new page is
-	 * selected in the notebook of a GncMainWindow.  This can be
-	 * used to to adjust menu actions based upon which page is
-	 * currently displayed in a window.
-	 */
-	main_window_signals[PAGE_CHANGED] =
-	  g_signal_new ("page_changed",
-			G_OBJECT_CLASS_TYPE (object_class),
-			G_SIGNAL_RUN_FIRST,
-			G_STRUCT_OFFSET (GncMainWindowClass, page_changed),
-			NULL, NULL,
-			g_cclosure_marshal_VOID__OBJECT,
-			G_TYPE_NONE, 1,
-			G_TYPE_OBJECT);
-
-	qof_session_add_close_hook(gnc_main_window_shutdown, NULL);
-}
-
-
-/** Initialize a new instance of a gnucash main window.  This function
- *  allocates and initializes the object private storage space.  It
- *  also adds the new object to a list (for memory tracking purposes).
- *
- *  @param view The new object instance created by the object system.
- *
- *  @internal
- */
-static void
-gnc_main_window_init (GncMainWindow *window)
-{
-	window->priv = g_new0 (GncMainWindowPrivate, 1);
-
-	window->priv->merged_actions_table =
-	  g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
-
-	window->priv->event_handler_id =
-	  gnc_engine_register_event_handler(gnc_main_window_event_handler,
-					    window);
-
-	gnc_main_window_setup_window (window);
-}
-
-
-/** Finalize the GncMainWindow object.  This function is called from
- *  the G_Object level to complete the destruction of the object.  It
- *  should release any memory not previously released by the destroy
- *  function (i.e. the private data structure), then chain up to the
- *  parent's destroy function.
- *
- *  @param object The object being destroyed.
- *
- *  @internal
- */
-static void
-gnc_main_window_finalize (GObject *object)
-{
-	GncMainWindow *window;
-
-	g_return_if_fail (object != NULL);
-	g_return_if_fail (GNC_IS_MAIN_WINDOW (object));
-
-	window = GNC_MAIN_WINDOW (object);
-	active_windows = g_list_remove (active_windows, window);
-
-	g_return_if_fail (window->priv != NULL);
-
-	gnc_gconf_remove_notification(G_OBJECT(window), DESKTOP_GNOME_INTERFACE);
-
-	gnc_engine_unregister_event_handler(window->priv->event_handler_id);
-	g_hash_table_destroy (window->priv->merged_actions_table);
-	g_free (window->priv);
-
-	G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-
-/*  Create a new gnc main window plugin.
- */
-GncMainWindow *
-gnc_main_window_new (void)
-{
-	GncMainWindow *window;
-
-	window = g_object_new (GNC_TYPE_MAIN_WINDOW, NULL);
-	active_windows = g_list_append (active_windows, window);
-	return window;
-}
-
-/************************************************************
- *                     Utility Functions                    *
- ************************************************************/
-
-/** Connect a GncPluginPage to the window.  This function will insert
- *  the page in to the window's notebook and its list of active pages.
- *  It will also emit the "inserted" signal on the page, and the
- *  "add_page" signal on the window.  This function does not connect
- *  the page's summarybar widget (if any).  That will be connected in
- *  a callback function generated by the page being inserted into the
- *  notebook.
- *
- *  @param window The window where the new page should be added.
- *
- *  @param page The GncPluginPage that should be added to the window.
- *  The visible widget for this plugin must have already been created.
- *
- *  @param tab_widget The widget that should be added into the
- *  notebook tab for this page.  Generally this is a GtkLabel, but
- *  could also be a GtkHBox containing an icon and a label.
- *
- *  @internal
- */
-static void
-gnc_main_window_connect (GncMainWindow *window,
-			 GncPluginPage *page,
-			 GtkWidget *tab_widget)
-{
-	GtkNotebook *notebook;
-
-	page->window = GTK_WIDGET(window);
-	notebook = GTK_NOTEBOOK (window->priv->notebook);
-	gtk_notebook_append_page (notebook, page->notebook_page, tab_widget);
-	gnc_plugin_page_inserted (page);
-	gtk_notebook_set_current_page (notebook, -1);
-	window->priv->installed_pages =
-	  g_list_append (window->priv->installed_pages, page);
-	g_signal_emit (window, main_window_signals[PAGE_ADDED], 0, page);
-}
-
-
-/** Disconnect a GncPluginPage page from the window.  If this page is
- *  currently foremost in the window's notebook, its user interface
- *  actions will be disconnected and the page's summarybar widget (if
- *  any) will be removed.  The page is then removed from the window's
- *  notebook and its list of active pages.
- *
- *  @param window The window the page should be removed from.
- *
- *  @param page The GncPluginPage that should be removed from the
- *  window.
- *
- *  @internal
- */
-static void
-gnc_main_window_disconnect (GncMainWindow *window,
-			    GncPluginPage *page)
-{
-	GtkNotebook *notebook;
-	gint page_num;
-
-	/* Disconnect the page and summarybar from the window */
-	if (window->priv->current_page == page) {
-		gnc_plugin_page_unmerge_actions (page, window->ui_merge);
-		gnc_plugin_page_unselected (page);
-		window->priv->current_page = NULL;
-
-		if (page->summarybar) {
-			gtk_container_remove(GTK_CONTAINER(window->priv->summarybar_dock),
-					     page->summarybar);
-		}
-	}
-
-	/* Remove it from the list of pages in the window */
-	window->priv->installed_pages =
-	  g_list_remove (window->priv->installed_pages, page);
-
-
-	/* Remove the page from the notebook */
-	notebook = GTK_NOTEBOOK (window->priv->notebook);
-	page_num =  gtk_notebook_page_num(notebook, page->notebook_page);
-	gtk_notebook_remove_page (notebook, page_num);
-
-	if ( gtk_notebook_get_current_page(notebook) == -1) {
-	  /* Need to synthesize a page changed signal when the last
-	   * page is removed.  The notebook doesn't generate a signal
-	   * for this, therefore the switch_page code in this file
-	   * never gets called to generate this signal. */
-	  gnc_main_window_switch_page(notebook, NULL, -1, window);
-	  //g_signal_emit (window, main_window_signals[PAGE_CHANGED], 0, NULL);
-	}
-
-	gnc_plugin_page_removed (page);
-
-	gtk_ui_manager_ensure_update (window->ui_merge);
-	gnc_window_set_status (GNC_WINDOW(window), page, NULL);
-}
-
-
-/************************************************************
- *                                                          *
- ************************************************************/
-
-
-/*  Display a data plugin page in a window.  If the page already
- *  exists in any window, then that window will be brought to the
- *  front and the notebook switch to display the specified page.  If
- *  the page is new then it will be added to the specified window.  If
- *  the window is NULL, the new page will be added to the first
- *  window.
- */
-void
-gnc_main_window_open_page (GncMainWindow *window,
-			   GncPluginPage *page)
-{
-	GtkWidget *label_box;
-	GtkWidget *label;
-	const gchar *icon;
-	GtkWidget *image;
-	GtkNotebook *notebook;
-	gint page_num;
-
-	if (window)
-	  g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
-	g_return_if_fail (GNC_IS_PLUGIN_PAGE (page));
-	g_return_if_fail (gnc_plugin_page_has_books(page));
-
-	if (gnc_main_window_page_exists(page)) {
-	  window = GNC_MAIN_WINDOW (page->window);
-	  notebook = GTK_NOTEBOOK (window->priv->notebook);
-	  page_num = gtk_notebook_page_num(notebook, page->notebook_page);
-	  gtk_notebook_set_current_page (notebook, page_num);
-	  gtk_window_present(GTK_WINDOW(window));
-	  return;
-	}
-
-	if ((window == NULL) && active_windows)
-	  window = active_windows->data;
-
-	/* Is this the first page in the first window? */
-	if ((window == active_windows->data) &&
-	    (window->priv->installed_pages == NULL)) {
-	  g_object_set_data (G_OBJECT (page), PLUGIN_PAGE_IMMUTABLE,
-			     GINT_TO_POINTER(1));
-	}
-
-	page->notebook_page = gnc_plugin_page_create_widget (page);
-	g_object_set_data (G_OBJECT (page->notebook_page),
-			   PLUGIN_PAGE_LABEL, page);
-
-	icon = GNC_PLUGIN_PAGE_GET_CLASS(page)->tab_icon;
-	label = gtk_label_new (page->tab_name);
-	gtk_widget_show (label);
-
-	if (icon != NULL) {
-		/* FIXME */
-		label_box = gtk_hbox_new (FALSE, 6);
-		gtk_widget_show (label_box);
-		image = gtk_image_new_from_stock (icon, GTK_ICON_SIZE_MENU);
-		gtk_widget_show (image);
-		gtk_box_pack_start (GTK_BOX (label_box), image, FALSE, FALSE, 0);
-		gtk_box_pack_start (GTK_BOX (label_box), label, TRUE, TRUE, 0);
-	} else {
-		label_box = label;
-	}
-	
-	gnc_main_window_connect(window, page, label_box);
-}
-
-
-/*  Remove a data plugin page from a window and display the previous
- *  page.  If the page removed was the last page in the window, and
- *  there is more than one window open, then the entire window will be
- *  destroyed.
- */
-void
-gnc_main_window_close_page (GncPluginPage *page)
-{
-	GncMainWindow *window;
-
-	if (!page->notebook_page)
-		return;
-
-	window = GNC_MAIN_WINDOW (page->window);
-	if (!window) {
-	  g_warning("Page is not in a window.");
-	  return;
-	}
-
-	gnc_main_window_disconnect(window, page);
-	gnc_plugin_page_destroy_widget (page);
-	g_object_unref(page);
-
-	/* If this isn't the last window, go ahead and destroy the window. */
-	if (window->priv->installed_pages == NULL) {
-		if (g_list_length(active_windows) > 1) {
-			gtk_widget_destroy(GTK_WIDGET(window));
-		}
-	}
-}
-
-
-/*  Retrieve a pointer to the page that is currently at the front of
- *  the specified window.  Any plugin that needs to manipulate its
- *  menus based upon the currently selected menu page should connect
- *  to the "page_changed" signal on a window.  The callback function
- *  from that signal can then call this function to obtain a pointer
- *  to the current page.
- */
-GncPluginPage *
-gnc_main_window_get_current_page (GncMainWindow *window)
-{
-	return window->priv->current_page;
-}
-
-
-/*  Manually add a set of actions to the specified window.  Plugins
- *  whose user interface is not hard coded (e.g. the menu-additions *
- *  plugin) must create their actions at run time, then use this *
- *  function to install them into the window.
- */
-void
-gnc_main_window_manual_merge_actions (GncMainWindow *window,
-				      const gchar *group_name,
-				      GtkActionGroup *group,
-				      guint merge_id)
-{
-	MergedActionEntry *entry;
-
-	g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
-	g_return_if_fail (group_name != NULL);
-	g_return_if_fail (GTK_IS_ACTION_GROUP(group));
-	g_return_if_fail (merge_id > 0);
-
-	entry = g_new0 (MergedActionEntry, 1);
-	entry->action_group = group;
-	entry->merge_id = merge_id;
-	gtk_ui_manager_ensure_update (window->ui_merge);
-	g_hash_table_insert (window->priv->merged_actions_table, g_strdup (group_name), entry);
-}
-
-
-/*  Add a set of actions to the specified window.  This function
- *  should not need to be called directly by plugin implementors.
- *  Correctly assigning values to the GncPluginClass fields during
- *  plugin initialization will cause this routine to be automatically
- *  called.
- */
-void
-gnc_main_window_merge_actions (GncMainWindow *window,
-			       const gchar *group_name,
-			       GtkActionEntry *actions,
-			       guint n_actions,
-			       const gchar *filename,
-			       gpointer user_data)
-{
-	GncMainWindowActionData *data;
-	MergedActionEntry *entry;
-	GError *error = NULL;
-	gchar *pathname;
-
-	g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
-	g_return_if_fail (group_name != NULL);
-	g_return_if_fail (actions != NULL);
-	g_return_if_fail (n_actions > 0);
-	g_return_if_fail (filename != NULL);
-
-	data = g_new0 (GncMainWindowActionData, 1);
-	data->window = window;
-	data->data = user_data;
-
-	pathname = gnc_gnome_locate_ui_file (filename);
-	if (pathname == NULL)
-	  return;
-
-	entry = g_new0 (MergedActionEntry, 1);
-	entry->action_group = gtk_action_group_new (group_name);
-	gtk_action_group_add_actions (entry->action_group, actions, n_actions, data);
-	gtk_ui_manager_insert_action_group (window->ui_merge, entry->action_group, 0);
-	entry->merge_id = gtk_ui_manager_add_ui_from_file (window->ui_merge, pathname, &error);
-	g_assert(entry->merge_id || error);
-	if (entry->merge_id) {
-	  gtk_ui_manager_ensure_update (window->ui_merge);
-	  g_hash_table_insert (window->priv->merged_actions_table, g_strdup (group_name), entry);
-	} else {
-	  g_critical("Failed to load ui file.\n  Filename %s\n  Error %s",
-		     filename, error->message);
-	  g_error_free(error);
-	  g_free(entry);
-	}
-	g_free(pathname);
-}
-
-
-/*  Remove a set of actions from the specified window.  This function
- *  should not need to be called directly by plugin implementors.  It
- *  will automatically be called when a plugin is removed from a
- *  window.
- */
-void
-gnc_main_window_unmerge_actions (GncMainWindow *window,
-				 const gchar *group_name)
-{
-	MergedActionEntry *entry;
-
-	g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
-	g_return_if_fail (group_name != NULL);
-
-	entry = g_hash_table_lookup (window->priv->merged_actions_table, group_name);
-
-	if (entry == NULL)
-		return;
-
-	gtk_ui_manager_remove_action_group (window->ui_merge, entry->action_group);
-	gtk_ui_manager_remove_ui (window->ui_merge, entry->merge_id);
-	gtk_ui_manager_ensure_update (window->ui_merge);
-
-	g_hash_table_remove (window->priv->merged_actions_table, group_name);
-}
-
-
-/*  Force a full update of the user interface for the specified
- *  window.  This can be an expensive function, but is needed because
- *  the gtk ui manager doesn't always seem to update properly when
- *  actions are changed.
- */
-void
-gnc_main_window_actions_updated (GncMainWindow *window)
-{
-	GtkActionGroup *force;
-
-	g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
-
-	/* Unfortunately gtk_ui_manager_ensure_update doesn't work
-	 * here.  Force a full update by adding and removing an empty
-	 * action group.
-	 */
-	force = gtk_action_group_new("force_update");
-	gtk_ui_manager_insert_action_group (window->ui_merge, force, 0);
-	gtk_ui_manager_ensure_update (window->ui_merge);
-	gtk_ui_manager_remove_action_group (window->ui_merge, force);
-	g_object_unref(force);
-}
-
-
-/*  Retrieve a specific set of user interface actions from a window.
- *  This function can be used to get an group of action to be
- *  manipulated when the front page of a window has changed.
- */
-GtkActionGroup *
-gnc_main_window_get_action_group (GncMainWindow *window,
-				  const gchar *group_name)
-{
-	MergedActionEntry *entry;
-
-	g_return_val_if_fail (GNC_IS_MAIN_WINDOW (window), NULL);
-	g_return_val_if_fail (group_name != NULL, NULL);
-
-	entry = g_hash_table_lookup (window->priv->merged_actions_table, group_name);
-
-	if (entry == NULL)
-		return NULL;
-
-	return entry->action_group;
-}
-
-
-static void
-gnc_main_window_add_plugin (gpointer plugin,
-			    gpointer window)
-{
-	g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
-	g_return_if_fail (GNC_IS_PLUGIN (plugin));
-
-	gnc_plugin_add_to_window (GNC_PLUGIN (plugin),
-				  GNC_MAIN_WINDOW (window),
-				  window_type);
-}
-
-static void
-gnc_main_window_update_toolbar (GncMainWindow *window,
-				const gchar *style_name)
-{
-	GtkToolbarStyle style;
-	GSList *list;
-
-	ENTER("window %p, style %s", window, style_name);
-
-	style = gnc_enum_from_nick(GTK_TYPE_TOOLBAR_STYLE, style_name,
-				   GTK_TOOLBAR_BOTH);
-	list = gtk_ui_manager_get_toplevels(window->ui_merge, GTK_UI_MANAGER_TOOLBAR);
-	g_slist_foreach(list, (GFunc)gtk_toolbar_set_style, GINT_TO_POINTER(style));
-	g_slist_free(list);
-	LEAVE("");
-}
-
-static void
-gnc_main_window_gconf_changed (GConfClient *client,
-			       guint cnxn_id,
-			       GConfEntry *entry,
-			       gpointer user_data)
-{
-	GncMainWindow *window;
-	GConfValue *value;
-	const gchar *key;
-
-	window = GNC_MAIN_WINDOW(user_data);
-
-	key = gconf_entry_get_key(entry);
-	value = gconf_entry_get_value(entry);
-	if (!key || !value)
-	  return;
-
-	if (strcmp(key, TOOLBAR_STYLE) == 0) {
-	  gnc_main_window_update_toolbar(window, gconf_value_get_string(value));
-	  return;
-	}
-}
-
-static void
-gnc_main_window_setup_window (GncMainWindow *window)
-{
-	GncMainWindowPrivate *priv;
-	GtkWidget *main_vbox;
-	guint merge_id;
-	GncPluginManager *manager;
-	GList *plugins;
-	GError *error = NULL;
-	gchar *filename, *style;
-	SCM debugging;
-
-	/* Create widgets and add them to the window */
-	main_vbox = gtk_vbox_new (FALSE, 0);
-	gtk_widget_show (main_vbox);
-	gtk_container_add (GTK_CONTAINER (window), main_vbox);
-
-	priv = window->priv;
-	priv->menu_dock = gtk_vbox_new (FALSE, 0);
-	gtk_widget_show (priv->menu_dock);
-	gtk_box_pack_start (GTK_BOX (main_vbox), priv->menu_dock,
-			    FALSE, TRUE, 0);
-
-	priv->notebook = gtk_notebook_new ();
-	gtk_widget_show (priv->notebook);
-	g_signal_connect (G_OBJECT (priv->notebook), "switch-page",
-			  G_CALLBACK (gnc_main_window_switch_page), window);
-	gtk_box_pack_start (GTK_BOX (main_vbox), priv->notebook,
-			    TRUE, TRUE, 0);
-
-	priv->show_summarybar = TRUE;
-	priv->summarybar_dock = gtk_vbox_new (FALSE, 0);
-	gtk_widget_show (priv->summarybar_dock);
-	gtk_box_pack_start (GTK_BOX (main_vbox), priv->summarybar_dock,
-			    FALSE, TRUE, 0);
-
-	priv->statusbar = gtk_statusbar_new ();
-	gtk_widget_show (priv->statusbar);
-	gtk_box_pack_start (GTK_BOX (main_vbox), priv->statusbar,
-	                           FALSE, TRUE, 0);
-        gtk_statusbar_set_has_resize_grip( GTK_STATUSBAR(priv->statusbar), TRUE );
-
-	priv->progressbar = gtk_progress_bar_new ();
-	gtk_widget_show (priv->progressbar);
-	gtk_box_pack_start (GTK_BOX (priv->statusbar), priv->progressbar,
-			    FALSE, TRUE, 0);
-
-	window->ui_merge = gtk_ui_manager_new ();
-
-	/* Create menu and toolbar information */
-	priv->action_group = gtk_action_group_new ("MainWindowActions");
-	gtk_action_group_add_actions (priv->action_group, gnc_menu_entries,
-				      gnc_menu_n_entries, window);
-	gtk_action_group_add_toggle_actions (priv->action_group, 
-					     toggle_entries, n_toggle_entries, 
-					     window);
-	gtk_ui_manager_insert_action_group (window->ui_merge, priv->action_group, 0);
-
-	g_signal_connect (G_OBJECT (window->ui_merge), "add_widget",
-			  G_CALLBACK (gnc_main_window_add_widget), window);
-	filename = gnc_gnome_locate_ui_file("gnc-main-window-ui.xml");
-
-	/* Can't do much without a ui. */
-	g_assert (filename);
-
-	merge_id = gtk_ui_manager_add_ui_from_file (window->ui_merge,
-						    filename, &error);
-	g_assert(merge_id || error);
-	if (merge_id) {
-	  gtk_window_add_accel_group (GTK_WINDOW (window),
-				      gtk_ui_manager_get_accel_group(window->ui_merge));
-	  gtk_ui_manager_ensure_update (window->ui_merge);
-	} else {
-	  g_critical("Failed to load ui file.\n  Filename %s\n  Error %s",
-		     filename, error->message);
-	  g_error_free(error);
-	  g_assert(merge_id != 0);
-	}
-	g_free(filename);
-
-	gnc_gconf_add_notification(G_OBJECT(window), DESKTOP_GNOME_INTERFACE,
-				   gnc_main_window_gconf_changed);
-	style = gnc_gconf_get_string(TOOLBAR_STYLE, NULL, NULL);
-	gnc_main_window_update_toolbar(window, style);
-	g_free(style);
-
-        /* Testing */
-        {
-                guint new_merge_id;
-                GtkActionGroup *eag;
-                GtkActionEntry newEntry[] =
-                        {
-                          { "BarAction", NULL, N_("_GtkHtml3 test"), "<control>3", NULL, G_CALLBACK (gnc_main_window_cmd_test) }
-                        };
-
-                eag = gtk_action_group_new ("MainWindowActions2");
-
-                gtk_action_group_add_actions (eag, newEntry,
-                                              G_N_ELEMENTS (newEntry), window);
-                gtk_ui_manager_insert_action_group( window->ui_merge, eag, 0 );
-
-                new_merge_id = gtk_ui_manager_new_merge_id( window->ui_merge );
-
-                gtk_ui_manager_add_ui( window->ui_merge, new_merge_id,
-                                       // "/menubar/Actions", no
-                                       // "/menubar/Actions/ActionsPlaceholder", no
-                                       // "/menubar/AdditionalMenusPlaceholder/AReportAction", no 
-                                       "/menubar/AdditionalMenusPlaceholder", // winnah!
-                                       "BarAction",
-                                       "BarAction", GTK_UI_MANAGER_MENUITEM, FALSE );
-                gtk_ui_manager_ensure_update( window->ui_merge );
-        }
-
-	/* Now update the "eXtensions" menu */
-	debugging = scm_c_eval_string("(gnc:debugging?)");
-	if (debugging == SCM_BOOL_F) {
-	  GtkAction*  action;
-
-	  action = gtk_action_group_get_action(priv->action_group,"ExtensionsAction");
-	  g_object_set(G_OBJECT(action), "visible", FALSE, NULL);
-	}
-
-	/* GncPluginManager stuff */
-	manager = gnc_plugin_manager_get ();
-	plugins = gnc_plugin_manager_get_plugins (manager);
-	g_signal_connect (G_OBJECT (manager), "plugin-added",
-			  G_CALLBACK (gnc_main_window_plugin_added), window);
-	g_signal_connect (G_OBJECT (manager), "plugin-removed",
-			  G_CALLBACK (gnc_main_window_plugin_removed), window);
-	g_list_foreach (plugins, gnc_main_window_add_plugin, window);
-	g_list_free (plugins);
-
-}
-
-static void
-gnc_main_window_add_widget (GtkUIManager *merge,
-			    GtkWidget *widget,
-			    GncMainWindow *window)
-{
-	if (GTK_IS_TOOLBAR (widget)) {
-		window->priv->toolbar_dock = widget;
-	}
-
-	gtk_box_pack_start (GTK_BOX (window->priv->menu_dock), widget, FALSE, FALSE, 0);
-	gtk_widget_show (widget);
-}
-
-/** This function is invoked when the GtkNotebook switches pages.  It
- *  is responsible for updating the rest of the window contents
- *  outside of the notebook.  I.E. Updating the user interface, the
- *  summary bar, etc.  This function also emits the "page_changed"
- *  signal from the window so that any plugin can also learn about the
- *  fact that the page has changed.
- *
- *  @internal
- */
-static void
-gnc_main_window_switch_page (GtkNotebook *notebook,
-			     GtkNotebookPage *notebook_page,
-			     gint pos,
-			     GncMainWindow *window)
-{
-	GtkWidget *child, *summarybar, *summarybar_dock;
-	GncPluginPage *page;
-	gboolean immutable;
-
-	DEBUG("Notebook %p, page, %p, index %d, window %p",
-	       notebook, notebook_page, pos, window);
-	g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
-
-	summarybar_dock = window->priv->summarybar_dock;
-
-	if (window->priv->current_page != NULL) {
-		page = window->priv->current_page;
-		gnc_plugin_page_unmerge_actions (page, window->ui_merge);
-		gnc_plugin_page_unselected (page);
-
-		/* Remove old page's summarybar too */
-		if (page->summarybar) {
-			gtk_container_remove(GTK_CONTAINER(summarybar_dock),
-					     page->summarybar);
-		}
-	}
-
-	child = gtk_notebook_get_nth_page (notebook, pos);
-	if (child) {
-		page = g_object_get_data (G_OBJECT (child), PLUGIN_PAGE_LABEL);
-	} else {
-		page = NULL;
-	}
-
-	window->priv->current_page = page;
-
-	if (page != NULL) {
-		/* Update the user interface (e.g. menus and toolbars */
-		gnc_plugin_page_merge_actions (page, window->ui_merge);
-
-		/* install new summarybar (if any) */
-		summarybar = page->summarybar;
-		if (summarybar) {
-		  if (GTK_OBJECT_FLOATING(summarybar)) {
-		    /* Own this object. This will prevent it from being deleted by
-		     * gtk when it is removed from the summarybar. */
-		    g_object_ref (summarybar);
-		    gtk_object_sink (GTK_OBJECT (summarybar));
-		  }
-
-		  if (window->priv->show_summarybar)
-		    gtk_widget_show(summarybar);
-		  else
-		    gtk_widget_hide(summarybar);
-		  gtk_box_pack_start(GTK_BOX(summarybar_dock), summarybar,
-				     FALSE, TRUE, 0 );
-		}
-
-		/* Allow page specific actions */
-		gnc_plugin_page_selected (page);
-		gnc_window_update_status (GNC_WINDOW(window), page);
-	}
-
-	/* Update the menus based upon whether this is an "immutable" page. */
-	immutable = page &&
-	  g_object_get_data (G_OBJECT (page), PLUGIN_PAGE_IMMUTABLE);
-	gnc_plugin_update_actions(window->priv->action_group,
-				  immutable_account_actions,
-				  "sensitive", !immutable);
-
-	g_signal_emit (window, main_window_signals[PAGE_CHANGED], 0, page);
-}
-
-static void
-gnc_main_window_plugin_added (GncPlugin *manager,
-			      GncPlugin *plugin,
-			      GncMainWindow *window)
-{
-	g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
-	g_return_if_fail (GNC_IS_PLUGIN (plugin));
-
-	gnc_plugin_add_to_window (plugin, window, window_type);
-}
-
-static void
-gnc_main_window_plugin_removed (GncPlugin *manager,
-				GncPlugin *plugin,
-				GncMainWindow *window)
-{
-	g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
-	g_return_if_fail (GNC_IS_PLUGIN (plugin));
-
-	gnc_plugin_remove_from_window (plugin, window, window_type);
-}
-
-
-/* Command callbacks */
-static void
-gnc_main_window_cmd_file_new (GtkAction *action, GncMainWindow *window)
-{
-	gnc_file_new ();
-	/* FIXME GNOME 2 Port (update the title etc.) */
-}
-
-static void
-gnc_main_window_cmd_file_open (GtkAction *action, GncMainWindow *window)
-{
-	gnc_window_set_progressbar_window (GNC_WINDOW(window));
-	gnc_file_open ();
-	gnc_window_set_progressbar_window (NULL);
-	gnc_main_window_update_title (window);
-	/* FIXME GNOME 2 Port (update the title etc.) */
-}
-
-static void
-gnc_main_window_cmd_file_open_new_window (GtkAction *action, GncMainWindow *window)
-{
-	GncMainWindowPrivate *priv;
-	GncMainWindow *new_window;
-	GncPluginPage *page;
-	GtkNotebook *notebook;
-	GtkWidget *tab_widget;
-
-	/* Setup */
-	priv = window->priv;
-	if (priv->current_page == NULL)
-		return;
-	notebook = GTK_NOTEBOOK (priv->notebook);
-	page = priv->current_page;
-	tab_widget = gtk_notebook_get_tab_label (notebook, page->notebook_page);
-
-	/* Ref the page components, then remove it from its old window */
-	g_object_ref(page);
-	g_object_ref(tab_widget);
-	g_object_ref(page->notebook_page);
-	gnc_main_window_disconnect(window, page);
-
-	/* Create the new window */
-	new_window = gnc_main_window_new ();
-	gtk_widget_show(GTK_WIDGET(new_window));
-
-	/* Now add the page to the new window */
-	gnc_main_window_connect (new_window, page, tab_widget);
-
-	/* Unref the page components now that we're done */
-	g_object_unref(page->notebook_page);
-	g_object_unref(tab_widget);
-	g_object_unref(page);
-
-	/* just a little debugging. :-) */
-	DEBUG("Moved page %p (sb %p) from window %p to new window %p",
-	      page, page->summarybar, window, new_window);
-	DEBUG("Old window current is %p, new window current is %p",
-	      window->priv->current_page, new_window->priv->current_page);
-}
-
-static void
-gnc_main_window_cmd_file_save (GtkAction *action, GncMainWindow *window)
-{
-	gnc_window_set_progressbar_window (GNC_WINDOW(window));
-	gnc_file_save ();
-	gnc_window_set_progressbar_window (NULL);
-	/* FIXME GNOME 2 Port (update the title etc.) */
-}
-
-static void
-gnc_main_window_cmd_file_save_as (GtkAction *action, GncMainWindow *window)
-{
-	gnc_window_set_progressbar_window (GNC_WINDOW(window));
-	gnc_file_save_as ();
-	gnc_window_set_progressbar_window (NULL);
-	/* FIXME GNOME 2 Port (update the title etc.) */
-}
-
-static void
-qsf_file_select_ok(GtkWidget *w, GtkFileSelection *fs )
-{
-	QofSession *qsf_session, *first_session;
-	const gchar *filename;
-	QofBook *original;
-
-	ENTER (" ");
-	gnc_engine_suspend_events();
-	filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION (fs));
-	gtk_widget_destroy((GtkWidget*) fs);
-	first_session = qof_session_get_current_session();
-	original = qof_session_get_book(first_session);
-	qsf_session = qof_session_new();
-	qof_session_begin(qsf_session, filename, TRUE, FALSE);
-	qof_session_load(qsf_session, NULL);
-	gnc_engine_resume_events();
-	gnc_ui_qsf_import_merge_druid(first_session, qsf_session);
-	LEAVE (" ");
-}
-
-static void
-gnc_main_window_cmd_file_qsf_import (GtkAction *action, GncMainWindow *window)
-{
-	GtkWidget *file_select;
-
-	gnc_window_set_progressbar_window(GNC_WINDOW(window));
-	file_select = gtk_file_selection_new("Select the QSF file to import into GnuCash");
-	g_signal_connect (G_OBJECT (GTK_FILE_SELECTION (file_select)->ok_button),
-		"clicked", G_CALLBACK (qsf_file_select_ok), (gpointer) file_select);
-	g_signal_connect_swapped (G_OBJECT (GTK_FILE_SELECTION (file_select)->cancel_button),
-		"clicked", G_CALLBACK (gtk_widget_destroy), G_OBJECT (file_select));
-	gtk_widget_show (file_select);
-	gnc_window_set_progressbar_window(NULL);
-}
-
-static void
-gnc_main_window_cmd_file_export_accounts (GtkAction *action, GncMainWindow *window)
-{
-	gnc_window_set_progressbar_window (GNC_WINDOW(window));
-	gnc_file_export_file (NULL);
-	gnc_window_set_progressbar_window (NULL);
-	/* FIXME GNOME 2 Port (update the title etc.) */
-	/* gnc_refresh_main_window_info (); */
-}
-
-static void
-gnc_main_window_cmd_chart_export (GtkAction *action, GncMainWindow *window)
-{
-	gnc_window_set_progressbar_window (GNC_WINDOW(window));
-	gnc_main_window_chart_export();
-	gnc_window_set_progressbar_window (NULL);
-	/* FIXME GNOME 2 Port (update the title etc.) */
-	/* gnc_refresh_main_window_info (); */
-}
-
-static void
-gnc_main_window_cmd_file_print (GtkAction *action, GncMainWindow *window)
-{
-}
-
-static void
-gnc_main_window_cmd_file_properties (GtkAction *action, GncMainWindow *window)
-{
-  SCM func = scm_c_eval_string("gnc:main-window-properties-cb");
-  if (!SCM_PROCEDUREP (func)) {
-      PERR ("not a procedure\n");
-      return;
-  }
-  scm_call_0(func);
-}
-
-static void
-gnc_main_window_cmd_file_close (GtkAction *action, GncMainWindow *window)
-{
-	g_return_if_fail(GNC_IS_MAIN_WINDOW(window));
-
-	if (window->priv->current_page != NULL) {
-		gnc_main_window_close_page (window->priv->current_page);
-	}
-}
-
-static void
-gnc_main_window_cmd_file_quit (GtkAction *action, GncMainWindow *window)
-{
-	gnc_shutdown (0);
-}
-
-static void
-gnc_main_window_cmd_edit_cut (GtkAction *action, GncMainWindow *window)
-{
-}
-
-static void
-gnc_main_window_cmd_edit_copy (GtkAction *action, GncMainWindow *window)
-{
-}
-
-static void
-gnc_main_window_cmd_edit_paste (GtkAction *action, GncMainWindow *window)
-{
-}
-
-static void
-gnc_main_window_cmd_edit_preferences (GtkAction *action, GncMainWindow *window)
-{
-	gnc_show_options_dialog ();
-}
-
-static void
-gnc_main_window_cmd_edit_tax_options (GtkAction *action, GncMainWindow *window)
-{
-	gnc_tax_info_dialog (GTK_WIDGET (window));
-}
-
-static void
-gnc_main_window_cmd_view_refresh (GtkAction *action, GncMainWindow *window)
-{
-}
-
-static void
-gnc_main_window_cmd_view_toolbar (GtkAction *action, GncMainWindow *window)
-{
-	if (gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action))) {
-		gtk_widget_show (window->priv->toolbar_dock);
-	} else {
-		gtk_widget_hide (window->priv->toolbar_dock);
-	}
-}
-
-static void
-gnc_main_window_cmd_view_summary (GtkAction *action, GncMainWindow *window)
-{
-	if (gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action))) {
-		gtk_widget_show (window->priv->summarybar_dock);
-	} else {
-		gtk_widget_hide (window->priv->summarybar_dock);
-	}
-}
-
-static void
-gnc_main_window_cmd_view_statusbar (GtkAction *action, GncMainWindow *window)
-{
-	if (gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action))) {
-		gtk_widget_show (window->priv->statusbar);
-	} else {
-		gtk_widget_hide (window->priv->statusbar);
-	}
-}
-
-static void
-gnc_main_window_cmd_actions_scheduled_transaction_editor (GtkAction *action, GncMainWindow *window)
-{
-	gnc_ui_scheduled_xaction_dialog_create ();
-}
-
-static void
-gnc_main_window_cmd_actions_since_last_run (GtkAction *action, GncMainWindow *window)
-{
-	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 (GTK_WIDGET(&window->parent), nothing_to_do_msg);
-	} else if ( ret < 0 ) {
-		gnc_info_dialog (GTK_WIDGET(&window->parent), 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_cmd_actions_mortgage_loan (GtkAction *action, GncMainWindow *window)
-{
-	gnc_ui_sx_loan_druid_create ();
-}
-
-static void 
-gnc_main_window_cmd_actions_budget_workbench(GtkAction *action, GncMainWindow *window)
-{
-    gnc_budget_list_dialog_create();
-}
-
-static void
-gnc_main_window_cmd_actions_close_books (GtkAction *action, GncMainWindow *window)
-{
-	gnc_acct_period_dialog();
-}
-
-static void
-gnc_main_window_cmd_tools_price_editor (GtkAction *action, GncMainWindow *window)
-{
-	gnc_prices_dialog (NULL);
-}
-
-static void
-gnc_main_window_cmd_tools_commodity_editor (GtkAction *action, GncMainWindow *window)
-{
-	gnc_commodities_dialog (NULL);
-}
-
-static void
-gnc_main_window_cmd_tools_financial_calculator (GtkAction *action, GncMainWindow *window)
-{
-	gnc_ui_fincalc_dialog_create();
-}
-
-static void
-gnc_main_window_cmd_tools_find_transactions (GtkAction *action, GncMainWindow *window)
-{
-	gnc_ui_find_transactions_dialog_create (NULL);
-}
-
-static void
-gnc_main_window_cmd_help_tutorial (GtkAction *action, GncMainWindow *window)
-{
-	gnc_gnome_help (HF_GUIDE, NULL);
-}
-
-static void
-gnc_main_window_cmd_help_totd (GtkAction *action, GncMainWindow *window)
-{
-	gnc_totd_dialog(GTK_WINDOW(window), FALSE);
-}
-
-static void
-gnc_main_window_cmd_help_contents (GtkAction *action, GncMainWindow *window)
-{
-	gnc_gnome_help (HF_HELP, NULL);
-}
-
-static void
-gnc_main_window_cmd_test( GtkAction *action, GncMainWindow *window )
-{
-        GtkWindow *w = GTK_WINDOW(gtk_window_new( GTK_WINDOW_TOPLEVEL ));
-        gnc_html *gnchtml = gnc_html_new( w );
-        gchar *html = "<html><head><title>testing</title></head><body><h1>testing</h1><h2>testing 2</h2> <p>Tes<br />ting<object classid=\"gnc-guppi-pie\" width=\"300\" height=\"200\">No pie for you!</object></p></body></html>";
-        gtk_container_add( GTK_CONTAINER(w), GTK_WIDGET(gnc_html_get_widget(gnchtml)) );
-
-        gnc_html_show_data( gnchtml, html, strlen( html ) );
-        
-        gtk_widget_show_all( GTK_WIDGET(w) );
-}
-
-static void
-gnc_main_window_cmd_help_about (GtkAction *action, GncMainWindow *window)
-{
-	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 = "\xc2\xa9 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
-	};
-	const gchar *documenters[] = {
-		NULL
-	};
-	const gchar *translator_credits = _("translator_credits");
-	GdkPixbuf *logo;
-
-	logo = gnc_gnome_get_gdkpixbuf ("appicon.png");
-
-	about = gnome_about_new ("GnuCash", VERSION, copyright, message, authors, documenters,
-				 strcmp (translator_credits, "translator_credits") != 0 ? translator_credits : NULL,
-				 logo);
-
-	gdk_pixbuf_unref (logo);
-	gtk_dialog_run (GTK_DIALOG (about));
-}
-
-void
-gnc_main_window_update_title (GncMainWindow *window)
-{
-  const gchar *filename;
-  gchar *title, *ptr;
-
-  filename = gnc_session_get_url (gnc_get_current_session ());
-
-  if (!filename)
-    filename = _("<no file>");
-  else {
-    /* Recommended gnome naming scheme */
-    ptr = rindex(filename, '/');
-    if (ptr != NULL)
-      filename = ptr+1;
-  }
-  title = g_strdup_printf ("%s - Gnucash", filename);
-  gtk_window_set_title (GTK_WINDOW(&window->parent), title);
-  g_free(title);
-}
-
-static GtkWidget *
-gnc_main_window_get_statusbar (GncWindow *window_in)
-{
-  GncMainWindowPrivate *priv;
-  GncMainWindow *window;
-
-  g_return_val_if_fail (GNC_IS_MAIN_WINDOW (window_in), NULL);
-
-  window = GNC_MAIN_WINDOW(window_in);
-  priv = window->priv;
-  return priv->statusbar;
-}
-
-static GtkWidget *
-gnc_main_window_get_progressbar (GncWindow *window_in)
-{
-  GncMainWindowPrivate *priv;
-  GncMainWindow *window;
-
-  g_return_val_if_fail (GNC_IS_MAIN_WINDOW (window_in), NULL);
-
-  window = GNC_MAIN_WINDOW(window_in);
-  priv = window->priv;
-  return priv->progressbar;
-}
-
-static void
-gnc_window_main_window_init (GncWindowIface *iface)
-{
-	iface->get_statusbar   = gnc_main_window_get_statusbar;
-	iface->get_progressbar = gnc_main_window_get_progressbar;
-}
-
-
-/*  Set the window where all progressbar updates should occur.  This
- *  is a wrapper around the gnc_window_set_progressbar_window()
- *  function.
- */
-void
-gnc_main_window_set_progressbar_window (GncMainWindow *window)
-{
-  GncWindow *gncwin;
-  gncwin = GNC_WINDOW(window);
-  gnc_window_set_progressbar_window(gncwin);
-}
-
-
-/*  Shutdown gnucash.  This function will call the Scheme side of
- *  GnuCash to initiate an orderly shutdown, and when that has
- *  finished it will exit the program.
- */
-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);
-  }
-}
--- src/gnome/gnc-embedded-window.c
+++ /dev/null
@@ -1,339 +0,0 @@
-/* 
- * gnc-main-window.c -- GtkWindow which represents the
- *	GnuCash main window.
- *
- * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
- * Copyright (C) 2003 David Hampton <hampton at employees.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, contact:
- *
- * Free Software Foundation           Voice:  +1-617-542-5942
- * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
- * Boston, MA  02111-1307,  USA       gnu at gnu.org
- */
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-
-#include "gnc-embedded-window.h"
-
-#include "gnc-engine.h"
-#include "gnc-engine-util.h"
-#include "gnc-gnome-utils.h"
-#include "gnc-dir.h"
-#include "gnc-file.h"
-#include "gnc-gui-query.h"
-#include "gnc-plugin.h"
-#include "gnc-plugin-manager.h"
-#include "gnc-session.h"
-#include "gnc-ui.h"
-#include "gnc-window.h"
-#include "messages.h"
-
-/** Static Globals *******************************************************/
-static short module = MOD_GUI;
-
-/** Declarations *********************************************************/
-static void gnc_embedded_window_class_init (GncEmbeddedWindowClass *klass);
-static void gnc_embedded_window_init (GncEmbeddedWindow *window);
-static void gnc_embedded_window_finalize (GObject *object);
-static void gnc_embedded_window_dispose (GObject *object);
-
-static void gnc_window_embedded_window_init (GncWindowIface *iface);
-
-static void gnc_embedded_window_setup_window (GncEmbeddedWindow *window);
-
-
-struct GncEmbeddedWindowPrivate
-{
-  GtkWidget *menu_dock;
-  GtkWidget *toolbar_dock;
-  GtkWidget *statusbar;
-
-  GtkActionGroup *action_group;
-
-  GncPluginPage *page;
-  GtkWidget     *parent_window;
-};
-
-static GObjectClass *parent_class = NULL;
-
-GType
-gnc_embedded_window_get_type (void)
-{
-  static GType gnc_embedded_window_type = 0;
-
-  if (gnc_embedded_window_type == 0) {
-    static const GTypeInfo our_info = {
-      sizeof (GncEmbeddedWindowClass),
-      NULL,
-      NULL,
-      (GClassInitFunc) gnc_embedded_window_class_init,
-      NULL,
-      NULL,
-      sizeof (GncEmbeddedWindow),
-      0,
-      (GInstanceInitFunc) gnc_embedded_window_init
-    };
-
-    static const GInterfaceInfo plugin_info = {
-      (GInterfaceInitFunc) gnc_window_embedded_window_init,
-      NULL,
-      NULL
-    };
-
-    gnc_embedded_window_type = g_type_register_static (GTK_TYPE_VBOX,
-						       "GncEmbeddedWindow",
-						       &our_info, 0);
-    g_type_add_interface_static (gnc_embedded_window_type,
-				 GNC_TYPE_WINDOW,
-				 &plugin_info);
-  }
-
-  return gnc_embedded_window_type;
-}
-
-void
-gnc_embedded_window_open_page (GncEmbeddedWindow *window,
-			       GncPluginPage *page)
-{
-  ENTER("window %p, page %p", window, page);
-  g_return_if_fail (GNC_IS_EMBEDDED_WINDOW (window));
-  g_return_if_fail (GNC_IS_PLUGIN_PAGE (page));
-  g_return_if_fail (window->priv->page == NULL);
-
-  window->priv->page = page;
-  page->window = GTK_WIDGET(window);
-  page->notebook_page = gnc_plugin_page_create_widget (page);
-  g_object_set_data (G_OBJECT (page->notebook_page), PLUGIN_PAGE_LABEL, page);
-
-  gtk_box_pack_end(GTK_BOX(window), page->notebook_page, TRUE, TRUE, 2);
-  gnc_plugin_page_inserted (page);
-
-  gnc_plugin_page_merge_actions (page, window->ui_merge);
-  LEAVE(" ");
-}
-
-void
-gnc_embedded_window_close_page (GncEmbeddedWindow *window,
-				GncPluginPage *page)
-{
-  ENTER("window %p, page %p", window, page);
-  g_return_if_fail (GNC_IS_EMBEDDED_WINDOW (window));
-  g_return_if_fail (GNC_IS_PLUGIN_PAGE (page));
-
-  if (!page->notebook_page) {
-    LEAVE("no displayed widget");
-    return;
-  }
-
-  gtk_container_remove (GTK_CONTAINER(window), GTK_WIDGET(window->priv->page));
-  window->priv->page = NULL;
-  gnc_plugin_page_removed (page);
-
-  gnc_plugin_page_unmerge_actions (page, window->ui_merge);
-  gtk_ui_manager_ensure_update (window->ui_merge);
-
-  gnc_plugin_page_destroy_widget (page);
-  g_object_unref(page);
-  LEAVE(" ");
-}
-
-GncPluginPage *
-gnc_embedded_window_get_page (GncEmbeddedWindow *window)
-{
-  return window->priv->page;
-}
-
-
-static void
-gnc_embedded_window_class_init (GncEmbeddedWindowClass *klass)
-{
-  GObjectClass *object_class;
-  ENTER("klass %p", klass);
-  object_class = G_OBJECT_CLASS (klass);
-
-  parent_class = g_type_class_peek_parent (klass);
-
-  object_class->finalize = gnc_embedded_window_finalize;
-  object_class->dispose = gnc_embedded_window_dispose;
-  LEAVE(" ");
-}
-
-static void
-gnc_embedded_window_init (GncEmbeddedWindow *window)
-{
-  ENTER("window %p", window);
-  window->priv = g_new0 (GncEmbeddedWindowPrivate, 1);
-
-  gnc_embedded_window_setup_window (window);
-  LEAVE(" ");
-}
-
-static void
-gnc_embedded_window_finalize (GObject *object)
-{
-  GncEmbeddedWindow *window;
-
-  ENTER("object %p", object);
-  g_return_if_fail (object != NULL);
-  g_return_if_fail (GNC_IS_EMBEDDED_WINDOW (object));
-
-  window = GNC_EMBEDDED_WINDOW (object);
-
-  g_return_if_fail (window->priv != NULL);
-
-  g_free (window->priv);
-
-  G_OBJECT_CLASS (parent_class)->finalize (object);
-  LEAVE(" ");
-}
-
-static void
-gnc_embedded_window_dispose (GObject *object)
-{
-  GncEmbeddedWindow *window;
-
-  ENTER("object %p", object);
-  g_return_if_fail (object != NULL);
-  g_return_if_fail (GNC_IS_EMBEDDED_WINDOW (object));
-
-  window = GNC_EMBEDDED_WINDOW (object);
-  if (window->priv->page) {
-    DEBUG("unreffing page %p (count currently %d)", window->priv->page,
-	  G_OBJECT(window->priv->page)->ref_count);
-    g_object_unref(window->priv->page);
-    window->priv->page = NULL;
-  }
-
-  G_OBJECT_CLASS (parent_class)->dispose (object);
-  LEAVE(" ");
-}
-
-static void
-gnc_embedded_window_add_widget (GtkUIManager *merge,
-				GtkWidget *widget,
-				GncEmbeddedWindow *window)
-{
-  ENTER("merge %p, new widget %p, window %p", merge, widget, window);
-  if (GTK_IS_TOOLBAR (widget)) {
-    window->priv->toolbar_dock = widget;
-  }
-
-  gtk_box_pack_start (GTK_BOX (window->priv->menu_dock), widget, FALSE, FALSE, 0);
-  gtk_widget_show (widget);
-  LEAVE(" ");
-}
-
-static void
-gnc_embedded_window_setup_window (GncEmbeddedWindow *window)
-{
-  GncEmbeddedWindowPrivate *priv;
-
-  ENTER("window %p", window);
-  priv = window->priv;
-
-  /* Create widgets and add them to the window */
-  gtk_widget_show (GTK_WIDGET(window));
-
-  priv->menu_dock = gtk_vbox_new (FALSE, 0);
-  gtk_widget_show (priv->menu_dock);
-  gtk_box_pack_start (GTK_BOX (window), priv->menu_dock, TRUE, TRUE, 0);
-
-  priv->statusbar = gtk_statusbar_new ();
-  gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR(priv->statusbar), FALSE);
-  gtk_widget_show (priv->statusbar);
-  gtk_box_pack_end (GTK_BOX (window), priv->statusbar, FALSE, TRUE, 0);
-
-  window->ui_merge = gtk_ui_manager_new ();
-  g_signal_connect (G_OBJECT (window->ui_merge), "add_widget",
-		    G_CALLBACK (gnc_embedded_window_add_widget), window);
-
-  priv->action_group = NULL;
-  LEAVE(" ");
-}
-
-GncEmbeddedWindow *
-gnc_embedded_window_new (const gchar *action_group_name,
-			 GtkActionEntry *action_entries,
-			 gint n_action_entries,
-			 const gchar *ui_filename,
-			 GtkWidget *enclosing_win,
-			 gboolean add_accelerators,
-			 gpointer user_data)
-{
-  GncEmbeddedWindowPrivate *priv;
-  GncEmbeddedWindow *window;
-  gchar *ui_fullname;
-  GError *error = NULL;
-  guint merge_id;
-
-  ENTER("group %s, first %p, num %d, ui file %s, parent %p, add accelerators %d, user data %p",
-	action_group_name, action_entries, n_action_entries, ui_filename,
-	enclosing_win, add_accelerators, user_data);
-  window = g_object_new (GNC_TYPE_EMBEDDED_WINDOW, NULL);
-  priv = window->priv;
-
-  /* Determine the full pathname of the ui file */
-  ui_fullname = gnc_gnome_locate_ui_file(ui_filename);
-
-  /* Create menu and toolbar information */
-  priv->action_group = gtk_action_group_new (action_group_name);
-  gtk_action_group_add_actions (priv->action_group, action_entries,
-				n_action_entries, user_data);
-  gtk_ui_manager_insert_action_group (window->ui_merge, priv->action_group, 0);
-  merge_id = gtk_ui_manager_add_ui_from_file (window->ui_merge, ui_fullname,
-					      &error);
-
-  /* Error checking */
-  g_assert(merge_id || error);
-  if (error) {
-    g_critical("Failed to load ui file.\n  Filename %s\n  Error %s",
-	       ui_fullname, error->message);
-    g_error_free(error);
-    g_free(ui_fullname);
-    LEAVE("window %p", window);
-    return window;
-  }
-
-  /* Add accelerators (if wanted) */
-  if (add_accelerators)
-    gtk_window_add_accel_group (GTK_WINDOW(enclosing_win),
-				gtk_ui_manager_get_accel_group(window->ui_merge));
-
-  gtk_ui_manager_ensure_update (window->ui_merge);
-  g_free(ui_fullname);
-  LEAVE("window %p", window);
-  return window;
-}
-
-static GtkWidget *
-gnc_embedded_window_get_statusbar (GncWindow *window_in)
-{
-  GncEmbeddedWindowPrivate *priv;
-  GncEmbeddedWindow *window;
-
-  g_return_val_if_fail (GNC_IS_EMBEDDED_WINDOW (window_in), NULL);
-
-  window = GNC_EMBEDDED_WINDOW(window_in);
-  priv = window->priv;
-  return priv->statusbar;
-}
-
-static void
-gnc_window_embedded_window_init (GncWindowIface *iface)
-{
-	iface->get_statusbar = gnc_embedded_window_get_statusbar;
-}
Index: Makefile.am
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/Makefile.am,v
retrieving revision 1.107.4.22
retrieving revision 1.107.4.23
diff -Lsrc/gnome/Makefile.am -Lsrc/gnome/Makefile.am -u -r1.107.4.22 -r1.107.4.23
--- src/gnome/Makefile.am
+++ src/gnome/Makefile.am
@@ -48,19 +48,13 @@
   druid-merge.c \
   druid-loan.c \
   druid-stock-split.c \
-  gnc-embedded-window.c \
-  gnc-main-window.c \
-  gnc-plugin.c \
   gnc-plugin-file-history.c \
-  gnc-plugin-menu-additions.c \
+  gnc-plugin-basic-commands.c \
   gnc-plugin-account-tree.c \
   gnc-plugin-register.c \
-  gnc-plugin-manager.c \
   gnc-plugin-page-account-tree.c \
   gnc-plugin-page-register.c \
-  gnc-plugin-page.c \
   gnc-split-reg.c \
-  gnc-window.c \
   lot-viewer.c \
   reconcile-list.c \
   top-level.c \
@@ -97,20 +91,14 @@
   druid-merge.h \
   druid-loan.h \
   druid-stock-split.h \
-  gnc-embedded-window.h \
-  gnc-main-window.h \
-  gnc-plugin.h \
   gnc-plugin-account-tree.h \
+  gnc-plugin-basic-commands.h \
   gnc-plugin-file-history.h \
-  gnc-plugin-menu-additions.h \
   gnc-plugin-register.h \
-  gnc-plugin-manager.h \
-  gnc-plugin-page.h \
   gnc-plugin-page-account-tree.h \
   gnc-plugin-page-register.h \
   gnc-network.h \
   gnc-split-reg.h \
-  gnc-window.h \
   gw-gnc.h \
   lot-viewer.h \
   reconcile-list.h \
--- src/gnome/gnc-plugin-manager.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* 
- * gnc-plugin-manager.h -- Manage gnucash plugins.
- *
- * Copyright (C) 2003 Jan Arne Petersen
- * Author: Jan Arne Petersen <jpetersen at uni-bonn.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, contact:
- *
- * Free Software Foundation           Voice:  +1-617-542-5942
- * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
- * Boston, MA  02111-1307,  USA       gnu at gnu.org
- */
-
-#ifndef __GNC_PLUGIN_MANAGER_H
-#define __GNC_PLUGIN_MANAGER_H
-
-#include "gnc-plugin.h"
-
-G_BEGIN_DECLS
-
-/* type macros */
-#define GNC_TYPE_PLUGIN_MANAGER            (gnc_plugin_manager_get_type ())
-#define GNC_PLUGIN_MANAGER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_MANAGER, GncPluginManager))
-#define GNC_PLUGIN_MANAGER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_MANAGER, GncPluginManagerClass))
-#define GNC_IS_PLUGIN_MANAGER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_MANAGER))
-#define GNC_IS_PLUGIN_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_MANAGER))
-#define GNC_PLUGIN_MANAGER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_MANAGER, GncPluginManagerClass))
-
-/* typedefs & structures */
-typedef struct GncPluginManagerPrivate GncPluginManagerPrivate;
-
-typedef struct {
-	GObject parent;
-
-	GncPluginManagerPrivate *priv;
-} GncPluginManager;
-
-typedef struct {
-	GObjectClass parent;
-
-	/* Signals */
-	void (* plugin_added) (GncPluginManager *plugin_manager, GncPlugin *plugin);
-	void (* plugin_removed) (GncPluginManager *plugin_manager, GncPlugin *plugin);
-} GncPluginManagerClass;
-
-/* function prototypes */
-GType             gnc_plugin_manager_get_type      (void);
-
-GncPluginManager *gnc_plugin_manager_get           (void);
-
-void              gnc_plugin_manager_add_plugin    (GncPluginManager *manager,
-						    GncPlugin *plugin);
-void		  gnc_plugin_manager_remove_plugin (GncPluginManager *manager,
-						    GncPlugin *plugin);
-
-GList            *gnc_plugin_manager_get_plugins   (GncPluginManager *manager);
-GncPlugin        *gnc_plugin_manager_get_plugin    (GncPluginManager *manager,
-						    const gchar *name);
-
-G_END_DECLS
-
-#endif /* __GNC_PLUGIN_MANAGER_H */
--- src/gnome/gnc-plugin-menu-additions.c
+++ /dev/null
@@ -1,396 +0,0 @@
-/* 
- * gnc-plugin-menu-additions.c -- 
- * Copyright (C) 2005 David Hampton hampton at employees.org>
- *
- * From:
- * gnc-menu-extensions.c -- functions to build dynamic menus
- * Copyright (C) 1999 Rob Browning
- *
- * 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
- */
-
-/** @addtogroup GUI
-    @{ */
-/** @addtogroup GuiImport Import GUI Utility functions.
-    @{ */
-/** @internal
-    @file gnc-plugin-menu-additions.c
-    @brief Utility functions for writing import modules.
-    @author Copyright (C) 2002 David Hampton <hampton at employees.org>
-*/
-
-#include "config.h"
-
-#include <string.h>
-#include <glib/gprintf.h>
-#include <libgnome/libgnome.h>
-#include <g-wrap-wct.h>
-
-#include "guile-util.h"
-#include "gnc-engine-util.h"
-#include "gnc-main-window.h"
-#include "gnc-plugin-menu-additions.h"
-#include "gnc-window.h"
-#include "gnc-trace.h"
-#include "messages.h"
-#include "gnc-gconf-utils.h"
-#include "gnc-ui.h"
-#include "gnc-menu-extensions.h"
-
-static GList *active_plugins = NULL;
-static GObjectClass *parent_class = NULL;
-
-static void gnc_plugin_menu_additions_class_init (GncPluginMenuAdditionsClass *klass);
-static void gnc_plugin_menu_additions_init (GncPluginMenuAdditions *plugin);
-static void gnc_plugin_menu_additions_finalize (GObject *object);
-
-static void gnc_plugin_menu_additions_add_to_window (GncPlugin *plugin, GncMainWindow *window, GQuark type);
-static void gnc_plugin_menu_additions_remove_from_window (GncPlugin *plugin, GncMainWindow *window, GQuark type);
-
-/* Callbacks on other objects */
-static void gnc_plugin_menu_additions_main_window_page_changed (GncMainWindow *window,
-								GncPluginPage *page);
-
-/* Command callbacks */
-
-/* This static indicates the debugging module that this .o belongs to.  */
-static short module = MOD_GUI;
-
-
-#define PLUGIN_ACTIONS_NAME "gnc-plugin-menu-additions-actions"
-
-struct GncPluginMenuAdditionsPrivate
-{
-  gpointer dummy;
-};
-
-typedef struct _GncPluginMenuAdditionsPerWindow
-{
-  GncMainWindow  *window;
-  GtkUIManager   *ui_manager;
-  GtkActionGroup *group;
-  gint merge_id;
-} GncPluginMenuAdditionsPerWindow;
-
-/************************************************************
- *                  Object Implementation                   *
- ************************************************************/
-
-GType
-gnc_plugin_menu_additions_get_type (void)
-{
-  static GType gnc_plugin_menu_additions_type = 0;
-
-  if (gnc_plugin_menu_additions_type == 0) {
-    static const GTypeInfo our_info = {
-      sizeof (GncPluginMenuAdditionsClass),
-      NULL,		/* base_init */
-      NULL,		/* base_finalize */
-      (GClassInitFunc) gnc_plugin_menu_additions_class_init,
-      NULL,		/* class_finalize */
-      NULL,		/* class_data */
-      sizeof (GncPluginMenuAdditions),
-      0,
-      (GInstanceInitFunc) gnc_plugin_menu_additions_init
-    };
-
-    gnc_plugin_menu_additions_type = g_type_register_static (GNC_TYPE_PLUGIN,
-							 "GncPluginMenuAdditions",
-							 &our_info, 0);
-  }
-
-  return gnc_plugin_menu_additions_type;
-}
-
-#if DEBUG_REFERENCE_COUNTING
-static void
-dump_model (GncPluginMenuAdditions *plugin, gpointer dummy)
-{
-  g_warning("GncPluginMenuAdditions %p still exists.", plugin);
-}
-
-static gint
-gnc_plugin_menu_additions_report_references (void)
-{
-  g_list_foreach(active_plugins, (GFunc)dump_model, NULL);
-  return 0;
-}
-#endif
-
-static void
-gnc_plugin_menu_additions_class_init (GncPluginMenuAdditionsClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass);
-
-  parent_class = g_type_class_peek_parent (klass);
-
-  object_class->finalize = gnc_plugin_menu_additions_finalize;
-
-  /* plugin info */
-  plugin_class->plugin_name   = GNC_PLUGIN_MENU_ADDITIONS_NAME;
-
-  /* function overrides */
-  plugin_class->add_to_window = gnc_plugin_menu_additions_add_to_window;
-  plugin_class->remove_from_window = gnc_plugin_menu_additions_remove_from_window;
-
-#if DEBUG_REFERENCE_COUNTING
-  gtk_quit_add (0,
-		(GtkFunction)gnc_plugin_menu_additions_report_references,
-		NULL);
-#endif
-}
-
-static void
-gnc_plugin_menu_additions_init (GncPluginMenuAdditions *plugin)
-{
-  ENTER("plugin %p", plugin);
-  plugin->priv = g_new0 (GncPluginMenuAdditionsPrivate, 1);
-
-  active_plugins = g_list_append (active_plugins, plugin);
-  LEAVE("");
-}
-
-static void
-gnc_plugin_menu_additions_finalize (GObject *object)
-{
-  GncPluginMenuAdditions *plugin;
-
-  g_return_if_fail (GNC_IS_PLUGIN_MENU_ADDITIONS (object));
-
-  plugin = GNC_PLUGIN_MENU_ADDITIONS (object);
-  ENTER("plugin %p", plugin);
-  active_plugins = g_list_remove (active_plugins, plugin);
-
-  g_return_if_fail (plugin->priv != NULL);
-  g_free (plugin->priv);
-
-  G_OBJECT_CLASS (parent_class)->finalize (object);
-  LEAVE("");
-}
-
-GncPlugin *
-gnc_plugin_menu_additions_new (void)
-{
-  GncPlugin *plugin_page = NULL;
-
-  ENTER("");
-  plugin_page = GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_MENU_ADDITIONS, NULL));
-  LEAVE("plugin %p", plugin_page);
-  return plugin_page;
-}
-
-/************************************************************
- *              Plugin Function Implementation              *
- ************************************************************/
-
-static SCM
-gnc_main_window_to_scm (GncMainWindow *window)
-{
-  static SCM main_window_type = SCM_UNDEFINED;
-
-  if (!window)
-    return SCM_BOOL_F;
-
-  if (main_window_type == SCM_UNDEFINED)
-  {
-    main_window_type = scm_c_eval_string ("<gnc:MainWindow*>");
-
-    /* don't really need this - types are bound globally anyway. */
-    if (main_window_type != SCM_UNDEFINED)
-      scm_gc_protect_object (main_window_type);
-  }
-  
-  return gw_wcp_assimilate_ptr ((void *)window, main_window_type);
-}
-
-/** The user has selected one of the items in the File History menu.
- *  Close down the current session and start up a new one with the
- *  requested file.
- *
- *  @param action A pointer to the action selected by the user.  This
- *  action represents one of the items in the file history menu.
- *
- *  @param data A pointer to the gnc-main-window data to be used by
- *  this function.  This is mainly to find out which window it was
- *  that had a menu selected.  That's not really important for this
- *  function and we're about to close all the windows anyway.
- */
-static void
-gnc_plugin_menu_additions_action_cb (GtkAction *action,
-				     GncMainWindowActionData *data)
-{
-
-  g_return_if_fail(GTK_IS_ACTION(action));
-  g_return_if_fail(data != NULL);
-
-  gnc_extension_invoke_cb(data->data, gnc_main_window_to_scm(data->window));
-}
-
-static void
-gnc_menu_additions_menu_setup_one (ExtensionInfo *ext_info,
-				   GncPluginMenuAdditionsPerWindow *per_window)
-{
-  GncMainWindowActionData *cb_data;
-
-  DEBUG( "Adding %s/%s [%s] as [%s]\n", ext_info->path, ext_info->ae.label,
-	 ext_info->ae.name, ext_info->typeStr );
-
-  cb_data = g_new0 (GncMainWindowActionData, 1);
-  cb_data->window = per_window->window;
-  cb_data->data = ext_info->extension;
-
-  if (ext_info->type == GTK_UI_MANAGER_MENUITEM)
-    ext_info->ae.callback = (GCallback)gnc_plugin_menu_additions_action_cb;
-
-  gtk_action_group_add_actions_full(per_window->group, &ext_info->ae, 1,
-				    cb_data, g_free);
-  gtk_ui_manager_add_ui(per_window->ui_manager, per_window->merge_id,
-			ext_info->path, ext_info->ae.label, ext_info->ae.name,
-			ext_info->type, FALSE);
-  gtk_ui_manager_ensure_update(per_window->ui_manager);
-}
-
-/** Initialize the file history menu for a window.  This function is
- *  called as part of the initialization of a window, after all the
- *  plugin menu items have been added to the menu structure.  Its job
- *  is to correctly initialize the file history menu.  It does this by
- *  first calling a function that initializes the menu to the current
- *  as maintained in gconf.  It then creates a gconf client that will
- *  listens for any changes to the file history menu, and will update
- *  the meny when they are signalled.
- *
- *  @param plugin A pointer to the gnc-plugin object responsible for
- *  adding/removing the file history menu.
- *
- *  @param window A pointer the gnc-main-window that is being initialized.
- *
- *  @param type Unused
- */
-static void
-gnc_plugin_menu_additions_add_to_window (GncPlugin *plugin,
-					 GncMainWindow *window,
-					 GQuark type)
-{
-  GncPluginMenuAdditionsPerWindow per_window;
-  GSList *menu_list;
-
-  ENTER(" ");
-
-  g_signal_connect (G_OBJECT(window), "page_changed",
-		    G_CALLBACK (gnc_plugin_menu_additions_main_window_page_changed),
-		    plugin);
-
-  per_window.window = window;
-  per_window.ui_manager = window->ui_merge;
-  per_window.group = gtk_action_group_new ("MenuAdditions" );
-  per_window.merge_id = gtk_ui_manager_new_merge_id(window->ui_merge);
-  gtk_ui_manager_insert_action_group(window->ui_merge, per_window.group, 0);
-
-  menu_list = gnc_extensions_get_menu_list();
-  g_slist_foreach(menu_list, (GFunc)gnc_menu_additions_menu_setup_one,
-		  &per_window);
-
-  /* Tell the window code about the actions that were just added
-   * behind its back (so to speak) */
-  gnc_main_window_manual_merge_actions (window, PLUGIN_ACTIONS_NAME,
-					per_window.group, per_window.merge_id);
-
-  LEAVE(" ");
-}
-
-
-/** Finalize the file history menu for this window.  This function is
- *  called as part of the destruction of a window.
- *
- *  @param plugin A pointer to the gnc-plugin object responsible for
- *  adding/removing the file history menu.  It stops the gconf
- *  notifications for this window, and destroys the gconf client
- *  object.
- *
- *  @param window A pointer the gnc-main-window that is being destroyed.
- *
- *  @param type Unused
- */
-static void
-gnc_plugin_menu_additions_remove_from_window (GncPlugin *plugin,
-					      GncMainWindow *window,
-					      GQuark type)
-{
-  GtkActionGroup *group;
-
-  ENTER(" ");
-
-  g_signal_handlers_disconnect_by_func(G_OBJECT(window),
-				       G_CALLBACK (gnc_plugin_menu_additions_main_window_page_changed),
-				       plugin);
-
-  /* Have to remove our actions manually. Its only automatic if the
-   * actions name is installed into the plugin class. */
-  group = gnc_main_window_get_action_group(window, PLUGIN_ACTIONS_NAME);
-  if (group)
-    gtk_ui_manager_remove_action_group(window->ui_merge, group);
-
-  LEAVE(" ");
-}
-
-/************************************************************
- *                     Object Callbacks                     *
- ************************************************************/
-
-static void
-our_gtk_action_set_visible(GtkAction *action, gboolean visible)
-{
-  g_object_set(G_OBJECT(action), "visible", visible, NULL);
-}
-
-
-/** Whenever the current page has changed, update the reports menus based
- *  upon the page that is currently selected. */
-static void
-gnc_plugin_menu_additions_main_window_page_changed (GncMainWindow *window,
-						    GncPluginPage *page)
-{
-  GtkActionGroup *action_group;
-  GList *action_list;
-  gboolean visible;
-  gpointer tmp;
-
-  ENTER("main window %p, page %p", window, page);
-  action_group = gnc_main_window_get_action_group(window,PLUGIN_ACTIONS_NAME);
-  if (action_group == NULL) {
-    LEAVE("Can't find action group");
-    return;
-  }
-
-  /* Does the now-visible page want menu-extensions to be visible? */
-  if (page) {
-    tmp = g_object_get_data(G_OBJECT(page),GNC_PLUGIN_HIDE_MENU_ADDITIONS_NAME);
-    visible = !GPOINTER_TO_INT(tmp);
-  } else {
-    visible = TRUE;
-  }
-
-  action_list = gtk_action_group_list_actions(action_group);
-  // Use the following line for gtk2.6
-  // g_list_foreach(action_list, (GFunc)gtk_action_set_visible, (gpointer)visible);
-  g_list_foreach(action_list, (GFunc)our_gtk_action_set_visible, (gpointer)visible);
-  g_list_free(action_list);
-
-  LEAVE(" ");
-}
--- src/gnome/gnc-plugin-page.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/* 
- * gnc-plugin-page.h -- A page, which can be added to the
- *	GnuCash main window.
- *
- * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
- * Copyright (C) 2003,2005 David Hampton <hampton at employees.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, contact:
- *
- * Free Software Foundation           Voice:  +1-617-542-5942
- * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
- * Boston, MA  02111-1307,  USA       gnu at gnu.org
- */
-
-#ifndef __GNC_PLUGIN_PAGE_H
-#define __GNC_PLUGIN_PAGE_H
-
-#include "guid.h"
-#include "qofbook.h"
-
-G_BEGIN_DECLS
-
-/* type macros */
-#define GNC_TYPE_PLUGIN_PAGE            (gnc_plugin_page_get_type ())
-#define GNC_PLUGIN_PAGE(o)              (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_PLUGIN_PAGE, GncPluginPage))
-#define GNC_PLUGIN_PAGE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_PAGE, GncPluginPageClass))
-#define GNC_IS_PLUGIN_PAGE(o)           (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_PLUGIN_PAGE))
-#define GNC_IS_PLUGIN_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_PAGE))
-#define GNC_PLUGIN_PAGE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_PLUGIN_PAGE, GncPluginPageClass))
-
-/* typedefs & structures */
-typedef struct GncPluginPagePrivate GncPluginPagePrivate;
-
-typedef struct GncPluginPage {
-	GObject parent;
-	GncPluginPagePrivate *priv;
-
-	GtkWidget *window;
-	GtkWidget *notebook_page;
-	GtkWidget *summarybar;
-
-	gchar *title;
-	gchar *tab_name;
-	gchar *uri;
-
-	gchar *statusbar_text;
-} GncPluginPage;
-
-typedef struct {
-	GObjectClass parent;
-
-	const gchar *tab_icon;
-	const gchar *plugin_name;
-
-	/* Signals */
-	void (* inserted) (GncPluginPage *plugin_page);
-	void (* removed) (GncPluginPage *plugin_page);
-	void (* selected) (GncPluginPage *plugin_page);
-	void (* unselected) (GncPluginPage *plugin_page);
-
-	/* Virtual Table */
-	GtkWidget *(* create_widget) (GncPluginPage *plugin_page);
-	void (* destroy_widget) (GncPluginPage *plugin_page);
-
-	void (* merge_actions) (GncPluginPage *plugin_page, GtkUIManager *merge);
-	void (* unmerge_actions) (GncPluginPage *plugin_page, GtkUIManager *merge);
-} GncPluginPageClass;
-
-/* function prototypes */
-GType                 gnc_plugin_page_get_type        (void);
-
-GtkWidget            *gnc_plugin_page_create_widget   (GncPluginPage *plugin_page);
-void                  gnc_plugin_page_destroy_widget  (GncPluginPage *plugin_page);
-
-void                  gnc_plugin_page_merge_actions   (GncPluginPage *plugin_page,
-                                                       GtkUIManager *merge);
-void                  gnc_plugin_page_unmerge_actions (GncPluginPage *plugin_page,
-                                                       GtkUIManager *merge);
-
-const gchar *         gnc_plugin_page_get_name        (GncPluginPage *plugin_page);
-
-/** Add a book reference to the specified page.
- *
- *  @param page The page to be modified.
- *
- *  @param book The book referenced by this page.
- */
-void gnc_plugin_page_add_book (GncPluginPage *page, QofBook *book);
-
-/** Query a page to see if it has a reference to a given book.  This
- *  function takes a guid instead of a QofBook because that's what the
- *  engine event mechanism provides.
- *
- *  @param page The page to query.
- *
- *  @param book The guid of the book in question.
- *
- *  @return TRUE if the page refers to the specified book. FALSE
- *  otherwise.
- */
-gboolean              gnc_plugin_page_has_book        (GncPluginPage *page, GUID *book);
-
-/** Query a page to see if it has a reference to any book.
- *
- *  @param page The page to query.
- *
- *  @return TRUE if the page references any books. FALSE otherwise.
- */
-gboolean              gnc_plugin_page_has_books       (GncPluginPage *page);
-
-
-/* Signals */
-void                  gnc_plugin_page_inserted        (GncPluginPage *plugin_page);
-void                  gnc_plugin_page_removed         (GncPluginPage *plugin_page);
-void                  gnc_plugin_page_selected        (GncPluginPage *plugin_page);
-void                  gnc_plugin_page_unselected      (GncPluginPage *plugin_page);
-
-G_END_DECLS
-
-#endif /* __GNC_PLUGIN_PAGE_H */
Index: Makefile.am
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/ui/Attic/Makefile.am,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -Lsrc/gnome/ui/Makefile.am -Lsrc/gnome/ui/Makefile.am -u -r1.1.2.4 -r1.1.2.5
--- src/gnome/ui/Makefile.am
+++ src/gnome/ui/Makefile.am
@@ -1,13 +1,13 @@
 uidir = $(GNC_UI_DIR)
 ui_DATA = \
 	gnc-plugin-account-tree-ui.xml \
+	gnc-plugin-basic-commands-ui.xml \
 	gnc-plugin-page-account-tree-ui.xml \
 	gnc-plugin-file-history-ui.xml \
 	gnc-plugin-register-ui.xml \
 	gnc-plugin-page-register-ui.xml \
 	gnc-plugin-page-sxregister-ui.xml \
 	gnc-sxed-to-create-window-ui.xml \
-	gnc-sxed-window-ui.xml \
-	gnc-main-window-ui.xml
+	gnc-sxed-window-ui.xml
 
 EXTRA_DIST = $(ui_DATA)
--- src/gnome/ui/gnc-main-window-ui.xml
+++ /dev/null
@@ -1,106 +0,0 @@
-<ui>
-  <menubar>
-    <menu name="File" action="FileAction">
-      <menuitem name="FileNew" action="FileNewAction"/>
-      <placeholder name="FileNewPlaceholder"/>
-      <separator name="FileSep1"/>
-      <menuitem name="FileOpen" action="FileOpenAction"/>
-      <placeholder name="FileOpenPlaceholder"/>
-      <menuitem name="FileOpenNewWindow" action="FileOpenNewWindowAction"/>
-      <placeholder name="FileOpenRecentPlaceholder"/>
-      <separator name="FileSep2"/>
-      <menuitem name="FileSave" action="FileSaveAction"/>
-      <menuitem name="FileSaveAs" action="FileSaveAsAction"/>
-      <placeholder name="FileSavePlaceholder"/>
-      <separator name="FileSep3"/>
-      <menu name="FileImport" action="FileImportAction">
-        <menuitem name="FileImportQSF" action="FileImportQSFAction"/>
-        <placeholder name="FileImportPlaceholder"/>
-      </menu>
-      <menu name="FileExport" action="FileExportAction">
-        <menuitem name="FileExportAccounts" action="FileExportAccountsAction"/>
-        <menuitem name="FileExportChart" action="FileExportChartAction"/>
-        <placeholder name="FileExportPlaceholder"/>
-      </menu>
-      <separator name="FileSep4"/>
-      <menuitem name="FilePrint" action="FilePrintAction"/>
-      <placeholder name="FilePrintPlaceholder"/>
-      <separator name="FileSep5"/>
-      <menuitem name="FileProperties" action="FilePropertiesAction"/>
-      <separator name="FileSep6"/>
-      <menuitem name="FileClose" action="FileCloseAction"/>
-      <menuitem name="FileQuit" action="FileQuitAction"/>
-    </menu>
-  
-    <menu name="Edit" action="EditAction">
-      <menuitem name="EditCut" action="EditCutAction"/>
-      <menuitem name="EditCopy" action="EditCopyAction"/>
-      <menuitem name="EditPaste" action="EditPasteAction"/>
-      <separator name="EditSep1"/>
-      <placeholder name="EditPlaceholder"/>
-      <menuitem name="EditPreferences" action="EditPreferencesAction"/>
-      <placeholder name="EditPreferencesPlaceholder"/>
-      <placeholder name="EditStyleSheetsPlaceholder"/>
-      <menuitem name="EditTaxOptions" action="EditTaxOptionsAction"/>
-    </menu>
-  
-    <menu name="View" action="ViewAction">
-      <menuitem name="ViewRefresh" action="ViewRefreshAction"/>
-      <separator name="ViewSep1"/>
-      <menuitem name="ViewToolbar" action="ViewToolbarAction"/>
-      <menuitem name="ViewSummary" action="ViewSummaryAction"/>
-      <menuitem name="ViewStatusbar" action="ViewStatusbarAction"/>
-      <separator name="ViewSep2"/>
-      <placeholder name="ViewPlaceholder"/>
-    </menu>
-  
-    <menu name="Actions" action="ActionsAction">
-      <menu name="ActionsScheduledTransactions" action="ActionsScheduledTransactionsAction">
-        <menuitem name="ActionsScheduledTransactionEditor" action="ActionsScheduledTransactionEditorAction"/>
-        <menuitem name="ActionsSinceLastRun" action="ActionsSinceLastRunAction"/>
-        <menuitem name="ActionsMortgageLoan" action="ActionsMortgageLoanAction"/>
-      </menu>
-      <menuitem name="ActionsBudgetWorkbenchAction" action="ActionsBudgetWorkbenchAction"/>
-      <placeholder name="ActionsPlaceholder"/>
-      <menuitem name="ActionsCloseBooks" action="ActionsCloseBooksAction"/>
-    </menu>
-  
-    <placeholder name="AdditionalMenusPlaceholder"/>
-
-    <menu name="Reports" action="ReportsAction">
-      <placeholder name="ReportsPlaceholder"/>
-    </menu>
-
-    <menu name="Tools" action="ToolsAction">
-      <placeholder name="ToolsPlaceholder"/>
-      <menuitem name="ToolsPriceEditor" action="ToolsPriceEditorAction"/>
-      <menuitem name="ToolsCommodityEditor" action="ToolsCommodityEditorAction"/>
-      <menuitem name="ToolsFinancialCalculator" action="ToolsFinancialCalculatorAction"/>
-      <menuitem name="ToolsFindTransactions" action="ToolsFindTransactionsAction"/>
-      <placeholder name="ToolsPlaceholder2"/>
-    </menu>
-
-    <menu name="Extensions" action="ExtensionsAction">
-      <placeholder name="ExtensionsPlaceholder"/>
-    </menu>
-
-    <menu name="Help" action="HelpAction">
-      <menuitem name="HelpTutorial" action="HelpTutorialAction"/>
-      <menuitem name="HelpTipsOfTheDay" action="HelpTipsOfTheDayAction"/>
-      <menuitem name="HelpContents" action="HelpContentsAction"/>
-      <menuitem name="HelpAbout" action="HelpAboutAction"/>
-    </menu>
-
-    <menu name="Misc" action="MiscAction">
-      <menuitem name="MiscTest" action="MiscTestAction"/>
-    </menu>
-
-  </menubar>
-
-  <toolbar name="DefaultToolbar">
-    <toolitem name="ToolbarSave" action="FileSaveAction"/>
-    <toolitem name="ToolbarClose" action="FileCloseAction"/>
-    <separator name="ToolbarSep1"/>
-    <placeholder name="DefaultToolbarPlaceholder"/>
-  </toolbar>
-</ui>
--- /dev/null
+++ src/gnome/ui/gnc-plugin-basic-commands-ui.xml
@@ -0,0 +1,107 @@
+<ui>
+  <menubar>
+    <menu name="File" action="FileAction">
+      <placeholder name="FileNewPlaceholder">
+        <menuitem name="FileNew" action="FileNewAction"/>
+      </placeholder>
+      <separator name="FileSep1"/>
+      <placeholder name="FileOpenPlaceholder">
+        <menuitem name="FileOpen" action="FileOpenAction"/>
+      </placeholder>
+      <menuitem name="FileOpenNewWindow" action="FileOpenNewWindowAction"/>
+      <placeholder name="FileOpenRecentPlaceholder"/>
+      <separator name="FileSep2"/>
+      <placeholder name="FileSavePlaceholder">
+        <menuitem name="FileSave" action="FileSaveAction"/>
+        <menuitem name="FileSaveAs" action="FileSaveAsAction"/>
+      </placeholder>
+      <separator name="FileSep3"/>
+      <menu name="FileImport" action="FileImportAction">
+        <menuitem name="FileImportQSF" action="FileImportQSFAction"/>
+      </menu>
+      <menu name="FileExport" action="FileExportAction">
+        <menuitem name="FileExportAccounts" action="FileExportAccountsAction"/>
+        <menuitem name="FileExportChart" action="FileExportChartAction"/>
+      </menu>
+      <separator name="FileSep4"/>
+      <menuitem name="FilePrint" action="FilePrintAction"/>
+      <placeholder name="FilePrintPlaceholder"/>
+      <separator name="FileSep5"/>
+      <menuitem name="FileProperties" action="FilePropertiesAction"/>
+      <separator name="FileSep6"/>
+      <menuitem name="FileClose" action="FileCloseAction"/>
+      <menuitem name="FileQuit" action="FileQuitAction"/>
+    </menu>
+  
+    <menu name="Edit" action="EditAction">
+      <menuitem name="EditCut" action="EditCutAction"/>
+      <menuitem name="EditCopy" action="EditCopyAction"/>
+      <menuitem name="EditPaste" action="EditPasteAction"/>
+      <separator name="EditSep1"/>
+      <placeholder name="EditPlaceholder"/>
+      <menuitem name="EditPreferences" action="EditPreferencesAction"/>
+      <placeholder name="EditPreferencesPlaceholder"/>
+      <placeholder name="EditStyleSheetsPlaceholder"/>
+      <menuitem name="EditTaxOptions" action="EditTaxOptionsAction"/>
+    </menu>
+  
+    <menu name="View" action="ViewAction">
+      <menuitem name="ViewRefresh" action="ViewRefreshAction"/>
+      <separator name="ViewSep1"/>
+      <menuitem name="ViewToolbar" action="ViewToolbarAction"/>
+      <menuitem name="ViewSummary" action="ViewSummaryAction"/>
+      <menuitem name="ViewStatusbar" action="ViewStatusbarAction"/>
+      <separator name="ViewSep2"/>
+      <placeholder name="ViewPlaceholder"/>
+    </menu>
+  
+    <menu name="Actions" action="ActionsAction">
+      <menu name="ActionsScheduledTransactions" action="ActionsScheduledTransactionsAction">
+        <menuitem name="ActionsScheduledTransactionEditor" action="ActionsScheduledTransactionEditorAction"/>
+        <menuitem name="ActionsSinceLastRun" action="ActionsSinceLastRunAction"/>
+        <menuitem name="ActionsMortgageLoan" action="ActionsMortgageLoanAction"/>
+      </menu>
+      <menuitem name="ActionsBudgetWorkbenchAction" action="ActionsBudgetWorkbenchAction"/>
+      <placeholder name="ActionsPlaceholder"/>
+      <menuitem name="ActionsCloseBooks" action="ActionsCloseBooksAction"/>
+    </menu>
+  
+    <placeholder name="AdditionalMenusPlaceholder"/>
+
+    <menu name="Reports" action="ReportsAction">
+      <placeholder name="ReportsPlaceholder"/>
+    </menu>
+
+    <menu name="Tools" action="ToolsAction">
+      <placeholder name="ToolsPlaceholder">
+        <menuitem name="ToolsPriceEditor" action="ToolsPriceEditorAction"/>
+        <menuitem name="ToolsCommodityEditor" action="ToolsCommodityEditorAction"/>
+        <menuitem name="ToolsFinancialCalculator" action="ToolsFinancialCalculatorAction"/>
+        <menuitem name="ToolsFindTransactions" action="ToolsFindTransactionsAction"/>
+      </placeholder>
+    </menu>
+
+    <menu name="Extensions" action="ExtensionsAction">
+      <placeholder name="ExtensionsPlaceholder"/>
+    </menu>
+
+    <menu name="Help" action="HelpAction">
+      <placeholder name="HelpPlaceholder1">
+        <menuitem name="HelpTipsOfTheDay" action="HelpTipsOfTheDayAction"/>
+      </placeholder>
+    </menu>
+
+    <menu name="Misc" action="MiscAction">
+      <menuitem name="MiscTest" action="MiscTestAction"/>
+    </menu>
+
+  </menubar>
+
+  <toolbar name="DefaultToolbar">
+    <placeholder name="ToolbarSavePlaceholder">
+      <toolitem name="ToolbarSave" action="FileSaveAction"/>
+    </placeholder>
+    <separator name="ToolbarSep1"/>
+    <placeholder name="DefaultToolbarPlaceholder"/>
+  </toolbar>
+</ui>
Index: Makefile.am
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/report/stylesheets/Makefile.am,v
retrieving revision 1.6.4.5
retrieving revision 1.6.4.6
diff -Lsrc/report/stylesheets/Makefile.am -Lsrc/report/stylesheets/Makefile.am -u -r1.6.4.5 -r1.6.4.6
--- src/report/stylesheets/Makefile.am
+++ src/report/stylesheets/Makefile.am
@@ -18,7 +18,6 @@
   -I${top_srcdir}/src \
   -I${top_srcdir}/src/engine \
   -I${top_srcdir}/src/gnc-module \
-  -I${top_srcdir}/src/app-utils \
   -I${top_srcdir}/src/gnome \
   -I${top_srcdir}/src/gnome-utils \
   -I${top_srcdir}/src/report/report-gnome \


More information about the gnucash-changes mailing list