Add preference general/tab_position to choose the edge of the notebook

the tabs will be showed (top, bottom, left or right). Add it to
preferences_dialog->Windows. Move "Show close button on notebook tabs"
from General to Windows. Fixes #340299.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14577 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Andreas Köhler 2006-07-30 00:39:02 +00:00
parent 31b61b71bc
commit 8a8510d34b
4 changed files with 306 additions and 58 deletions

View File

@ -1,3 +1,13 @@
2006-07-30 Andreas Köhler <andi5.py@gmx.net>
* src/gnome-utils/gnc-main-window.c:
* src/gnome/schemas/apps_gnucash_general.schemas.in:
* src/gnome-utils/glade/preferences.glade: Add preference
general/tab_position to choose the edge of the notebook the tabs
will be showed (top, bottom, left or right). Add it to
preferences_dialog->Windows. Move "Show close button on notebook
tabs" from General to Windows. Fixes #340299.
2006-07-24 Derek Atkins <derek@ihtfp.com>
* [lots of Makefile.am files]:

View File

@ -1522,7 +1522,7 @@
<widget class="GtkTable" id="table2">
<property name="border_width">6</property>
<property name="visible">True</property>
<property name="n_rows">17</property>
<property name="n_rows">16</property>
<property name="n_columns">4</property>
<property name="homogeneous">False</property>
<property name="row_spacing">0</property>
@ -1592,8 +1592,8 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">4</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_padding">12</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
@ -1624,30 +1624,6 @@
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="gconf/general/tab_close_buttons">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Show a close button on each notebook tab. These function identically to the 'Close' menu item.</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Show close button on _notebook tabs</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">4</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_padding">12</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox2">
<property name="visible">True</property>
@ -1698,8 +1674,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
<property name="top_attach">13</property>
<property name="bottom_attach">14</property>
<property name="top_attach">12</property>
<property name="bottom_attach">13</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
@ -1723,8 +1699,8 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">13</property>
<property name="bottom_attach">14</property>
<property name="top_attach">12</property>
<property name="bottom_attach">13</property>
<property name="x_padding">12</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
@ -1747,8 +1723,8 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">4</property>
<property name="top_attach">12</property>
<property name="bottom_attach">13</property>
<property name="top_attach">11</property>
<property name="bottom_attach">12</property>
<property name="x_padding">12</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
@ -1772,8 +1748,8 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">11</property>
<property name="bottom_attach">12</property>
<property name="top_attach">10</property>
<property name="bottom_attach">11</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@ -1796,8 +1772,8 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">10</property>
<property name="bottom_attach">11</property>
<property name="top_attach">9</property>
<property name="bottom_attach">10</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@ -1821,8 +1797,8 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">9</property>
<property name="bottom_attach">10</property>
<property name="top_attach">8</property>
<property name="bottom_attach">9</property>
<property name="x_padding">12</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
@ -1845,8 +1821,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">9</property>
<property name="bottom_attach">10</property>
<property name="top_attach">8</property>
<property name="bottom_attach">9</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@ -1868,8 +1844,8 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">4</property>
<property name="top_attach">8</property>
<property name="bottom_attach">9</property>
<property name="top_attach">7</property>
<property name="bottom_attach">8</property>
<property name="x_padding">12</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
@ -1892,8 +1868,8 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">4</property>
<property name="top_attach">7</property>
<property name="bottom_attach">8</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="x_padding">12</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
@ -1917,8 +1893,8 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@ -1941,8 +1917,8 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@ -1965,8 +1941,8 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">14</property>
<property name="bottom_attach">15</property>
<property name="top_attach">13</property>
<property name="bottom_attach">14</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@ -1989,8 +1965,8 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">15</property>
<property name="bottom_attach">16</property>
<property name="top_attach">14</property>
<property name="bottom_attach">15</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@ -2014,8 +1990,8 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">16</property>
<property name="bottom_attach">17</property>
<property name="top_attach">15</property>
<property name="bottom_attach">16</property>
<property name="x_padding">12</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
@ -2038,8 +2014,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">16</property>
<property name="bottom_attach">17</property>
<property name="top_attach">15</property>
<property name="bottom_attach">16</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@ -3020,7 +2996,7 @@
<widget class="GtkTable" id="table5">
<property name="border_width">6</property>
<property name="visible">True</property>
<property name="n_rows">9</property>
<property name="n_rows">18</property>
<property name="n_columns">4</property>
<property name="homogeneous">False</property>
<property name="row_spacing">0</property>
@ -3244,6 +3220,225 @@
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label110">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">12</property>
<property name="bottom_attach">13</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label111">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Tab Position&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">13</property>
<property name="bottom_attach">14</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="gconf/general/tab_position/top">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Display the notebook tabs at the top of the window.</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">To_p</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">14</property>
<property name="bottom_attach">15</property>
<property name="x_padding">12</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="gconf/general/tab_position/bottom">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Display the notebook tabs at the bottom of the window.</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">B_ottom</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<property name="group">gconf/general/tab_position/top</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">15</property>
<property name="bottom_attach">16</property>
<property name="x_padding">12</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="gconf/general/tab_position/left">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Display the notebook tabs at the left of the window.</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">_Left</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<property name="group">gconf/general/tab_position/top</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">16</property>
<property name="bottom_attach">17</property>
<property name="x_padding">12</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="gconf/general/tab_position/right">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Display the notebook tabs at the right of the window.</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">_Right</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<property name="group">gconf/general/tab_position/top</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">17</property>
<property name="bottom_attach">18</property>
<property name="x_padding">12</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label112">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">9</property>
<property name="bottom_attach">10</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label113">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Close Button&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">10</property>
<property name="bottom_attach">11</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="gconf/general/tab_close_buttons">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Show a close button on each notebook tab. These function identically to the 'Close' menu item.</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Show close button on _notebook tabs</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">11</property>
<property name="bottom_attach">12</property>
<property name="x_padding">12</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
<packing>
<property name="tab_expand">False</property>

