magnifier: Adjust for removal of 'show-magnifier' key

gsettings-desktop-schemas had two conflicting settings for showing
the magnifier: 'show-magnifier' in org.gnome.desktop.a11y.magnifier
and 'screen-magnifier-enabled' in org.gnome.desktop.a11y.applications.
The former has been removed in favor of the latter, so adjust to this
change.
This commit is contained in:
Florian Müllner 2011-02-17 16:05:22 +01:00
parent a1e019b41a
commit 3631983de5
2 changed files with 13 additions and 8 deletions

View File

@ -33,7 +33,10 @@ const MOUSE_POLL_FREQUENCY = 50;
const CROSSHAIRS_CLIP_SIZE = [100, 100];
// Settings
const SHOW_KEY = 'show-magnifier';
const APPLICATIONS_SCHEMA = 'org.gnome.desktop.a11y.applications';
const SHOW_KEY = 'screen-magnifier-enabled';
const MAGNIFIER_SCHEMA = 'org.gnome.desktop.a11y.magnifier';
const SCREEN_POSITION_KEY = 'screen-position';
const MAG_FACTOR_KEY = 'mag-factor';
const LENS_MODE_KEY = 'lens-mode';
@ -438,7 +441,8 @@ Magnifier.prototype = {
},
_settingsInit: function(zoomRegion) {
this._settings = new Gio.Settings({ schema: 'org.gnome.desktop.a11y.magnifier' });
this._appSettings = new Gio.Settings({ schema: APPLICATIONS_SCHEMA });
this._settings = new Gio.Settings({ schema: MAGNIFIER_SCHEMA });
if (zoomRegion) {
// Mag factor is accurate to two decimal places.
@ -462,9 +466,9 @@ Magnifier.prototype = {
this.addCrosshairs();
this.setCrosshairsVisible(showCrosshairs);
this._settings.connect('changed::' + SHOW_KEY,
this._appSettings.connect('changed::' + SHOW_KEY,
Lang.bind(this, function() {
this.setActive(this._settings.get_boolean(SHOW_KEY));
this.setActive(this._appSettings.get_boolean(SHOW_KEY));
}));
this._settings.connect('changed::' + SCREEN_POSITION_KEY,
@ -508,7 +512,7 @@ Magnifier.prototype = {
this.setCrosshairsClip(this._settings.get_boolean(CROSS_HAIRS_CLIP_KEY));
}));
return this._settings.get_boolean(SHOW_KEY);
return this._appSettings.get_boolean(SHOW_KEY);
},
_updateScreenPosition: function() {

View File

@ -23,7 +23,7 @@ const KEY_BOUNCE_KEYS_ENABLED = 'bouncekeys-enable';
const KEY_SLOW_KEYS_ENABLED = 'slowkeys-enable';
const KEY_MOUSE_KEYS_ENABLED = 'mousekeys-enable';
const MAGNIFIER_SCHEMA = 'org.gnome.desktop.a11y.magnifier';
const APPLICATIONS_SCHEMA = 'org.gnome.desktop.a11y.applications';
const AT_SCREEN_KEYBOARD_SCHEMA = 'org.gnome.desktop.default-applications.at.mobility';
const AT_SCREEN_READER_SCHEMA = 'org.gnome.desktop.default-applications.at.visual';
@ -80,7 +80,8 @@ ATIndicator.prototype = {
let highContrast = this._buildHCItem();
this.menu.addMenuItem(highContrast);
let magnifier = this._buildItem(_("Zoom"), MAGNIFIER_SCHEMA, 'show-magnifier');
let magnifier = this._buildItem(_("Zoom"), APPLICATIONS_SCHEMA,
'screen-magnifier-enabled');
this.menu.addMenuItem(magnifier);
let textZoom = this._buildFontItem();