Background: allow passing the settings schema from outside

This way it is possible to use different settings for different
backgrounds.

https://bugzilla.gnome.org/show_bug.cgi?id=688210
This commit is contained in:
Giovanni Campagna 2013-08-20 00:48:56 +02:00
parent 02224bb5fe
commit 4413f816e6

View File

@ -295,14 +295,15 @@ const Background = new Lang.Class({
_init: function(params) {
params = Params.parse(params, { monitorIndex: 0,
layoutManager: Main.layoutManager,
effects: Meta.BackgroundEffects.NONE });
effects: Meta.BackgroundEffects.NONE,
settings: null });
this.actor = new Meta.BackgroundGroup();
this.actor._delegate = this;
this._destroySignalId = this.actor.connect('destroy',
Lang.bind(this, this._destroy));
this._settings = new Gio.Settings({ schema: BACKGROUND_SCHEMA });
this._settings = params.settings;
this._monitorIndex = params.monitorIndex;
this._layoutManager = params.layoutManager;
this._effects = params.effects;
@ -716,8 +717,10 @@ const BackgroundManager = new Lang.Class({
layoutManager: Main.layoutManager,
monitorIndex: null,
effects: Meta.BackgroundEffects.NONE,
controlPosition: true });
controlPosition: true,
settingsSchema: BACKGROUND_SCHEMA });
this._settings = new Gio.Settings({ schema: params.settingsSchema });
this._container = params.container;
this._layoutManager = params.layoutManager;
this._effects = params.effects;
@ -776,7 +779,8 @@ const BackgroundManager = new Lang.Class({
_createBackground: function() {
let background = new Background({ monitorIndex: this._monitorIndex,
layoutManager: this._layoutManager,
effects: this._effects });
effects: this._effects,
settings: this._settings });
this._container.add_child(background.actor);
let monitor = this._layoutManager.monitors[this._monitorIndex];