1
0
mirror of https://github.com/gryf/wicd.git synced 2026-01-03 20:34:17 +01:00

Enforce only one scan being allowed to happen at a time in the daemon.

This commit is contained in:
Dan O'Reilly
2009-02-08 16:09:55 -05:00
parent 41e356cd97
commit c3bcda73cb
2 changed files with 9 additions and 2 deletions

View File

@@ -2,3 +2,4 @@ experimental.wpr
install.log
uninstall.log
.bzrignore
vcsinfo.py

View File

@@ -97,6 +97,7 @@ class WicdDaemon(dbus.service.Object):
self.connection_info = [""]
self.auto_connecting = False
self.prefer_wired = False
self._scanning = False
self.dhcp_client = 0
self.link_detect_tool = 0
self.flush_tool = 0
@@ -949,6 +950,10 @@ class WirelessDaemon(dbus.service.Object):
be done synchronously.
"""
if self._scanning:
if self.debug_mode:
print "scan already in progress, skipping"
return False
if self.debug_mode:
print 'scanning start'
self.SendStartScanSignal()
@@ -956,6 +961,7 @@ class WirelessDaemon(dbus.service.Object):
self._sync_scan()
else:
self._async_scan()
return True
@misc.threaded
def _async_scan(self):
@@ -1251,12 +1257,12 @@ class WirelessDaemon(dbus.service.Object):
@dbus.service.signal(dbus_interface='org.wicd.daemon.wireless', signature='')
def SendStartScanSignal(self):
""" Emits a signal announcing a scan has started. """
pass
self._scanning = True
@dbus.service.signal(dbus_interface='org.wicd.daemon.wireless', signature='')
def SendEndScanSignal(self):
""" Emits a signal announcing a scan has finished. """
pass
self._scanning = False
def _wireless_autoconnect(self, fresh=True):
""" Attempts to autoconnect to a wireless network. """