[gnome-control-center] Revert "wip remove input-sources-switcher label"
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] Revert "wip remove input-sources-switcher label"
- Date: Mon, 13 May 2013 14:26:24 +0000 (UTC)
commit 0d064f1b013f5d251af8fe0012c262852672c1fd
Author: Rui Matos <tiagomatos gmail com>
Date: Mon May 13 16:25:39 2013 +0200
Revert "wip remove input-sources-switcher label"
This reverts commit 8a76727604eb504bf0a0728dd106025e1ffc717f.
panels/region/cc-input-options.c | 48 +++++++++++++++++++++++++++++++++++++-
1 files changed, 47 insertions(+), 1 deletions(-)
---
diff --git a/panels/region/cc-input-options.c b/panels/region/cc-input-options.c
index 9e4165b..7c90952 100644
--- a/panels/region/cc-input-options.c
+++ b/panels/region/cc-input-options.c
@@ -74,6 +74,36 @@ update_shortcut_label (GtkWidget *widget,
g_free (text);
}
+static struct
+{
+ const gchar *value;
+ const gchar *description;
+} input_switcher_options[] =
+{
+ { "off", N_("Disabled") },
+ { "shift-l", N_("Left Shift") },
+ { "alt-l", N_("Left Alt") },
+ { "ctrl-l", N_("Left Ctrl") },
+ { "shift-r", N_("Right Shift") },
+ { "alt-r", N_("Right Alt") },
+ { "ctrl-r", N_("Right Ctrl") },
+ { "alt-shift-l", N_("Left Alt+Shift") },
+ { "alt-shift-r", N_("Right Alt+Shift") },
+ { "ctrl-shift-l", N_("Left Ctrl+Shift") },
+ { "ctrl-shift-r", N_("Right Ctrl+Shift") },
+ { "shift-l-shift-r", N_("Left+Right Shift") },
+ { "alt-l-alt-r", N_("Left+Right Alt") },
+ { "ctrl-l-ctrl-r", N_("Left+Right Ctrl") },
+ { "alt-shift", N_("Alt+Shift") },
+ { "ctrl-shift", N_("Ctrl+Shift") },
+ { "alt-ctrl", N_("Alt+Ctrl") },
+ { "caps", N_("Caps") },
+ { "shift-caps", N_("Shift+Caps") },
+ { "alt-caps", N_("Alt+Caps") },
+ { "ctrl-caps", N_("Ctrl+Caps") },
+ { NULL, NULL }
+};
+
static void
update_shortcuts (GtkWidget *options)
{
@@ -82,6 +112,8 @@ update_shortcuts (GtkWidget *options)
gchar **next;
gchar *previous_shortcut;
GSettings *settings;
+ gchar *s;
+ gint i;
settings = g_settings_new ("org.gnome.desktop.wm.keybindings");
@@ -102,7 +134,21 @@ update_shortcuts (GtkWidget *options)
g_object_unref (settings);
- gtk_widget_hide (priv->alt_next_source); /* FIXME */
+ settings = g_settings_new ("org.gnome.settings-daemon.peripherals.keyboard");
+ s = g_settings_get_string (settings, "input-sources-switcher");
+
+ if (strcmp (s, "off") == 0) {
+ gtk_widget_hide (priv->alt_next_source);
+ } else {
+ for (i = 0; input_switcher_options[i].value; i++) {
+ if (strcmp (s, input_switcher_options[i].value) == 0) {
+ gtk_label_set_text (GTK_LABEL (priv->alt_next_source),
_(input_switcher_options[i].description));
+ break;
+ }
+ }
+ }
+ g_free (s);
+ g_object_unref (settings);
}
#define WID(name) ((GtkWidget *) gtk_builder_get_object (builder, name))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]