From 0a84b4c1d2528eb699598d1207ce2979d81f1bb4 Mon Sep 17 00:00:00 2001 From: Chris Lumens Date: Tue, 18 Nov 2008 17:18:01 -0500 Subject: Strip the network screen down to just setting the default hostname. --- textw/network_text.py | 57 +++------------------------------------------------ 1 file 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 # David Cantrell # - -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 -- cgit