Skip to content

Commit

Permalink
Merge branch 'bug797787-pref' into maint
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherlam committed May 16, 2021
2 parents 4400493 + f49cd4b commit 2255854
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 13 deletions.
6 changes: 5 additions & 1 deletion gnucash/gnome-utils/gnc-main-window.c
Expand Up @@ -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"

Expand Down Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions gnucash/gschemas/org.gnucash.gschema.xml.in
Expand Up @@ -130,6 +130,11 @@
<summary>Width of notebook tabs</summary>
<description>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.</description>
</key>
<key name="tab-open-adjacent" type="b">
<default>true</default>
<summary>Opens new tab adjacent to current tab instead of at the end</summary>
<description>If active, new tabs are opened adjacent to current tab. If inactive, the new tabs are opened instead at the end.</description>
</key>
<key name="currency-choice-locale" type="b">
<default>true</default>
<summary>Use the system locale currency for all newly created accounts.</summary>
Expand Down
43 changes: 31 additions & 12 deletions gnucash/gtkbuilder/dialog-preferences.glade
Expand Up @@ -3328,7 +3328,7 @@ many months before the current month</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
<property name="top_attach">6</property>
<property name="width">2</property>
</packing>
</child>
Expand All @@ -3339,7 +3339,7 @@ many months before the current month</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">7</property>
<property name="top_attach">8</property>
</packing>
</child>
<child>
Expand All @@ -3352,7 +3352,7 @@ many months before the current month</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">8</property>
<property name="top_attach">9</property>
</packing>
</child>
<child>
Expand All @@ -3371,7 +3371,7 @@ many months before the current month</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">9</property>
<property name="top_attach">10</property>
</packing>
</child>
<child>
Expand All @@ -3390,7 +3390,7 @@ many months before the current month</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">10</property>
<property name="top_attach">11</property>
</packing>
</child>
<child>
Expand All @@ -3409,7 +3409,7 @@ many months before the current month</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">11</property>
<property name="top_attach">12</property>
</packing>
</child>
<child>
Expand All @@ -3428,7 +3428,7 @@ many months before the current month</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">12</property>
<property name="top_attach">13</property>
</packing>
</child>
<child>
Expand All @@ -3441,7 +3441,7 @@ many months before the current month</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">8</property>
<property name="top_attach">9</property>
</packing>
</child>
<child>
Expand All @@ -3460,7 +3460,7 @@ many months before the current month</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">9</property>
<property name="top_attach">10</property>
</packing>
</child>
<child>
Expand All @@ -3479,7 +3479,7 @@ many months before the current month</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">10</property>
<property name="top_attach">11</property>
</packing>
</child>
<child>
Expand Down Expand Up @@ -3565,7 +3565,7 @@ many months before the current month</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">6</property>
<property name="top_attach">7</property>
</packing>
</child>
<child>
Expand All @@ -3579,7 +3579,26 @@ many months before the current month</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
<property name="top_attach">7</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="pref/general/tab-open-adjacent">
<property name="label" translatable="yes">Open new tabs _adjacent to current tab</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup">Opens new tab adjacent to current tab instead of at the end</property>
<property name="tooltip_text" translatable="yes">Opens new tab adjacent to current tab instead of at the end.</property>
<property name="halign">start</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
<property name="width">2</property>
</packing>
</child>
<child>
Expand Down

0 comments on commit 2255854

Please sign in to comment.