Don't show Ad-Hoc mode networks in mesh view

This commit is contained in:
Dan Williams 2007-04-06 15:50:57 -04:00
parent fc12f73fba
commit 1d25366c4f

View File

@ -80,6 +80,9 @@ DEVICE_STATE_ACTIVATING = 0
DEVICE_STATE_ACTIVATED = 1 DEVICE_STATE_ACTIVATED = 1
DEVICE_STATE_INACTIVE = 2 DEVICE_STATE_INACTIVE = 2
IW_MODE_ADHOC = 1
IW_MODE_INFRA = 2
class Network(gobject.GObject): class Network(gobject.GObject):
__gsignals__ = { __gsignals__ = {
'initialized' : (gobject.SIGNAL_RUN_FIRST, 'initialized' : (gobject.SIGNAL_RUN_FIRST,
@ -118,6 +121,15 @@ class Network(gobject.GObject):
self._valid = False self._valid = False
self.emit('initialized', self._valid) self.emit('initialized', self._valid)
return return
if self._mode != IW_MODE_INFRA:
# Don't show Ad-Hoc networks; they usually don't DHCP and therefore
# won't work well here. This also works around the bug where we show
# our own mesh SSID on the Mesh view when in mesh mode
logging.debug("Net(%s): ssid '%s' is adhoc; not showing" % (self._op,
self._ssid))
self._valid = False
self.emit('initialized', self._valid)
return
self._valid = True self._valid = True
logging.debug("Net(%s): ssid '%s', mode %d, strength %d" % (self._op, logging.debug("Net(%s): ssid '%s', mode %d, strength %d" % (self._op,