From 46ba718ab23c2ccb75dca5a6a6c7834c54430b12 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Tue, 30 Nov 2010 13:11:11 -0500 Subject: [PATCH] LookingGlass: Use GSettings for monospace-font-name Convert code to look up and watch the configured monospace font to use GSettings instead of GConf. https://bugzilla.gnome.org/show_bug.cgi?id=636155 --- js/ui/lookingGlass.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js index 8daa9ff1a..984255591 100644 --- a/js/ui/lookingGlass.js +++ b/js/ui/lookingGlass.js @@ -664,10 +664,10 @@ LookingGlass.prototype = { vertical: true, visible: false }); - let gconf = GConf.Client.get_default(); - gconf.add_dir('/desktop/gnome/interface', GConf.ClientPreloadType.PRELOAD_NONE); - gconf.notify_add('/desktop/gnome/interface/monospace_font_name', - Lang.bind(this, this._updateFont)); + + this._interfaceSettings = new Gio.Settings({ schema: 'org.gnome.desktop.interface' }); + this._interfaceSettings.connect('changed::monospace-font-name', + Lang.bind(this, this._updateFont)); this._updateFont(); Main.uiGroup.add_actor(this.actor); @@ -778,8 +778,7 @@ LookingGlass.prototype = { }, _updateFont: function() { - let gconf = GConf.Client.get_default(); - let fontName = gconf.get_string('/desktop/gnome/interface/monospace_font_name'); + let fontName = this._interfaceSettings.get_string('monospace-font-name'); // This is mishandled by the scanner - should by Pango.FontDescription_from_string(fontName); // https://bugzilla.gnome.org/show_bug.cgi?id=595889 let fontDesc = Pango.font_description_from_string(fontName);