Exemplo n.º 1
0
    def refresh(self, args = None):
        NormalTUISpoke.refresh(self, args)

        # Join the initialization thread to block on it
        # This print is foul.  Need a better message display
        print(_("Probing storage..."))
        threadMgr.wait(THREAD_STORAGE_WATCHER)

        # synchronize our local data store with the global ksdata
        # Commment out because there is no way to select a disk right
        # now without putting it in ksdata.  Seems wrong?
        #self.selected_disks = self.data.ignoredisk.onlyuse[:]
        self.autopart = self.data.autopart.autopart

        message = self._update_summary()

        # loop through the disks and present them.
        for disk in self.disks:
            disk_info = self._format_disk_info(disk)
            c = CheckboxWidget(title="%i) %s" % (self.disks.index(disk) + 1, disk_info),
                               completed=(disk.name in self.selected_disks))
            self._window += [c, ""]

        # if we have more than one disk, present an option to just
        # select all disks
        if len(self.disks) > 1:
            c = CheckboxWidget(title="%i) %s" % (len(self.disks) + 1, _("Select all")),
                                completed=(self.selection == len(self.disks)))

            self._window += [c, ""]

        self._window += [TextWidget(message), ""]

        return True
Exemplo n.º 2
0
    def refresh(self, args=None):
        """ Refresh screen. """
        NormalTUISpoke.refresh(self, args)

        threadMgr.wait(THREAD_PAYLOAD)

        if not self.payload.baseRepo:
            message = TextWidget(
                _("Installation source needs to be set up first."))
            self._window.append(message)

            # add some more space below
            self._window.append(TextWidget(""))
            return True

        threadMgr.wait(THREAD_CHECK_SOFTWARE)
        displayed = []

        # Display the environments
        if args is None:
            environments = self.payload.environments
            length = len(environments)
            msg = _("Base environment")

            for env in environments:
                name = self.payload.environmentDescription(env)[0]
                selected = environments.index(env) == self._selection
                displayed.append(
                    CheckboxWidget(title="%s" % name, completed=selected))

        # Display the add-ons
        else:
            length = len(args)

            if length > 0:
                msg = _("Add-ons for selected environment")
            else:
                msg = _("No add-ons to select.")

            for addon_id in args:
                name = self.payload.groupDescription(addon_id)[0]
                selected = addon_id in self._addons_selection
                displayed.append(
                    CheckboxWidget(title="%s" % name, completed=selected))

        def _prep(i, w):
            """ Do some format magic for display. """
            num = TextWidget("%2d)" % (i + 1))
            return ColumnWidget([(4, [num]), (None, [w])], 1)

        # split list of DE's into two columns
        mid = length / 2
        left = [_prep(i, w) for i, w in enumerate(displayed) if i <= mid]
        right = [_prep(i, w) for i, w in enumerate(displayed) if i > mid]

        cw = ColumnWidget([(38, left), (38, right)], 2)
        self._window += [TextWidget(msg), "", cw, ""]

        return True
Exemplo n.º 3
0
    def refresh(self, args=None):
        """ Refresh screen. """
        NormalTUISpoke.refresh(self, args)

        environments = self.payload.environments

        displayed = []
        for env in environments:
            name = self.payload.environmentDescription(env)[0]

            displayed.append(CheckboxWidget(title="%s" % name, completed=(environments.index(env) == self._selection)))
        print(_("Base environment"))

        def _prep(i, w):
            """ Do some format magic for display. """
            num = TextWidget("%2d)" % (i + 1))
            return ColumnWidget([(4, [num]), (None, [w])], 1)

        # split list of DE's into two columns
        mid = len(environments) / 2
        left = [_prep(i, w) for i, w in enumerate(displayed) if i <= mid]
        right = [_prep(i, w) for i, w in enumerate(displayed) if i > mid]

        cw = ColumnWidget([(38, left), (38, right)], 2)
        self._window.append(cw)

        return True
Exemplo n.º 4
0
    def refresh(self, args=None):
        NormalTUISpoke.refresh(self, args)

        schemelist = self.partschemes.keys()
        for i, sch in enumerate(schemelist):
            box = CheckboxWidget(title="%i) %s" %(i + 1, _(sch)), completed=(i == self._selection))
            self._window += [box, ""]

        message = _("Select a partition scheme configuration.")
        self._window += [TextWidget(message), ""]
        return True
