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

Optimized autoconnect for wired code (should be more log friendly)

This commit is contained in:
imdano
2007-07-11 12:47:44 +00:00
parent 7aaf402389
commit 0b0859152d

View File

@@ -327,13 +327,19 @@ class ConnectionWizard(dbus.service.Object):
return return
print "unable to find a network to autoconnect to, checking for a wired connection" print "unable to find a network to autoconnect to, checking for a wired connection"
if self.CheckPluggedIn() == True: if self.CheckPluggedIn() == True:
if self.CheckIfWiredConnecting() == False: # Keeps us from going into an infinite connecting loop defaultNetwork = self.GetDefaultWiredNetwork()
defaultNetwork = self.GetDefaultWiredNetwork() if defaultNetwork != None:
if defaultNetwork != None: self.ReadWiredNetworkProfile(defaultNetwork)
self.ReadWiredNetworkProfile(defaultNetwork) self.ConnectWired()
self.ConnectWired() time.sleep(1)
else: print "Attempting to autoconnect with wired interface..."
print "couldn't find a default wired connection, couldn't autoconnect" while self.CheckIfWiredConnecting(): # Keeps us from going into an infinite connecting loop
#I didn't include a self.GetWired/WirelessIP call and it seems
#to work for me...could it cause problems? - Dan
time.sleep(1)
print "...done autoconnecting."
else:
print "couldn't find a default wired connection, couldn't autoconnect"
else: else:
print "no wired connection present, couldn't autoconnect." print "no wired connection present, couldn't autoconnect."
else: else: