From b72f4b28034caba54f862ef79cda97c150491431 Mon Sep 17 00:00:00 2001 From: imdano <> Date: Fri, 11 Apr 2008 10:29:10 +0000 Subject: [PATCH] Fixed bug where advanced settings dialog wouldn't appear for wired networks. Added MAC address to the top level info line in a wireless network entry. Fixed some setup.py problems. --- gui.py | 8 +++++--- monitor.py | 1 + networking.py | 2 +- setup.py | 15 ++------------- wnettools.py | 13 +++++++------ 5 files changed, 16 insertions(+), 23 deletions(-) diff --git a/gui.py b/gui.py index d7548e2..9f578bc 100644 --- a/gui.py +++ b/gui.py @@ -258,6 +258,7 @@ class GreyLabel(gtk.Label): """ Creates a grey gtk.Label. """ def __init__(self): gtk.Label.__init__(self) + def set_label(self, text): self.set_markup("" + text + "") self.set_alignment(0, 0) @@ -773,7 +774,7 @@ class WiredNetworkEntry(NetworkEntry): # Show everything, but hide the profile help label. self.show_all() self.profile_help.hide() - self.advanced_dialog = AdvancedSettingsDialog() + self.advanced_dialog = WiredSettingsDialog() # Display the default profile if it exists. if self.profile_list is not None: @@ -952,8 +953,9 @@ class WirelessNetworkEntry(NetworkEntry): # The the expander label. self.expander.set_use_markup(True) self.expander.set_label(self.essid + " " + - self.lbl_encryption.get_label() + " " - + self.lbl_strength.get_label()) + self.lbl_strength.get_label() + " " + + self.lbl_encryption.get_label() + " " + + self.lbl_mac.get_label()) # Pack the network status HBox. self.hbox_status.pack_start(self.lbl_strength, True, True) diff --git a/monitor.py b/monitor.py index d817adc..d357d55 100755 --- a/monitor.py +++ b/monitor.py @@ -67,6 +67,7 @@ class ConnectionStatus(): self.reconnect_tries = 0 self.last_reconnect_time = time.time() self.signal_changed = False + # This determines if we use ioctl or external programs self.fast = True self.iwconfig = '' diff --git a/networking.py b/networking.py index de1b638..181956b 100644 --- a/networking.py +++ b/networking.py @@ -124,7 +124,7 @@ class Controller(object): debug = property(get_debug, set_debug) flush_tool = property(get_flush_tool, set_flush_tool) dhcp_client = property(get_dhcp_client, set_dhcp_client) - + class ConnectThread(threading.Thread): """ A class to perform network connections in a multi-threaded way. diff --git a/setup.py b/setup.py index 17c65d5..615280f 100755 --- a/setup.py +++ b/setup.py @@ -34,27 +34,16 @@ data=[ ('translations/zh_HK/LC_MESSAGES', ['translations/zh_HK/LC_MESSAGES/wicd.mo']), ('translations/fr_FR/LC_MESSAGES', ['translations/fr_FR/LC_MESSAGES/wicd.mo']), ('translations/ca_ES/LC_MESSAGES', ['translations/ca_ES/LC_MESSAGES/wicd.mo']), -('translations/ko_KR/LC_MESSAGES', ['translations/ko_KR/LC_MESSAGES/wicd.mo']), ('translations/gl_GL/LC_MESSAGES', ['translations/gl_GL/LC_MESSAGES/wicd.mo']), -('translations/no_NO/LC_MESSAGES', ['translations/no_NO/LC_MESSAGES/wicd.mo']), -('translations/bg_PHO/LC_MESSAGES', ['translations/bg_PHO/LC_MESSAGES/wicd.mo']), ('translations/po', [('translations/po/' + b) for b in os.listdir('translations/po') if not b.startswith('.')]), ('translations/sl_SI/LC_MESSAGES', ['translations/sl_SI/LC_MESSAGES/wicd.mo']), -('translations/da_DK/LC_MESSAGES', ['translations/da_DK/LC_MESSAGES/wicd.mo']), ('translations/ja_JA/LC_MESSAGES', ['translations/ja_JA/LC_MESSAGES/wicd.mo']), -('translations/zh_CN/LC_MESSAGES', ['translations/zh_CN/LC_MESSAGES/wicd.mo']), -('translations/ru_RU/LC_MESSAGES', ['translations/ru_RU/LC_MESSAGES/wicd.mo']), ('translations/it_IT/LC_MESSAGES', ['translations/it_IT/LC_MESSAGES/wicd.mo']), ('translations/es_ES/LC_MESSAGES', ['translations/es_ES/LC_MESSAGES/wicd.mo']), -('translations/pt_BR/LC_MESSAGES', ['translations/pt_BR/LC_MESSAGES/wicd.mo']), -('translations/cs_CZ/LC_MESSAGES', ['translations/cs_CZ/LC_MESSAGES/wicd.mo']), ('translations/sv_SE/LC_MESSAGES', ['translations/sv_SE/LC_MESSAGES/wicd.mo']), -('translations/ar_EG/LC_MESSAGES', ['translations/ar_EG/LC_MESSAGES/wicd.mo']), -('translations/tr_TR/LC_MESSAGES', ['translations/tr_TR/LC_MESSAGES/wicd.mo']), ('translations/en_US/LC_MESSAGES', ['translations/en_US/LC_MESSAGES/wicd.mo']), ('translations/fi_FI/LC_MESSAGES', ['translations/fi_FI/LC_MESSAGES/wicd.mo']), ('translations/pl_PL/LC_MESSAGES', ['translations/pl_PL/LC_MESSAGES/wicd.mo']), -('translations/hu_HU/LC_MESSAGES', ['translations/hu_HU/LC_MESSAGES/wicd.mo']), ('translations/nl_NL/LC_MESSAGES', ['translations/nl_NL/LC_MESSAGES/wicd.mo'])] if os.access('/etc/redhat-release', os.F_OK): data.append(('/etc/rc.d/init.d', ['other/initscripts/redhat/wicd'])) @@ -64,11 +53,11 @@ elif os.access('/etc/fedora-release', os.F_OK): data.append(('/etc/rc.d/init.d', ['other/initscripts/redhat/wicd'])) elif os.access('/etc/gentoo-release', os.F_OK): data.append(('/etc/init.d', ['other/initscripts/gentoo/wicd'])) -elif os.access('/etc/debian-release', os.F_OK): +elif os.access('/etc/debian_version', os.F_OK): data.append(('/etc/init.d', ['other/initscripts/debian/wicd'])) elif os.access('/etc/arch-release', os.F_OK): data.append(('/etc/rc.d', ['other/initscripts/arch/wicd'])) -elif os.access('/etc/slackware-release', os.F_OK): +elif os.access('/etc/slackware-version', os.F_OK): data.append(('/etc/rc.d', ['other/initscripts/slackware/wicd'])) diff --git a/wnettools.py b/wnettools.py index cad3372..f9ec8c6 100644 --- a/wnettools.py +++ b/wnettools.py @@ -723,7 +723,7 @@ class WirelessInterface(Interface): essid -- essid to set the interface to """ - cmd = ''.join(['iwconfig ', self.iface, ' essid "', essid, '"']) + cmd = 'iwconfig %s essid "%s"' % (self.iface, essid) if self.verbose: print cmd misc.Run(cmd) @@ -962,7 +962,7 @@ class WirelessInterface(Interface): """ if mode.lower() == 'master': mode = 'managed' - cmd = 'iwconfig ' + self.iface + ' mode ' + mode + cmd = 'iwconfig %s mode %s' % (self.iface, mode) if self.verbose: print cmd misc.Run(cmd) @@ -973,7 +973,7 @@ class WirelessInterface(Interface): channel -- channel to set the interface to """ - cmd = 'iwconfig ' + self.iface + ' channel ' + str(channel) + cmd = 'iwconfig %s channel %s' % (self.iface, str(channel)) if self.verbose: print cmd misc.Run(cmd) @@ -984,7 +984,7 @@ class WirelessInterface(Interface): key -- encryption key to set """ - cmd = 'iwconfig ' + self.iface + ' key ' + key + cmd = 'iwconfig %s key %s' % (self.iface, key) if self.verbose: print cmd misc.Run(cmd) @@ -997,7 +997,7 @@ class WirelessInterface(Interface): bssid -- bssid of the network """ - cmd = ''.join(['iwconfig ', self.iface, ' essid "', essid, '"']) + cmd = 'iwconfig %s essid "%s"' % (self.iface, essid) if channel: cmd = ''.join([cmd, ' channel ', str(channel)]) if bssid: @@ -1121,7 +1121,8 @@ class WirelessInterface(Interface): auth_mode = 'WPA2PSK' key_name = 'WPAPSK' else: - print 'Unknown AuthMode, can\'t complete connection process!' + print 'Unknown AuthMode, can\'t complete ' + \ + 'connection process!' return cmd_list = []