NetworkMenu: fix logic for updating wifi icon
Previously, we connected to notify::strength only if there was already a signal connected, and the AP changed (thus, by induction, we never connected). As a result, the icon became stale and different from that shown inside the menu (which is correctly updated). https://bugzilla.gnome.org/show_bug.cgi?id=650007
This commit is contained in:
parent
d2bd9efc25
commit
d7d5da0301
@ -2065,10 +2065,11 @@ NMApplet.prototype = {
|
|||||||
}
|
}
|
||||||
this.setIcon('network-wireless-connected');
|
this.setIcon('network-wireless-connected');
|
||||||
} else {
|
} else {
|
||||||
if (this._accessPointUpdateId && this._activeAccessPoint != ap) {
|
if (this._activeAccessPoint != ap) {
|
||||||
|
if (this._accessPointUpdateId)
|
||||||
this._activeAccessPoint.disconnect(this._accessPointUpdateId);
|
this._activeAccessPoint.disconnect(this._accessPointUpdateId);
|
||||||
this._activeAccessPoint = ap;
|
this._activeAccessPoint = ap;
|
||||||
this._activeAccessPointUpdateId = ap.connect('notify::strength', Lang.bind(function() {
|
this._activeAccessPointUpdateId = ap.connect('notify::strength', Lang.bind(this, function() {
|
||||||
this.setIcon('network-wireless-signal-' + signalToIcon(ap.strength));
|
this.setIcon('network-wireless-signal-' + signalToIcon(ap.strength));
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@ -2095,7 +2096,8 @@ NMApplet.prototype = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._mobileUpdateId && this._mobileUpdateDevice != dev) {
|
if (dev.mobileDevice != this._mobileUpdateDevice) {
|
||||||
|
if (this._mobileUpdateId)
|
||||||
this._mobileUpdateDevice.disconnect(this._mobileUpdateId);
|
this._mobileUpdateDevice.disconnect(this._mobileUpdateId);
|
||||||
this._mobileUpdateDevice = dev.mobileDevice;
|
this._mobileUpdateDevice = dev.mobileDevice;
|
||||||
this._mobileUpdateId = dev.mobileDevice.connect('notify::signal-quality', Lang.bind(this, function() {
|
this._mobileUpdateId = dev.mobileDevice.connect('notify::signal-quality', Lang.bind(this, function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user