user-theme: port to new extension API

main() has been	replaced by init(), enable() and disable()
This commit is contained in:
Giovanni Campagna
2011-08-02 23:35:37 +02:00
parent 231e1f610a
commit 1eb245c514
+18 -3
View File
@@ -15,11 +15,26 @@ function ThemeManager() {
ThemeManager.prototype = {
_init: function() {
},
enable: function() {
this._settings = new Gio.Settings({ schema: SETTINGS_SCHEMA });
this._settings.connect('changed::'+SETTINGS_KEY, Lang.bind(this, this._changeTheme));
this._changedId = this._settings.connect('changed::'+SETTINGS_KEY, Lang.bind(this, this._changeTheme));
this._changeTheme();
},
disable: function() {
if (this._changedId) {
this._settings.disconnect(this._changedId);
this._changedId = 0;
}
this._settings = null;
Main.setThemeStylesheet(null);
Main.loadTheme();
},
_changeTheme: function() {
let _stylesheet = null;
let _themeName = this._settings.get_string(SETTINGS_KEY);
@@ -52,6 +67,6 @@ ThemeManager.prototype = {
}
function main(metadata) {
new ThemeManager();
function init(metadata) {
return new ThemeManager();
}