diff --git a/capplets/keyboard/ChangeLog b/capplets/keyboard/ChangeLog index 5d532450f..1d2422468 100644 --- a/capplets/keyboard/ChangeLog +++ b/capplets/keyboard/ChangeLog @@ -1,3 +1,11 @@ +2009-02-11 Matthias Clasen + + Bug 564998 – Visual bell settings went away + + * gnome-keyboard-properties-a11y.c: + * gnome-keyboard-properties.glade: Add visual bell controls to the + Audio Feedback dialog on the a11y tab. + 2009-02-07 Sergey Udaltsov * gnome-keyboard-properties-xkbot.c, gnome-keyboard-properties.glade: diff --git a/capplets/keyboard/gnome-keyboard-properties-a11y.c b/capplets/keyboard/gnome-keyboard-properties-a11y.c index fa3030ef0..1a4467c8b 100644 --- a/capplets/keyboard/gnome-keyboard-properties-a11y.c +++ b/capplets/keyboard/gnome-keyboard-properties-a11y.c @@ -64,6 +64,55 @@ bouncekeys_enable_toggled_cb (GtkWidget *w, GladeXML *dialog) gtk_widget_set_sensitive (NWID ("bouncekeys_notifications_box"), active); } +static void +visual_bell_enable_toggled_cb (GtkWidget *w, GladeXML *dialog) +{ + gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w)); + + if (notifications_dialog) { + gtk_widget_set_sensitive (NWID ("visual_bell_titlebar"), active); + gtk_widget_set_sensitive (NWID ("visual_bell_fullscreen"), active); + } +} + +static GConfEnumStringPair bell_flash_enums[] = { + { 0, "frame_flash" }, + { 1, "fullscreen" }, + { -1, NULL } +}; + +static GConfValue * +bell_flash_from_widget (GConfPropertyEditor *peditor, const GConfValue *value) +{ + GConfValue *new_value; + + new_value = gconf_value_new (GCONF_VALUE_STRING); + gconf_value_set_string (new_value, + gconf_enum_to_string (bell_flash_enums, gconf_value_get_int (value))); + + return new_value; +} + +static GConfValue * +bell_flash_to_widget (GConfPropertyEditor *peditor, const GConfValue *value) +{ + GConfValue *new_value; + const gchar *str; + gint val = 2; + + str = (value && (value->type == GCONF_VALUE_STRING)) ? gconf_value_get_string (value) : NULL; + + new_value = gconf_value_new (GCONF_VALUE_INT); + if (value->type == GCONF_VALUE_STRING) { + gconf_string_to_enum (bell_flash_enums, + str, + &val); + } + gconf_value_set_int (new_value, val); + + return new_value; +} + static void a11y_notifications_dialog_response_cb (GtkWidget *w, gint response) { @@ -122,6 +171,21 @@ notifications_button_clicked_cb (GtkWidget *button, GladeXML *dialog) CONFIG_ROOT "/bouncekeys_beep_reject", w, NULL); + w = NWID ("visual_bell_enable"); + gconf_peditor_new_boolean (NULL, + "/apps/metacity/general/visual_bell", + w, NULL); + g_signal_connect (w, "toggled", + G_CALLBACK (visual_bell_enable_toggled_cb), dialog); + visual_bell_enable_toggled_cb (w, dialog); + + gconf_peditor_new_select_radio (NULL, + "/apps/metacity/general/visual_bell_type", + gtk_radio_button_get_group (GTK_RADIO_BUTTON (NWID ("visual_bell_titlebar"))), + "conv-to-widget-cb", bell_flash_to_widget, + "conv-from-widget-cb", bell_flash_from_widget, + NULL); + w = NWID ("a11y_notifications_dialog"); gtk_window_set_transient_for (GTK_WINDOW (w), GTK_WINDOW (WID ("keyboard_dialog"))); diff --git a/capplets/keyboard/gnome-keyboard-properties.glade b/capplets/keyboard/gnome-keyboard-properties.glade index 4e71774c1..08c9254f8 100644 --- a/capplets/keyboard/gnome-keyboard-properties.glade +++ b/capplets/keyboard/gnome-keyboard-properties.glade @@ -2158,6 +2158,126 @@ False + 0 + + + + + True + vertical + 6 + + + True + 0 + <b>Visual cues for sounds</b> + True + + + 0 + + + + + True + + + True + + + + False + 0 + + + + + True + vertical + 6 + + + Show _visual feedback for the alert sound + True + True + False + True + True + + + 0 + + + + + True + + + True + + + + False + 0 + + + + + True + vertical + 6 + + + Flash _window titlebar + True + True + False + True + True + True + + + 0 + + + + + Flash entire _screen + True + True + False + True + True + True + visual_bell_titlebar + + + 1 + + + + + 1 + + + + + 1 + + + + + 1 + + + + + 1 + + + + + 1