diff options
author | Chris Lumens <clumens@redhat.com> | 2008-11-18 17:18:01 -0500 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2009-02-09 11:30:02 -0500 |
commit | 0a84b4c1d2528eb699598d1207ce2979d81f1bb4 (patch) | |
tree | 35614c3e2febb64bb5902f46dab49599fd6e1993 /textw | |
parent | 1a663b85dffc4610c8ea7139d2de654d578aca90 (diff) | |
download | anaconda-0a84b4c1d2528eb699598d1207ce2979d81f1bb4.tar.gz anaconda-0a84b4c1d2528eb699598d1207ce2979d81f1bb4.tar.xz anaconda-0a84b4c1d2528eb699598d1207ce2979d81f1bb4.zip |
Strip the network screen down to just setting the default hostname.
Diffstat (limited to 'textw')
-rw-r--r-- | textw/network_text.py | 57 |
1 files changed, 3 insertions, 54 deletions
diff --git a/textw/network_text.py b/textw/network_text.py index c5831289d..f5f8eac1a 100644 --- a/textw/network_text.py +++ b/textw/network_text.py @@ -21,64 +21,13 @@ # Michael Fulbright <msf@redhat.com> # David Cantrell <dcantrell@redhat.com> # - -import string -import network -from snack import * from constants_text import * -from constants import * - -import gettext -_ = lambda x: gettext.ldgettext("anaconda", x) - -import logging -log = logging.getLogger("anaconda") +import network class HostnameWindow: def __call__(self, screen, anaconda): - toplevel = GridFormHelp(screen, _("Hostname"), "hostname", 1, 3) - text = TextboxReflowed(55, - _("Please name this computer. The hostname " - "identifies the computer on a network.")) - toplevel.add(text, 0, 0, (0, 0, 0, 1)) - - hostEntry = Entry(55) - hostEntry.set(network.getDefaultHostname(anaconda)) - toplevel.add(hostEntry, 0, 1, padding = (0, 0, 0, 1)) - - bb = ButtonBar(screen, (TEXT_OK_BUTTON, TEXT_BACK_BUTTON)) - toplevel.add(bb, 0, 2, growx = 1) - - while 1: - result = toplevel.run() - rc = bb.buttonPressed(result) - - if rc == TEXT_BACK_CHECK: - screen.popWindow() - return INSTALL_BACK - - hostname = string.strip(hostEntry.value()) - herrors = network.sanityCheckHostname(hostname) - - if not hostname: - ButtonChoiceWindow(_("Error with Hostname"), - _("You must enter a valid hostname for this " - "computer."), - buttons = [ _("OK") ]) - continue - - if herrors is not None: - ButtonChoiceWindow(_("Error with Hostname"), - _("The hostname \"%s\" is not valid for the " - "following reason:\n\n%s") - % (hostname, herrors,), - buttons = [ _("OK") ]) - continue - - anaconda.id.network.hostname = hostname - break - - screen.popWindow() + hname = network.getDefaultHostname(anaconda) + anaconda.id.network.hostname = hname return INSTALL_OK # vim:tw=78:ts=4:et:sw=4 |