1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-19 20:38:00 +01:00

Added checks to auto-reconnection code to keep it from constantly trying to reconnect when it isn't working.

Added a ShouldAutoReconnect method to the daemon, to simply the call needed in monitor.py's auto_reconnect method.
This commit is contained in:
imdano
2008-03-18 09:12:05 +00:00
parent cff1336d32
commit eb5e9f49cc
2 changed files with 22 additions and 6 deletions

View File

@@ -390,10 +390,6 @@ class ConnectionWizard(dbus.service.Object):
self.auto_connecting = True
time.sleep(1.5)
gobject.timeout_add(3000, self._monitor_wired_autoconnect)
@dbus.service.method('org.wicd.daemon')
def GetAutoConnecting(self):
return self.auto_connecting
def _wireless_autoconnect(self):
""" Attempts to autoconnect to a wireless network. """
@@ -496,6 +492,15 @@ class ConnectionWizard(dbus.service.Object):
"""
self.need_profile_chooser = misc.to_bool(val)
@dbus.service.method('org.wicd.daemon')
def ShouldAutoReconnect(self):
""" Returns True if it's the right time to try autoreconnecting. """
if self.GetAutoReconnect() and not self.CheckIfConnecting() and \
not self.GetForcedDisconnect() and not self.auto_connecting:
return True
else:
return False
@dbus.service.method('org.wicd.daemon')
def GetForcedDisconnect(self):