mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14376 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
2006-06-16 David Hampton <hampton@employees.org>
|
||||
|
||||
* 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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user