[gnome-control-center] region: Add an initial input sources tab



commit bfaeb6a41ddd5ad0c65744397e026346a0acf89f
Author: Rui Matos <tiagomatos gmail com>
Date:   Wed May 16 23:05:00 2012 +0200

    region: Add an initial input sources tab
    
    This is just the scaffolding according to
    https://live.gnome.org/Design/SystemSettings/RegionAndLanguage
    No code behind it yet.
    
    Original code from Matthias Clasen.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=662489

 panels/region/Makefile.am                         |    3 +
 panels/region/cc-region-panel.c                   |    2 +
 panels/region/gnome-region-panel-input-chooser.ui |  152 +++++
 panels/region/gnome-region-panel-input.c          |  536 ++++++++++++++++
 panels/region/gnome-region-panel-input.h          |   36 ++
 panels/region/gnome-region-panel.ui               |  676 +++++++++++----------
 6 files changed, 1091 insertions(+), 314 deletions(-)
---
diff --git a/panels/region/Makefile.am b/panels/region/Makefile.am
index ca747d5..f5b3728 100644
--- a/panels/region/Makefile.am
+++ b/panels/region/Makefile.am
@@ -23,6 +23,8 @@ libregion_la_SOURCES =	\
 	gnome-region-panel-lang.h \
 	gnome-region-panel-system.c \
 	gnome-region-panel-system.h \
+	gnome-region-panel-input.c \
+	gnome-region-panel-input.h \
 	gnome-region-panel-xkb.c \
 	gnome-region-panel-xkblt.c \
 	gnome-region-panel-xkbltadd.c \
@@ -40,6 +42,7 @@ uidir   = $(pkgdatadir)/ui
 ui_DATA = \
 	gnome-region-panel.ui \
 	gnome-region-panel-layout-chooser.ui \
+	gnome-region-panel-input-chooser.ui \
 	gnome-region-panel-options-dialog.ui
 
 desktopdir = $(datadir)/applications
diff --git a/panels/region/cc-region-panel.c b/panels/region/cc-region-panel.c
index d75cdf2..dbaa455 100644
--- a/panels/region/cc-region-panel.c
+++ b/panels/region/cc-region-panel.c
@@ -23,6 +23,7 @@
 #include <gtk/gtk.h>
 
 #include "gnome-region-panel-xkb.h"
+#include "gnome-region-panel-input.h"
 #include "gnome-region-panel-lang.h"
 #include "gnome-region-panel-formats.h"
 #include "gnome-region-panel-system.h"
@@ -161,6 +162,7 @@ cc_region_panel_init (CcRegionPanel * self)
 	gtk_widget_reparent (prefs_widget, GTK_WIDGET (self));
 
 	setup_xkb_tabs (priv->builder);
+        setup_input_tabs (priv->builder, self);
 	setup_language (priv->builder);
 	setup_formats (priv->builder);
 	setup_system (priv->builder);
