summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJody Goldberg <jody@gnome.org>2002-09-10 04:03:44 +0000
committerJody Goldberg <jody@src.gnome.org>2002-09-10 04:03:44 +0000
commit9605651251e283d7a37cadbd1e00d465db82626c (patch)
treefab12a3aef99cf517b625c7178728553248a14ec
parent4101aaa9661ae07c998c90c2d347f6c6ebe76675 (diff)
downloadgnome-control-center-9605651251e283d7a37cadbd1e00d465db82626c.tar.gz
add a warning if xkb is not available.
2002-09-09 Jody Goldberg <jody@gnome.org> * gnome-accessibility-keyboard-properties.c (main) : add a warning if xkb is not available.
-rw-r--r--capplets/accessibility/keyboard/ChangeLog25
-rw-r--r--capplets/accessibility/keyboard/accessibility-keyboard.c44
-rw-r--r--capplets/accessibility/keyboard/gnome-accessibility-keyboard-properties.c34
-rw-r--r--capplets/accessibility/keyboard/gnome-accessibility-keyboard-properties.glade13
4 files changed, 92 insertions, 24 deletions
diff --git a/capplets/accessibility/keyboard/ChangeLog b/capplets/accessibility/keyboard/ChangeLog
index 74a972a6f..fbcd999eb 100644
--- a/capplets/accessibility/keyboard/ChangeLog
+++ b/capplets/accessibility/keyboard/ChangeLog
@@ -1,3 +1,28 @@
+2002-09-09 Jody Goldberg <jody@gnome.org>
+
+ * gnome-accessibility-keyboard-properties.c (main) : add a warning if
+ xkb is not available.
+
+2002-09-09 Jody Goldberg <jody@gnome.org>
+
+ * accessibility-keyboard.c : on 2nd thought lets disable the 'beep on
+ feature change' if the master switch is off.
+
+ http://bugzilla.gnome.org/show_bug.cgi?id=92488
+ * gnome-accessibility-keyboard-properties.glade : tweak accelerators
+
+2002-09-09 Jody Goldberg <jody@gnome.org>
+
+ http://bugzilla.gnome.org/show_bug.cgi?id=90936
+ * gnome-accessibility-keyboard-properties.glade : Add mnemonic_widget
+ assignments and fix a typo.
+
+2002-08-28 Jody Goldberg <jody@gnome.org>
+
+ http://bugzilla.gnome.org/show_bug.cgi?id=91854
+ * accessibility-keyboard.c : the max slow key delay is 500ms.
+ We clamp that in the settings daemon. Fix the ui to reflect that.
+
2002-08-21 Jody Goldberg <jody@gnome.org>
* Release 2.1.0
diff --git a/capplets/accessibility/keyboard/accessibility-keyboard.c b/capplets/accessibility/keyboard/accessibility-keyboard.c
index 286ba7bdb..e7959028b 100644
--- a/capplets/accessibility/keyboard/accessibility-keyboard.c
+++ b/capplets/accessibility/keyboard/accessibility-keyboard.c
@@ -63,7 +63,10 @@ static struct {
{ NULL, NULL, NULL } },
{ "timeout_enable", NULL, NULL,
CONFIG_ROOT "/timeout_enable",
- { "timeout_slide", "timeout_spin", "timeout_label" } }
+ { "timeout_slide", "timeout_spin", "timeout_label" } },
+ { "feature_state_change_beep", NULL, NULL,
+ CONFIG_ROOT "/feature_state_change_beep",
+ { NULL, NULL, NULL } }
};
static struct {
@@ -77,7 +80,7 @@ static struct {
} const ranges [] = {
{ "bouncekeys_delay_slide", "bouncekeys_delay_spin", 300, 10, 900, 10,
CONFIG_ROOT "/bouncekeys_delay" },
- { "slowkeys_delay_slide", "slowkeys_delay_spin", 300, 10, 900, 10,
+ { "slowkeys_delay_slide", "slowkeys_delay_spin", 300, 10, 500, 10,
CONFIG_ROOT "/slowkeys_delay" },
/* WARNING anything larger than approx 512 seems to loose all keyboard input */
{ "mousekeys_max_speed_slide", "mousekeys_max_speed_spin", 300, 10, 500, 20,
@@ -148,7 +151,6 @@ setup_simple_toggles (GladeXML *dialog, GConfChangeSet *changeset)
char const *gconf_key;
char const *checkbox;
} const simple_toggles [] = {
- { CONFIG_ROOT "/feature_state_change_beep","feature_state_change_beep" },
{ CONFIG_ROOT "/bouncekeys_beep_reject", "bouncekeys_beep_reject" },
{ CONFIG_ROOT "/slowkeys_beep_press", "slowkeys_beep_press" },
@@ -269,11 +271,11 @@ xrm_get_bool (GConfClient *client, XrmDatabase *db, char const *gconf_key,
static void
xrm_get_int (GConfClient *client, XrmDatabase *db, char const *gconf_key,
- char const *res_str, char const *class_str)
+ char const *res_str, char const *class_str, float scale)
{
XrmValue resourceValue;
char *res;
- int value;
+ int value, log_scale;
char resource [256];
snprintf (resource, sizeof (resource), "%s.value", res_str);
@@ -281,17 +283,17 @@ xrm_get_int (GConfClient *client, XrmDatabase *db, char const *gconf_key,
return;
value = atoi (resourceValue.addr);
-#if 0
- {
- int decimal;
snprintf (resource, sizeof (resource), "%s.decimalPoints", res_str);
if (!XrmGetResource (*db, resource, class_str, &res, &resourceValue))
return;
- decimal = atoi (resourceValue.addr);
- }
-#endif
+ log_scale = atoi (resourceValue.addr);
+
+ while (log_scale-- > 0)
+ scale /= 10.;
gconf_client_set_int (client, gconf_key, value, NULL);
+
+ printf ("%f * %d\n", scale, value);
}
/* This loads the current users XKB settings from their file */
@@ -316,8 +318,8 @@ load_CDE_file (GtkFileSelection *fsel)
}
client = gconf_client_get_default ();
- xrm_get_bool (client, &db, CONFIG_ROOT "/enable",
- "*EnableAccessXToggle.set", "AccessX*ToggleButtonGadget.XmCSet");
+ gconf_client_set_bool (client, CONFIG_ROOT "/enable", TRUE, NULL);
+
xrm_get_bool (client, &db, CONFIG_ROOT "/feature_state_change_beep",
"*SoundOnOffToggle.set", "AccessX*ToggleButtonGadget.XmCSet");
xrm_get_bool (client, &db, CONFIG_ROOT "/timeout_enable",
@@ -341,17 +343,21 @@ load_CDE_file (GtkFileSelection *fsel)
xrm_get_bool (client, &db, CONFIG_ROOT "/slowkeys_beep_accept",
"*SlowKeysOnAcceptToggle.set", "AccessX*ToggleButtonGadget.XmCSet");
xrm_get_int (client, &db, CONFIG_ROOT "/timeout",
- "*TimeOutScale", "AccessX*XmScale");
+ "*TimeOutScale", "AccessX*XmScale", 60);
xrm_get_int (client, &db, CONFIG_ROOT "/mousekeys_max_speed",
- "*MouseMaxSpeedScale", "AccessX*XmScale");
+ "*MouseMaxSpeedScale", "AccessX*XmScale", 1);
xrm_get_int (client, &db, CONFIG_ROOT "/mousekeys_accel_time",
- "*MouseAccelScale", "AccessX*XmScale");
+ "*MouseAccelScale", "AccessX*XmScale", 1);
xrm_get_int (client, &db, CONFIG_ROOT "/mousekeys_init_delay",
- "*MouseDelayScale", "AccessX*XmScale");
+ "*MouseDelayScale", "AccessX*XmScale", 1);
xrm_get_int (client, &db, CONFIG_ROOT "/slowkeys_delay",
- "*KRGSlowKeysDelayScale", "AccessX*XmScale");
+ "*KRGSlowKeysDelayScale", "AccessX*XmScale", 1000);
xrm_get_int (client, &db, CONFIG_ROOT "/bouncekeys_delay",
- "*KRGDebounceScale", "AccessX*XmScale");
+ "*KRGDebounceScale", "AccessX*XmScale", 1000);
+
+ /* Set the master enable flag last */
+ xrm_get_bool (client, &db, CONFIG_ROOT "/enable",
+ "*EnableAccessXToggle.set", "AccessX*ToggleButtonGadget.XmCSet");
return TRUE;
}
diff --git a/capplets/accessibility/keyboard/gnome-accessibility-keyboard-properties.c b/capplets/accessibility/keyboard/gnome-accessibility-keyboard-properties.c
index ed37b8212..436bd12b2 100644
--- a/capplets/accessibility/keyboard/gnome-accessibility-keyboard-properties.c
+++ b/capplets/accessibility/keyboard/gnome-accessibility-keyboard-properties.c
@@ -32,6 +32,34 @@
#include <activate-settings-daemon.h>
#include "accessibility-keyboard.h"
+#ifdef HAVE_X11_EXTENSIONS_XKB_H
+# include <X11/XKBlib.h>
+# include <X11/extensions/XKBstr.h>
+# include <gdk/gdk.h>
+# include <gdk/gdkx.h>
+
+static void
+xkb_enabled (void)
+{
+ gboolean have_xkb = FALSE;
+ int opcode, errorBase, major, minor, xkbEventBase;
+
+ gdk_error_trap_push ();
+ have_xkb = XkbQueryExtension (GDK_DISPLAY (),
+ &opcode, &xkbEventBase, &errorBase, &major, &minor)
+ && XkbUseExtension (GDK_DISPLAY (), &major, &minor);
+ XSync (GDK_DISPLAY (), FALSE);
+ gdk_error_trap_pop ();
+
+ if (!have_xkb) {
+ GtkWidget *warn = gtk_message_dialog_new (NULL, 0,
+ GTK_MESSAGE_WARNING, GTK_BUTTONS_CLOSE,
+ _("This system does not seem to have the XKB extension. The keyboard accessibility features will not operate with it."));
+ gtk_dialog_run (GTK_DIALOG (warn));
+ }
+}
+#endif
+
static void
dialog_response (GtkWidget *widget,
gint response_id,
@@ -67,7 +95,11 @@ main (int argc, char **argv)
GNOME_PARAM_APP_DATADIR, GNOMECC_DATA_DIR,
NULL);
activate_settings_daemon ();
-
+
+#ifdef HAVE_X11_EXTENSIONS_XKB_H
+ xkb_enabled ();
+#endif
+
changeset = NULL;
dialog = setup_accessX_dialog (changeset);
g_signal_connect (G_OBJECT (dialog),
diff --git a/capplets/accessibility/keyboard/gnome-accessibility-keyboard-properties.glade b/capplets/accessibility/keyboard/gnome-accessibility-keyboard-properties.glade
index dc393bea7..c0e1f8fe1 100644
--- a/capplets/accessibility/keyboard/gnome-accessibility-keyboard-properties.glade
+++ b/capplets/accessibility/keyboard/gnome-accessibility-keyboard-properties.glade
@@ -235,7 +235,7 @@
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Beep when an LED is turned on and two beeps when one is turned off.</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Enable _Toggle Keys</property>
+ <property name="label" translatable="yes">E_nable Toggle Keys</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="active">True</property>
@@ -451,6 +451,7 @@ two keys pressed simultaneously</property>
<property name="yalign">0.5</property>
<property name="xpad">9</property>
<property name="ypad">0</property>
+ <property name="mnemonic_widget">slowkeys_delay_spin</property>
<accessibility>
<atkrelation target="slowkeys_delay_spin" type="label-for"/>
</accessibility>
@@ -730,6 +731,7 @@ two keys pressed simultaneously</property>
<property name="yalign">0.5</property>
<property name="xpad">10</property>
<property name="ypad">0</property>
+ <property name="mnemonic_widget">bouncekeys_delay_spin</property>
<accessibility>
<atkrelation target="bouncekeys_delay_spin" type="label-for"/>
</accessibility>
@@ -857,7 +859,7 @@ two keys pressed simultaneously</property>
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Ignore all subsequent presses of the SAME key if they happen within a user selectable period of time.</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Enable _Bounce Keys</property>
+ <property name="label" translatable="yes">Enable Bo_unce Keys</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="active">True</property>
@@ -908,6 +910,7 @@ two keys pressed simultaneously</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="mnemonic_widget">mousekeys_max_speed_spin</property>
<accessibility>
<atkrelation target="mousekeys_max_speed_spin" type="label-for"/>
</accessibility>
@@ -1066,8 +1069,9 @@ two keys pressed simultaneously</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="mnemonic_widget">mousekeys_accel_time_spin</property>
<accessibility>
- <atkrelation target="mousekeys_accel_time_title" type="label-for"/>
+ <atkrelation target="mousekeys_accel_time_spin" type="label-for"/>
</accessibility>
</widget>
<packing>
@@ -1193,6 +1197,7 @@ two keys pressed simultaneously</property>
<property name="yalign">0.5</property>
<property name="xpad">2</property>
<property name="ypad">0</property>
+ <property name="mnemonic_widget">mousekeys_init_delay_spin</property>
<accessibility>
<atkrelation target="mousekeys_init_delay_spin" type="label-for"/>
</accessibility>
@@ -1297,7 +1302,7 @@ two keys pressed simultaneously</property>
<widget class="GtkCheckButton" id="feature_state_change_beep">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">_Beep when enabling/disabling keyboard accessibility features</property>
+ <property name="label" translatable="yes">Beep when enabling/disabling _keyboard accessibility features</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="active">False</property>