gnome-control-center r9257 - trunk/capplets/keyboard
- From: matthiasc svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-control-center r9257 - trunk/capplets/keyboard
- Date: Wed, 11 Feb 2009 23:10:15 +0000 (UTC)
Author: matthiasc
Date: Wed Feb 11 23:10:14 2009
New Revision: 9257
URL: http://svn.gnome.org/viewvc/gnome-control-center?rev=9257&view=rev
Log:
Add visual bell settings
Modified:
trunk/capplets/keyboard/ChangeLog
trunk/capplets/keyboard/gnome-keyboard-properties-a11y.c
trunk/capplets/keyboard/gnome-keyboard-properties.glade
Modified: trunk/capplets/keyboard/gnome-keyboard-properties-a11y.c
==============================================================================
--- trunk/capplets/keyboard/gnome-keyboard-properties-a11y.c (original)
+++ trunk/capplets/keyboard/gnome-keyboard-properties-a11y.c Wed Feb 11 23:10:14 2009
@@ -65,6 +65,55 @@
}
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)
{
if (response == GTK_RESPONSE_HELP) {
@@ -122,6 +171,21 @@
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")));
Modified: trunk/capplets/keyboard/gnome-keyboard-properties.glade
==============================================================================
--- trunk/capplets/keyboard/gnome-keyboard-properties.glade (original)
+++ trunk/capplets/keyboard/gnome-keyboard-properties.glade Wed Feb 11 23:10:14 2009
@@ -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"><b>Visual cues for sounds</b></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>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]