From da000d4a08ae9d6b2f503d1a481e65547040dbfb Mon Sep 17 00:00:00 2001 From: Jody Goldberg Date: Mon, 25 Mar 2002 17:07:00 +0000 Subject: [PATCH] oked by jrb new. (volume_from_widget) : new. (setup_dialog) : use them 2002-03-25 Jody Goldberg oked by jrb * gnome-keyboard-properties.c (volume_to_widget) : new. (volume_from_widget) : new. (setup_dialog) : use them here. --- capplets/keyboard/ChangeLog | 6 ++++++ capplets/keyboard/gnome-keyboard-properties.c | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/capplets/keyboard/ChangeLog b/capplets/keyboard/ChangeLog index 572e03ced..0a705d303 100644 --- a/capplets/keyboard/ChangeLog +++ b/capplets/keyboard/ChangeLog @@ -1,3 +1,9 @@ +2002-03-25 Jody Goldberg + + * gnome-keyboard-properties.c (volume_to_widget) : new. + (volume_from_widget) : new. + (setup_dialog) : use them here. + 2002-03-25 Jody Goldberg * gnome-keyboard-properties.c (setup_accessibility) : Use diff --git a/capplets/keyboard/gnome-keyboard-properties.c b/capplets/keyboard/gnome-keyboard-properties.c index 350b44354..826eb7691 100644 --- a/capplets/keyboard/gnome-keyboard-properties.c +++ b/capplets/keyboard/gnome-keyboard-properties.c @@ -186,6 +186,17 @@ blink_to_widget (GConfPropertyEditor *peditor, const GConfValue *value) return new_value; } +static GConfValue * +volume_to_widget (GConfPropertyEditor *peditor, const GConfValue *value) +{ + return gconf_value_int_to_float (value); +} +static GConfValue * +volume_from_widget (GConfPropertyEditor *peditor, const GConfValue *value) +{ + return gconf_value_float_to_int (value); +} + static void bell_guard (GtkWidget *toggle, GladeXML *dialog) @@ -272,7 +283,10 @@ setup_dialog (GladeXML *dialog, (changeset, "/desktop/gnome/peripherals/keyboard/click", WID ("volume_toggle"), NULL); gconf_peditor_widget_set_guard (GCONF_PROPERTY_EDITOR (peditor), WID ("volume_hbox")); gconf_peditor_new_numeric_range - (changeset, "/desktop/gnome/peripherals/keyboard/click_volume", WID ("volume_scale"), NULL); + (changeset, "/desktop/gnome/peripherals/keyboard/click_volume", WID ("volume_scale"), + "conv-to-widget-cb", volume_to_widget, + "conv-from-widget-cb", volume_from_widget, + NULL); g_signal_connect (G_OBJECT (WID ("bell_custom_radio")), "toggled", (GCallback) bell_guard, dialog); peditor = gconf_peditor_new_select_radio