mirror of
https://github.com/gryf/wicd.git
synced 2025-12-19 20:38:00 +01:00
Added support for using one set of global settings for all networks with a given essid.
Fixed a few wired autoconnect issues.
This commit is contained in:
121
daemon.py
121
daemon.py
@@ -367,17 +367,17 @@ class ConnectionWizard(dbus.service.Object):
|
|||||||
if self.GetWiredAutoConnectMethod() == 2 and \
|
if self.GetWiredAutoConnectMethod() == 2 and \
|
||||||
not self.GetNeedWiredProfileChooser():
|
not self.GetNeedWiredProfileChooser():
|
||||||
self.LaunchChooser()
|
self.LaunchChooser()
|
||||||
|
return
|
||||||
elif self.GetWiredAutoConnectMethod() == 1:
|
elif self.GetWiredAutoConnectMethod() == 1:
|
||||||
network = self.GetDefaultWiredNetwork()
|
network = self.GetDefaultWiredNetwork()
|
||||||
if not network:
|
if not network:
|
||||||
print "Couldn't find a default wired connection, wired \
|
print "Couldn't find a default wired connection, wired autoconnect failed."
|
||||||
autoconnect failed."
|
|
||||||
self._wireless_autoconnect()
|
self._wireless_autoconnect()
|
||||||
|
return
|
||||||
else: # Assume its last-used.
|
else: # Assume its last-used.
|
||||||
network = self.GetLastUsedWiredNetwork()
|
network = self.GetLastUsedWiredNetwork()
|
||||||
if not network:
|
if not network:
|
||||||
print "no previous wired profile available, wired autoconnect \
|
print "no previous wired profile available, wired autoconnect failed."
|
||||||
failed."
|
|
||||||
self._wireless_autoconnect()
|
self._wireless_autoconnect()
|
||||||
return
|
return
|
||||||
self.ReadWiredNetworkProfile(network)
|
self.ReadWiredNetworkProfile(network)
|
||||||
@@ -551,6 +551,7 @@ class ConnectionWizard(dbus.service.Object):
|
|||||||
info[1] = essid
|
info[1] = essid
|
||||||
info[2] = signal strength
|
info[2] = signal strength
|
||||||
info[3] = internal networkid
|
info[3] = internal networkid
|
||||||
|
SUSPENDED - info[0] = ""
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@@ -983,7 +984,7 @@ class ConnectionWizard(dbus.service.Object):
|
|||||||
profileList = config.sections()
|
profileList = config.sections()
|
||||||
for profile in profileList:
|
for profile in profileList:
|
||||||
if config.has_option(profile, "default"):
|
if config.has_option(profile, "default"):
|
||||||
if config.get(profile, "default") == "True":
|
if misc.to_bool(config.get(profile, "default")):
|
||||||
print "removing existing default", profile
|
print "removing existing default", profile
|
||||||
config.set(profile, "default", False)
|
config.set(profile, "default", False)
|
||||||
self.SaveWiredNetworkProfile(profile)
|
self.SaveWiredNetworkProfile(profile)
|
||||||
@@ -996,7 +997,7 @@ class ConnectionWizard(dbus.service.Object):
|
|||||||
profileList = config.sections()
|
profileList = config.sections()
|
||||||
for profile in profileList:
|
for profile in profileList:
|
||||||
if config.has_option(profile, "default"):
|
if config.has_option(profile, "default"):
|
||||||
if config.get(profile, "default") == "True":
|
if misc.to_bool(config.get(profile, "default")):
|
||||||
return profile
|
return profile
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@@ -1078,58 +1079,98 @@ class ConnectionWizard(dbus.service.Object):
|
|||||||
print "setting network profile"
|
print "setting network profile"
|
||||||
config = ConfigParser.ConfigParser()
|
config = ConfigParser.ConfigParser()
|
||||||
config.read(self.wireless_conf)
|
config.read(self.wireless_conf)
|
||||||
if config.has_section(self.LastScan[id]["bssid"]):
|
cur_network = self.LastScan[id]
|
||||||
config.remove_section(self.LastScan[id]["bssid"])
|
bssid_key = cur_network["bssid"]
|
||||||
config.add_section(self.LastScan[id]["bssid"])
|
essid_key = "essid:" + cur_network["essid"]
|
||||||
#add the essid so that people reading the config can figure
|
|
||||||
#out which network is which. it will not be read
|
if config.has_section(bssid_key):
|
||||||
for x in self.LastScan[id]:
|
config.remove_section(bssid_key)
|
||||||
config.set(self.LastScan[id]["bssid"], x, self.LastScan[id][x])
|
config.add_section(bssid_key)
|
||||||
|
|
||||||
|
# We want to write the essid and bssid sections if global
|
||||||
|
# settings are enabled.
|
||||||
|
if cur_network["use_settings_globally"]:
|
||||||
|
if config.has_section(essid_key):
|
||||||
|
config.remove_section(essid_key)
|
||||||
|
config.add_section(essid_key)
|
||||||
|
|
||||||
|
for x in cur_network:
|
||||||
|
config.set(bssid_key, x, cur_network[x])
|
||||||
|
if cur_network["use_settings_globally"]:
|
||||||
|
config.set(essid_key, x, cur_network[x])
|
||||||
|
|
||||||
config.write(open(self.wireless_conf, "w"))
|
config.write(open(self.wireless_conf, "w"))
|
||||||
|
|
||||||
@dbus.service.method('org.wicd.daemon.config')
|
@dbus.service.method('org.wicd.daemon.config')
|
||||||
def SaveWirelessNetworkProperty(self, id, option):
|
def SaveWirelessNetworkProperty(self, id, option):
|
||||||
""" Writes a particular wireless property to disk """
|
""" Writes a particular wireless property to disk """
|
||||||
if (option.strip()).endswith("script"):
|
if (option.strip()).endswith("script"):
|
||||||
print 'you cannot save script information to disk through the daemon.'
|
print 'you cannot save script information to disk through \
|
||||||
|
the daemon.'
|
||||||
return
|
return
|
||||||
|
cur_network = self.LastScan[id]
|
||||||
print ("setting network option " + str(option) + " to " +
|
essid_key = "essid:" + cur_network["essid"]
|
||||||
str(self.LastScan[id][option]))
|
print ''.join("setting network option ", str(option), " to ",
|
||||||
|
str(cur_network[option]))
|
||||||
config = ConfigParser.ConfigParser()
|
config = ConfigParser.ConfigParser()
|
||||||
config.read(self.wireless_conf)
|
config.read(self.wireless_conf)
|
||||||
if config.has_section(self.LastScan[id]["bssid"]):
|
|
||||||
config.set(self.LastScan[id]["bssid"], option,
|
if config.has_section(cur_network["bssid"]):
|
||||||
str(self.LastScan[id][option]))
|
config.set(cur_network["bssid"], option,
|
||||||
|
str(cur_network[option]))
|
||||||
|
|
||||||
|
# Write the global section as well, if required.
|
||||||
|
if config.has_section(essid_key):
|
||||||
|
if config.get(essid_key, 'use_settings_globally'):
|
||||||
|
config.set(essid_key, option, str(cur_network[option]))
|
||||||
|
|
||||||
config.write(open(self.wireless_conf, "w"))
|
config.write(open(self.wireless_conf, "w"))
|
||||||
|
|
||||||
|
@dbus.service.method('org.wicd.daemon.config')
|
||||||
|
def RemoveGlobalEssidEntry(self, networkid):
|
||||||
|
""" Removes the global entry for the networkid provided. """
|
||||||
|
config = ConfigParser.ConfigParser()
|
||||||
|
config.read(self.wireless_conf)
|
||||||
|
cur_network = self.LastScan[networkid]
|
||||||
|
essid_key = "essid:" + cur_network["essid"]
|
||||||
|
if config.has_section(essid_key):
|
||||||
|
config.remove_section(essid_key)
|
||||||
|
|
||||||
@dbus.service.method('org.wicd.daemon.config')
|
@dbus.service.method('org.wicd.daemon.config')
|
||||||
def ReadWirelessNetworkProfile(self, id):
|
def ReadWirelessNetworkProfile(self, id):
|
||||||
""" Reads in wireless profile as the active network """
|
""" Reads in wireless profile as the active network """
|
||||||
config = ConfigParser.ConfigParser()
|
config = ConfigParser.ConfigParser()
|
||||||
config.read(self.wireless_conf)
|
config.read(self.wireless_conf)
|
||||||
print self.LastScan[id]["bssid"]
|
cur_network = self.LastScan[id]
|
||||||
if config.has_section(self.LastScan[id]["bssid"]):
|
essid_key = "essid:" + cur_network["essid"]
|
||||||
self.LastScan[id]["has_profile"] = True
|
bssid_key = cur_network["bssid"]
|
||||||
|
print bssid_key
|
||||||
# Read the essid because we be needing to name those hidden
|
if config.has_section(essid_key):
|
||||||
# wireless networks now - but only read it if it is hidden.
|
if config.get(essid_key, 'use_settings_globally'):
|
||||||
if self.LastScan[id]["hidden"]:
|
return self._read_wireless_profile(config, cur_network,
|
||||||
self.LastScan[id]["essid"] = misc.Noneify(config.get(self.LastScan[id]["bssid"],
|
essid_key)
|
||||||
"essid"))
|
elif config.has_section(bssid_key):
|
||||||
for x in config.options(self.LastScan[id]["bssid"]):
|
return self._read_wireless_profile(config, cur_network, bssid_key)
|
||||||
if not self.LastScan[id].has_key(x) or x.endswith("script"):
|
|
||||||
self.LastScan[id][x] = misc.Noneify(config.get(self.LastScan[id]["bssid"], x))
|
|
||||||
self.LastScan[id]['use_static_dns'] = bool(self.LastScan[id].get('use_static_dns'))
|
|
||||||
self.LastScan[id]['use_global_dns'] = bool(self.LastScan[id].get('use_global_dns'))
|
|
||||||
self.LastScan[id]['encryption'] = bool(self.LastScan[id].get('encryption'))
|
|
||||||
return "100: Loaded Profile"
|
|
||||||
else:
|
else:
|
||||||
self.LastScan[id]["has_profile"] = False
|
cur_network["has_profile"] = False
|
||||||
# Are these next two lines needed? -Dan
|
|
||||||
self.LastScan[id]['use_static_dns'] = bool(self.GetUseGlobalDNS())
|
|
||||||
self.LastScan[id]['use_global_dns'] = bool(self.GetUseGlobalDNS())
|
|
||||||
return "500: Profile Not Found"
|
return "500: Profile Not Found"
|
||||||
|
|
||||||
|
def _read_wireless_profile(self, config, cur_network, section):
|
||||||
|
cur_network["has_profile"] = True
|
||||||
|
|
||||||
|
# Read the essid because we be needing to name those hidden
|
||||||
|
# wireless networks now - but only read it if it is hidden.
|
||||||
|
if cur_network["hidden"]:
|
||||||
|
cur_network["essid"] = misc.Noneify(config.get(section,
|
||||||
|
"essid"))
|
||||||
|
for x in config.options(section):
|
||||||
|
if not cur_network.has_key(x) or x.endswith("script"):
|
||||||
|
cur_network[x] = misc.Noneify(config.get(section,
|
||||||
|
x))
|
||||||
|
for option in ['use_static_dns', 'use_global_dns', 'encryption',
|
||||||
|
'use_settings_globally']:
|
||||||
|
cur_network[option] = bool(cur_network.get(option))
|
||||||
|
return "100: Loaded Profile"
|
||||||
|
|
||||||
@dbus.service.method('org.wicd.daemon.config')
|
@dbus.service.method('org.wicd.daemon.config')
|
||||||
def WriteWindowSize(self, width, height):
|
def WriteWindowSize(self, width, height):
|
||||||
|
|||||||
116
gui.py
116
gui.py
@@ -147,6 +147,7 @@ language['stop_showing_chooser'] = _('Stop Showing Autoconnect pop-up temporaril
|
|||||||
language['display_type_dialog'] = _('Use dBm to measure signal strength')
|
language['display_type_dialog'] = _('Use dBm to measure signal strength')
|
||||||
language['scripts'] = _('Scripts')
|
language['scripts'] = _('Scripts')
|
||||||
language['invalid_address'] = _('Invalid address in $A entry.')
|
language['invalid_address'] = _('Invalid address in $A entry.')
|
||||||
|
language['global_settings'] = _('Use these settings for all networks sharing this essid')
|
||||||
language['encrypt_info_missing'] = _('Required encryption information is missing.')
|
language['encrypt_info_missing'] = _('Required encryption information is missing.')
|
||||||
language['enable_encryption'] = _('This network requires encryption to be enabled.')
|
language['enable_encryption'] = _('This network requires encryption to be enabled.')
|
||||||
|
|
||||||
@@ -453,6 +454,9 @@ class WiredSettingsDialog(AdvancedSettingsDialog):
|
|||||||
AdvancedSettingsDialog.__init__(self)
|
AdvancedSettingsDialog.__init__(self)
|
||||||
self.des = self.connect("destroy", self.destroy_called)
|
self.des = self.connect("destroy", self.destroy_called)
|
||||||
|
|
||||||
|
def set_net_prop(self, option, value):
|
||||||
|
wired.SetWiredProperty(option, value)
|
||||||
|
|
||||||
def set_values(self):
|
def set_values(self):
|
||||||
""" Fill in the Gtk.Entry objects with the correct values. """
|
""" Fill in the Gtk.Entry objects with the correct values. """
|
||||||
self.txt_ip.set_text(self.format_entry("ip"))
|
self.txt_ip.set_text(self.format_entry("ip"))
|
||||||
@@ -496,6 +500,7 @@ class WirelessSettingsDialog(AdvancedSettingsDialog):
|
|||||||
self.networkID = networkID
|
self.networkID = networkID
|
||||||
self.combo_encryption = gtk.combo_box_new_text()
|
self.combo_encryption = gtk.combo_box_new_text()
|
||||||
self.chkbox_encryption = gtk.CheckButton(language['use_encryption'])
|
self.chkbox_encryption = gtk.CheckButton(language['use_encryption'])
|
||||||
|
self.chkbox_global_settings = gtk.CheckButton(language['global_settings'])
|
||||||
# Make the vbox to hold the encryption stuff.
|
# Make the vbox to hold the encryption stuff.
|
||||||
self.vbox_encrypt_info = gtk.VBox(False, 0)
|
self.vbox_encrypt_info = gtk.VBox(False, 0)
|
||||||
self.toggle_encryption()
|
self.toggle_encryption()
|
||||||
@@ -518,8 +523,8 @@ class WirelessSettingsDialog(AdvancedSettingsDialog):
|
|||||||
else:
|
else:
|
||||||
self.combo_encryption.set_active(0)
|
self.combo_encryption.set_active(0)
|
||||||
self.change_encrypt_method()
|
self.change_encrypt_method()
|
||||||
self.vbox.pack_start(self.chkbox_encryption, fill=False,
|
self.vbox.pack_start(self.chkbox_global_settings, False, False)
|
||||||
expand=False)
|
self.vbox.pack_start(self.chkbox_encryption, False, False)
|
||||||
self.vbox.pack_start(self.combo_encryption)
|
self.vbox.pack_start(self.combo_encryption)
|
||||||
self.vbox.pack_start(self.vbox_encrypt_info)
|
self.vbox.pack_start(self.vbox_encrypt_info)
|
||||||
|
|
||||||
@@ -547,6 +552,10 @@ class WirelessSettingsDialog(AdvancedSettingsDialog):
|
|||||||
self.destroy()
|
self.destroy()
|
||||||
del self
|
del self
|
||||||
|
|
||||||
|
def set_net_prop(self, option, value):
|
||||||
|
""" Sets the given option to the given value for this network. """
|
||||||
|
wireless.SetWirelessProperty(self.networkID, option, value)
|
||||||
|
|
||||||
def set_values(self):
|
def set_values(self):
|
||||||
""" Set the various network settings to the right values. """
|
""" Set the various network settings to the right values. """
|
||||||
networkID = self.networkID
|
networkID = self.networkID
|
||||||
@@ -568,6 +577,9 @@ class WirelessSettingsDialog(AdvancedSettingsDialog):
|
|||||||
self.chkbox_encryption.set_active(True)
|
self.chkbox_encryption.set_active(True)
|
||||||
else:
|
else:
|
||||||
self.chkbox_encryption.set_active(False)
|
self.chkbox_encryption.set_active(False)
|
||||||
|
|
||||||
|
if wireless.GetWirelessProperty(networkID, 'use_settings_globally'):
|
||||||
|
self.chkbox_global_settings.set_active(True)
|
||||||
|
|
||||||
def format_entry(self, networkid, label):
|
def format_entry(self, networkid, label):
|
||||||
""" Helper method for fetching/formatting wireless properties. """
|
""" Helper method for fetching/formatting wireless properties. """
|
||||||
@@ -1633,30 +1645,30 @@ class appGui:
|
|||||||
def save_wired_settings(self, entry):
|
def save_wired_settings(self, entry):
|
||||||
""" Saved wired network settings. """
|
""" Saved wired network settings. """
|
||||||
if entry.chkbox_static_ip.get_active():
|
if entry.chkbox_static_ip.get_active():
|
||||||
wired.SetWiredProperty("ip", noneToString(entry.txt_ip.get_text()))
|
entry.set_net_prop("ip", noneToString(entry.txt_ip.get_text()))
|
||||||
wired.SetWiredProperty("netmask", noneToString(entry.txt_netmask.get_text()))
|
entry.set_net_prop("netmask", noneToString(entry.txt_netmask.get_text()))
|
||||||
wired.SetWiredProperty("gateway", noneToString(entry.txt_gateway.get_text()))
|
entry.set_net_prop("gateway", noneToString(entry.txt_gateway.get_text()))
|
||||||
else:
|
else:
|
||||||
wired.SetWiredProperty("ip", '')
|
entry.set_net_prop("ip", '')
|
||||||
wired.SetWiredProperty("netmask", '')
|
entry.set_net_prop("netmask", '')
|
||||||
wired.SetWiredProperty("gateway", '')
|
entry.set_net_prop("gateway", '')
|
||||||
|
|
||||||
if entry.chkbox_static_dns.get_active() and \
|
if entry.chkbox_static_dns.get_active() and \
|
||||||
not entry.chkbox_global_dns.get_active():
|
not entry.chkbox_global_dns.get_active():
|
||||||
wired.SetWiredProperty('use_static_dns', True)
|
entry.set_net_prop('use_static_dns', True)
|
||||||
wired.SetWiredProperty('use_global_dns', False)
|
entry.set_net_prop('use_global_dns', False)
|
||||||
wired.SetWiredProperty("dns1", noneToString(entry.txt_dns_1.get_text()))
|
entry.set_net_prop("dns1", noneToString(entry.txt_dns_1.get_text()))
|
||||||
wired.SetWiredProperty("dns2", noneToString(entry.txt_dns_2.get_text()))
|
entry.set_net_prop("dns2", noneToString(entry.txt_dns_2.get_text()))
|
||||||
wired.SetWiredProperty("dns3", noneToString(entry.txt_dns_3.get_text()))
|
entry.set_net_prop("dns3", noneToString(entry.txt_dns_3.get_text()))
|
||||||
elif entry.chkbox_static_dns.get_active() and \
|
elif entry.chkbox_static_dns.get_active() and \
|
||||||
entry.chkbox_global_dns.get_active():
|
entry.chkbox_global_dns.get_active():
|
||||||
wired.SetWiredProperty('use_static_dns', True)
|
entry.set_net_prop('use_static_dns', True)
|
||||||
wired.SetWiredProperty('use_global_dns', True)
|
entry.set_net_prop('use_global_dns', True)
|
||||||
else:
|
else:
|
||||||
wired.SetWiredProperty('use_static_dns', False)
|
entry.set_net_prop('use_static_dns', False)
|
||||||
wired.SetWiredProperty("dns1", '')
|
entry.set_net_prop("dns1", '')
|
||||||
wired.SetWiredProperty("dns2", '')
|
entry.set_net_prop("dns2", '')
|
||||||
wired.SetWiredProperty("dns3", '')
|
entry.set_net_prop("dns3", '')
|
||||||
config.SaveWiredNetworkProfile(entry.combo_profile_names.get_active_text())
|
config.SaveWiredNetworkProfile(entry.combo_profile_names.get_active_text())
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@@ -1667,15 +1679,15 @@ class appGui:
|
|||||||
print "setting encryption info..."
|
print "setting encryption info..."
|
||||||
encryption_info = entry.encryption_info
|
encryption_info = entry.encryption_info
|
||||||
encrypt_methods = misc.LoadEncryptionMethods()
|
encrypt_methods = misc.LoadEncryptionMethods()
|
||||||
wireless.SetWirelessProperty(networkid, "enctype",
|
entry.set_net_prop("enctype",
|
||||||
encrypt_methods[entry.combo_encryption.
|
encrypt_methods[entry.combo_encryption.
|
||||||
get_active()][1])
|
get_active()][1])
|
||||||
for x in encryption_info:
|
for x in encryption_info:
|
||||||
if encryption_info[x].get_text() == "":
|
if encryption_info[x].get_text() == "":
|
||||||
misc.error(self.window, language['encrypt_info_missing'])
|
misc.error(self.window, language['encrypt_info_missing'])
|
||||||
return False
|
return False
|
||||||
wireless.SetWirelessProperty(networkid, x,
|
entry.set_net_prop(x, noneToString(encryption_info[x].
|
||||||
noneToString(encryption_info[x].get_text()))
|
get_text()))
|
||||||
elif not entry.chkbox_encryption.get_active() and \
|
elif not entry.chkbox_encryption.get_active() and \
|
||||||
wireless.GetWirelessProperty(networkid, "encryption"):
|
wireless.GetWirelessProperty(networkid, "encryption"):
|
||||||
misc.error(self.window, language['enable_encryption'])
|
misc.error(self.window, language['enable_encryption'])
|
||||||
@@ -1683,45 +1695,47 @@ class appGui:
|
|||||||
else:
|
else:
|
||||||
print 'encryption is', wireless.GetWirelessProperty(networkid, "encryption")
|
print 'encryption is', wireless.GetWirelessProperty(networkid, "encryption")
|
||||||
print "no encryption specified..."
|
print "no encryption specified..."
|
||||||
wireless.SetWirelessProperty(networkid, "enctype", "None")
|
entry.set_net_prop("enctype", "None")
|
||||||
|
|
||||||
wireless.SetWirelessProperty(networkid, "automatic",
|
entry.set_net_prop("automatic",
|
||||||
noneToString(netent.chkbox_autoconnect.get_active()))
|
noneToString(netent.chkbox_autoconnect.get_active()))
|
||||||
# Save IP info
|
# Save IP info
|
||||||
if entry.chkbox_static_ip.get_active():
|
if entry.chkbox_static_ip.get_active():
|
||||||
wireless.SetWirelessProperty(networkid, "ip",
|
entry.set_net_prop("ip", noneToString(entry.txt_ip.get_text()))
|
||||||
noneToString(entry.txt_ip.get_text()))
|
entry.set_net_prop("netmask",
|
||||||
wireless.SetWirelessProperty(networkid, "netmask",
|
noneToString(entry.txt_netmask.get_text()))
|
||||||
noneToString(entry.txt_netmask.get_text()))
|
entry.set_net_prop("gateway",
|
||||||
wireless.SetWirelessProperty(networkid, "gateway",
|
noneToString(entry.txt_gateway.get_text()))
|
||||||
noneToString(entry.txt_gateway.get_text()))
|
|
||||||
else:
|
else:
|
||||||
# Blank the values
|
# Blank the values
|
||||||
wireless.SetWirelessProperty(networkid, "ip", '')
|
entry.set_net_prop("ip", '')
|
||||||
wireless.SetWirelessProperty(networkid, "netmask", '')
|
entry.set_net_prop("netmask", '')
|
||||||
wireless.SetWirelessProperty(networkid, "gateway", '')
|
entry.set_net_prop("gateway", '')
|
||||||
|
|
||||||
# Save DNS info
|
# Save DNS info
|
||||||
if entry.chkbox_static_dns.get_active() and \
|
if entry.chkbox_static_dns.get_active() and \
|
||||||
not entry.chkbox_global_dns.get_active():
|
not entry.chkbox_global_dns.get_active():
|
||||||
wireless.SetWirelessProperty(networkid, 'use_static_dns', True)
|
entry.set_net_prop('use_static_dns', True)
|
||||||
wireless.SetWirelessProperty(networkid, 'use_global_dns', False)
|
entry.set_net_prop('use_global_dns', False)
|
||||||
wireless.SetWirelessProperty(networkid, 'dns1',
|
entry.set_net_prop('dns1', noneToString(entry.txt_dns_1.get_text()))
|
||||||
noneToString(entry.txt_dns_1.get_text()))
|
entry.set_net_prop('dns2', noneToString(entry.txt_dns_2.get_text()))
|
||||||
wireless.SetWirelessProperty(networkid, 'dns2',
|
entry.set_net_prop('dns3', noneToString(entry.txt_dns_3.get_text()))
|
||||||
noneToString(entry.txt_dns_2.get_text()))
|
|
||||||
wireless.SetWirelessProperty(networkid, 'dns3',
|
|
||||||
noneToString(entry.txt_dns_3.get_text()))
|
|
||||||
elif entry.chkbox_static_dns.get_active() and \
|
elif entry.chkbox_static_dns.get_active() and \
|
||||||
entry.chkbox_global_dns.get_active():
|
entry.chkbox_global_dns.get_active():
|
||||||
wireless.SetWirelessProperty(networkid, 'use_static_dns', True)
|
entry.set_net_prop('use_static_dns', True)
|
||||||
wireless.SetWirelessProperty(networkid, 'use_global_dns', True)
|
entry.set_net_prop('use_global_dns', True)
|
||||||
else:
|
else:
|
||||||
wireless.SetWirelessProperty(networkid, 'use_static_dns', False)
|
entry.set_net_prop('use_static_dns', False)
|
||||||
wireless.SetWirelessProperty(networkid, 'use_global_dns', False)
|
entry.set_net_prop('use_global_dns', False)
|
||||||
wireless.SetWirelessProperty(networkid, 'dns1', '')
|
entry.set_net_prop('dns1', '')
|
||||||
wireless.SetWirelessProperty(networkid, 'dns2', '')
|
entry.set_net_prop('dns2', '')
|
||||||
wireless.SetWirelessProperty(networkid, 'dns3', '')
|
entry.set_net_prop('dns3', '')
|
||||||
|
|
||||||
|
if entry.chkbox_global_settings.get_active():
|
||||||
|
entry.set_net_prop('use_settings_globally', True)
|
||||||
|
else:
|
||||||
|
entry.set_net_prop('use_settings_globally', False)
|
||||||
|
config.RemoveGlobalEssidEntry(networkid)
|
||||||
|
|
||||||
config.SaveWirelessNetworkProfile(networkid)
|
config.SaveWirelessNetworkProfile(networkid)
|
||||||
return True
|
return True
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2007 Adam Blackburn
|
# Copyright (C) 2007 Adam Blackburn
|
||||||
# Copyright (C) 2007 Dan O'Reilly
|
# Copyright (C) 2007 Dan O'Reilly
|
||||||
# Copyright (C) 2007 Byron Hillis
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License Version 2 as
|
# it under the terms of the GNU General Public License Version 2 as
|
||||||
@@ -246,4 +245,4 @@ def main():
|
|||||||
mainloop.run()
|
mainloop.run()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user