[gnome-control-center] region: Easier to understand layout switching options
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] region: Easier to understand layout switching options
- Date: Mon, 7 Feb 2011 01:09:13 +0000 (UTC)
commit 9c2bfba4caf404456d5daf30ebfcc863c6d2cd68
Author: Bastien Nocera <hadess hadess net>
Date: Mon Feb 7 01:06:39 2011 +0000
region: Easier to understand layout switching options
Use 2 groups of radio buttons to make layout options related
to windows easier to understand.
https://bugzilla.gnome.org/show_bug.cgi?id=641021
panels/region/gnome-region-panel-xkb.c | 40 +++++--------
panels/region/gnome-region-panel.ui | 99 +++++++++++++++++++++++++-------
2 files changed, 93 insertions(+), 46 deletions(-)
---
diff --git a/panels/region/gnome-region-panel-xkb.c b/panels/region/gnome-region-panel-xkb.c
index 352e05f..b9611dd 100644
--- a/panels/region/gnome-region-panel-xkb.c
+++ b/panels/region/gnome-region-panel-xkb.c
@@ -82,19 +82,6 @@ reset_to_defaults (GtkWidget * button, GtkBuilder * dialog)
}
static void
-chk_separate_group_per_window_toggled (GSettings * settings,
- const gchar * key,
- GtkBuilder * dialog)
-{
- if (!strcmp (key, GKBD_DESKTOP_CONFIG_KEY_GROUP_PER_WINDOW)) {
- gboolean gpw = g_settings_get_boolean (settings, key);
- gtk_widget_set_sensitive (WID
- ("chk_new_windows_inherit_layout"),
- gpw);
- }
-}
-
-static void
chk_new_windows_inherit_layout_toggled (GtkWidget *
chk_new_windows_inherit_layout,
GtkBuilder * dialog)
@@ -131,13 +118,25 @@ setup_xkb_tabs (GtkBuilder * dialog)
gkbd_keyboard_config_init (&initial_config, engine);
gkbd_keyboard_config_load_from_x_initial (&initial_config, NULL);
+ /* Set initial state */
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("chk_separate_group_per_window")),
+ g_settings_get_boolean (xkb_desktop_settings,
+ GKBD_DESKTOP_CONFIG_KEY_GROUP_PER_WINDOW));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (chk_new_windows_inherit_layout),
+ xkb_get_default_group () < 0);
+
g_settings_bind (xkb_desktop_settings,
GKBD_DESKTOP_CONFIG_KEY_GROUP_PER_WINDOW,
WID ("chk_separate_group_per_window"), "active",
G_SETTINGS_BIND_DEFAULT);
- g_signal_connect (xkb_desktop_settings, "changed",
- G_CALLBACK
- (chk_separate_group_per_window_toggled), dialog);
+ g_settings_bind (xkb_desktop_settings,
+ GKBD_DESKTOP_CONFIG_KEY_GROUP_PER_WINDOW,
+ WID ("chk_new_windows_inherit_layout"), "sensitive",
+ G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (xkb_desktop_settings,
+ GKBD_DESKTOP_CONFIG_KEY_GROUP_PER_WINDOW,
+ WID ("chk_new_windows_default_layout"), "sensitive",
+ G_SETTINGS_BIND_DEFAULT);
#ifdef HAVE_X11_EXTENSIONS_XKB_H
if (strcmp (xkl_engine_get_backend_name (engine), "XKB"))
@@ -147,15 +146,6 @@ setup_xkb_tabs (GtkBuilder * dialog)
xkb_layouts_prepare_selected_tree (dialog);
xkb_layouts_fill_selected_tree (dialog);
- gtk_widget_set_sensitive (chk_new_windows_inherit_layout,
- gtk_toggle_button_get_active
- (GTK_TOGGLE_BUTTON
- (WID
- ("chk_separate_group_per_window"))));
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
- (chk_new_windows_inherit_layout),
- xkb_get_default_group () < 0);
-
xkb_layouts_register_buttons_handlers (dialog);
g_signal_connect (G_OBJECT (WID ("xkb_reset_to_defaults")),
"clicked", G_CALLBACK (reset_to_defaults),
diff --git a/panels/region/gnome-region-panel.ui b/panels/region/gnome-region-panel.ui
index e17ac55..3c856e4 100644
--- a/panels/region/gnome-region-panel.ui
+++ b/panels/region/gnome-region-panel.ui
@@ -82,6 +82,11 @@
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ </object>
+ </child>
<child>
<object class="GtkVBox" id="region_vbox">
<property name="visible">True</property>
@@ -225,7 +230,6 @@
<object class="GtkTreeView" id="xkb_layouts_selected">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="has_tooltip">False</property>
<property name="headers_visible">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/>
@@ -328,7 +332,6 @@
<object class="GtkVBox" id="vbox33">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="border_width">0</property>
<property name="spacing">12</property>
<child>
<object class="GtkVBox" id="vbox34">
@@ -336,51 +339,110 @@
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
- <object class="GtkCheckButton" id="chk_separate_group_per_window">
- <property name="label" translatable="yes">_Separate layout for each window</property>
+ <object class="GtkRadioButton" id="chk_same_group">
+ <property name="label" translatable="yes">Use same layout in all windows</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
- <property name="use_underline">True</property>
<property name="xalign">0</property>
+ <property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="chk_new_windows_inherit_layout">
- <property name="label" translatable="yes">New windows u_se active window's layout</property>
+ <object class="GtkRadioButton" id="chk_separate_group_per_window">
+ <property name="label" translatable="yes">Allow different layouts for each window</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
- <property name="use_underline">True</property>
<property name="xalign">0</property>
+ <property name="active">True</property>
<property name="draw_indicator">True</property>
+ <property name="group">chk_same_group</property>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
- <placeholder/>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkVBox" id="vbox4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkRadioButton" id="chk_new_windows_default_layout">
+ <property name="label" translatable="yes">Use default layout in new windows</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="chk_new_windows_inherit_layout">
+ <property name="label" translatable="yes">Use previous window's layout in new windows</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">chk_new_windows_default_layout</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
</child>
</object>
<packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <placeholder/>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
</child>
<child>
<object class="GtkHButtonBox" id="hbuttonbox2">
@@ -480,11 +542,6 @@ default settings</property>
<property name="position">1</property>
</packing>
</child>
- <child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area1">
- <property name="can_focus">False</property>
- </object>
- </child>
</object>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]