diff --git a/panels/region/gnome-region-panel-input-chooser.ui b/panels/region/gnome-region-panel-input-chooser.ui
new file mode 100644
index 0000000..a7d30aa
--- /dev/null
+++ b/panels/region/gnome-region-panel-input-chooser.ui
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <requires lib="gtk+" version="2.16"/>
+  <object class="GtkListStore" id="input_source_model">
+    <columns>
+      <column type="gchararray"/>
+    </columns>
+  </object>
+  <object class="GtkTreeModelFilter" id="filtered_input_source_model">
+    <property name="child_model">input_source_model</property>
+  </object>
+  <object class="GtkDialog" id="input_source_chooser">
+    <property name="visible">False</property>
+    <property name="can_focus">False</property>
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Choose an input source</property>
+    <property name="modal">True</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox3">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">2</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="hbtnBox">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="cancel-button">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="pack_type">end</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="ok-button">
+                <property name="label">gtk-add</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="pack_type">end</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkVBox" id="vbox40">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="border_width">5</property>
+            <property name="spacing">6</property>
+            <child>
+              <object class="GtkVBox" id="vbox1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="spacing">6</property>
+                <child>
+                  <object class="GtkLabel" id="label1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">Select an input source to add</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkScrolledWindow" id="scrolledwindow1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hscrollbar_policy">never</property>
+                    <property name="shadow_type">etched-in</property>
+                    <property name="min_content_width">450</property>
+                    <property name="min_content_height">250</property>
+                    <child>
+                      <object class="GtkTreeView" id="filtered_input_source_list">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="model">filtered_input_source_model</property>
+                        <property name="headers_visible">False</property>
+                        <property name="search_column">0</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="input_source_filter">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="invisible_char">â</property>
+                <property name="secondary-icon-name">edit-find-symbolic</property>
+                <property name="secondary-icon-activatable">False</property>
+                <property name="secondary-icon-sensitive">False</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="pack_type">end</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="-5">ok-button</action-widget>
+      <action-widget response="-6">cancel-button</action-widget>
+    </action-widgets>
+  </object>
+</interface>
diff --git a/panels/region/gnome-region-panel-input.c b/panels/region/gnome-region-panel-input.c
new file mode 100644
index 0000000..ab630fe
--- /dev/null
+++ b/panels/region/gnome-region-panel-input.c
@@ -0,0 +1,536 @@
+/*
+ * Copyright (C) 2011 Red Hat, Inc.
+ *
+ * Written by: Matthias Clasen <mclasen redhat com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include <config.h>
+
+#include <string.h>
+
+#include <glib.h>
+#include <glib/gi18n.h>
+
+#include "gnome-region-panel-input.h"
+
+#define WID(s) GTK_WIDGET(gtk_builder_get_object (builder, s))
+
+static GtkWidget *input_chooser_new          (GtkWindow     *main_window);
+static gboolean   input_chooser_get_selected (GtkWidget     *chooser,
+                                              GtkTreeModel **model,
+                                              GtkTreeIter   *iter);
+
+static gboolean
+get_selected_iter (GtkBuilder    *builder,
+                   GtkTreeModel **model,
+                   GtkTreeIter   *iter)
+{
+  GtkTreeSelection *selection;
+
+  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (WID ("active_input_sources")));
+
+  return gtk_tree_selection_get_selected (selection, model, iter);
+}
+
+static gint
+find_selected_layout_idx (GtkBuilder *builder)
+{
+  GtkTreeIter iter;
+  GtkTreeModel *model;
+  GtkTreePath *path;
+  gint idx;
+
+  if (!get_selected_iter (builder, &model, &iter))
+    return -1;
+
+  path = gtk_tree_model_get_path (model, &iter);
+  if (path == NULL)
+    return -1;
+
+  idx = gtk_tree_path_get_indices (path)[0];
+  gtk_tree_path_free (path);
+
+  return idx;
+}
+
+static void
+update_button_sensitivity (GtkBuilder *builder)
+{
+  GtkWidget *remove_button;
+  GtkWidget *up_button;
+  GtkWidget *down_button;
+  GtkWidget *show_button;
+  GtkTreeView *tv;
+  gint n_active;
+  gint index;
+
+  remove_button = WID("input_source_remove");
+  show_button = WID("input_source_show");
+  up_button = WID("input_source_move_up");
+  down_button = WID("input_source_move_down");
+
+  tv = GTK_TREE_VIEW (WID ("active_input_sources"));
+
+  n_active = gtk_tree_model_iter_n_children (gtk_tree_view_get_model (tv), NULL);
+  index = find_selected_layout_idx (builder);
+
+  gtk_widget_set_sensitive (remove_button, index >= 0 && n_active > 1);
+  gtk_widget_set_sensitive (show_button, index >= 0);
+  gtk_widget_set_sensitive (up_button, index > 0);
+  gtk_widget_set_sensitive (down_button, index >= 0 && index < n_active - 1);
+}
+
+static void
+set_selected_path (GtkBuilder  *builder,
+                   GtkTreePath *path)
+{
+  GtkTreeSelection *selection;
+
+  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (WID ("active_input_sources")));
+
+  gtk_tree_selection_select_path (selection, path);
+}
+
+static void
+chooser_response (GtkWidget *chooser, gint response_id, gpointer data)
+{
+  GtkBuilder *builder = data;
+
+  if (response_id == GTK_RESPONSE_OK)
+    {
+      GtkTreeModel *model;
+      GtkTreeIter iter;
+
+      if (input_chooser_get_selected (chooser, &model, &iter))
+        {
+          GtkTreeView *my_tv;
+          GtkListStore *my_model;
+          GtkTreeIter my_iter;
+          gchar *name;
+
+          gtk_tree_model_get (model, &iter,
+                              0, &name,
+                              -1);
+
+          my_tv = GTK_TREE_VIEW (WID ("active_input_sources"));
+          my_model = GTK_LIST_STORE (gtk_tree_view_get_model (my_tv));
+
+          gtk_list_store_append (my_model, &my_iter);
+
+          gtk_list_store_set (my_model, &my_iter,
+                              0, name,
+                              -1);
+
+          g_free (name);
+
+          gtk_tree_selection_select_iter (gtk_tree_view_get_selection (my_tv), &my_iter);
+
+          update_button_sensitivity (builder);
+        }
+      else
+        {
+          g_debug ("nothing selected, nothing added");
+        }
+    }
+
+  gtk_widget_destroy (GTK_WIDGET (chooser));
+}
+
+static void
+add_input (GtkButton *button, gpointer data)
+{
+  GtkBuilder *builder = data;
+  GtkWidget *chooser;
+  GtkWidget *toplevel;
+
+  g_debug ("add an input source");
+
+  toplevel = gtk_widget_get_toplevel (WID ("region_notebook"));
+  chooser = input_chooser_new (GTK_WINDOW (toplevel));
+  g_signal_connect (chooser, "response",
+                    G_CALLBACK (chooser_response), builder);
+}
+
+static void
+remove_selected_input (GtkButton *button, gpointer data)
+{
+  GtkBuilder *builder = data;
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+  GtkTreePath *path;
+
+  g_debug ("remove selected input source");
+
+  if (get_selected_iter (builder, &model, &iter) == FALSE)
+    return;
+
+  path = gtk_tree_model_get_path (model, &iter);
+  gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
+
+  if (!gtk_tree_model_get_iter (model, &iter, path))
+    gtk_tree_path_prev (path);
+
+  set_selected_path (builder, path);
+
+  gtk_tree_path_free (path);
+
+  update_button_sensitivity (builder);
+}
+
+static void
+move_selected_input_up (GtkButton *button, gpointer data)
+{
+  GtkBuilder *builder = data;
+  GtkTreeModel *model;
+  GtkTreeIter iter, prev;
+  GtkTreePath *path;
+
+  g_debug ("move selected input source up");
+
+  if (!get_selected_iter (builder, &model, &iter))
+    return;
+
+  prev = iter;
+  if (!gtk_tree_model_iter_previous (model, &prev))
+    return;
+
+  path = gtk_tree_model_get_path (model, &prev);
+
+  gtk_list_store_swap (GTK_LIST_STORE (model), &iter, &prev);
+  set_selected_path (builder, path);
+  gtk_tree_path_free (path);
+
+  update_button_sensitivity (builder);
+}
+
+static void
+move_selected_input_down (GtkButton *button, gpointer data)
+{
+  GtkBuilder *builder = data;
+  GtkTreeModel *model;
+  GtkTreeIter iter, next;
+  GtkTreePath *path;
+
+  g_debug ("move selected input source down");
+
+  if (!get_selected_iter (builder, &model, &iter))
+    return;
+
+  next = iter;
+  if (!gtk_tree_model_iter_next (model, &next))
+    return;
+
+  path = gtk_tree_model_get_path (model, &next);
+  gtk_list_store_swap (GTK_LIST_STORE (model), &iter, &next);
+  set_selected_path (builder, path);
+  gtk_tree_path_free (path);
+
+  update_button_sensitivity (builder);
+}
+
+static void
+show_selected_layout (GtkButton *button, gpointer data)
+{
+  GtkBuilder *builder = data;
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+  gchar *layout;
+  gchar *kbd_viewer_args;
+
+  g_debug ("show selected layout");
+
+  if (!get_selected_iter (builder, &model, &iter))
+    return;
+
+  gtk_tree_model_get (model, &iter,
+                      0, &layout,
+                      -1);
+
+  kbd_viewer_args = g_strdup_printf ("gkbd-keyboard-display -l %s", layout);
+  g_spawn_command_line_async (kbd_viewer_args, NULL);
+
+  g_free (kbd_viewer_args);
+  g_free (layout);
+}
+
+static gboolean
+go_to_shortcuts (GtkLinkButton *button,
+                 CcRegionPanel *panel)
+{
+  CcShell *shell;
+  const gchar *argv[] = { "shortcuts", NULL };
+  GError *error = NULL;
+
+  shell = cc_panel_get_shell (CC_PANEL (panel));
+  if (!cc_shell_set_active_panel_from_id (shell, "keyboard", argv, &error))
+    {
+      g_warning ("Failed to activate Keyboard panel: %s", error->message);
+      g_error_free (error);
+    }
+
+  return TRUE;
+}
+
+void
+setup_input_tabs (GtkBuilder    *builder,
+                  CcRegionPanel *panel)
+{
+  GtkWidget *treeview;
+  GtkTreeViewColumn *column;
+  GtkCellRenderer *cell;
+  GtkListStore *store;
+  GtkTreeSelection *selection;
+  gchar *previous = NULL;
+  gchar *next = NULL;
+  GtkWidget *label;
+
+  /* set up the list of active inputs */
+  treeview = WID("active_input_sources");
+  column = gtk_tree_view_column_new ();
+  cell = gtk_cell_renderer_text_new ();
+  gtk_tree_view_column_pack_start (column, cell, TRUE);
+  gtk_tree_view_column_add_attribute (column, cell, "text", 0);
+  gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
+
+  store = gtk_list_store_new (1, G_TYPE_STRING);
+
+  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
+  g_signal_connect_swapped (selection, "changed",
+                            G_CALLBACK (update_button_sensitivity), builder);
+
+  gtk_tree_view_set_model (GTK_TREE_VIEW (treeview), GTK_TREE_MODEL (store));
+
+  /* set up the buttons */
+  g_signal_connect (WID("input_source_add"), "clicked",
+                    G_CALLBACK (add_input), builder);
+  g_signal_connect (WID("input_source_remove"), "clicked",
+                    G_CALLBACK (remove_selected_input), builder);
+  g_signal_connect (WID("input_source_move_up"), "clicked",
+                    G_CALLBACK (move_selected_input_up), builder);
+  g_signal_connect (WID("input_source_move_down"), "clicked",
+                    G_CALLBACK (move_selected_input_down), builder);
+  g_signal_connect (WID("input_source_show"), "clicked",
+                    G_CALLBACK (show_selected_layout), builder);
+
+  /* use an em dash is no shortcut */
+  if (!previous)
+    previous = g_strdup ("\342\200\224");
+  if (!next)
+    next = g_strdup ("\342\200\224");
+
+  label = WID("prev-source-shortcut-label");
+  gtk_label_set_label (GTK_LABEL (label), previous);
+  label = WID("next-source-shortcut-label");
+  gtk_label_set_label (GTK_LABEL (label), next);
+
+  g_free (previous);
+  g_free (next);
+
+  g_signal_connect (WID("jump-to-shortcuts"), "activate-link",
+                    G_CALLBACK (go_to_shortcuts), panel);
+}
+
+static void
+filter_clear (GtkEntry             *entry,
+              GtkEntryIconPosition  icon_pos,
+              GdkEvent             *event,
+              gpointer              user_data)
+{
+  gtk_entry_set_text (entry, "");
+}
+
+static gchar **search_pattern_list;
+
+static void
+filter_changed (GtkBuilder *builder)
+{
+  GtkTreeModelFilter *filtered_model;
+  GtkWidget *filter_entry;
+  const gchar *pattern;
+  gchar *upattern;
+
+  filtered_model = GTK_TREE_MODEL_FILTER (gtk_builder_get_object (builder,
+                                                   "filtered_input_source_model"));
+  filter_entry = WID ("input_source_filter");
+  pattern = gtk_entry_get_text (GTK_ENTRY (filter_entry));
+  upattern = g_utf8_strup (pattern, -1);
+  if (!g_strcmp0 (pattern, ""))
+    g_object_set (G_OBJECT (filter_entry),
+                  "secondary-icon-name", "edit-find-symbolic",
+                  "secondary-icon-activatable", FALSE,
+                  "secondary-icon-sensitive", FALSE,
+                  NULL);
+  else
+    g_object_set (G_OBJECT (filter_entry),
+                  "secondary-icon-name", "edit-clear-symbolic",
+                  "secondary-icon-activatable", TRUE,
+                  "secondary-icon-sensitive", TRUE,
+                  NULL);
+
+  if (search_pattern_list != NULL)
+    g_strfreev (search_pattern_list);
+
+  search_pattern_list = g_strsplit (upattern, " ", -1);
+  g_free (upattern);
+
+  gtk_tree_model_filter_refilter (filtered_model);
+}
+
+static void
+selection_changed (GtkTreeSelection *selection,
+                   GtkBuilder       *builder)
+{
+  gtk_widget_set_sensitive (WID ("ok-button"),
+                            gtk_tree_selection_get_selected (selection, NULL, NULL));
+}
+
+static void
+row_activated (GtkTreeView       *tree_view,
+               GtkTreePath       *path,
+               GtkTreeViewColumn *column,
+               GtkBuilder        *builder)
+{
+  GtkWidget *add_button;
+  GtkWidget *dialog;
+
+  add_button = WID ("ok-button");
+  dialog = WID ("input_source_chooser");
+  if (gtk_widget_is_sensitive (add_button))
+    gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
+}
+
+static gboolean
+filter_func (GtkTreeModel *model,
+             GtkTreeIter  *iter,
+             gpointer      data)
+{
+  gchar *desc = NULL;
+  gchar **pattern;
+  gboolean rv = TRUE;
+
+  if (search_pattern_list == NULL || search_pattern_list[0] == NULL)
+    return TRUE;
+
+  gtk_tree_model_get (model, iter,
+                      0, &desc,
+                      -1);
+
+  pattern = search_pattern_list;
+  do {
+    gboolean is_pattern_found = FALSE;
+    gchar *udesc = g_utf8_strup (desc, -1);
+    if (udesc != NULL && g_strstr_len (udesc, -1, *pattern))
+      {
+        is_pattern_found = TRUE;
+      }
+    g_free (udesc);
+
+    if (!is_pattern_found)
+      {
+        rv = FALSE;
+        break;
+      }
+
+  } while (*++pattern != NULL);
+
+  g_free (desc);
+
+  return rv;
+}
+
+static GtkWidget *
+input_chooser_new (GtkWindow *main_window)
+{
+  GtkBuilder *builder;
+  GtkWidget *chooser;
+  GtkWidget *filtered_list;
+  GtkWidget *filter_entry;
+  GtkTreeViewColumn *visible_column;
+  GtkTreeSelection *selection;
+  GtkListStore *model;
+  GtkTreeModelFilter *filtered_model;
+
+  builder = gtk_builder_new ();
+  gtk_builder_add_from_file (builder,
+                             GNOMECC_UI_DIR "/gnome-region-panel-input-chooser.ui",
+                             NULL);
+  chooser = WID ("input_source_chooser");
+  g_object_set_data_full (G_OBJECT (chooser), "builder", builder, g_object_unref);
+
+  filtered_list = WID ("filtered_input_source_list");
+  filter_entry = WID ("input_source_filter");
+
+  g_object_set_data (G_OBJECT (chooser),
+                     "filtered_input_source_list", filtered_list);
+  visible_column =
+    gtk_tree_view_column_new_with_attributes ("Layout",
+                                              gtk_cell_renderer_text_new (),
+                                              "text", 0,
+                                              NULL);
+
+  gtk_window_set_transient_for (GTK_WINDOW (chooser), main_window);
+
+  gtk_tree_view_append_column (GTK_TREE_VIEW (filtered_list),
+                               visible_column);
+  g_signal_connect_swapped (G_OBJECT (filter_entry), "notify::text",
+                            G_CALLBACK (filter_changed), builder);
+
+  g_signal_connect (G_OBJECT (filter_entry), "icon-release",
+                    G_CALLBACK (filter_clear), NULL);
+
+  selection =
+    gtk_tree_view_get_selection (GTK_TREE_VIEW (filtered_list));
+
+  g_signal_connect (G_OBJECT (selection), "changed",
+                    G_CALLBACK (selection_changed), builder);
+
+  selection_changed (selection, builder);
+
+  g_signal_connect (G_OBJECT (filtered_list), "row-activated",
+                    G_CALLBACK (row_activated), builder);
+
+  filtered_model = GTK_TREE_MODEL_FILTER (gtk_builder_get_object (builder, "filtered_input_source_model"));
+  model = GTK_LIST_STORE (gtk_builder_get_object (builder, "input_source_model"));
+
+  gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model),
+                                        0, GTK_SORT_ASCENDING);
+
+  gtk_tree_model_filter_set_visible_func (filtered_model,
+                                          filter_func,
+                                          NULL, NULL);
+
+  gtk_widget_grab_focus (filter_entry);
+
+  gtk_widget_show (chooser);
+
+  return chooser;
+}
+
+static gboolean
+input_chooser_get_selected (GtkWidget     *dialog,
+                            GtkTreeModel **model,
+                            GtkTreeIter   *iter)
+{
+  GtkWidget *tv;
+  GtkTreeSelection *selection;
+
+  tv = g_object_get_data (G_OBJECT (dialog), "filtered_input_source_list");
+  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tv));
+
+  return gtk_tree_selection_get_selected (selection, model, iter);
+}
diff --git a/panels/region/gnome-region-panel-input.h b/panels/region/gnome-region-panel-input.h
new file mode 100644
index 0000000..47a1f52
--- /dev/null
+++ b/panels/region/gnome-region-panel-input.h
@@ -0,0 +1,36 @@
+/* gnome-region-panel-input.h
+ * Copyright (C) 2011 Red Hat, Inc.
+ *
+ * Written by Matthias Clasen
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef __GNOME_KEYBOARD_PROPERTY_INPUT_H
+#define __GNOME_KEYBOARD_PROPERTY_INPUT_H
+
+#include <gtk/gtk.h>
+
+#include "cc-region-panel.h"
+
+G_BEGIN_DECLS
+
+void setup_input_tabs (GtkBuilder    *builder,
+                       CcRegionPanel *self);
+
+G_END_DECLS
+
+#endif  /* __GNOME_KEYBOARD_PROPERTY_INPUT_H */
diff --git a/panels/region/gnome-region-panel.ui b/panels/region/gnome-region-panel.ui
index c4b027d..94950af 100644
--- a/panels/region/gnome-region-panel.ui
+++ b/panels/region/gnome-region-panel.ui
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <requires lib="gtk+" version="2.22"/>
+  <!-- interface-requires gtk+ 3.0 -->
   <object class="GtkAdjustment" id="adjustment1">
     <property name="lower">100</property>
     <property name="upper">2000</property>
