summaryrefslogtreecommitdiffstats
path: root/text.py
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>1999-08-28 21:17:10 +0000
committerErik Troan <ewt@redhat.com>1999-08-28 21:17:10 +0000
commitb262eeb479c02a03ee03918934a0d3fed94cc6a9 (patch)
treee461b3662d567dba94608092ec16507a0df6f990 /text.py
parentfc8946f211931bc776ad63598913f03975ba137a (diff)
downloadanaconda-b262eeb479c02a03ee03918934a0d3fed94cc6a9.tar.gz
anaconda-b262eeb479c02a03ee03918934a0d3fed94cc6a9.tar.xz
anaconda-b262eeb479c02a03ee03918934a0d3fed94cc6a9.zip
lilo reworks for merging configs between back buttons, and tracking
location as mbr/partition rather then which device
Diffstat (limited to 'text.py')
-rw-r--r--text.py38
1 files changed, 23 insertions, 15 deletions
diff --git a/text.py b/text.py
index bb58efce9..2336c650c 100644
--- a/text.py
+++ b/text.py
@@ -857,14 +857,14 @@ class LiloWindow:
def __call__(self, screen, todo):
if '/' not in todo.mounts.keys (): return INSTALL_NOOP
- if todo.mounts.has_key ('/boot'):
- bootpart = todo.mounts['/boot'][0]
- else:
- bootpart = todo.mounts['/'][0]
- i = len (bootpart) - 1
- while i < 0 and bootpart[i] in digits:
- i = i - 1
- boothd = bootpart[0:i]
+ (bootpart, boothd) = todo.getLiloOptions()
+
+ if (todo.getLiloLocation == "mbr"):
+ default = boothd
+ elif (todo.getLiloLocation == "partition"):
+ default = bootpart
+ else:
+ default = None
format = "/dev/%-11s %s"
locations = []
@@ -874,13 +874,13 @@ class LiloWindow:
# XXX fixme restore state
(rc, sel) = ListboxChoiceWindow (screen, _("LILO Configuration"),
_("Where do you want to install the bootloader?"),
- locations,
+ locations, default = default,
buttons = [ _("OK"), _("Back") ])
if sel == 0:
- todo.setLiloLocation(boothd)
+ todo.setLiloLocation("mbr")
else:
- todo.setLiloLocation(bootpart)
+ todo.setLiloLocation("partition")
if rc == string.lower (_("Back")):
return INSTALL_BACK
@@ -938,7 +938,7 @@ class LiloImagesWindow:
return "%-10s %-25s %-7s %-10s" % ( "/dev/" + device, type, default, label)
def __call__(self, screen, todo):
- images = todo.liloImages
+ images = todo.getLiloImages()
if not images: return
sortedKeys = images.keys()
@@ -948,6 +948,8 @@ class LiloImagesWindow:
( _("Device"), _("Partition type"), _("Default"), _("Boot label")))
listbox = Listbox(5, scroll = 1, returnExit = 1)
+ default = ""
+
foundDos = 0
for n in sortedKeys:
(label, type) = images[n]
@@ -958,7 +960,8 @@ class LiloImagesWindow:
images[n] = (label, type)
listbox.append(self.formatDevice(type, label, n, default), n)
- buttons = ButtonBar(screen, [ _("Ok"), _("Edit"), _("Back") ] )
+ buttons = ButtonBar(screen, [ (_("Ok"), "ok"), (_("Edit"), "edit"),
+ (_("Back"), "back") ] )
text = TextboxReflowed(55, _("The boot manager Red Hat uses can boot other "
"operating systems as well. You need to tell me "
@@ -973,7 +976,7 @@ class LiloImagesWindow:
g.addHotKey("F2")
result = None
- while (result != string.lower(_("Ok")) and result != string.lower(_("Back"))):
+ while (result != "ok" and result != "back"):
result = g.run()
if (buttons.buttonPressed(result)):
result = buttons.buttonPressed(result)
@@ -1002,7 +1005,12 @@ class LiloImagesWindow:
screen.popWindow()
- return INSTALL_NOOP
+ if (result == "back"):
+ return INSTALL_BACK
+
+ todo.setLiloImages(images)
+
+ return INSTALL_OK
class BeginInstallWindow:
def __call__ (self, screen, todo):