diff options
author | Jeremy Katz <katzj@redhat.com> | 2001-07-06 19:32:32 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2001-07-06 19:32:32 +0000 |
commit | 5e2a048aed88094fa64981d123614d3544c5e9c2 (patch) | |
tree | 0e7806847e713bb9a52bf8fc714f411dfc394901 /textw/bootloader_text.py | |
parent | 17cce59b7a6fd63d4cc46836062eb4d68dd78e34 (diff) | |
download | anaconda-5e2a048aed88094fa64981d123614d3544c5e9c2.tar.gz anaconda-5e2a048aed88094fa64981d123614d3544c5e9c2.tar.xz anaconda-5e2a048aed88094fa64981d123614d3544c5e9c2.zip |
text.py
Diffstat (limited to 'textw/bootloader_text.py')
-rw-r--r-- | textw/bootloader_text.py | 99 |
1 files changed, 68 insertions, 31 deletions
diff --git a/textw/bootloader_text.py b/textw/bootloader_text.py index d7a4c4ff4..7dd6d4514 100644 --- a/textw/bootloader_text.py +++ b/textw/bootloader_text.py @@ -12,9 +12,75 @@ import iutil #cat = gettext.Catalog ("anaconda", "/usr/share/locale") #_ = cat.gettext +class BootloaderChoiceWindow: + + def __call__(self, screen, dispatch, bl, fsset, diskSet): + # XXX need more text here + t = TextboxReflowed(53, + _("Which bootloader would you like to use?")) + + if dispatch.stepInSkipList("instbootloader"): + useGrub = 0 + useLilo = 0 + noBl = 1 + elif not bl.useGrub(): + useGrub = 0 + useLilo = 1 + noBl = 0 + else: + useGrub = 1 + useLilo = 0 + noBl = 0 + + blradio = RadioGroup() + grub = blradio.add(_("Use GRUB Boot Loader"), "grub", useGrub) + lilo = blradio.add(_("Use LILO Boot Loader"), "lilo", useLilo) + skipbl = blradio.add(_("No Boot Loader"), "nobl", noBl) + buttons = ButtonBar(screen, [TEXT_OK_BUTTON, TEXT_BACK_BUTTON ] ) + + grid = GridFormHelp(screen, _("Boot Loader Configuration"), "bootloader", 1, 5) + grid.add(t, 0, 0, (0,0,0,1)) + grid.add(grub, 0, 1, (0,0,0,0)) + grid.add(lilo, 0, 2, (0,0,0,0)) + grid.add(skipbl, 0, 3, (0,0,0,1)) + grid.add(buttons, 0, 4, growx = 1) + + result = grid.runOnce() + + button = buttons.buttonPressed(result) + + if button == TEXT_BACK_CHECK: + return INSTALL_BACK + + if blradio.getSelection() == "nobl": + rc = ButtonChoiceWindow(screen, _("Skip Boot Loader"), + _("You have elected to not install " + "any boot loader. It is strongly recommended " + "that you install a boot loader unless " + "you have an advanced need. A boot loader " + "is almost always required in order " + "to reboot your system into Linux " + "directly from the hard drive.\n\n" + "Are you sure you want to skip boot loader " + "installation?"), + [ (_("Yes"), "yes"), (_("No"), "no") ], + width = 50) + dispatch.skipStep("instbootloader", skip = (rc == "yes")) + elif blradio.getSelection() == "lilo": + bl.setUseGrub(0) + dispatch.skipStep("instbootloader", 0) + else: + bl.setUseGrub(1) + dispatch.skipStep("instbootloader", 0) + + return INSTALL_OK + + class BootloaderAppendWindow: def __call__(self, screen, dispatch, bl, fsset, diskSet): + if dispatch.stepInSkipList("instbootloader"): return INSTALL_NOOP + t = TextboxReflowed(53, _("A few systems will need to pass special options " "to the kernel at boot time for the system to function " @@ -22,21 +88,14 @@ class BootloaderAppendWindow: "kernel, enter them now. If you don't need any or " "aren't sure, leave this blank.")) - cb = Checkbox(_("Use LILO Boot Loader (instead of GRUB)"), - isOn = not bl.useGrub()) entry = Entry(48, scroll = 1, returnExit = 1) entry.set(bl.args.get()) - buttons = ButtonBar(screen, [TEXT_OK_BUTTON, (_("Skip"), "skip"), - TEXT_BACK_BUTTON ] ) + buttons = ButtonBar(screen, [TEXT_OK_BUTTON, TEXT_BACK_BUTTON ] ) grid = GridFormHelp(screen, _("Boot Loader Configuration"), "kernelopts", 1, 4) grid.add(t, 0, 0, padding = (0, 0, 0, 1)) -# XXX -# if not edd.detect(): -# grid.add(cb, 0, 1, padding = (0, 0, 0, 1)) - grid.add(entry, 0, 2, padding = (0, 0, 0, 1)) grid.add(buttons, 0, 3, growx = 1) @@ -46,25 +105,7 @@ class BootloaderAppendWindow: if button == TEXT_BACK_CHECK: return INSTALL_BACK - if button == "skip": - rc = ButtonChoiceWindow(screen, _("Skip Boot Loader"), - _("You have elected to not install " - "any boot loader. It is strongly recommended " - "that you install a boot loader unless " - "you have an advanced need. A boot loader " - "is almost always required in order " - "to reboot your system into Linux " - "directly from the hard drive.\n\n" - "Are you sure you want to skip boot loader " - "installation?"), - [ (_("Yes"), "yes"), (_("No"), "no") ], - width = 50) - dispatch.skipStep("instbootloader", skip = (rc == "yes")) - else: - dispatch.skipStep("instbootloader", 0) - bl.args.set(entry.value()) - bl.setUseGrub(not cb.value()) return INSTALL_OK @@ -159,14 +200,10 @@ class BootloaderImagesWindow: return newLabel.value() def formatDevice(self, type, label, device, default): - if (type == "ext2"): - type = "Linux Native" - elif (type == "FAT"): + if (type == "FAT"): type = "DOS/Windows" elif (type == "ntfs" or type == "hpfs"): type = "OS/2 / Windows NT" - else: - type = "Other" if default == device: default = '*' |