@@ -153,34 +153,45 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkVBox" id="vbox3">
+                          <object class="GtkToolbar" id="language-toolbar">
+                            <property name="visible">True</property>
                             <property name="can_focus">False</property>
+                            <property name="toolbar_style">icons</property>
+                            <property name="show_arrow">False</property>
+                            <property name="icon_size">1</property>
+                            <style>
+                              <class name="inline-toolbar"/>
+                            </style>
+                            <style>
+                              <class name="inline-toolbar"/>
+                            </style>
                             <child>
-                              <object class="GtkLabel" id="label23">
+                              <object class="GtkToolButton" id="language_add">
+                                <property name="use_action_appearance">False</property>
                                 <property name="visible">True</property>
+                                <property name="label" translatable="yes">Add Language</property>
                                 <property name="can_focus">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="icon_name">list-add-symbolic</property>
                               </object>
                               <packing>
-                                <property name="expand">True</property>
-                                <property name="fill">True</property>
-                                <property name="position">0</property>
+                                <property name="expand">False</property>
+                                <property name="homogeneous">True</property>
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkLinkButton" id="linkbutton1">
-                                <property name="label" translatable="yes">Install languages...</property>
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="receives_default">True</property>
-                                <property name="has_tooltip">False</property>
+                              <object class="GtkToolButton" id="language_remove">
                                 <property name="use_action_appearance">False</property>
