[gnome-control-center] Show correct default layout



commit 860a1cec9214fe915d6341eb130c94b6d29287e0
Author: Michael Terry <michael terry canonical com>
Date:   Tue Sep 8 11:00:25 2009 -0400

    Show correct default layout
    
    When 'Reset to Defaults' is pressed, the default layout should also be reset.
    When showing the list of layouts, treat a -1 (unset) default layout value as 0.

 capplets/keyboard/gnome-keyboard-properties-xkb.c  |    4 ++++
 .../keyboard/gnome-keyboard-properties-xkblt.c     |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/capplets/keyboard/gnome-keyboard-properties-xkb.c b/capplets/keyboard/gnome-keyboard-properties-xkb.c
index f7a7515..ba31659 100644
--- a/capplets/keyboard/gnome-keyboard-properties-xkb.c
+++ b/capplets/keyboard/gnome-keyboard-properties-xkb.c
@@ -134,6 +134,10 @@ reset_to_defaults (GtkWidget * button, GtkBuilder * dialog)
 	gkbd_keyboard_config_save_to_gconf (&empty_kbd_config);
 	gkbd_keyboard_config_term (&empty_kbd_config);
 
+	gconf_client_unset (xkb_gconf_client,
+			      GKBD_DESKTOP_CONFIG_KEY_DEFAULT_GROUP,
+			      NULL);
+
 	/* all the rest is g-s-d's business */
 }
 
diff --git a/capplets/keyboard/gnome-keyboard-properties-xkblt.c b/capplets/keyboard/gnome-keyboard-properties-xkblt.c
index 680f0ad..21b72f8 100644
--- a/capplets/keyboard/gnome-keyboard-properties-xkblt.c
+++ b/capplets/keyboard/gnome-keyboard-properties-xkblt.c
@@ -154,7 +154,7 @@ def_group_in_gconf_changed (GConfClient * client,
 				    (GTK_TREE_VIEW (tree_view)));
 		GtkTreeIter iter;
 		int counter = 0;
-		default_group = gconf_value_get_int (value);
+		default_group = MAX(0, gconf_value_get_int (value));
 		if (gtk_tree_model_get_iter_first (model, &iter)) {
 			do {
 				gboolean cur_val;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]