Add visual bell settings

svn path=/trunk/; revision=9257
This commit is contained in:
Matthias Clasen 2009-02-11 23:10:14 +00:00
parent fe18fb4357
commit 3c6c697c34
3 changed files with 192 additions and 0 deletions

View file

@ -1,3 +1,11 @@
2009-02-11 Matthias Clasen <mclasen@redhat.com>
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 <svu@gnome.org>
* gnome-keyboard-properties-xkbot.c, gnome-keyboard-properties.glade:

View file

@ -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")));

View file

@ -2158,6 +2158,126 @@
</widget>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="system_bell_box">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<widget class="GtkLabel" id="label500">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;b&gt;Visual cues for sounds&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="label"> </property>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<widget class="GtkCheckButton" id="visual_bell_enable">
<property name="label" translatable="yes">Show _visual feedback for the alert sound</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox3">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="label"> </property>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<widget class="GtkRadioButton" id="visual_bell_titlebar">
<property name="label" translatable="yes">Flash _window titlebar</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="visual_bell_fullscreen">
<property name="label" translatable="yes">Flash entire _screen</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">visual_bell_titlebar</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>