Initialize the other fields of this data structure (apply_settings): Use

2001-07-26  Bradford Hovinen  <hovinen@ximian.com>

	* keyboard-properties.c (apply_settings): Initialize the other
	fields of this data structure
	(apply_settings): Use lookup table to get the values to put in
	kbdsettings
This commit is contained in:
Bradford Hovinen 2001-07-26 20:59:58 +00:00 committed by Bradford Hovinen (Gdict maintainer)
parent b9b13ebbbc
commit 71942b3edf
2 changed files with 11 additions and 2 deletions

View file

@ -2,6 +2,8 @@
* keyboard-properties.c (apply_settings): Initialize the other
fields of this data structure
(apply_settings): Use lookup table to get the values to put in
kbdsettings
* Makefile.am (bonobo_sources): Remove bonobo-property-editor-range.[ch]

View file

@ -45,6 +45,13 @@ apply_settings (Bonobo_ConfigDatabase db)
int rate, delay, volume;
int bell_volume, bell_pitch, bell_duration;
static int rates[] = {
255, 192, 128, 64
};
static int delays[] = {
10000, 6000, 3000, 0
};
#ifdef HAVE_X11_EXTENSIONS_XF86MISC_H
XF86MiscKbdSettings kbdsettings;
#endif
@ -68,8 +75,8 @@ apply_settings (Bonobo_ConfigDatabase db)
&error_base_return) == True)
{
kbdsettings.type = 0;
kbdsettings.rate = rate;
kbdsettings.delay = delay;
kbdsettings.rate = rates[rate];
kbdsettings.delay = delays[delay];
kbdsettings.servnumlock = False;
XF86MiscSetKbdSettings (GDK_DISPLAY (), &kbdsettings);
} else {