diff options
author | David Cantrell <dcantrell@redhat.com> | 2008-04-25 13:53:02 -1000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2008-04-25 13:55:16 -1000 |
commit | 3c4deee414ad8c37cfdc55ce2de7d4fbd49af017 (patch) | |
tree | bf8eb147642924158d614b5418686edaed043279 /iw | |
parent | 4738a3bae4a75c4ec7f789d6503b0f87f898f244 (diff) | |
download | anaconda-3c4deee414ad8c37cfdc55ce2de7d4fbd49af017.tar.gz anaconda-3c4deee414ad8c37cfdc55ce2de7d4fbd49af017.tar.xz anaconda-3c4deee414ad8c37cfdc55ce2de7d4fbd49af017.zip |
Preserve 'set the hostname' setting when going Next/Back (#443414)
Better fix for #408921. Using network.overrideDHCPhostname to set
the default behavior of requiring users to set a hostname. If the
user changed that to 'use DHCP', clicked Next, then clicked Back,
the network configuration screen would be back at manual for the
hostname. Fixed that by honoring overrideDHCPhostname. Also took
the opportunity to make overrideDHCPhostname a boolean since that's
how we are using it.
Diffstat (limited to 'iw')
-rw-r--r-- | iw/network_gui.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/iw/network_gui.py b/iw/network_gui.py index 0fdfa0977..95a6c1e5e 100644 --- a/iw/network_gui.py +++ b/iw/network_gui.py @@ -46,7 +46,7 @@ class NetworkWindow(InstallWindow): if not rc: raise gui.StayOnScreen - override = 0 + override = False if self.hostnameManual.get_active(): hname = string.strip(self.hostnameEntry.get_text()) neterrors = network.sanityCheckHostname(hname) @@ -60,10 +60,10 @@ class NetworkWindow(InstallWindow): raise gui.StayOnScreen newHostname = hname - override = 1 + override = True else: newHostname = "localhost.localdomain" - override = 0 + override = False # FIXME: This is a temporary solution until the UI is reworked. Since # we do dual IPv4/IPv6 stacks, we could have IPv4 on DHCP and static @@ -120,10 +120,13 @@ class NetworkWindow(InstallWindow): return None def setHostOptionsSensitivity(self): - # force users to pick a hostname (#408921) self.hostnameUseDHCP.set_sensitive(1) self.hostnameManual.set_sensitive(1) - self.hostnameManual.set_active(1) + + if self.network.overrideDHCPhostname: + self.hostnameManual.set_active(1) + else: + self.hostnameUseDHCP.set_active(1) # FIXME: ipTable should allow for default gateways for IPv4 and IPv6 # Disable ipTable (gateway and dns entry fields) if we have no devices @@ -347,8 +350,7 @@ class NetworkWindow(InstallWindow): self.setHostOptionsSensitivity() return - - + def setupDevices(self): devnames = self.devices.keys() devnames.sort() @@ -406,11 +408,11 @@ class NetworkWindow(InstallWindow): return self.ethdevices def hostnameUseDHCPCB(self, widget, data): - self.network.overrideDHCPhostname = 0 + self.network.overrideDHCPhostname = False self.hostnameEntry.set_sensitive(not widget.get_active()) def hostnameManualCB(self, widget, data): - self.network.overrideDHCPhostname = 1 + self.network.overrideDHCPhostname = True if widget.get_active(): self.hostnameEntry.grab_focus() @@ -493,7 +495,6 @@ class NetworkWindow(InstallWindow): frame.set_shadow_type(gtk.SHADOW_NONE) box.pack_start(frame, False, False) - self.setHostOptionsSensitivity() self.ipTable = gtk.Table(len(global_options), 2) |