1
0
mirror of https://github.com/gryf/wicd.git synced 2026-04-20 21:01:25 +02:00

improved autoreconnect code

This commit is contained in:
imdano
2007-07-17 07:33:18 +00:00
parent ba48602aa9
commit 5bd069702d
+5 -3
View File
@@ -125,12 +125,14 @@ def set_signal_image():
#Auto-reconnect code - not sure how well this works. I know that without the ForcedDisconnect check it reconnects you when
#a disconnect is forced. People who have disconnection problems need to test it to determine if it actually works.
#First it will attempt to reconnect to the last known wireless network, and if that fails it should run a scan and try to
#connect to any network set to autoconnect. It will continuously rescan until a network is found or the user manually reconnects
#This behavior could prove to be annoying, so we'll keep it in the experimental build for now
#connect to any network set to autoconnect.
if wireless.GetAutoReconnect() == True and wireless.CheckIfWirelessConnecting() == False and wireless.GetForcedDisconnect() == False:
curNetID = wireless.GetCurrentNetworkID()
if curNetID > -1: #value of -1 is typically caused by hibernation and breaks the tray if passed to daemon
if curNetID > -1:
wireless.ConnectWireless(wireless.GetCurrentNetworkID())
print 'Trying to autoreconnect'
while wireless.CheckIfWirelessConnecting() == True:
time.sleep(1)
if wireless.GetCurrentSignalStrength() != 0:
print "Successfully autoreconnected."
else: