NetworkMenu: fix wireless-enabled property notifications

The property is on the NMClient, not NMDevice. Also, make sure
we disconnect the signal when the item is destroyed.
Also, connect to wireless-hardware-enabled, which we'll use soon.

https://bugzilla.gnome.org/show_bug.cgi?id=709635
This commit is contained in:
Giovanni Campagna 2013-10-08 21:23:30 +02:00
parent f7624e5f05
commit 8a8b3bf96e

View File

@ -971,7 +971,8 @@ const NMDeviceWireless = new Lang.Class({
this.item.menu.addSettingsAction(_("Network Settings"), 'gnome-network-panel.desktop');
this._wirelessEnabledChangedId = this._device.connect('notify::wireless-enabled', Lang.bind(this, this._sync));
this._wirelessEnabledChangedId = this._client.connect('notify::wireless-enabled', Lang.bind(this, this._sync));
this._wirelessHwEnabledChangedId = this._client.connect('notify::wireless-hardware-enabled', Lang.bind(this, this._sync));
this._activeApChangedId = this._device.connect('notify::active-access-point', Lang.bind(this, this._activeApChanged));
this._stateChangedId = this._device.connect('state-changed', Lang.bind(this, this._deviceStateChanged));
@ -991,6 +992,14 @@ const NMDeviceWireless = new Lang.Class({
this._activeAccessPoint.disconnect(this._strengthChangedId);
this._strengthChangedId = 0;
}
if (this._wirelessEnabledChangedId) {
this._client.disconnect(this._wirelessEnabledChangedId);
this._wirelessEnabledChangedId = 0;
}
if (this._wirelessHwEnabledChangedId) {
this._client.disconnect(this._wirelessHwEnabledChangedId);
this._wirelessHwEnabledChangedId = 0;
}
this.item.destroy();
},