diff --git a/ChangeLog b/ChangeLog index 7a578d0b4f..c2e9de1d83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2006-06-16 David Hampton + * src/gnome-utils/gnc-main-window.[ch]: + * src/gnome/gnc-plugin-page-account-tree.c: Instead of marking the + first page so that it can't be closed, mark the first *accounts* + page so that it can't be closed. + * src/register/register-gnome/gnucash-header.c: Remove five year old workaround for a resizing bug. Fixes #344764. Also explicitly initialize a couple of variables. diff --git a/src/gnome-utils/gnc-main-window.c b/src/gnome-utils/gnc-main-window.c index 2d46ffdc38..dcda9430dc 100644 --- a/src/gnome-utils/gnc-main-window.c +++ b/src/gnome-utils/gnc-main-window.c @@ -80,7 +80,6 @@ enum { * back to the corresponding GncPluginPage object. */ #define PLUGIN_PAGE_LABEL "plugin-page" -#define PLUGIN_PAGE_IMMUTABLE "page-immutable" #define PLUGIN_PAGE_CLOSE_BUTTON "close-button" #define KEY_SHOW_CLOSE_BUTTON "tab_close_buttons" @@ -2001,7 +2000,6 @@ gnc_main_window_open_page (GncMainWindow *window, GtkWidget *label, *entry; const gchar *icon; GtkWidget *image; - gboolean immutable = FALSE; GList *tmp; if (window) @@ -2031,16 +2029,6 @@ gnc_main_window_open_page (GncMainWindow *window, window = active_windows->data; } - /* Is this the first page in the first window? */ - if (window == active_windows->data) { - priv = GNC_MAIN_WINDOW_GET_PRIVATE(window); - if (priv->installed_pages == NULL) { - immutable = TRUE; - g_object_set_data (G_OBJECT (page), PLUGIN_PAGE_IMMUTABLE, - GINT_TO_POINTER(1)); - } - } - page->window = GTK_WIDGET(window); page->notebook_page = gnc_plugin_page_create_widget (page); g_object_set_data (G_OBJECT (page->notebook_page), @@ -2080,7 +2068,7 @@ gnc_main_window_open_page (GncMainWindow *window, page); /* Add close button - Not for immutable pages */ - if (!immutable) { + if (!g_object_get_data (G_OBJECT (page), PLUGIN_PAGE_IMMUTABLE)) { GtkWidget *close_image, *close_button; GtkRequisition requisition; diff --git a/src/gnome-utils/gnc-main-window.h b/src/gnome-utils/gnc-main-window.h index 7d3be956c7..c52e51ad5b 100644 --- a/src/gnome-utils/gnc-main-window.h +++ b/src/gnome-utils/gnc-main-window.h @@ -51,6 +51,8 @@ G_BEGIN_DECLS #define GNC_MAIN_WINDOW_NAME "GncMainWindow" +#define PLUGIN_PAGE_IMMUTABLE "page-immutable" + /* typedefs & structures */ /** The instance data structure for a main window object. */ diff --git a/src/gnome/gnc-plugin-page-account-tree.c b/src/gnome/gnc-plugin-page-account-tree.c index 8285393d41..c3daf03370 100644 --- a/src/gnome/gnc-plugin-page-account-tree.c +++ b/src/gnome/gnc-plugin-page-account-tree.c @@ -53,6 +53,7 @@ #include "gnc-component-manager.h" #include "gnc-engine.h" #include "gnc-gnome-utils.h" +#include "gnc-gobject-utils.h" #include "gnc-html.h" #include "gnc-icons.h" #include "gnc-plugin-account-tree.h" @@ -297,6 +298,7 @@ gnc_plugin_page_account_tree_init (GncPluginPageAccountTree *plugin_page) GtkActionGroup *action_group; GncPluginPageAccountTreePrivate *priv; GncPluginPage *parent; + const GList *page_list; ENTER("page %p", plugin_page); priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(plugin_page); @@ -312,6 +314,14 @@ gnc_plugin_page_account_tree_init (GncPluginPageAccountTree *plugin_page) /* change me when the system supports multiple books */ gnc_plugin_page_add_book(parent, gnc_get_current_book()); + /* Is this the first accounts page? */ + page_list = + gnc_gobject_tracking_get_list(GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME); + if (plugin_page == page_list->data) { + g_object_set_data(G_OBJECT(plugin_page), PLUGIN_PAGE_IMMUTABLE, + GINT_TO_POINTER(1)); + } + /* Create menu and toolbar information */ action_group = gnc_plugin_page_create_action_group(parent,