[gnome-shell] a11y: Adapt to re-addition of 'visual-bell'



commit 8678b8712027707fb851a724fceb2b09d0fc3382
Author: Florian MÃllner <fmuellner gnome org>
Date:   Mon Nov 14 15:34:42 2011 +0100

    a11y: Adapt to re-addition of 'visual-bell'
    
    The option was merge with 'visual-bell-type' with the GSettings
    port, but the change turned out too disruptive for the universal
    access menu / settings panel, so gsettings-desktop-schemas commit
    a5819b2a4e9 re-added the separate option.

 js/ui/status/accessibility.js |   25 ++-----------------------
 1 files changed, 2 insertions(+), 23 deletions(-)
---
diff --git a/js/ui/status/accessibility.js b/js/ui/status/accessibility.js
index 0c6ef7c..77c5141 100644
--- a/js/ui/status/accessibility.js
+++ b/js/ui/status/accessibility.js
@@ -31,7 +31,7 @@ const DPI_FACTOR_LARGER  = 1.5;
 const DPI_FACTOR_LARGEST = 2.0;
 
 const WM_SCHEMA            = 'org.gnome.desktop.wm.preferences';
-const KEY_VISUAL_BELL_TYPE = 'visual-bell-type';
+const KEY_VISUAL_BELL      = 'visual-bell';
 
 const DESKTOP_INTERFACE_SCHEMA = 'org.gnome.desktop.interface';
 const KEY_GTK_THEME      = 'gtk-theme';
@@ -68,7 +68,7 @@ ATIndicator.prototype = {
                                                                    'screen-keyboard-enabled');
         this.menu.addMenuItem(screenKeyboard);
 
-        let visualBell = this._buildVisualBellItem();
+        let visualBell = this._buildItem(_("Visual Alerts"), WM_SCHEMA, KEY_VISUAL_BELL);
         this.menu.addMenuItem(visualBell);
 
         let stickyKeys = this._buildItem(_("Sticky Keys"), A11Y_SCHEMA, KEY_STICKY_KEYS_ENABLED);
@@ -112,27 +112,6 @@ ATIndicator.prototype = {
         return widget;
     },
 
-    _buildVisualBellItem: function() {
-        let settings = new Gio.Settings({ schema: WM_SCHEMA });
-        let currentValue = settings.get_enum(KEY_VISUAL_BELL_TYPE);
-        let visualBellItem = this._buildItemExtended(
-            _("Visual Alerts"),
-            currentValue != GDesktopEnums.VisualBellType.NONE,
-            settings.is_writable(KEY_VISUAL_BELL_TYPE),
-            function(enabled) {
-                if (enabled)
-                    settings.set_enum(KEY_VISUAL_BELL_TYPE,
-                                      GDesktopEnums.VisualBellType.FULLSCREEN_FLASH);
-                else
-                    settings.reset(KEY_VISUAL_BELL_TYPE);
-            });
-        settings.connect('changed::' + KEY_VISUAL_BELL_TYPE, function() {
-            let value = settings.get_enum(KEY_VISUAL_BELL_TYPE);
-            visualBellItem.setToggleState(value != GDesktopEnums.VisualBellType.NONE);
-        });
-        return visualBellItem;
-    },
-
     _buildHCItem: function() {
         let settings = new Gio.Settings({ schema: DESKTOP_INTERFACE_SCHEMA });
         let gtkTheme = settings.get_string(KEY_GTK_THEME);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]