1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-19 12:28:08 +01:00

Strip IPs before submitting them in wicd-curses.

This commit is contained in:
Andrew Psaltis
2009-07-18 10:55:26 -04:00
parent a0ed8c4a44
commit 25a61b0744
2 changed files with 9 additions and 0 deletions

View File

@@ -140,6 +140,10 @@ class AdvancedSettingsDialog(urwid.WidgetWrap):
not self.global_dns_cb.get_state(): not self.global_dns_cb.get_state():
self.set_net_prop('use_static_dns', True) self.set_net_prop('use_static_dns', True)
self.set_net_prop('use_global_dns', False) self.set_net_prop('use_global_dns', False)
# Strip addressses before checking them in the daemon.
for i in [self.dns1, self.dns2,
self.dns3,self.dns_dom, self.search_dom, self.dns_dom]:
i.set_edit_text(i.get_edit_text().strip())
self.set_net_prop('dns_domain', noneToString(self.dns_dom_edit.get_edit_text())) self.set_net_prop('dns_domain', noneToString(self.dns_dom_edit.get_edit_text()))
self.set_net_prop("search_domain", noneToString(self.search_dom_edit.get_edit_text())) self.set_net_prop("search_domain", noneToString(self.search_dom_edit.get_edit_text()))
self.set_net_prop("dns1", noneToString(self.dns1.get_edit_text())) self.set_net_prop("dns1", noneToString(self.dns1.get_edit_text()))

View File

@@ -326,6 +326,11 @@ class PrefsDialog(urwid.WidgetWrap):
""" Pushes the selected settings to the daemon. """ Pushes the selected settings to the daemon.
This exact order is found in prefs.py""" This exact order is found in prefs.py"""
daemon.SetUseGlobalDNS(self.global_dns_checkb.get_state()) daemon.SetUseGlobalDNS(self.global_dns_checkb.get_state())
for i in [self.dns1, self.dns2,
self.dns3,self.dns_dom, self.search_dom, self.dns_dom]:
i.set_edit_text(i.get_edit_text().strip())
daemon.SetGlobalDNS(self.dns1.get_edit_text(), self.dns2.get_edit_text(), daemon.SetGlobalDNS(self.dns1.get_edit_text(), self.dns2.get_edit_text(),
self.dns3.get_edit_text(), self.dns_dom.get_edit_text(), self.dns3.get_edit_text(), self.dns_dom.get_edit_text(),
self.search_dom.get_edit_text()) self.search_dom.get_edit_text())