def getSelected(self):
        selection = self.osTreeView.get_selection()
        (model, iter) = selection.get_selected()
        if not iter:
            return None

        dev = devicePathToName(model.get_value(iter, 2))
        label = model.get_value(iter, 1)
        isRoot = model.get_value(iter, 3)
        isDefault = model.get_value(iter, 0)
        return (dev, label, isDefault, isRoot)
    def getNext(self):
        if self.nobl_radio.get_active():
            self.dispatch.skipStep("bootloadersetup", skip = 1)
            self.dispatch.skipStep("bootloader", skip = 1)
            self.dispatch.skipStep("instbootloader", skip = 1)
        elif self.newbl_radio.get_active():
            self.dispatch.skipStep("bootloadersetup", skip = 0)
            self.dispatch.skipStep("bootloader", 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("instbootloader", skip = 0)
            self.bl.doUpgradeOnly = 1

            if self.type == "GRUB":
                self.bl.useGrubVal = 1
            else:
                self.bl.useGrubVal = 0
            self.bl.setDevice(devicePathToName(self.bootDev))
Exemplo n.º 3
0
    def getNext(self):
        if self.nobl_radio.get_active():
            self.dispatch.skipStep("bootloadersetup", skip=1)
            self.dispatch.skipStep("bootloader", skip=1)
            self.dispatch.skipStep("instbootloader", skip=1)
        elif self.newbl_radio.get_active():
            self.dispatch.skipStep("bootloadersetup", skip=0)
            self.dispatch.skipStep("bootloader", 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("instbootloader", skip=0)
            self.bl.doUpgradeOnly = 1

            if self.type == "GRUB":
                self.bl.useGrubVal = 1
            else:
                self.bl.useGrubVal = 0
            self.bl.setDevice(devicePathToName(self.bootDev))
 def toggledDefault(self, data, row):
     iter = self.osStore.get_iter((int(row),))
     dev = self.osStore.get_value(iter, 2)
     self.defaultDev = devicePathToName(dev)
     self.fillOSList()
    def __call__(self, screen, anaconda):
        self.screen = screen
        self.dispatch = anaconda.dispatch
        self.bl = anaconda.bootloader

        newToLibata = self._ideToLibata(anaconda.rootPath)
        (self.type, self.bootDev) = \
                    checkbootloader.getBootloaderTypeAndBoot(anaconda.rootPath, storage=anaconda.storage)

        blradio = RadioGroup()

        (update, nobl) = (0, 0)
        if self.dispatch.stepInSkipList("instbootloader"):
            nobl = 1
        elif not (newToLibata or self.type is None or self.bootDev is None):
            update = 1

        if newToLibata or self.type is None or self.bootDev is None:
            if newToLibata:
                t = TextboxReflowed(53,
                    _("Due to system changes, your boot loader "
                      "configuration can not be automatically updated."))
            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)
        else:
            t = TextboxReflowed(53,
                                _("The installer has detected the %(type)s "
                                  "boot loader currently installed on "
                                  "%(bootDev)s.")
                                % {'type': self.type, 'bootDev': self.bootDev})

            self.update_radio = blradio.add(_("Update boot loader configuration"),
                                            "update", update)

        self.nobl_radio = blradio.add(_("Skip boot loader updating"),
                                      "nobl", nobl)

        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(buttons, 0, 3, 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("instbootloader", skip = 1)
            else:
                self.dispatch.skipStep("bootloadersetup", skip = 0)
                self.dispatch.skipStep("bootloader", 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(devicePathToName(self.bootDev))



            screen.popWindow()
            return INSTALL_OK
Exemplo n.º 6
0
    def __call__(self, screen, anaconda):
        self.screen = screen
        self.dispatch = anaconda.dispatch
        self.bl = anaconda.bootloader

        newToLibata = self._ideToLibata(anaconda.rootPath)
        (self.type, self.bootDev) = \
                    checkbootloader.getBootloaderTypeAndBoot(anaconda.rootPath, storage=anaconda.storage)

        blradio = RadioGroup()

        (update, nobl) = (0, 0)
        if self.dispatch.stepInSkipList("instbootloader"):
            nobl = 1
        elif not (newToLibata or self.type is None or self.bootDev is None):
            update = 1

        if newToLibata or self.type is None or self.bootDev is None:
            if newToLibata:
                t = TextboxReflowed(
                    53,
                    _("Due to system changes, your boot loader "
                      "configuration can not be automatically updated."))
            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)
        else:
            t = TextboxReflowed(
                53,
                _("The installer has detected the %(type)s "
                  "boot loader currently installed on "
                  "%(bootDev)s.") % {
                      'type': self.type,
                      'bootDev': self.bootDev
                  })

            self.update_radio = blradio.add(
                _("Update boot loader configuration"), "update", update)

        self.nobl_radio = blradio.add(_("Skip boot loader updating"), "nobl",
                                      nobl)

        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(buttons, 0, 3, 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("instbootloader", skip=1)
            else:
                self.dispatch.skipStep("bootloadersetup", skip=0)
                self.dispatch.skipStep("bootloader", 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(devicePathToName(self.bootDev))

            screen.popWindow()
            return INSTALL_OK