[gnome-control-center] Revert "Use a common definition for modifier-only keybindings array"
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] Revert "Use a common definition for modifier-only keybindings array"
- Date: Mon, 13 May 2013 14:23:12 +0000 (UTC)
commit 34906dba2730b42dc0f756822298291e8da7411c
Author: Rui Matos <tiagomatos gmail com>
Date: Mon Apr 1 20:02:38 2013 +0200
Revert "Use a common definition for modifier-only keybindings array"
This reverts commit ae3014ba3e10f37baff039bf969d6c075b303e67.
panels/common/cc-util.c | 27 +---------------------
panels/common/cc-util.h | 7 -----
panels/keyboard/Makefile.am | 2 +-
panels/keyboard/cc-keyboard-option.c | 38 +++++++++++++++++++++++++++----
panels/region/cc-input-options.c | 41 +++++++++++++++++++++++++++++----
5 files changed, 71 insertions(+), 44 deletions(-)
---
diff --git a/panels/common/cc-util.c b/panels/common/cc-util.c
index 3db2500..e51a9d2 100644
--- a/panels/common/cc-util.c
+++ b/panels/common/cc-util.c
@@ -20,34 +20,9 @@
#include "config.h"
#include <string.h>
-#include <glib/gi18n.h>
-#include "cc-util.h"
-CcInputSwitcherOptions cc_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 }
-};
+#include "cc-util.h"
/* Combining diacritical mark?
* Basic range: [0x0300,0x036F]
diff --git a/panels/common/cc-util.h b/panels/common/cc-util.h
index 737a86b..42b09ff 100644
--- a/panels/common/cc-util.h
+++ b/panels/common/cc-util.h
@@ -23,13 +23,6 @@
#include <glib.h>
-typedef struct {
- const gchar *value;
- const gchar *description;
-} CcInputSwitcherOptions;
-
-extern CcInputSwitcherOptions cc_input_switcher_options[];
-
char *cc_util_normalize_casefold_and_unaccent (const char *str);
#endif
diff --git a/panels/keyboard/Makefile.am b/panels/keyboard/Makefile.am
index 81cc7bb..bd9faea 100644
--- a/panels/keyboard/Makefile.am
+++ b/panels/keyboard/Makefile.am
@@ -23,7 +23,7 @@ libkeyboard_la_SOURCES = \
keyboard-shortcuts.h
libkeyboard_la_CFLAGS = $(PANEL_CFLAGS) $(KEYBOARD_PANEL_CFLAGS) -I$(top_srcdir)/panels/common/
-libkeyboard_la_LIBADD = $(PANEL_LIBS) $(KEYBOARD_PANEL_LIBS) $(top_builddir)/panels/common/liblanguage.la
+libkeyboard_la_LIBADD = $(PANEL_LIBS) $(KEYBOARD_PANEL_LIBS)
resource_files = $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies
$(srcdir)/keyboard.gresource.xml)
cc-keyboard-resources.c: keyboard.gresource.xml $(resource_files)
diff --git a/panels/keyboard/cc-keyboard-option.c b/panels/keyboard/cc-keyboard-option.c
index 38f3532..a8ff9a0 100644
--- a/panels/keyboard/cc-keyboard-option.c
+++ b/panels/keyboard/cc-keyboard-option.c
@@ -19,13 +19,11 @@
* 02110-1301, USA.
*/
-#include <config.h>
#include <glib/gi18n.h>
#define GNOME_DESKTOP_USE_UNSTABLE_API
#include <libgnome-desktop/gnome-xkb-info.h>
-#include "cc-util.h"
#include "cc-keyboard-option.h"
#define CC_TYPE_KEYBOARD_OPTION (cc_keyboard_option_get_type ())
@@ -247,6 +245,36 @@ cc_keyboard_option_finalize (GObject *object)
G_OBJECT_CLASS (cc_keyboard_option_parent_class)->finalize (object);
}
+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
cc_keyboard_option_constructed (GObject *object)
{
@@ -296,11 +324,11 @@ cc_keyboard_option_constructed (GObject *object)
else
{
gint i;
- for (i = 0; cc_input_switcher_options[i].value; i++)
+ for (i = 0; input_switcher_options[i].value; i++)
{
gtk_list_store_insert_with_values (self->store, NULL, -1,
- XKB_OPTION_DESCRIPTION_COLUMN,
_(cc_input_switcher_options[i].description),
- XKB_OPTION_ID_COLUMN, cc_input_switcher_options[i].value,
+ XKB_OPTION_DESCRIPTION_COLUMN,
input_switcher_options[i].description,
+ XKB_OPTION_ID_COLUMN, input_switcher_options[i].value,
-1);
}
}
diff --git a/panels/region/cc-input-options.c b/panels/region/cc-input-options.c
index d292593..52ed6f8 100644
--- a/panels/region/cc-input-options.c
+++ b/panels/region/cc-input-options.c
@@ -20,11 +20,12 @@
* Matthias Clasen
*/
+#define _GNU_SOURCE
#include <config.h>
+#include "cc-input-options.h"
+
#include <glib/gi18n.h>
-#include "cc-util.h"
-#include "cc-input-options.h"
typedef struct {
GtkWidget *dialog;
@@ -73,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)
{
@@ -109,9 +140,9 @@ update_shortcuts (GtkWidget *options)
if (strcmp (s, "off") == 0) {
gtk_widget_hide (priv->alt_next_source);
} else {
- for (i = 0; cc_input_switcher_options[i].value; i++) {
- if (strcmp (s, cc_input_switcher_options[i].value) == 0) {
- gtk_label_set_text (GTK_LABEL (priv->alt_next_source),
_(cc_input_switcher_options[i].description));
+ 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;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]