-                                <property name="relief">none</property>
-                                <property name="uri">http://glade.gnome.org</property>
+                                <property name="label" translatable="yes">Remove Language</property>
+                                <property name="visible">True</property>
+                                <property name="sensitive">False</property>
+                                <property name="can_focus">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="icon_name">list-remove-symbolic</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
+                                <property name="homogeneous">True</property>
                               </packing>
                             </child>
                           </object>
@@ -191,42 +202,33 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkToolbar" id="language-toolbar">
-                            <property name="visible">True</property>
+                          <object class="GtkVBox" id="vbox3">
                             <property name="can_focus">False</property>
-                            <property name="toolbar_style">icons</property>
-                            <property name="show_arrow">False</property>
-                            <property name="icon_size">1</property>
-                            <style>
-                              <class name="inline-toolbar"/>
-                            </style>
                             <child>
-                              <object class="GtkToolButton" id="language_add">
+                              <object class="GtkLabel" id="label23">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="use_action_appearance">False</property>
                                 <property name="use_underline">True</property>
-                                <property name="icon_name">list-add-symbolic</property>
                                 <property name="label" translatable="yes">Add Language</property>
                               </object>
                               <packing>
-                                <property name="expand">False</property>
-                                <property name="homogeneous">True</property>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkToolButton" id="language_remove">
+                              <object class="GtkLinkButton" id="linkbutton1">
+                                <property name="label" translatable="yes">Install languages...</property>
                                 <property name="visible">True</property>