Exemplo n.º 5
0
    def refresh(self, args=None):
        """
        The refresh method that is called every time the spoke is displayed.
        It should update the UI elements according to the contents of
        self.data.

        :see: pyanaconda.ui.common.UIObject.refresh
        :see: pyanaconda.ui.tui.base.UIScreen.refresh
        :param args: optional argument that may be used when the screen is
                     scheduled (passed to App.switch_screen* methods)
        :type args: anything
        :return: whether this screen requests input or not
        :rtype: bool

        """
        NormalTUISpoke.refresh(self, args)
        # It should always prompt
        box1 = CheckboxWidget(title="1. MODE: ALLINONE", text="DEFAULT", completed= (self.mode == "allinone"))
        box2 = CheckboxWidget(title="2. MODE: ANSWER FILE", text=self.link, completed= (self.mode == "answerfile"))
        box3 = CheckboxWidget(title="3. Disable OpenStack Support",completed=(self.mode == "disabled"))
        self._window += [box1, "", box2, "", box3, ""]
        return (True)
Exemplo n.º 6
0
    def refresh(self, args=None):
        NormalTUISpoke.refresh(self, args)

        message = _(
            "The following installations were discovered on your system.\n")
        self._window += [TextWidget(message), ""]

        for i, root in enumerate(self._roots):
            box = CheckboxWidget(title="%i) %s on %s" %
                                 (i + 1, _(root.name), root.device.path),
                                 completed=(self._selection == i))
            self._window += [box, ""]

        return True
Exemplo n.º 7
0
    def refresh(self, args=None):
        """
        The refresh method that is called every time the spoke is displayed.
        It should update the UI elements according to the contents of
        self.data.

        :see: pyanaconda.ui.common.UIObject.refresh
        :see: pyanaconda.ui.tui.base.UIScreen.refresh
        :param args: optional argument that may be used when the screen is
                     scheduled (passed to App.switch_screen* methods)
        :type args: anything
        :return: whether this screen requests input or not
        :rtype: bool

        """
        NormalTUISpoke.refresh(self, args)
        # It should always prompt
        box1 = CheckboxWidget(title="1. Enable Cloud Support",
                                  text="OpenStack MODE: " + str(self.data.addons.org_centos_cloud.arguments),
                                  completed=(self.data.addons.org_centos_cloud.state == "True"))
        box2 = CheckboxWidget(title=("2. Disable Cloud Support"), completed= (self.data.addons.org_centos_cloud.state == "False"))
        self._window += [box1, "", box2, ""]
        return (self.enabled) # Don't Prompt if ADDON was disabled during setup, because no packages have been installed
Exemplo n.º 8
0
    def refresh(self, args=None):
        """ Refresh screen. """
        NormalTUISpoke.refresh(self, args)

        threadMgr.wait(THREAD_PAYLOAD)

        if not self.payload.baseRepo:
            message = TextWidget(
                _("Installation source needs to be set up first."))
            self._window.append(message)

            # add some more space below
            self._window.append(TextWidget(""))
            return True

        threadMgr.wait(THREAD_CHECK_SOFTWARE)

        # put a title above the list and some space below it
        self._window.append(TextWidget(_("Base environment")))
        self._window.append(TextWidget(""))

        environments = self.payload.environments

        displayed = []
        for env in environments:
            name = self.payload.environmentDescription(env)[0]

            displayed.append(
                CheckboxWidget(
                    title="%s" % name,
                    completed=(environments.index(env) == self._selection)))

        def _prep(i, w):
            """ Do some format magic for display. """
            num = TextWidget("%2d)" % (i + 1))
            return ColumnWidget([(4, [num]), (None, [w])], 1)

        # split list of DE's into two columns
        mid = len(environments) / 2
        left = [_prep(i, w) for i, w in enumerate(displayed) if i <= mid]
        right = [_prep(i, w) for i, w in enumerate(displayed) if i > mid]

        cw = ColumnWidget([(38, left), (38, right)], 2)
        self._window.append(cw)

        return True
Exemplo n.º 9
0
    def refresh(self, args=None):
        NormalTUISpoke.refresh(self, args)
        # synchronize our local data store with the global ksdata
        self.clearPartType = self.data.clearpart.type
        # I dislike "is None", but bool(0) returns false :(
        if self.clearPartType is None:
            # Default to clearing everything.
            self.clearPartType = CLEARPART_TYPE_ALL

        for i, parttype in enumerate(self.parttypelist):
            c = CheckboxWidget(title="%i) %s" % (i + 1, _(parttype)),
                               completed=(PARTTYPES[parttype] == self.clearPartType))
            self._window += [c, ""]

        message = _("Installation requires partitioning of your hard drive. Select what space to use for the install target.")

        self._window += [TextWidget(message), ""]

        return True