NetworkMenu: fix handling WWAN devices

NMDeviceModem._createSection was not checking whether it should have
shown the connection list, resulting in status item shown even if
the device was in an invalid state.
Also, fix a logic error when creating the operatorItem and fix overriding
_clearSection protected method.

https://bugzilla.gnome.org/show_bug.cgi?id=646395
This commit is contained in:
Giovanni Campagna 2011-04-02 22:27:20 +02:00 committed by Dan Winship
parent 5b1a76aeff
commit c7dfd0894e

View File

@ -824,12 +824,15 @@ NMDeviceModem.prototype = {
}, },
_createSection: function() { _createSection: function() {
if (!this._shouldShowConnectionList())
return;
if (this.mobileDevice) { if (this.mobileDevice) {
// If operator_name is null, just pass the empty string, as the item is hidden anyway // If operator_name is null, just pass the empty string, as the item is hidden anyway
this._operatorItem = new PopupMenu.PopupImageMenuItem(this.mobileDevice.operator_name || '', this._operatorItem = new PopupMenu.PopupImageMenuItem(this.mobileDevice.operator_name || '',
this._getSignalIcon(), this._getSignalIcon(),
{ reactive: false }); { reactive: false });
if (this.mobileDevice.operator_name) if (!this.mobileDevice.operator_name)
this._operatorItem.actor.hide(); this._operatorItem.actor.hide();
this.section.addMenuItem(this._operatorItem); this.section.addMenuItem(this._operatorItem);
} }
@ -837,7 +840,7 @@ NMDeviceModem.prototype = {
NMDevice.prototype._createSection.call(this); NMDevice.prototype._createSection.call(this);
}, },
clearSection: function() { _clearSection: function() {
this._operatorItem = null; this._operatorItem = null;
NMDevice.prototype._clearSection.call(this); NMDevice.prototype._clearSection.call(this);