[Xfce4-commits] <xfce4-settings:master> Select the first layout when deleting the active one.

Jérôme Guelfucci noreply at xfce.org
Wed Sep 22 00:18:02 CEST 2010


Updating branch refs/heads/master
         to 2cec1c082921c7bf6524a814e2c90a85b044867b (commit)
       from f6a83070b3f06b9f0c7f203a70fc5b48ed6d0ad6 (commit)

commit 2cec1c082921c7bf6524a814e2c90a85b044867b
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date:   Wed Sep 22 00:15:37 2010 +0200

    Select the first layout when deleting the active one.

 dialogs/keyboard-settings/xfce-keyboard-settings.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/dialogs/keyboard-settings/xfce-keyboard-settings.c b/dialogs/keyboard-settings/xfce-keyboard-settings.c
index 10e42fb..1ae9690 100644
--- a/dialogs/keyboard-settings/xfce-keyboard-settings.c
+++ b/dialogs/keyboard-settings/xfce-keyboard-settings.c
@@ -1397,6 +1397,19 @@ xfce_keyboard_settings_del_layout_button_cb (GtkWidget            *widget,
 
   if (gtk_tree_selection_get_selected (selection, &model, &iter))
     {
+      gboolean active;
+
+      gtk_tree_model_get (model, &iter, XKB_TREE_ACTIVE, &active, -1);
+
+      if (active)
+        {
+          GtkTreeIter iter2;
+
+          if (gtk_tree_model_get_iter_first (model, &iter2))
+            gtk_list_store_set (GTK_LIST_STORE (model), &iter2,
+                                XKB_TREE_ACTIVE, TRUE, -1);
+        }
+
       gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
       xfce_keyboard_settings_update_edit_button (GTK_TREE_VIEW (view), settings);
       xfce_keyboard_settings_update_layout_buttons (settings);



More information about the Xfce4-commits mailing list