-                                <property name="sensitive">False</property>
-                                <property name="can_focus">False</property>
-                                <property name="use_action_appearance">False</property>
-                                <property name="use_underline">True</property>
-                                <property name="icon_name">list-remove-symbolic</property>
-                                <property name="label" translatable="yes">Remove Language</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">True</property>
+                                <property name="has_tooltip">True</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
-                                <property name="homogeneous">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
                               </packing>
                             </child>
                           </object>
@@ -259,12 +261,12 @@
                   <object class="GtkGrid" id="table1">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="column_spacing">12</property>
-                    <property name="row_spacing">6</property>
-                    <property name="margin_top">12</property>
-                    <property name="margin_bottom">12</property>
                     <property name="margin_left">12</property>
                     <property name="margin_right">12</property>
+                    <property name="margin_top">12</property>
+                    <property name="margin_bottom">12</property>
+                    <property name="row_spacing">6</property>
+                    <property name="column_spacing">12</property>
                     <child>
                       <object class="GtkLabel" id="label5">
                         <property name="visible">True</property>
@@ -273,92 +275,92 @@
                         <property name="label" translatable="yes">Select a region (change will be applied the next time you log in)</property>
                       </object>
                       <packing>
-                        <property name="left-attach">0</property>
-                        <property name="top-attach">0</property>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">0</property>
                         <property name="width">2</property>
+                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
                       <object class="GtkBox" id="region-box">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="orientation">vertical</property>
                         <child>
-                      <object class="GtkScrolledWindow" id="region-swindow">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="hscrollbar_policy">never</property>
-                        <property name="shadow_type">in</property>
-                        <property name="halign">fill</property>
-                        <property name="valign">fill</property>
-                        <property name="vexpand">True</property>
-                        <child>
-                          <object class="GtkTreeView" id="region_selector">
+                          <object class="GtkScrolledWindow" id="region-swindow">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                            <property name="headers_visible">False</property>
-                            <child internal-child="selection">
-                              <object class="GtkTreeSelection" id="region-treeview-selection"/>
+                            <property name="vexpand">True</property>
+                            <property name="hscrollbar_policy">never</property>
+                            <property name="shadow_type">in</property>
+                            <child>
+                              <object class="GtkTreeView" id="region_selector">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="headers_visible">False</property>
+                                <child internal-child="selection">
+                                  <object class="GtkTreeSelection" id="region-treeview-selection"/>
+                                </child>
+                              </object>
                             </child>
                           </object>
-                        </child>
-                      </object>
-                        <packing>
-                          <property name="expand">True</property>
-                          <property name="fill">True</property>
-                          <property name="position">0</property>
-                        </packing>
-                        </child>
-                      <child>
-                        <object class="GtkToolbar" id="region-toolbar">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="toolbar_style">icons</property>
-                        <property name="show_arrow">False</property>
-                        <property name="icon_size">1</property>
-                        <style>
-                          <class name="inline-toolbar"/>
-                        </style>
-                        <child>
-                          <object class="GtkToolButton" id="region_add">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="use_action_appearance">False</property>
-                            <property name="use_underline">True</property>
-                            <property name="icon_name">list-add-symbolic</property>
-                            <property name="label" translatable="yes">Add Region</property>
-                          </object>
                           <packing>
-                            <property name="expand">False</property>
-                            <property name="homogeneous">True</property>
+                            <property name="expand">True</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkToolButton" id="region_remove">
+                          <object class="GtkToolbar" id="region-toolbar">
+                            <property name="toolbar_style">icons</property>
+                            <property name="show_arrow">False</property>
+                            <property name="icon_size">1</property>
                             <property name="visible">True</property>
-                            <property name="sensitive">False</property>
-                            <property name="can_focus">False</property>
-                            <property name="use_action_appearance">False</property>
-                            <property name="use_underline">True</property>
-                            <property name="icon_name">list-remove-symbolic</property>
-                            <property name="label" translatable="yes">Remove Region</property>
+                            <style>
+                              <class name="inline-toolbar"/>
+                            </style>
+                            <child>
+                              <object class="GtkToolButton" id="region_add">
+                                <property name="use_action_appearance">False</property>
+                                <property name="label" translatable="yes">Add Region</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="icon_name">list-add-symbolic</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="homogeneous">True</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkToolButton" id="region_remove">
+                                <property name="use_action_appearance">False</property>
+                                <property name="visible">True</property>
+                                <property name="label" translatable="yes">Remove Region</property>
+                                <property name="sensitive">False</property>
+                                <property name="can_focus">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="icon_name">list-remove-symbolic</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="homogeneous">True</property>
+                              </packing>
+                            </child>
                           </object>
                           <packing>
                             <property name="expand">False</property>
