From 718e6e09457009cca3a7ea2e1976bd802ae2ba97 Mon Sep 17 00:00:00 2001 From: Shad L. Lords Date: Mon, 19 Oct 2009 08:16:24 -0600 Subject: [PATCH 06/17] Automatically upgrade bootloader if necessary --- textw/upgrade_bootloader_text.py | 91 ++++++++----------------------------- 1 files changed, 20 insertions(+), 71 deletions(-) diff --git a/textw/upgrade_bootloader_text.py b/textw/upgrade_bootloader_text.py index 53f4c88..e23fd16 100644 --- a/textw/upgrade_bootloader_text.py +++ b/textw/upgrade_bootloader_text.py @@ -44,75 +44,24 @@ class UpgradeBootloaderWindow: else: nobl = 1 - if self.type is not None and self.bootDev is not None: - t = TextboxReflowed(53, - _("The installer has detected the %s boot " - "loader currently installed on %s.") - % (self.type, self.bootDev)) - - self.update_radio = blradio.add(_("Update boot loader configuration"), - "update", update) + if nobl == 1: + self.dispatch.skipStep("bootloadersetup", skip = 1) + self.dispatch.skipStep("bootloader", skip = 1) + self.dispatch.skipStep("bootloaderadvanced", skip = 1) + self.dispatch.skipStep("instbootloader", skip = 1) + elif newbl == 1: + self.dispatch.skipStep("bootloadersetup", skip = 0) + self.dispatch.skipStep("bootloader", skip = 1) + self.dispatch.skipStep("bootloaderadvanced", skip = 1) + self.dispatch.skipStep("instbootloader", skip = 0) + self.bl.doUpgradeOnly = 0 else: - t = TextboxReflowed(53, - _("The installer is unable to detect the boot loader " - "currently in use on your system.")) - - self.update_radio = blradio.add(_("Update boot loader configuration"), - "update", update) - self.update_radio.w.checkboxSetFlags(FLAG_DISABLED, FLAGS_SET) - - self.nobl_radio = blradio.add(_("Skip boot loader updating"), - "nobl", nobl) - self.newbl_radio = blradio.add(_("Create new boot loader " - "configuration"), - "newbl", newbl) - - buttons = ButtonBar(screen, [TEXT_OK_BUTTON, TEXT_BACK_BUTTON]) - - grid = GridFormHelp(screen, _("Upgrade Boot Loader Configuration"), - "bl-upgrade", 1, 5) - - grid.add(t, 0, 0, (0,0,0,1)) - grid.add(self.update_radio, 0, 1, (0,0,0,0)) - grid.add(self.nobl_radio, 0, 2, (0,0,0,0)) - grid.add(self.newbl_radio, 0, 3, (0,0,0,1)) - grid.add(buttons, 0, 4, growx = 1) - - - while 1: - result = grid.run() - - button = buttons.buttonPressed(result) - - if button == TEXT_BACK_CHECK: - screen.popWindow() - return INSTALL_BACK - - if blradio.getSelection() == "nobl": - self.dispatch.skipStep("bootloadersetup", skip = 1) - self.dispatch.skipStep("bootloader", skip = 1) - self.dispatch.skipStep("bootloaderadvanced", skip = 1) - self.dispatch.skipStep("instbootloader", skip = 1) - elif blradio.getSelection() == "newbl": - self.dispatch.skipStep("bootloadersetup", skip = 0) - self.dispatch.skipStep("bootloader", skip = 0) - self.dispatch.skipStep("bootloaderadvanced", skip = 0) - self.dispatch.skipStep("instbootloader", skip = 0) - self.bl.doUpgradeOnly = 0 - else: - self.dispatch.skipStep("bootloadersetup", skip = 0) - self.dispatch.skipStep("bootloader", skip = 1) - self.dispatch.skipStep("bootloaderadvanced", skip = 1) - self.dispatch.skipStep("instbootloader", skip = 0) - self.bl.doUpgradeOnly = 1 - - if self.type == "GRUB": - self.bl.useGrubVal = 1 - else: - self.bl.useGrubVal = 0 - self.bl.setDevice(self.bootDev) - - - - screen.popWindow() - return INSTALL_OK + self.dispatch.skipStep("bootloadersetup", skip = 0) + self.dispatch.skipStep("bootloader", skip = 1) + self.dispatch.skipStep("bootloaderadvanced", skip = 1) + self.dispatch.skipStep("instbootloader", skip = 0) + self.bl.doUpgradeOnly = 1 + self.bl.useGrubVal = 1 + self.bl.setDevice(self.bootDev) + + return INSTALL_OK -- 1.7.1