diff --git a/data/wicd.glade b/data/wicd.glade index 4a5cf77..dd69932 100644 --- a/data/wicd.glade +++ b/data/wicd.glade @@ -1,6 +1,6 @@ - + 450 @@ -429,15 +429,17 @@ 4 4 - + True - 24 - + True True - If enabled, the wired network interface will always be displayed in the main window. This can be useful if your wired network card does not detect when the interface is connected to a cable. - Always show wired interface + True + If selected, wicd will automatically connect to a wired network +as soon as a cable is plugged in, even if a wireless connection +is already active. + Always switch to a wired connection when available 0 True @@ -445,73 +447,52 @@ 2 - 3 - 4 + 4 + 5 + + 24 + + + + + True + 24 + + + True + 0 + DNS domain: + + + + + 7 + 8 - + True True 1 2 - 8 - 9 - + 7 + 8 + GTK_FILL - - True - True - - - 1 - 2 - 9 - 10 - - - - - - True - True - - - 1 - 2 - 10 - 11 - - - - - - True - 0 - <b>Global DNS Servers</b> - True - - - 2 - 5 - 6 - - - - - + True 12 - + True True - Use global DNS servers + Automatically reconnect on network connection loss 0 True @@ -519,204 +500,44 @@ 2 - 6 - 7 + 17 + 18 - - True - 24 - - - True - 0 - Search domain: - - - - - 8 - 9 - - - - - - True - 24 - - - True - 0 - DNS server 1: - - - - - 9 - 10 - - - - - - True - 24 - - - True - 0 - DNS server 2: - - - - - 10 - 11 - - - - - - True - True - - - 1 - 2 - 11 - 12 - - - - - - True - 24 - - - True - 0 - DNS server 3: - - - - - 11 - 12 - - - - - + True 0 - <b>Network Interfaces</b> + <b>Automatic Reconnection</b> True 2 + 16 + 17 - - True - True - - - 1 - 2 - 1 - 2 - - - - - - True - True - - - 1 - 2 - 2 - 3 - - - - - + True 12 - - True - 0 - Wireless interface: - - - - - 1 - 2 - - - - - - True - 12 - - - True - 0 - Wired interface: - - - - - 2 - 3 - - - - - - True - 0 - <b>Wired automatic connection</b> - True - - - 2 - 12 - 13 - - - - - - True - 12 - - + True True - Use default wired network profile + Use last wired network profile 0 True True - pref_use_last_radio 2 - 13 - 14 + 15 + 16 @@ -744,105 +565,210 @@ - + True 12 - + True True - Use last wired network profile + Use default wired network profile 0 True True + pref_use_last_radio 2 - 15 - 16 + 13 + 14 - + True 0 - <b>Automatic Reconnection</b> + <b>Wired automatic connection</b> True 2 - 16 - 17 + 12 + 13 - + True 12 - + True - True - Automatically reconnect on network connection loss - 0 - True + 0 + Wired interface: - 2 - 17 - 18 + 2 + 3 - + + True + 12 + + + True + 0 + Wireless interface: + + + + + 1 + 2 + + + + + True True 1 2 - 7 - 8 - GTK_FILL - - - - - True - 24 - - - True - 0 - DNS domain: - - - - - 7 - 8 + 2 + 3 - + True + True + + + 1 + 2 + 1 + 2 + + + + + + True + 0 + <b>Network Interfaces</b> + True + + + 2 + + + + + + True + 24 - + + True + 0 + DNS server 3: + + + + + 11 + 12 + + + + + + True + True + + + 1 + 2 + 11 + 12 + + + + + + True + 24 + + + True + 0 + DNS server 2: + + + + + 10 + 11 + + + + + + True + 24 + + + True + 0 + DNS server 1: + + + + + 9 + 10 + + + + + + True + 24 + + + True + 0 + Search domain: + + + + + 8 + 9 + + + + + + True + 12 + + True True - True - If selected, wicd will automatically connect to a wired network -as soon as a cable is plugged in, even if a wireless connection -is already active. - Always switch to a wired connection when available + Use global DNS servers 0 True @@ -850,9 +776,84 @@ is already active. 2 - 4 - 5 - 24 + 6 + 7 + + + + + + True + 0 + <b>Global DNS Servers</b> + True + + + 2 + 5 + 6 + + + + + + True + True + + + 1 + 2 + 10 + 11 + + + + + + True + True + + + 1 + 2 + 9 + 10 + + + + + + True + True + + + 1 + 2 + 8 + 9 + + + + + + True + 24 + + + True + True + If enabled, the wired network interface will always be displayed in the main window. This can be useful if your wired network card does not detect when the interface is connected to a cable. + Always show wired interface + 0 + True + + + + + 2 + 3 + 4 + @@ -896,13 +897,146 @@ is already active. True 6 - + True 0 - <b>DHCP Client</b> + <b>Route Table Flushing</b> True + 4 + 5 + + + + + + True + 0 + <b>Wired Link Detection</b> + True + + + 2 + 3 + + + + + + True + 12 + + + True + + + True + True + Automatic (recommended) + 0 + True + True + + + False + + + + + True + True + ip + 0 + True + True + flush_auto_radio + + + False + 1 + + + + + True + True + route + 0 + True + True + flush_auto_radio + + + False + 2 + + + + + + + 5 + 6 + + + + + + True + 12 + + + True + + + True + True + Automatic (recommended) + 0 + True + True + + + False + + + + + True + True + ethtool + 0 + True + True + link_auto_radio + + + False + 1 + + + + + True + True + mii-tool + 0 + True + True + link_auto_radio + + + False + 2 + + + + + + + 3 + 4 @@ -981,146 +1115,13 @@ is already active. - - True - 12 - - - True - - - True - True - Automatic (recommended) - 0 - True - True - - - False - - - - - True - True - ethtool - 0 - True - True - link_auto_radio - - - False - 1 - - - - - True - True - mii-tool - 0 - True - True - link_auto_radio - - - False - 2 - - - - - - - 3 - 4 - - - - - - True - 12 - - - True - - - True - True - Automatic (recommended) - 0 - True - True - - - False - - - - - True - True - ip - 0 - True - True - flush_auto_radio - - - False - 1 - - - - - True - True - route - 0 - True - True - flush_auto_radio - - - False - 2 - - - - - - - 5 - 6 - - - - - + True 0 - <b>Wired Link Detection</b> + <b>DHCP Client</b> True - 2 - 3 - - - - - - True - 0 - <b>Route Table Flushing</b> - True - - - 4 - 5 @@ -1159,135 +1160,67 @@ is already active. 10 2 - - True - - - 5 - 6 - GTK_FILL - - - - - + True 0 - You should almost always use wext as the -WPA supplicant driver. + Hover your mouse over the selected backend +to read its description. True 1 2 - 2 - 3 + 5 + 6 - + True - 0 - <b>Backend</b> - True - - - 2 - 3 - 4 - - - - - - True - True + + + True + + + False + + 1 2 - 4 - 5 + 1 + 2 - + + True + + + 2 + 3 + GTK_FILL + + + + + True 12 - + True 0 - Backend: + Driver: - 4 - 5 - - - - - - True - 0 - <b>Debugging</b> - True - - - 2 - 6 - 7 - - - - - - True - 0 - <b>WPA Supplicant</b> - True - - - 2 - - - - - - True - 0 - <b>Wireless Interface</b> - True - - - 2 - 8 - 9 - - - - - - True - 12 - - - True - True - Enable debug mode - 0 - True - - - - - 2 - 7 - 8 + 1 + 2 @@ -1313,67 +1246,135 @@ WPA supplicant driver. - + True 12 - + + True + True + Enable debug mode + 0 + True + + + + + 2 + 7 + 8 + + + + + + True + 0 + <b>Wireless Interface</b> + True + + + 2 + 8 + 9 + + + + + + True + 0 + <b>WPA Supplicant</b> + True + + + 2 + + + + + + True + 0 + <b>Debugging</b> + True + + + 2 + 6 + 7 + + + + + + True + 12 + + True 0 - Driver: + Backend: - 1 - 2 + 4 + 5 - + True - - - 2 - 3 - GTK_FILL - - - - - - True - - - True - - - False - - + True 1 2 - 1 - 2 + 4 + 5 - + True 0 - Hover your mouse over the selected backend -to read its description. + <b>Backend</b> + True + + + 2 + 3 + 4 + + + + + + True + 0 + You should almost always use wext as the +WPA supplicant driver. True 1 2 + 2 + 3 + + + + + + True + + 5 6 + GTK_FILL diff --git a/wicd/misc.py b/wicd/misc.py index 30b473a..3244c5a 100644 --- a/wicd/misc.py +++ b/wicd/misc.py @@ -536,10 +536,13 @@ def get_language_list_gui(): language['bad_pass'] = _('Connection Failed: Could not authenticate (bad password?)') language['done'] = _('Done connecting...') language['scanning'] = _('Scanning') + language['scanning_stand_by'] = _('Scanning networks... stand by...') language['cannot_start_daemon'] = _("Unable to connect to wicd daemon DBus interface. " + \ "This typically means there was a problem starting the daemon. " + \ "Check the wicd log for more info") language['lost_dbus'] = _("The wicd daemon has shut down, the UI will not function properly until it is restarted.") + language['configuring_wireless'] = ("Configuring preferences for wireless network \"$A\" ($B)") + language['configuring_wired'] = ("Configuring preferences for wired profile \"$A\"") return language diff --git a/wicd/netentry.py b/wicd/netentry.py index 8f36f13..0616e5b 100644 --- a/wicd/netentry.py +++ b/wicd/netentry.py @@ -551,21 +551,7 @@ class WiredNetworkEntry(NetworkEntry): self.button_delete = gtk.Button(stock=gtk.STOCK_DELETE) self.profile_help = gtk.Label(language['wired_network_instructions']) self.chkbox_default_profile = gtk.CheckButton(language['default_wired']) - - # Build the profile list. self.combo_profile_names = gtk.combo_box_new_text() - self.profile_list = wired.GetWiredProfileList() - default_prof = wired.GetDefaultWiredNetwork() - if self.profile_list: - starting_index = 0 - for x, prof in enumerate(self.profile_list): - self.combo_profile_names.append_text(prof) - if default_prof == prof: - starting_index = x - self.combo_profile_names.set_active(starting_index) - else: - print "no wired profiles found" - self.profile_help.show() # Format the profile help label. self.profile_help.set_justify(gtk.JUSTIFY_LEFT) @@ -588,11 +574,26 @@ class WiredNetworkEntry(NetworkEntry): self.chkbox_default_profile.connect("toggled", self.toggle_default_profile) self.combo_profile_names.connect("changed", self.change_profile) + + # Build profile list. + self.profile_list = wired.GetWiredProfileList() + default_prof = wired.GetDefaultWiredNetwork() + if self.profile_list: + starting_index = 0 + for x, prof in enumerate(self.profile_list): + self.combo_profile_names.append_text(prof) + if default_prof == prof: + starting_index = x + self.combo_profile_names.set_active(starting_index) + else: + print "no wired profiles found" + self.profile_help.show() + + self.advanced_dialog = WiredSettingsDialog(self.combo_profile_names.get_active_text()) # Show everything, but hide the profile help label. self.show_all() self.profile_help.hide() - self.advanced_dialog = WiredSettingsDialog(self.combo_profile_names.get_active_text()) # Toggle the default profile checkbox to the correct state. if to_bool(wired.GetWiredProperty("default")): @@ -700,17 +701,12 @@ class WiredNetworkEntry(NetworkEntry): return profile_name = self.combo_profile_names.get_active_text() - self.advanced_dialog.prof_name = profile_name wired.ReadWiredNetworkProfile(profile_name) - self.advanced_dialog.txt_ip.set_text(self.format_entry("ip")) - self.advanced_dialog.txt_netmask.set_text(self.format_entry("netmask")) - self.advanced_dialog.txt_gateway.set_text(self.format_entry("gateway")) - self.advanced_dialog.txt_dns_1.set_text(self.format_entry("dns1")) - self.advanced_dialog.txt_dns_2.set_text(self.format_entry("dns2")) - self.advanced_dialog.txt_dns_3.set_text(self.format_entry("dns3")) - self.advanced_dialog.prof_name = profile_name - + if hasattr(self, 'advanced_dialog'): + self.advanced_dialog.prof_name = profile_name + self.advanced_dialog.set_values() + is_default = wired.GetWiredProperty("default") self.chkbox_default_profile.set_active(to_bool(is_default)) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index b751965..dc14add 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -44,6 +44,7 @@ import os import pango import time import atexit +from dbus import DBusException # Wicd specific imports from wicd import wpath diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 40e80ea..9314df4 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -1147,7 +1147,7 @@ class WirelessDaemon(dbus.service.Object): # Read the essid because we need to name those hidden # wireless networks now - but only read it if it is hidden. if cur_network["hidden"]: - cur_network["essid"] = config.get(section, x) + cur_network["essid"] = self.config.get(section, "essid") if cur_network["essid"] in ["", "Hidden", ""]: cur_network["essid"] = "" for x in self.config.options(section): @@ -1416,8 +1416,9 @@ class WiredDaemon(dbus.service.Object): if self.config.has_section(profilename): return False - for option in ["ip", "broadcast", "netmask","gateway", "dns1", "dns2", - "dns3", "beforescript", "afterscript", "disconnectscript"]: + for option in ["ip", "broadcast", "netmask","gateway", "search_domain", + "dns_domain", "dns1", "dns2", "dns3", "beforescript", + "afterscript", "disconnectscript"]: self.config.set(profilename, option, None) self.config.set(profilename, "default", default) self.config.write() @@ -1428,29 +1429,24 @@ class WiredDaemon(dbus.service.Object): """ Finds the previous lastused network, and sets lastused to False. """ profileList = self.config.sections() for profile in profileList: - if self.config.has_option(profile, "lastused"): - if misc.to_bool(self.config.get(profile, "lastused")): - self.config.set(profile, "lastused", False) - self.SaveWiredNetworkProfile(profile) + if misc.to_bool(self.config.get(profile, "lastused")): + self.config.set(profile, "lastused", False, write=True) @dbus.service.method('org.wicd.daemon.wired') def UnsetWiredDefault(self): """ Unsets the default option in the current default wired profile. """ profileList = self.config.sections() for profile in profileList: - if self.config.has_option(profile, "default"): - if misc.to_bool(self.config.get(profile, "default")): - self.config.set(profile, "default", False) - self.SaveWiredNetworkProfile(profile) + if misc.to_bool(self.config.get(profile, "default")): + self.config.set(profile, "default", False, write=True) @dbus.service.method('org.wicd.daemon.wired') def GetDefaultWiredNetwork(self): """ Returns the current default wired network. """ profileList = self.config.sections() for profile in profileList: - if self.config.has_option(profile, "default"): - if misc.to_bool(self.config.get(profile, "default")): - return profile + if misc.to_bool(self.config.get(profile, "default")): + return profile return None @dbus.service.method('org.wicd.daemon.wired') @@ -1458,9 +1454,8 @@ class WiredDaemon(dbus.service.Object): """ Returns the profile of the last used wired network. """ profileList = self.config.sections() for profile in profileList: - if self.config.has_option(profile, "lastused"): - if misc.to_bool(self.config.get(profile, "lastused")): - return profile + if misc.to_bool(self.config.get(profile, "lastused")): + return profile return None @dbus.service.method('org.wicd.daemon.wired') @@ -1481,6 +1476,8 @@ class WiredDaemon(dbus.service.Object): if profilename == "": self.config.write() return "500: Bad Profile name" + if self.debug_mode: + print "saving wired profile %s" % profilename profilename = misc.to_unicode(profilename) self.config.remove_section(profilename) self.config.add_section(profilename) @@ -1499,6 +1496,8 @@ class WiredDaemon(dbus.service.Object): profile = {} profilename = misc.to_unicode(profilename) if self.config.has_section(profilename): + if self.debug_mode: + print "Reading wired profile %s" % profilename for x in self.config.options(profilename): profile[x] = misc.Noneify(self.config.get(profilename, x)) profile['use_global_dns'] = bool(profile.get('use_global_dns'))