-                            <property name="homogeneous">True</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
                           </packing>
                         </child>
                       </object>
-                        <packing>
-                          <property name="expand">False</property>
-                          <property name="fill">True</property>
-                          <property name="position">1</property>
-                        </packing>
-                    </child>
-
-                      </object>
                       <packing>
                         <property name="left_attach">0</property>
                         <property name="top_attach">1</property>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
@@ -616,8 +618,16 @@
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="top_attach">1</property>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
                       </packing>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </object>
                   <packing>
                     <property name="position">1</property>
@@ -635,36 +645,43 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkVBox" id="vbox1">
+                  <object class="GtkVBox" id="vbox5">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="border_width">10</property>
                     <property name="spacing">12</property>
                     <child>
-                      <placeholder/>
+                      <object class="GtkLabel" id="label24">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Select keyboards or other input sources</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
                     </child>
                     <child>
-                      <object class="GtkHBox" id="hbox2">
+                      <object class="GtkHBox" id="hbox3">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="spacing">12</property>
                         <child>
-                          <object class="GtkVBox" id="vbox7">
+                          <object class="GtkVBox" id="vbox6">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <child>
-                              <object class="GtkScrolledWindow" id="xkb_layouts_swindow">
+                              <object class="GtkScrolledWindow" id="input_sources_swindow">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="shadow_type">in</property>
                                 <child>
-                                  <object class="GtkTreeView" id="xkb_layouts_selected">
+                                  <object class="GtkTreeView" id="active_input_sources">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="headers_visible">False</property>
-                                    <child internal-child="selection">
-                                      <object class="GtkTreeSelection" id="treeview-selection1"/>
-                                    </child>
                                   </object>
                                 </child>
                               </object>
@@ -675,7 +692,7 @@
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkToolbar" id="layouts-toolbar">
+                              <object class="GtkToolbar" id="input-toolbar">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
                                 <property name="toolbar_style">icons</property>
@@ -685,75 +702,166 @@
                                   <class name="inline-toolbar"/>
                                 </style>
                                 <child>
-                                  <object class="GtkToolButton" id="xkb_layouts_add">
+                                  <object class="GtkToolItem" id="i_s_ar_item">
                                     <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="use_action_appearance">False</property>
-                                    <property name="use_underline">True</property>
-                                    <property name="icon_name">list-add-symbolic</property>
-                                    <property name="label" translatable="yes">Add Layout</property>
+                                    <child>
+                                      <object class="GtkBox" id="i_s_ar_box">
+                                        <property name="visible">True</property>
+                                        <child>
+                                           <object class="GtkButton" id="input_source_add">
+                                             <property name="visible">True</property>
+                                             <child internal-child="accessible">
+                                               <object class="AtkObject" id="i_s_a_a11y">
+                                                 <property name="accessible-name" translatable="yes">Add Input Source</property>
+                                               </object>
+                                             </child>
+                                             <child>
+                                                <object class="GtkImage" id="i_s_a_image">
+
+                                                  <property name="visible">True</property>
+                                                  <property name="icon-name">list-add-symbolic</property>
+                                                  <property name="icon-size">1</property>
+                                                </object>
+                                             </child>
+                                           </object>
+                                        </child>
+                                        <child>
+                                           <object class="GtkButton" id="input_source_remove">
+                                             <property name="visible">True</property>
+                                             <child internal-child="accessible">
+                                               <object class="AtkObject" id="i_s_r_a11y">
+                                                 <property name="accessible-name" translatable="yes">Remove Input Source</property>
+                                               </object>
+                                             </child>
+                                             <child>
+                                                <object class="GtkImage" id="i_s_r_image">
+                                                  <property name="visible">True</property>
+                                                  <property name="icon-name">list-remove-symbolic</property>
+                                                  <property name="icon-size">1</property>
+                                                </object>
+                                             </child>
+                                           </object>
+                                        </child>
+                                      </object>
+                                    </child>
                                   </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="homogeneous">True</property>
-                                  </packing>
                                 </child>
+
                                 <child>
-                                  <object class="GtkToolButton" id="xkb_layouts_remove">
+                                  <object class="GtkSeparatorToolItem" id="sep1">
                                     <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="use_action_appearance">False</property>
-                                    <property name="use_underline">True</property>
-                                    <property name="icon_name">list-remove-symbolic</property>
-                                    <property name="label" translatable="yes">Remove Layout</property>
+                                    <property name="draw">False</property>
                                   </object>
                                   <packing>
-                                    <property name="expand">False</property>
-                                    <property name="homogeneous">True</property>
+                                    <property name="expand">True</property>
                                   </packing>
                                 </child>
+
                                 <child>
-                                  <object class="GtkToolButton" id="xkb_layouts_move_up">
+                                  <object class="GtkToolItem" id="i_s_ud_item">
                                     <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="use_action_appearance">False</property>
-                                    <property name="use_underline">True</property>
-                                    <property name="icon_name">go-up-symbolic</property>
-                                    <property name="label" translatable="yes">Move Up</property>
+                                    <child>
+                                      <object class="GtkBox" id="i_s_ud_box">
+                                        <property name="visible">True</property>
+                                        <child>
+                                           <object class="GtkButton" id="input_source_move_up">
+                                             <property name="visible">True</property>
+                                             <child internal-child="accessible">
+                                               <object class="AtkObject" id="i_s_u_a11y">
+                                                 <property name="accessible-name" translatable="yes">Move Input Source Up</property>
+                                               </object>
+                                             </child>
+                                             <child>
+                                                <object class="GtkImage" id="i_s_u_image">
+
+                                                  <property name="visible">True</property>
+                                                  <property name="icon-name">go-up-symbolic</property>
+                                                  <property name="icon-size">1</property>
+                                                </object>
+                                             </child>
+                                           </object>
+                                        </child>
+                                        <child>
+                                           <object class="GtkButton" id="input_source_move_down">
+                                             <property name="visible">True</property>
+                                             <child internal-child="accessible">
+                                               <object class="AtkObject" id="i_s_d_a11y">
+                                                 <property name="accessible-name" translatable="yes">Move Input Source Down</property>
+                                               </object>
+                                             </child>
+                                             <child>
+                                                <object class="GtkImage" id="i_s_d_image">
+                                                  <property name="visible">True</property>
+                                                  <property name="icon-name">go-down-symbolic</property>
+                                                  <property name="icon-size">1</property>
+                                                </object>
+                                             </child>
+                                           </object>
+                                        </child>
+                                      </object>
+                                    </child>
                                   </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="homogeneous">True</property>
