summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey V. Udaltsov <svu@src.gnome.org>2006-04-02 01:11:42 +0000
committerSergey V. Udaltsov <svu@src.gnome.org>2006-04-02 01:11:42 +0000
commit69a2971101376b6bb512626598763679aee284b3 (patch)
tree3d6d3c1cf94fce87ff0569f9a803e1a9e3503fa9
parent0d10f6ba20f4fcbf6e943aebb7c4034856c1e1a1 (diff)
downloadgnome-control-center-69a2971101376b6bb512626598763679aee284b3.tar.gz
fixed the buggon sensitivity, b.g.o#336396
-rw-r--r--capplets/keyboard/ChangeLog7
-rw-r--r--capplets/keyboard/gnome-keyboard-properties-xkblt.c21
2 files changed, 27 insertions, 1 deletions
diff --git a/capplets/keyboard/ChangeLog b/capplets/keyboard/ChangeLog
index 10e6ebabb..390496334 100644
--- a/capplets/keyboard/ChangeLog
+++ b/capplets/keyboard/ChangeLog
@@ -1,3 +1,10 @@
+2006-03-02 Sergey Udaltsov <svu@gnome.org>
+
+ Fixes #336396
+
+ * gnome-keyboard-properties-xkblt.c: fixed the buttons sensitivity
+ change.
+
2006-01-26 Rodrigo Moya <rodrigownovell.com>
Fixes #328748
diff --git a/capplets/keyboard/gnome-keyboard-properties-xkblt.c b/capplets/keyboard/gnome-keyboard-properties-xkblt.c
index 0ee37a3d9..e79dde8e2 100644
--- a/capplets/keyboard/gnome-keyboard-properties-xkblt.c
+++ b/capplets/keyboard/gnome-keyboard-properties-xkblt.c
@@ -53,6 +53,8 @@ static int defaultGroup = -1;
static GtkCellRenderer *textRenderer;
static GtkCellRenderer *toggleRenderer;
+static gboolean disableButtonsSensibilityUpdate = FALSE;
+
void
clear_xkb_elements_list (GSList * list)
{
@@ -214,6 +216,9 @@ xkb_layouts_enable_disable_buttons (GladeXML * dialog)
gtk_tree_model_iter_n_children (selectedLayoutsModel,
NULL);
+ if (disableButtonsSensibilityUpdate)
+ return;
+
gtk_widget_set_sensitive (addLayoutBtn,
(nSelectedLayouts < maxSelectedLayouts ||
maxSelectedLayouts == 0));
@@ -232,6 +237,7 @@ xkb_layouts_enable_disable_buttons (GladeXML * dialog)
gtk_tree_path_free (path);
}
}
+
gtk_widget_set_sensitive (upLayoutBtn, canMoveUp);
gtk_widget_set_sensitive (dnLayoutBtn, canMoveDn);
}
@@ -322,6 +328,10 @@ xkb_layouts_fill_selected_tree (GladeXML * dialog)
GtkListStore *listStore =
GTK_LIST_STORE (gtk_tree_view_get_model
(GTK_TREE_VIEW (WID ("xkb_layouts_selected"))));
+
+ /* temporarily disable the buttons' status update */
+ disableButtonsSensibilityUpdate = TRUE;
+
gtk_list_store_clear (listStore);
for (curLayout = layouts; curLayout != NULL; curLayout = curLayout->next)
@@ -344,7 +354,10 @@ xkb_layouts_fill_selected_tree (GladeXML * dialog)
}
clear_xkb_elements_list (layouts);
- xkb_layouts_enable_disable_buttons (dialog);
+
+ /* enable the buttons' status update */
+ disableButtonsSensibilityUpdate = FALSE;
+
if (idx2Select != -1)
{
GtkTreeSelection *selection =
@@ -355,6 +368,12 @@ xkb_layouts_fill_selected_tree (GladeXML * dialog)
gtk_tree_path_free (path);
idx2Select = -1;
}
+ else
+ {
+ /* if there is nothing to select - just enable/disable the buttons,
+ otherwise it would be done by the selection change */
+ xkb_layouts_enable_disable_buttons (dialog);
+ }
gce = gconf_client_get_entry (xkbGConfClient,
GSWITCHIT_CONFIG_KEY_DEFAULT_GROUP,