[gnome-control-center] universal-access: Use GTK+ instead of custom code
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] universal-access: Use GTK+ instead of custom code
- Date: Fri, 4 Nov 2011 17:01:33 +0000 (UTC)
commit 1465f98af9641b19236afb266a571a0d71b74e7a
Author: Bastien Nocera <hadess hadess net>
Date: Thu Nov 3 17:29:15 2011 +0000
universal-access: Use GTK+ instead of custom code
https://bugzilla.gnome.org/show_bug.cgi?id=663341
panels/universal-access/Makefile.am | 2 +-
panels/universal-access/cc-ua-panel.c | 11 ++++++-----
2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/panels/universal-access/Makefile.am b/panels/universal-access/Makefile.am
index 80bca2c..6432ae8 100644
--- a/panels/universal-access/Makefile.am
+++ b/panels/universal-access/Makefile.am
@@ -23,7 +23,7 @@ libuniversal_access_la_SOURCES = \
zoom-options.c \
zoom-options.h
-libuniversal_access_la_LIBADD = $(PANEL_LIBS) $(UNIVERSAL_ACCESS_PANEL_LIBS) $(top_builddir)/panels/common/libshortcuts.la
+libuniversal_access_la_LIBADD = $(PANEL_LIBS) $(UNIVERSAL_ACCESS_PANEL_LIBS)
libuniversal_access_la_LDFLAGS = $(PANEL_LDFLAGS)
uidir = $(pkgdatadir)/ui
diff --git a/panels/universal-access/cc-ua-panel.c b/panels/universal-access/cc-ua-panel.c
index eaf62c6..45a59fe 100644
--- a/panels/universal-access/cc-ua-panel.c
+++ b/panels/universal-access/cc-ua-panel.c
@@ -29,7 +29,6 @@
#include <gconf/gconf-client.h>
-#include "eggaccelerators.h"
#include "gconf-property-editor.h"
#include "zoom-options.h"
@@ -495,8 +494,8 @@ cc_ua_panel_set_shortcut_label (CcUaPanel *self,
GtkWidget *widget;
char *value;
char *text;
- guint accel_key, keycode;
- EggVirtualModifierType mods;
+ guint accel_key, *keycode;
+ GdkModifierType mods;
widget = WID (self->priv->builder, label);
value = g_settings_get_string (self->priv->mediakeys_settings, key);
@@ -506,7 +505,8 @@ cc_ua_panel_set_shortcut_label (CcUaPanel *self,
g_free (value);
return;
}
- if (egg_accelerator_parse_virtual (value, &accel_key, &keycode, &mods) == FALSE) {
+ gtk_accelerator_parse_with_keycode (value, &accel_key, &keycode, &mods);
+ if (accel_key == 0 && keycode == NULL && mods == 0) {
gtk_label_set_text (GTK_LABEL (widget), _("No shortcut set"));
g_free (value);
g_warning ("Failed to parse keyboard shortcut: '%s'", value);
@@ -514,7 +514,8 @@ cc_ua_panel_set_shortcut_label (CcUaPanel *self,
}
g_free (value);
- text = egg_virtual_accelerator_label (accel_key, keycode, mods);
+ text = gtk_accelerator_get_label_with_keycode (gtk_widget_get_display (widget), accel_key, *keycode, mods);
+ g_free (keycode);
gtk_label_set_text (GTK_LABEL (widget), text);
g_free (text);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]