View File

@ -83,6 +83,7 @@ enum {
#define PLUGIN_PAGE_CLOSE_BUTTON "close-button"
#define KEY_SHOW_CLOSE_BUTTON "tab_close_buttons"
#define KEY_TAB_POSITION "tab_position"
/* Static Globals *******************************************************/
@ -2369,6 +2370,28 @@ gnc_main_window_update_toolbar (GncMainWindow *window)
LEAVE("");
}
static void
gnc_main_window_update_tab_position (GncMainWindow *window)
{
GtkPositionType position = GTK_POS_TOP;
gchar *conf_string;
GncMainWindowPrivate *priv;
ENTER ("window %p", window);
conf_string = gnc_gconf_get_string (GCONF_GENERAL,
KEY_TAB_POSITION, NULL);
if (conf_string) {
position = gnc_enum_from_nick (GTK_TYPE_POSITION_TYPE,
conf_string, GTK_POS_TOP);
g_free (conf_string);
}
priv = GNC_MAIN_WINDOW_GET_PRIVATE (window);
gtk_notebook_set_tab_pos (GTK_NOTEBOOK (priv->notebook), position);
LEAVE ("");
}
/*
* Based on code from Epiphany (src/ephy-window.c)
*/
@ -2502,6 +2525,8 @@ gnc_main_window_gconf_changed (GConfClient *client,
key_tail++;
if (strcmp(key_tail, KEY_TOOLBAR_STYLE) == 0) {
gnc_main_window_update_toolbar(window);
} else if (strcmp(key_tail, KEY_TAB_POSITION) == 0) {
gnc_main_window_update_tab_position(window);
}
}
@ -2710,6 +2735,7 @@ gnc_main_window_setup_window (GncMainWindow *window)
gnc_gconf_add_notification(G_OBJECT(window), DESKTOP_GNOME_INTERFACE,
gnc_main_window_gconf_changed);
gnc_main_window_update_toolbar(window);
gnc_main_window_update_tab_position(window);
gnc_main_window_init_menu_updaters(window);

View File

@ -462,5 +462,22 @@
</locale>
</schema>
<schema>
<key>/schemas/apps/gnucash/general/tab_position</key>
<applyto>/apps/gnucash/general/tab_position</applyto>
<owner>gnucash</owner>
<type>string</type>
<default>top</default>
<locale name="C">
<short>Position of the notebook tabs</short>
<long>
This setting determines the edge at which the tabs for
switching pages in notebooks are drawn. Possible values
are "top", "left", "bottom" and "right".
It defaults to "top".
</long>
</locale>
</schema>
</schemalist>
</gconfschemafile>