예제 #1
0
    def refresh(self, args=None):
        NormalTUISpoke.refresh(self, args)

        threadMgr.wait(THREAD_PAYLOAD)

        self._container = ListColumnContainer(1, columns_width=78, spacing=1)

        if self.data.method.method == "harddrive" and \
           get_mount_device(DRACUT_ISODIR) == get_mount_device(DRACUT_REPODIR):
            message = _("The installation source is in use by the installer and cannot be changed.")
            self.window.add_with_separator(TextWidget(message))
            return

        if args == self.SET_NETWORK_INSTALL_MODE:
            if self.payload.mirrors_available:
                self._container.add(TextWidget(_("Closest mirror")), self._set_network_close_mirror)
            self._container.add(TextWidget("http://"), self._set_network_url, SpecifyRepoSpoke.HTTP)
            self._container.add(TextWidget("https://"), self._set_network_url, SpecifyRepoSpoke.HTTPS)
            self._container.add(TextWidget("ftp://"), self._set_network_url, SpecifyRepoSpoke.FTP)
            self._container.add(TextWidget("nfs"), self._set_network_nfs)
        else:
            self.window.add(TextWidget(_("Choose an installation source type.")))
            self._container.add(TextWidget(_("CD/DVD")), self._set_cd_install_source)
            self._container.add(TextWidget(_("local ISO file")), self._set_iso_install_source)
            self._container.add(TextWidget(_("Network")), self._set_network_install_source)

            if self._hmc:
                self._container.add(TextWidget(_("SE/HMC")), self._set_hmc_install_source)

        self.window.add_with_separator(self._container)
예제 #2
0
    def refresh(self, args=None):
        EditTUISpoke.refresh(self, args)

        threadMgr.wait(THREAD_PAYLOAD)

        _methods = [_("CD/DVD"), _("local ISO file"), _("Network")]

        if self.data.method.method == "harddrive" and \
           get_mount_device(DRACUT_ISODIR) == get_mount_device(DRACUT_REPODIR):
            message = _("The installation source is in use by the installer and cannot be changed.")
            self._window += [TextWidget(message), ""]
            return True

        if args == 3:
            text = [TextWidget(_(p)) for p in self._protocols]
        else:
            self._window += [TextWidget(_("Choose an installation source type."))]
            text = [TextWidget(m) for m in _methods]

        def _prep(i, w):
            """ Mangle our text to make it look pretty on screen. """
            number = TextWidget("%2d)" % (i + 1))
            return ColumnWidget([(4, [number]), (None, [w])], 1)

        # gnarl and mangle all of our widgets so things look pretty on screen
        choices = [_prep(i, w) for i, w in enumerate(text)]

        displayed = ColumnWidget([(78, choices)], 1)
        self._window.append(displayed)

        return True
예제 #3
0
파일: source.py 프로젝트: LiuCan01/anaconda
    def refresh(self, args=None):
        EditTUISpoke.refresh(self, args)

        threadMgr.wait(THREAD_PAYLOAD)

        if self.data.method.method == "harddrive" and \
           get_mount_device(DRACUT_ISODIR) == get_mount_device(DRACUT_REPODIR):
            message = _(
                "The installation source is in use by the installer and cannot be changed."
            )
            self._window += [TextWidget(message), ""]
            return True

        _methods = [_("CD/DVD"), _("local ISO file"), _("Network")]
        if args == 3:
            text = [TextWidget(_(p)) for p in self._protocols]
        else:
            self._window += [
                TextWidget(_("Choose an installation source type."))
            ]
            text = [TextWidget(m) for m in _methods]

        def _prep(i, w):
            """ Mangle our text to make it look pretty on screen. """
            number = TextWidget("%2d)" % (i + 1))
            return ColumnWidget([(4, [number]), (None, [w])], 1)

        # gnarl and mangle all of our widgets so things look pretty on screen
        choices = [_prep(i, w) for i, w in enumerate(text)]

        displayed = ColumnWidget([(78, choices)], 1)
        self._window.append(displayed)

        return True
예제 #4
0
    def refresh(self, args=None):
        NormalTUISpoke.refresh(self, args)

        threadMgr.wait(THREAD_PAYLOAD)

        self._container = ListColumnContainer(1, columns_width=78, spacing=1)

        if self.data.method.method == "harddrive" and \
           get_mount_device(DRACUT_ISODIR) == get_mount_device(DRACUT_REPODIR):
            message = _("The installation source is in use by the installer and cannot be changed.")
            self.window.add_with_separator(TextWidget(message))
            return

        if args == self.SET_NETWORK_INSTALL_MODE:
            self._container.add(TextWidget(_("Closest mirror")), self._set_network_close_mirror)
            self._container.add(TextWidget("http://"), self._set_network_url, SpecifyRepoSpoke.HTTP)
            self._container.add(TextWidget("https://"), self._set_network_url, SpecifyRepoSpoke.HTTPS)
            self._container.add(TextWidget("ftp://"), self._set_network_url, SpecifyRepoSpoke.FTP)
            self._container.add(TextWidget("nfs"), self._set_network_nfs)
        else:
            self.window.add(TextWidget(_("Choose an installation source type.")))
            self._container.add(TextWidget(_("CD/DVD")), self._set_cd_install_source)
            self._container.add(TextWidget(_("local ISO file")), self._set_iso_install_source)
            self._container.add(TextWidget(_("Network")), self._set_network_install_source)

            if self._hmc:
                self._container.add(TextWidget(_("SE/HMC")), self._set_hmc_install_source)

        self.window.add_with_separator(self._container)