extensionPrefs: Connect to ExtensionStateChanged after building UI

Since we manipulate parts of the UI (like the switch) in this signal
handler, let's only connect it after setting up the UI.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/705
This commit is contained in:
Jonas Dreßler 2019-09-09 17:06:55 +02:00 committed by Florian Müllner
parent 004a5e1042
commit 17fa5a2db4

View File

@ -567,6 +567,10 @@ class ExtensionRow extends Gtk.ListBoxRow {
this._extension = extension; this._extension = extension;
this._prefsModule = null; this._prefsModule = null;
this.connect('destroy', this._onDestroy.bind(this));
this._buildUI();
this._extensionStateChangedId = this._app.shellProxy.connectSignal( this._extensionStateChangedId = this._app.shellProxy.connectSignal(
'ExtensionStateChanged', (p, sender, [uuid, newState]) => { 'ExtensionStateChanged', (p, sender, [uuid, newState]) => {
if (this.uuid !== uuid) if (this.uuid !== uuid)
@ -577,10 +581,6 @@ class ExtensionRow extends Gtk.ListBoxRow {
this._switch.state = state; this._switch.state = state;
this._switch.sensitive = this._canToggle(); this._switch.sensitive = this._canToggle();
}); });
this.connect('destroy', this._onDestroy.bind(this));
this._buildUI();
} }
get uuid() { get uuid() {