From 44f0413d47b67b16c8ac11a59ec827e455e60eda Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Sat, 8 May 2021 14:35:36 +0800 Subject: [PATCH 1/2] Bug 797787 add preference tab-open-adjacent --- gnucash/gschemas/org.gnucash.gschema.xml.in | 5 +++ gnucash/gtkbuilder/dialog-preferences.glade | 43 +++++++++++++++------ 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/gnucash/gschemas/org.gnucash.gschema.xml.in b/gnucash/gschemas/org.gnucash.gschema.xml.in index 8f1f808f8db..7598dbaaf2a 100644 --- a/gnucash/gschemas/org.gnucash.gschema.xml.in +++ b/gnucash/gschemas/org.gnucash.gschema.xml.in @@ -130,6 +130,11 @@ Width of notebook tabs This key specifies the maximum width of notebook tabs. If the text in the tab is longer than this value (the test is approximate) then the tab label will have the middle cut and replaced with an ellipsis. + + true + Opens new tab adjacent to current tab instead of at the end + If active, new tabs are opened adjacent to current tab. If inactive, the new tabs are opened instead at the end. + true Use the system locale currency for all newly created accounts. diff --git a/gnucash/gtkbuilder/dialog-preferences.glade b/gnucash/gtkbuilder/dialog-preferences.glade index df512c2b90c..3d78ab83bb9 100644 --- a/gnucash/gtkbuilder/dialog-preferences.glade +++ b/gnucash/gtkbuilder/dialog-preferences.glade @@ -3328,7 +3328,7 @@ many months before the current month 0 - 5 + 6 2 @@ -3339,7 +3339,7 @@ many months before the current month 0 - 7 + 8 @@ -3352,7 +3352,7 @@ many months before the current month 0 - 8 + 9 @@ -3371,7 +3371,7 @@ many months before the current month 0 - 9 + 10 @@ -3390,7 +3390,7 @@ many months before the current month 0 - 10 + 11 @@ -3409,7 +3409,7 @@ many months before the current month 0 - 11 + 12 @@ -3428,7 +3428,7 @@ many months before the current month 0 - 12 + 13 @@ -3441,7 +3441,7 @@ many months before the current month 1 - 8 + 9 @@ -3460,7 +3460,7 @@ many months before the current month 1 - 9 + 10 @@ -3479,7 +3479,7 @@ many months before the current month 1 - 10 + 11 @@ -3565,7 +3565,7 @@ many months before the current month 1 - 6 + 7 @@ -3579,7 +3579,26 @@ many months before the current month 0 - 6 + 7 + + + + + Open new tabs _adjacent to current tab + True + True + True + True + Opens new tab adjacent to current tab instead of at the end + Opens new tab adjacent to current tab instead of at the end. + start + True + True + + + 0 + 5 + 2 From f49cd4b173cd9f821397b8097895f10e86eb4da8 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Sat, 8 May 2021 14:36:04 +0800 Subject: [PATCH 2/2] Bug 797787 - Feature request: preference setting to open new tabs adjacent to currently active tab tests preference; if enabled then new tab inserted after current. if disabled then new tab is at the end. --- gnucash/gnome-utils/gnc-main-window.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c index e1d2a8d8f25..f9ceea98526 100644 --- a/gnucash/gnome-utils/gnc-main-window.c +++ b/gnucash/gnome-utils/gnc-main-window.c @@ -109,6 +109,7 @@ enum #define GNC_PREF_TAB_COLOR "show-account-color-tabs" #define GNC_PREF_SAVE_CLOSE_EXPIRES "save-on-close-expires" #define GNC_PREF_SAVE_CLOSE_WAIT_TIME "save-on-close-wait-time" +#define GNC_PREF_TAB_OPEN_ADJACENT "tab-open-adjacent" #define GNC_MAIN_WINDOW_NAME "GncMainWindow" @@ -3015,7 +3016,10 @@ gnc_main_window_connect (GncMainWindow *window, page->window = GTK_WIDGET(window); priv = GNC_MAIN_WINDOW_GET_PRIVATE(window); notebook = GTK_NOTEBOOK (priv->notebook); - current_position = g_list_index (priv->installed_pages, priv->current_page) + 1; + + if (gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_OPEN_ADJACENT)) + current_position = g_list_index (priv->installed_pages, priv->current_page) + 1; + priv->installed_pages = g_list_insert (priv->installed_pages, page, current_position); priv->usage_order = g_list_prepend (priv->usage_order, page); gtk_notebook_insert_page_menu (notebook, page->notebook_page,