summaryrefslogtreecommitdiffstats
path: root/iw/network_gui.py
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2006-09-29 23:44:07 +0000
committerDavid Cantrell <dcantrell@redhat.com>2006-09-29 23:44:07 +0000
commit14be3305bbbbfd31273cd6e938f021e2684962ca (patch)
tree15b5bbc15daa200b5f531a2f90fdbb22e016489c /iw/network_gui.py
parent69e6584b7098d7b74e43a3c8d8934ea1c4d6485f (diff)
downloadanaconda-14be3305bbbbfd31273cd6e938f021e2684962ca.tar.gz
anaconda-14be3305bbbbfd31273cd6e938f021e2684962ca.tar.xz
anaconda-14be3305bbbbfd31273cd6e938f021e2684962ca.zip
* iw/network_gui.py (NetworkWindow): Removed duplicate handleIPError()
function. Wrap ipv6prefix input validation to catch exception where the user left the field blank (ValueError). * textw/network_text.py: Added descr hash. Removed badIPDisplay(). * textw/network_text.py: Added handleIPError() and handleIPMissing() which work in the same way as the functions of the same name in the iw interface, but they are modified to use ButtonChoiceWindow. * textw/network_text.py (NetworkDeviceWindow): Replace all instances of self.intf.messageWindow with ButtonChoiceWindow. Call the handleIPError() and handleIPMissing() functions correctly. Catch ipv6prefix entry errors when the user left the field blank. * textw/network_text.py (NetworkGlobalWindow): Rewrote input validation for gateway, primary DNS, and secondary DNS. Use exceptions from network and handleIPError() and handleIPMissing() functions.
Diffstat (limited to 'iw/network_gui.py')
-rw-r--r--iw/network_gui.py27
1 files changed, 15 insertions, 12 deletions
diff --git a/iw/network_gui.py b/iw/network_gui.py
index 911272543..10acbcc22 100644
--- a/iw/network_gui.py
+++ b/iw/network_gui.py
@@ -170,12 +170,6 @@ class NetworkWindow(InstallWindow):
self.intf.messageWindow(_("Error With Data"),
_("The hostname \"%s\" is not valid for the following reason:\n\n%s") % (hostname, error))
- def handleIPError(self, field, errmsg):
- newfield = string.replace(field, "_", "")
- self.intf.messageWindow(_("Error With Data"),
- _("An error occurred converting "
- "the value entered for \"%s\":\n%s") % (newfield, errmsg))
-
def handleIPMissing(self, field):
try:
newfield = descr[field]
@@ -396,6 +390,7 @@ class NetworkWindow(InstallWindow):
entrys['remip'] = ptplist[1]
ipTable.attach(ptplist[1], 1, 2, 3, 4, xpadding=0, ypadding=0)
+ # Wireless settings
if (isys.isWireless(dev)):
wifilist.append(gtk.Label(_("_ESSID:")))
wifilist[0].set_alignment(0.0, 0.5)
@@ -512,12 +507,20 @@ class NetworkWindow(InstallWindow):
break
elif t == 'ipv6prefix' and IPV6cb.get_active() is True:
- if int(val) > 128 or int(val) < 0:
- self.intf.messageWindow(_("Invalid Prefix"),
- _("IPv6 prefix must be "
- "between 0 and 128."))
- valsgood = 0
- break
+ try:
+ if int(val) > 128 or int(val) < 0:
+ self.intf.messageWindow(_("Invalid Prefix"),
+ _("IPv6 prefix must be "
+ "between 0 and 128."))
+ valsgood = 0
+ break
+ except:
+ self.intf.messageWindow(_("Invalid Prefix"),
+ _("Invalid or missing "
+ "IPv6 prefix (must be "
+ "between 0 and 128."))
+ valsgood = 0
+ break
if valsgood == 0:
continue