So I'm writing an extension, that has some preferences. I store the preferences in GSettings, using the convenience.js (as described here). The related code looks like this:
const SETTINGS_APP_SORT_MODE = 'sort-mode';
this._settings = Convenience.getSettings("org.gnome.shell.extensions.workspace-alt-tab"); //get schema
this._settings.set_string(SETTINGS_APP_SORT_MODE,modeCapture); //set value
this._sortMode = this._settings.get_string(SETTINGS_APP_SORT_MODE); //get value
So far it works nicely, and I can also use the command
gsettings monitor org.gnome.shell.extensions.workspace-alt-tab sort-mode
To make sure that I really set the values as I want.
But here it comes to my problem, when I try to capture the changes made to those settings to reflect them in my code. From what I've seen in other extensions, I'm guessing it should look something like this:
_init: function(params) {
this._settingsChanged=
this._settings.connect('changed',
Lang.bind(this,this._settingsChanged)); //get notified on every schema change
this._sortModeChangedId =
this._settings.connect('changed::' + SETTINGS_APP_SORT_MODE,
Lang.bind(this,this._sortModeChanged)); //get notified for sort-mode changes
this._sortModeChanged(); //force initialization
},
_settingsChanged: function() {
this._sortMode = this._settings.get_string(SETTINGS_APP_SORT_MODE);
log("[_settingsChanged] new sortMode: "+this._sortMode);
},
_sortModeChanged: function() {
this._sortMode = this._settings.get_string(SETTINGS_APP_SORT_MODE);
log("[_sortModeChanged] new sortMode: "+this._sortMode);
}
But the problem is that I only see the log line called from init:
Gjs-Message: JS LOG: [_sortModeChanged] new sortMode: most-recently-used
Also, I have absolutely no idea about how to debug this kind of thing (even in LookingGlass...). If someone can point to me my silly mistake, or give some pointers as to how to debug this kind of things, it'd be much appreciated!