-                                  </packing>
                                 </child>
+
                                 <child>
-                                  <object class="GtkToolButton" id="xkb_layouts_move_down">
+                                  <object class="GtkSeparatorToolItem" id="sep2">
                                     <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="use_action_appearance">False</property>
-                                    <property name="use_underline">True</property>
-                                    <property name="icon_name">go-down-symbolic</property>
-                                    <property name="label" translatable="yes">Move Down</property>
+                                    <property name="draw">False</property>
+                                    <property name="hexpand">True</property>
                                   </object>
                                   <packing>
-                                    <property name="expand">False</property>
-                                    <property name="homogeneous">True</property>
+                                    <property name="expand">True</property>
                                   </packing>
                                 </child>
+
                                 <child>
-                                  <object class="GtkToolButton" id="xkb_layouts_show">
+                                  <object class="GtkToolItem" id="i_s_sp_item">
                                     <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="use_action_appearance">False</property>
-                                    <property name="use_underline">True</property>
-                                    <property name="icon_name">input-keyboard-symbolic</property>
-                                    <property name="label" translatable="yes">Preview Layout</property>
+                                    <child>
+                                      <object class="GtkBox" id="i_s_sp_box">
+                                        <property name="visible">True</property>
+                                        <child>
+                                           <object class="GtkButton" id="input_source_settings">
+                                             <property name="visible">True</property>
+                                             <child internal-child="accessible">
+                                               <object class="AtkObject" id="i_s_s_a11y">
+                                                 <property name="accessible-name" translatable="yes">Input Source Settings</property>
+                                               </object>
+                                             </child>
+                                             <child>
+                                                <object class="GtkImage" id="i_s_s_image">
+
+                                                  <property name="visible">True</property>
+                                                  <property name="icon_name">preferences-system-symbolic</property>
+                                                  <property name="icon_size">1</property>
+                                                  <property name="pixel_size">16</property>
+                                                </object>
+                                             </child>
+                                           </object>
+                                        </child>
+                                        <child>
+                                           <object class="GtkButton" id="input_source_show">
+                                             <property name="visible">True</property>
+                                             <child internal-child="accessible">
+                                               <object class="AtkObject" id="i_s_p_a11y">
+                                                 <property name="accessible-name" translatable="yes">Show Keyboard Layout</property>
+                                               </object>
+                                             </child>
+                                             <child>
+                                                <object class="GtkImage" id="i_s_p_image">
+
+                                                  <property name="visible">True</property>
+                                                  <property name="icon_name">input-keyboard-symbolic</property>
+                                                  <property name="icon-size">1</property>
+                                                </object>
+                                             </child>
+                                           </object>
+                                        </child>
+                                      </object>
+                                    </child>
                                   </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="homogeneous">True</property>
-                                  </packing>
                                 </child>
+
                               </object>
                               <packing>
                                 <property name="expand">False</property>
@@ -769,171 +877,111 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkVBox" id="vbox33">
+                          <object class="GtkFrame" id="frame4">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="spacing">12</property>
+                            <property name="label_xalign">0</property>
+                            <property name="shadow_type">none</property>
                             <child>
-                              <object class="GtkVBox" id="vbox34">
+                              <object class="GtkAlignment" id="alignment3">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="spacing">6</property>
-                                <child>
-                                  <object class="GtkRadioButton" id="chk_same_group">
-                                    <property name="label" translatable="yes">Use the same layout for all windows</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">False</property>
-                                    <property name="use_action_appearance">False</property>
-                                    <property name="xalign">0</property>
-                                    <property name="active">True</property>
-                                    <property name="draw_indicator">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">True</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">0</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkRadioButton" id="chk_separate_group_per_window">
-                                    <property name="label" translatable="yes">Allow different layouts for individual windows</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">False</property>
-                                    <property name="use_action_appearance">False</property>
-                                    <property name="xalign">0</property>
-                                    <property name="active">True</property>
-                                    <property name="draw_indicator">True</property>
-                                    <property name="group">chk_same_group</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">True</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">1</property>
-                                  </packing>
-                                </child>
+                                <property name="left_padding">12</property>
                                 <child>
-                                  <object class="GtkAlignment" id="alignment1">
+                                  <object class="GtkGrid" id="shortcuts-grid">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
-                                    <property name="left_padding">12</property>
+                                    <property name="margin_top">6</property>
+                                    <property name="row_spacing">6</property>
+                                    <property name="column_spacing">6</property>
                                     <child>
-                                      <object class="GtkVBox" id="vbox4">
+                                      <object class="GtkLabel" id="prev-source-label">
                                         <property name="visible">True</property>
                                         <property name="can_focus">False</property>
-                                        <child>
-                                          <object class="GtkRadioButton" id="chk_new_windows_default_layout">
-                                            <property name="label" translatable="yes">New windows use the default layout</property>
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">True</property>
-                                            <property name="receives_default">False</property>
-                                            <property name="use_action_appearance">False</property>
-                                            <property name="xalign">0</property>
-                                            <property name="active">True</property>
-                                            <property name="draw_indicator">True</property>
-                                          </object>
-                                          <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
-                                            <property name="position">0</property>
-                                          </packing>
-                                        </child>
-                                        <child>
-                                          <object class="GtkRadioButton" id="chk_new_windows_inherit_layout">
-                                            <property name="label" translatable="yes">New windows use the previous window's layout</property>
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">True</property>
-                                            <property name="receives_default">False</property>
-                                            <property name="use_action_appearance">False</property>
-                                            <property name="xalign">0</property>
-                                            <property name="active">True</property>
-                                            <property name="draw_indicator">True</property>
-                                            <property name="group">chk_new_windows_default_layout</property>
-                                          </object>
-                                          <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
-                                            <property name="position">1</property>
-                                          </packing>
-                                        </child>
+                                        <property name="xalign">0</property>
+                                        <property name="label" translatable="yes">Switch to previous source</property>
                                       </object>
