[gnome-shell] LookingGlass: Use GSettings for monospace-font-name



commit 46ba718ab23c2ccb75dca5a6a6c7834c54430b12
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Tue Nov 30 13:11:11 2010 -0500

    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 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js
index 8daa9ff..9842555 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);



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