Added missing icon images
Updated dbus config file to work under more distros Added support for determing wireless interface by parsing /proc/net/wireless (removing need for iwconfig call) A few minor formatting improvements.
@@ -161,7 +161,8 @@ def main (argv):
|
|||||||
dialog = wTree.get_widget("configure_script_dialog")
|
dialog = wTree.get_widget("configure_script_dialog")
|
||||||
wTree.get_widget("pre_label").set_label(language['before_script'] + ":")
|
wTree.get_widget("pre_label").set_label(language['before_script'] + ":")
|
||||||
wTree.get_widget("post_label").set_label(language['after_script'] + ":")
|
wTree.get_widget("post_label").set_label(language['after_script'] + ":")
|
||||||
wTree.get_widget("disconnect_label").set_label(language['disconnect_script'] + ":")
|
wTree.get_widget("disconnect_label").set_label(language['disconnect_script']
|
||||||
|
+ ":")
|
||||||
wTree.get_widget("window1").hide()
|
wTree.get_widget("window1").hide()
|
||||||
|
|
||||||
pre_entry = wTree.get_widget("pre_entry")
|
pre_entry = wTree.get_widget("pre_entry")
|
||||||
|
|||||||
2
gui.py
@@ -182,7 +182,7 @@ language['running_dhcp'] = _('Obtaining IP address...')
|
|||||||
language['no_dhcp_offers'] = _('Connection Failed: No DHCP offers received. \
|
language['no_dhcp_offers'] = _('Connection Failed: No DHCP offers received. \
|
||||||
Couldn\'t get an IP Address.')
|
Couldn\'t get an IP Address.')
|
||||||
language['dhcp_failed'] = _('Connection Failed: Unable to Get IP Address')
|
language['dhcp_failed'] = _('Connection Failed: Unable to Get IP Address')
|
||||||
language['aborted'] = _('Connection cancelled')
|
language['aborted'] = _('Connection Cancelled')
|
||||||
language['bad_pass'] = _('Connection Failed: Bad password')
|
language['bad_pass'] = _('Connection Failed: Bad password')
|
||||||
language['done'] = _('Done connecting...')
|
language['done'] = _('Done connecting...')
|
||||||
|
|
||||||
|
|||||||
BIN
images/both-bad-signal-lock.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/both-bad-signal.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/both-good-signal-lock.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/both-good-signal.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/both-high-signal-lock.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/both-high-signal.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/both-low-signal-lock.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/both-low-signal.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/idle-bad-signal-lock.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/idle-bad-signal.png
Executable file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
images/idle-good-signal-lock.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/idle-good-signal.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/idle-high-signal-lock.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/idle-high-signal.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/idle-low-signal-lock.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/idle-low-signal.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/receiving-bad-signal-lock.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/receiving-bad-signal.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/receiving-good-signal-lock.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/receiving-good-signal.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/receiving-high-signal-lock.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/receiving-high-signal.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/receiving-low-signal-lock.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/receiving-low-signal.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/transmitting-bad-signal-lock.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/transmitting-bad-signal.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/transmitting-good-signal-lock.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/transmitting-good-signal.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/transmitting-high-signal-lock.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/transmitting-high-signal.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/transmitting-low-signal-lock.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/transmitting-low-signal.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
@@ -241,7 +241,7 @@ class ConnectionStatus():
|
|||||||
# If we just lost a wireless connection, try to connect to that
|
# If we just lost a wireless connection, try to connect to that
|
||||||
# network again. Otherwise just call Autoconnect.
|
# network again. Otherwise just call Autoconnect.
|
||||||
cur_net_id = wireless.GetCurrentNetworkID(self.iwconfig)
|
cur_net_id = wireless.GetCurrentNetworkID(self.iwconfig)
|
||||||
if from_wireless and cur_net_id > -1: # Needs to be a valid network
|
if from_wireless and cur_net_id > -1:
|
||||||
print 'Trying to reconnect to last used wireless ' + \
|
print 'Trying to reconnect to last used wireless ' + \
|
||||||
'network'
|
'network'
|
||||||
wireless.ConnectWireless(cur_net_id)
|
wireless.ConnectWireless(cur_net_id)
|
||||||
|
|||||||
@@ -1,17 +1,19 @@
|
|||||||
<!-- This configuration file specifies the required security policies
|
<!-- /etc/dbus-1/system.d/wicd.conf -->
|
||||||
for connection-manager to work. -->
|
|
||||||
|
|
||||||
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||||
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||||
<busconfig>
|
<busconfig>
|
||||||
|
<policy user="root">
|
||||||
<!-- ../system.conf have denied everything, so we just punch some holes -->
|
<allow own="org.wicd.daemon"/>
|
||||||
|
<allow send_destination="org.wicd.daemon"/>
|
||||||
<policy context="default">
|
<allow send_interface="org.wicd.daemon"/>
|
||||||
<allow own="org.wicd.daemon"/>
|
</policy>
|
||||||
|
<policy at_console="true">
|
||||||
<allow send_destination="org.wicd.daemon"/>
|
<allow send_destination="org.wicd.daemon"/>
|
||||||
<allow receive_sender="org.wicd.daemon"/>
|
<allow send_interface="org.wicd.daemon"/>
|
||||||
</policy>
|
</policy>
|
||||||
|
<policy context="default">
|
||||||
|
<allow own="org.wicd.daemon"/>
|
||||||
|
<allow send_destination="org.wicd.daemon"/>
|
||||||
|
<allow send_interface="org.wicd.daemon"/>
|
||||||
|
</policy>
|
||||||
</busconfig>
|
</busconfig>
|
||||||
|
|||||||
29
wnettools.py
@@ -105,13 +105,37 @@ def StopDHCP():
|
|||||||
def GetWirelessInterfaces():
|
def GetWirelessInterfaces():
|
||||||
""" Get available wireless interfaces.
|
""" Get available wireless interfaces.
|
||||||
|
|
||||||
|
Attempts to get an interface first by parsing /proc/net/wireless,
|
||||||
|
and should that fail, by parsing iwconfig.
|
||||||
Returns:
|
Returns:
|
||||||
The first interface available.
|
The first interface available.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
output = misc.Run('iwconfig')
|
iface = _fast_get_wifi_interfaces()
|
||||||
return misc.RunRegex(re.compile('(\w*)\s*\w*\s*[a-zA-Z0-9.-_]*\s*(?=ESSID)',
|
if not iface:
|
||||||
|
output = misc.Run('iwconfig')
|
||||||
|
iface = misc.RunRegex(re.compile('(\w*)\s*\w*\s*[a-zA-Z0-9.-_]*\s*(?=ESSID)',
|
||||||
re.I | re.M | re.S), output)
|
re.I | re.M | re.S), output)
|
||||||
|
return iface
|
||||||
|
|
||||||
|
def _fast_get_wifi_interfaces():
|
||||||
|
""" Tries to get a wireless interface by parsing /proc/net/wireless. """
|
||||||
|
device = re.compile('[a-z]{3,4}[0-9]')
|
||||||
|
ifnames = []
|
||||||
|
|
||||||
|
f = open('/proc/net/wireless', 'r')
|
||||||
|
data = f.readlines()
|
||||||
|
f.close()
|
||||||
|
for line in data:
|
||||||
|
try:
|
||||||
|
ifnames.append(device.search(line).group())
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
if ifnames:
|
||||||
|
return ifnames[0]
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
class Interface(object):
|
class Interface(object):
|
||||||
""" Control a network interface. """
|
""" Control a network interface. """
|
||||||
@@ -944,7 +968,6 @@ class WirelessInterface(Interface):
|
|||||||
cmd_list.append(key_name + '=' + network.get('key'))
|
cmd_list.append(key_name + '=' + network.get('key'))
|
||||||
if info[5] == 'SHARED' and info[4] == 'WEP':
|
if info[5] == 'SHARED' and info[4] == 'WEP':
|
||||||
cmd_list.append('DefaultKeyID=1')
|
cmd_list.append('DefaultKeyID=1')
|
||||||
#TODO: Confirm whether this second SSID set is required.
|
|
||||||
cmd_list.append('SSID=' + info[2])
|
cmd_list.append('SSID=' + info[2])
|
||||||
|
|
||||||
for cmd in cmd_list:
|
for cmd in cmd_list:
|
||||||
|
|||||||