+                                      <packing>
+                                        <property name="left_attach">0</property>
+                                        <property name="top_attach">0</property>
+                                        <property name="width">1</property>
+                                        <property name="height">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkLabel" id="prev-source-shortcut-label">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="halign">end</property>
+                                        <property name="hexpand">True</property>
+                                        <property name="label" translatable="yes">Ctrl+Alt+Space</property>
+                                        <style><class name="dim-label"/></style>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">1</property>
+                                        <property name="top_attach">0</property>
+                                        <property name="width">1</property>
+                                        <property name="height">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkLabel" id="next-source-label">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="xalign">0</property>
+                                        <property name="label" translatable="yes">Switch to next source</property>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">0</property>
+                                        <property name="top_attach">1</property>
+                                        <property name="width">1</property>
+                                        <property name="height">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkLabel" id="next-source-shortcut-label">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="halign">end</property>
+                                        <property name="hexpand">True</property>
+                                        <property name="label" translatable="yes">Ctrl+Alt+Shift+Space</property>
+                                        <style><class name="dim-label"/></style>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">1</property>
+                                        <property name="top_attach">1</property>
+                                        <property name="width">1</property>
+                                        <property name="height">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkLinkButton" id="jump-to-shortcuts">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="label" translatable="yes">Shortcut Settings</property>
+                                        <property name="halign">end</property>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">1</property>
+                                        <property name="top_attach">2</property>
+                                        <property name="width">1</property>
+                                        <property name="height">1</property>
+                                      </packing>
                                     </child>
                                   </object>
-                                  <packing>
-                                    <property name="expand">True</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">2</property>
-                                  </packing>
                                 </child>
                               </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="position">0</property>
-                              </packing>
                             </child>
-                            <child>
-                              <object class="GtkLabel" id="label2">
+                            <child type="label">
+                              <object class="GtkLabel" id="shortcuts-frame-label">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">Shortcuts</property>
+                                <property name="use_markup">True</property>
+                                <attributes>
+                                  <attribute name="weight" value="bold"/>
+                                </attributes>
                               </object>
-                              <packing>
-                                <property name="expand">True</property>
-                                <property name="fill">False</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkHButtonBox" id="hbuttonbox2">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="spacing">6</property>
-                                <property name="layout_style">end</property>
-                                <child>
-                                  <object class="GtkButton" id="xkb_layout_options">
-                                    <property name="label" translatable="yes">_Options...</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">True</property>
-                                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                    <property name="has_tooltip">True</property>
-                                    <property name="tooltip_text" translatable="yes">View and edit keyboard layout options</property>
-                                    <property name="use_action_appearance">False</property>
-                                    <property name="use_underline">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">False</property>
-                                    <property name="position">0</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkButton" id="xkb_reset_to_defaults">
-                                    <property name="label" translatable="yes">Reset to De_faults</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">True</property>
-                                    <property name="has_tooltip">True</property>
-                                    <property name="tooltip_text" translatable="yes">Replace the current keyboard layout settings with the
-default settings</property>
-                                    <property name="use_action_appearance">False</property>
-                                    <property name="use_underline">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">False</property>
-                                    <property name="pack_type">end</property>
-                                    <property name="position">1</property>
-                                    <property name="secondary">True</property>
-                                  </packing>
-                                </child>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="position">2</property>
-                              </packing>
                             </child>
                           </object>
                           <packing>
@@ -951,17 +999,17 @@ default settings</property>
                     </child>
                   </object>
                   <packing>
-                    <property name="position">2</property>
+                    <property name="position">3</property>
                   </packing>
                 </child>
                 <child type="tab">
-                  <object class="GtkLabel" id="label46">
+                  <object class="GtkLabel" id="label13">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">Layouts</property>
+                    <property name="label" translatable="yes">Input Sources</property>
                   </object>
                   <packing>
-                    <property name="position">2</property>
+                    <property name="position">3</property>
                     <property name="tab_fill">False</property>
                   </packing>
                 </child>
@@ -982,7 +1030,7 @@ default settings</property>
                         <property name="ypad">6</property>
                         <property name="label" translatable="yes">The login screen, system accounts and new user accounts use the system-wide Region and Language settings. You may change the system settings to match yours.</property>
                         <property name="wrap">True</property>
-                        <property name="width-chars">60</property>
+                        <property name="width_chars">60</property>
                       </object>
                       <packing>
                         <property name="right_attach">2</property>
@@ -1000,10 +1048,10 @@ default settings</property>
                         <property name="shadow_type">none</property>
                         <child>
                           <object class="GtkTable" id="table4">
-                            <property name="margin_top">12</property>
-                            <property name="margin_left">12</property>
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
+                            <property name="margin_left">12</property>
+                            <property name="margin_top">12</property>
                             <property name="n_rows">3</property>
                             <property name="n_columns">2</property>
                             <property name="column_spacing">3</property>
@@ -1127,10 +1175,10 @@ default settings</property>
                         <property name="shadow_type">none</property>
                         <child>
                           <object class="GtkTable" id="table5">
-                            <property name="margin_left">12</property>
-                            <property name="margin_top">12</property>
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
+                            <property name="margin_left">12</property>
+                            <property name="margin_top">12</property>
                             <property name="n_rows">3</property>
                             <property name="n_columns">2</property>
                             <property name="column_spacing">3</property>
@@ -1251,10 +1299,10 @@ default settings</property>
                     <child>
                       <object class="GtkButton" id="copy_settings_button">
                         <property name="label" translatable="yes">Copy Settings...</property>
+                        <property name="use_action_appearance">False</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
-                        <property name="use_action_appearance">False</property>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
@@ -1272,7 +1320,7 @@ default settings</property>
                     </child>
                   </object>
                   <packing>
-                    <property name="position">3</property>
+                    <property name="position">4</property>
                   </packing>
                 </child>
                 <child type="tab">
@@ -1282,7 +1330,7 @@ default settings</property>
                     <property name="label" translatable="yes">System</property>
                   </object>
                   <packing>
-                    <property name="position">3</property>
+                    <property name="position">4</property>
                     <property name="tab_fill">False</property>
                   </packing>
                 </child>



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