mirror of
https://github.com/gryf/wicd.git
synced 2026-02-24 11:15:49 +01:00
Merged back with mainline.
This commit is contained in:
4
.bzrignore
Normal file
4
.bzrignore
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
experimental.wpr
|
||||||
|
install.log
|
||||||
|
uninstall.log
|
||||||
|
.bzrignore
|
||||||
@@ -194,10 +194,10 @@ class WiredInterface(Interface, wnettools.BaseWiredInterface):
|
|||||||
except (IOError, ValueError, TypeError):
|
except (IOError, ValueError, TypeError):
|
||||||
print 'Error checking link using /sys/class/net/%s/carrier' % self.iface
|
print 'Error checking link using /sys/class/net/%s/carrier' % self.iface
|
||||||
|
|
||||||
if self.miitool_cmd and self.link_detect == misc.MIITOOL:
|
if self.ethtool_cmd and self.link_detect in [misc.ETHTOOL, misc.AUTO]:
|
||||||
return self._mii_get_plugged_in()
|
|
||||||
elif self.ethtool_cmd:
|
|
||||||
return self._eth_get_plugged_in()
|
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:
|
else:
|
||||||
print 'Error: No way of checking for a wired connection. Make ' + \
|
print 'Error: No way of checking for a wired connection. Make ' + \
|
||||||
'sure that either mii-tool or ethtool is installed.'
|
'sure that either mii-tool or ethtool is installed.'
|
||||||
|
|||||||
@@ -191,9 +191,9 @@ class WiredInterface(Interface, wnettools.BaseWiredInterface):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
if not self.iface: return False
|
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()
|
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()
|
return self._mii_get_plugged_in()
|
||||||
else:
|
else:
|
||||||
print 'Error: No way of checking for a wired connection. Make \
|
print 'Error: No way of checking for a wired connection. Make \
|
||||||
|
|||||||
@@ -300,8 +300,7 @@ class appGui(object):
|
|||||||
def settings_dialog(self, widget, event=None):
|
def settings_dialog(self, widget, event=None):
|
||||||
""" Displays a general settings dialog. """
|
""" Displays a general settings dialog. """
|
||||||
if not self.pref:
|
if not self.pref:
|
||||||
self.pref = PreferencesDialog(self.wTree,
|
self.pref = PreferencesDialog(self.wTree)
|
||||||
dbusmanager.get_dbus_ifaces())
|
|
||||||
else:
|
else:
|
||||||
self.pref.load_preferences_diag()
|
self.pref.load_preferences_diag()
|
||||||
if self.pref.run() == 1:
|
if self.pref.run() == 1:
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ def setup_dbus():
|
|||||||
|
|
||||||
class PreferencesDialog(object):
|
class PreferencesDialog(object):
|
||||||
""" Class for handling the wicd preferences dialog window. """
|
""" Class for handling the wicd preferences dialog window. """
|
||||||
def __init__(self, wTree, dbus):
|
def __init__(self, wTree):
|
||||||
setup_dbus()
|
setup_dbus()
|
||||||
self.wTree = wTree
|
self.wTree = wTree
|
||||||
self.prep_settings_diag()
|
self.prep_settings_diag()
|
||||||
|
|||||||
@@ -208,16 +208,13 @@ class BaseInterface(object):
|
|||||||
"""
|
"""
|
||||||
def get_client_name(cl):
|
def get_client_name(cl):
|
||||||
""" Converts the integer value for a dhcp client to a string. """
|
""" Converts the integer value for a dhcp client to a string. """
|
||||||
if (cl in [misc.DHCLIENT, "dhclient"] or
|
if self.dhclient_cmd and cl in [misc.DHCLIENT, misc.AUTO]:
|
||||||
(cl == misc.AUTO and self.dhclient_cmd)):
|
|
||||||
client = "dhclient"
|
client = "dhclient"
|
||||||
cmd = self.dhclient_cmd
|
cmd = self.dhclient_cmd
|
||||||
elif (cl in [misc.DHCPCD, "dhcpcd"] or
|
elif self.dhcpcd_cmd and cl in [misc.DHCPCD, misc.AUTO]:
|
||||||
(cl == misc.AUTO and self.dhcpcd_cmd)):
|
|
||||||
client = "dhcpcd"
|
client = "dhcpcd"
|
||||||
cmd = self.dhcpcd_cmd
|
cmd = self.dhcpcd_cmd
|
||||||
elif (cl in [misc.PUMP, "pump"] or
|
elif self.pump_cmd and cl in [misc.PUMP, misc.AUTO]:
|
||||||
(cl == misc.AUTO and self.pump_cmd)):
|
|
||||||
client = "pump"
|
client = "pump"
|
||||||
cmd = self.pump_cmd
|
cmd = self.pump_cmd
|
||||||
else:
|
else:
|
||||||
@@ -482,12 +479,12 @@ class BaseInterface(object):
|
|||||||
def FlushRoutes(self):
|
def FlushRoutes(self):
|
||||||
""" Flush all network routes. """
|
""" Flush all network routes. """
|
||||||
if not self.iface: return False
|
if not self.iface: return False
|
||||||
if self.route_cmd and self.flush_tool == misc.ROUTE:
|
if self.ip_cmd and self.flush_tool in [misc.AUTO, misc.IP]:
|
||||||
cmds = ['%s del default' % self.route_cmd]
|
|
||||||
cmds.append('route del dev %s' % self.iface)
|
|
||||||
elif self.ip_cmd:
|
|
||||||
#cmd = "ip route flush dev " + self.iface
|
#cmd = "ip route flush dev " + self.iface
|
||||||
cmds = ['%s route flush all' % self.ip_cmd]
|
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:
|
else:
|
||||||
print "No flush command available!"
|
print "No flush command available!"
|
||||||
cmds = []
|
cmds = []
|
||||||
|
|||||||
Reference in New Issue
Block a user