1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-24 15:12:31 +01:00

Merged back with mainline.

This commit is contained in:
Robby Workman
2009-02-03 21:18:35 -06:00
6 changed files with 18 additions and 18 deletions

4
.bzrignore Normal file
View File

@@ -0,0 +1,4 @@
experimental.wpr
install.log
uninstall.log
.bzrignore

View File

@@ -194,10 +194,10 @@ class WiredInterface(Interface, wnettools.BaseWiredInterface):
except (IOError, ValueError, TypeError):
print 'Error checking link using /sys/class/net/%s/carrier' % self.iface
if self.miitool_cmd and self.link_detect == misc.MIITOOL:
return self._mii_get_plugged_in()
elif self.ethtool_cmd:
if self.ethtool_cmd and self.link_detect in [misc.ETHTOOL, misc.AUTO]:
return self._eth_get_plugged_in()
elif self.miitool_cmd and self.link_detect in [misc.MIITOOL, misc.AUTO]:
return self._mii_get_plugged_in()
else:
print 'Error: No way of checking for a wired connection. Make ' + \
'sure that either mii-tool or ethtool is installed.'

View File

@@ -191,9 +191,9 @@ class WiredInterface(Interface, wnettools.BaseWiredInterface):
"""
if not self.iface: return False
if self.ethtool_cmd and self.link_detect != misc.MIITOOL:
if self.ethtool_cmd and self.link_detect in [misc.ETHTOOL, misc.AUTO]:
return self._eth_get_plugged_in()
elif self.miitool_cmd:
elif self.miitool_cmd and self.link_detect in [misc.MIITOOL, misc.AUTO]:
return self._mii_get_plugged_in()
else:
print 'Error: No way of checking for a wired connection. Make \

View File

@@ -300,8 +300,7 @@ class appGui(object):
def settings_dialog(self, widget, event=None):
""" Displays a general settings dialog. """
if not self.pref:
self.pref = PreferencesDialog(self.wTree,
dbusmanager.get_dbus_ifaces())
self.pref = PreferencesDialog(self.wTree)
else:
self.pref.load_preferences_diag()
if self.pref.run() == 1:

View File

@@ -49,7 +49,7 @@ def setup_dbus():
class PreferencesDialog(object):
""" Class for handling the wicd preferences dialog window. """
def __init__(self, wTree, dbus):
def __init__(self, wTree):
setup_dbus()
self.wTree = wTree
self.prep_settings_diag()

View File

@@ -208,16 +208,13 @@ class BaseInterface(object):
"""
def get_client_name(cl):
""" Converts the integer value for a dhcp client to a string. """
if (cl in [misc.DHCLIENT, "dhclient"] or
(cl == misc.AUTO and self.dhclient_cmd)):
if self.dhclient_cmd and cl in [misc.DHCLIENT, misc.AUTO]:
client = "dhclient"
cmd = self.dhclient_cmd
elif (cl in [misc.DHCPCD, "dhcpcd"] or
(cl == misc.AUTO and self.dhcpcd_cmd)):
elif self.dhcpcd_cmd and cl in [misc.DHCPCD, misc.AUTO]:
client = "dhcpcd"
cmd = self.dhcpcd_cmd
elif (cl in [misc.PUMP, "pump"] or
(cl == misc.AUTO and self.pump_cmd)):
elif self.pump_cmd and cl in [misc.PUMP, misc.AUTO]:
client = "pump"
cmd = self.pump_cmd
else:
@@ -482,12 +479,12 @@ class BaseInterface(object):
def FlushRoutes(self):
""" Flush all network routes. """
if not self.iface: return False
if self.route_cmd and self.flush_tool == misc.ROUTE:
cmds = ['%s del default' % self.route_cmd]
cmds.append('route del dev %s' % self.iface)
elif self.ip_cmd:
if self.ip_cmd and self.flush_tool in [misc.AUTO, misc.IP]:
#cmd = "ip route flush dev " + self.iface
cmds = ['%s route flush all' % self.ip_cmd]
elif self.route_cmd and self.flush_tool in [misc.AUTO, misc.ROUTE]:
cmds = ['%s del default' % self.route_cmd]
cmds.append('route del dev %s' % self.iface)
else:
print "No flush command available!"
cmds = []