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.
This commit is contained in:
Michael Terry 2009-09-08 11:00:25 -04:00 committed by Sergey V. Udaltsov
parent 194099ccce
commit 860a1cec92
2 changed files with 5 additions and 1 deletions

View file

@ -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 */
}

View file

@ -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;