From 5edeb504e29b0f710fa72871417c1a7495f5c413 Mon Sep 17 00:00:00 2001 From: David Hampton Date: Tue, 27 Mar 2007 01:55:38 +0000 Subject: [PATCH] Add an option to change the tab closing behavior. The two choices are to move to the tab immediately to the left, or to move to the most recently viewed tab. Implements #346314. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15759 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/gnome-utils/glade/preferences.glade | 49 ++++++++++++++----- src/gnome-utils/gnc-main-window.c | 13 +++-- .../schemas/apps_gnucash_general.schemas.in | 17 ++++++- 3 files changed, 60 insertions(+), 19 deletions(-) diff --git a/src/gnome-utils/glade/preferences.glade b/src/gnome-utils/glade/preferences.glade index 0a3f0491a6..beed29e24b 100644 --- a/src/gnome-utils/glade/preferences.glade +++ b/src/gnome-utils/glade/preferences.glade @@ -3457,7 +3457,7 @@ 6 True - 18 + 19 4 False 0 @@ -3694,6 +3694,29 @@ + + + True + True + Bring the most _recent tab to the front + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + 1 + 12 + 13 + 12 + fill + + + + True @@ -3715,8 +3738,8 @@ 0 1 - 12 - 13 + 13 + 14 fill @@ -3743,8 +3766,8 @@ 0 1 - 13 - 14 + 14 + 15 fill @@ -3766,8 +3789,8 @@ 0 1 - 14 - 15 + 15 + 16 12 fill @@ -3791,8 +3814,8 @@ 0 1 - 15 - 16 + 16 + 17 12 fill @@ -3816,8 +3839,8 @@ 0 1 - 16 - 17 + 17 + 18 12 fill @@ -3841,8 +3864,8 @@ 0 1 - 17 - 18 + 18 + 19 12 fill diff --git a/src/gnome-utils/gnc-main-window.c b/src/gnome-utils/gnc-main-window.c index 2a591d147d..c6d45ee99b 100644 --- a/src/gnome-utils/gnc-main-window.c +++ b/src/gnome-utils/gnc-main-window.c @@ -81,6 +81,7 @@ enum { #define PLUGIN_PAGE_CLOSE_BUTTON "close-button" #define KEY_SHOW_CLOSE_BUTTON "tab_close_buttons" +#define KEY_TAB_NEXT_RECENT "tab_next_recent" #define KEY_TAB_POSITION "tab_position" #define GNC_MAIN_WINDOW_NAME "GncMainWindow" @@ -2006,11 +2007,13 @@ gnc_main_window_disconnect (GncMainWindow *window, /* Switch to the last recently used page */ notebook = GTK_NOTEBOOK (priv->notebook); - new_page = g_list_nth_data (priv->usage_order, 0); - if (new_page) { - page_num = gtk_notebook_page_num(notebook, new_page->notebook_page); - gtk_notebook_set_current_page(notebook, page_num); - } + if (gnc_gconf_get_bool(GCONF_GENERAL, KEY_TAB_NEXT_RECENT, NULL)) { + new_page = g_list_nth_data (priv->usage_order, 0); + if (new_page) { + page_num = gtk_notebook_page_num(notebook, new_page->notebook_page); + gtk_notebook_set_current_page(notebook, page_num); + } + } /* Remove the page from the notebook */ page_num = gtk_notebook_page_num(notebook, page->notebook_page); diff --git a/src/gnome/schemas/apps_gnucash_general.schemas.in b/src/gnome/schemas/apps_gnucash_general.schemas.in index a8b37978c2..5e3d6d219c 100644 --- a/src/gnome/schemas/apps_gnucash_general.schemas.in +++ b/src/gnome/schemas/apps_gnucash_general.schemas.in @@ -501,7 +501,22 @@ bool false - If gnucash should allow file incompatability. If true, then gnucash will (be allowed to) intentionally break file compatability with old versions. + Allow file incompatability with older versions. + If gnucash should allow file incompatability. If true, then gnucash will (be allowed to) intentionally break file compatability with old versions. + + + + + /schemas/apps/gnucash/general/tab_next_recent + /apps/gnucash/general/tab_next_recent + gnucash + bool + FALSE + + Closing a tab moves to the the most recent tab. + + If true, closing a tab moves to the most recently visited tab. If false, closing a tab moves one tab to the left. +