diff --git a/extension.js b/extension.js index a2911b2..0f236ff 100644 --- a/extension.js +++ b/extension.js @@ -146,14 +146,12 @@ class Extension { constructor() { this._previous_y_align = BannerBin.get_y_align(); this._previous_x_align = BannerBin.get_x_align(); - this._loadSettings(); } _loadSettings() { this._settings = Prefs.SettingsSchema; this._settingsChangedId = this._settings.connect('changed', Lang.bind(this, this._onSettingsChange)); - this._fetchSettings(); } @@ -170,6 +168,7 @@ class Extension { } enable() { + this._loadSettings(); // generally alignment can be controller with START/CENTER/END // but CENTER and END are problematic to implement animations with // (especially x -> END and animations from left/right) @@ -192,6 +191,7 @@ class Extension { BannerBin.x = 0 BannerBin.y = 0 this.restore() + this._settings = null; } diff --git a/prefs.js b/prefs.js index b853066..f711305 100644 --- a/prefs.js +++ b/prefs.js @@ -43,15 +43,7 @@ var Fields = { const SCHEMA_NAME = 'org.gnome.shell.extensions.notification-banner-reloaded'; -const getSchema = function () { - let schemaDir = Me.dir.get_child('schemas').get_path(); - let schemaSource = Gio.SettingsSchemaSource.new_from_directory(schemaDir, Gio.SettingsSchemaSource.get_default(), false); - let schema = schemaSource.lookup(SCHEMA_NAME, false); - - return new Gio.Settings({ settings_schema: schema }); -}; - -var SettingsSchema = getSchema(); +var SettingsSchema = ExtensionUtils.getSettings(SCHEMA_NAME); function init() { let localeDir = Me.dir.get_child('locale');