[Xfce4-commits] <xfce4-settings:master> Allow deselecting keyboard model.

Igor Slepchin noreply at xfce.org
Wed Aug 22 23:14:09 CEST 2012


Updating branch refs/heads/master
         to cbf93af63ea5335107d91990f39a7e7b3b82b171 (commit)
       from 2e389f927ef14dd2ad43b4d25c5910d1bcef7172 (commit)

commit cbf93af63ea5335107d91990f39a7e7b3b82b171
Author: Igor Slepchin <igor.slepchin at gmail.com>
Date:   Thu Jul 26 00:01:37 2012 -0400

    Allow deselecting keyboard model.

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

diff --git a/dialogs/keyboard-settings/xfce-keyboard-settings.c b/dialogs/keyboard-settings/xfce-keyboard-settings.c
index d55177e..b2de750 100644
--- a/dialogs/keyboard-settings/xfce-keyboard-settings.c
+++ b/dialogs/keyboard-settings/xfce-keyboard-settings.c
@@ -381,6 +381,12 @@ xfce_keyboard_settings_constructed (GObject *object)
   /* Keyboard model combo */
   list_store = gtk_list_store_new (XKB_MODEL_COMBO_NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
   gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (list_store), 0, GTK_SORT_ASCENDING);
+
+  gtk_list_store_append (list_store, &iter);
+  gtk_list_store_set (list_store, &iter,
+                      XKB_MODEL_COMBO_DESCRIPTION, "-",
+                      XKB_MODEL_COMBO_MODELS, "", -1);
+
   xkl_config_registry_foreach_model (settings->priv->xkl_registry,
                                      xfce_keyboard_settings_add_model_to_combo,
                                      list_store);
@@ -1316,6 +1322,12 @@ xfce_keyboard_settings_init_model (XfceKeyboardSettings *settings)
   xkbmodel = xfconf_channel_get_string (settings->priv->keyboard_layout_channel, "/Default/XkbModel", settings->priv->xkl_rec_config->model);
   item = gtk_tree_model_get_iter_first (model, &iter);
 
+  if (xkbmodel == NULL || *xkbmodel == 0)
+  {
+      gtk_combo_box_set_active_iter (GTK_COMBO_BOX (view), &iter);
+      return;
+  }
+
   while (item && !found)
     {
       gtk_tree_model_get (model, &iter, XKB_MODEL_COMBO_MODELS, &id, -1);


More information about the Xfce4-commits mailing list