Exemple #1
0
    def _on_continue_clicked(self, window, user_data=None):
        # Autostep needs to be triggered just before switching to the next screen
        # (or before quiting the installation if there are no more screens) to be consistent
        # in both fully automatic kickstart installation and for installation with an incomplete
        # kickstart. Therefore we basically "hook" the continue-clicked signal, start autostepping
        # and ignore any other continue-clicked signals until autostep is done.
        # Once autostep finishes, it emits the appropriate continue-clicked signal itself,
        # switching to the next screen (if any).
        if self.data.autostep.seen and self._currentAction.handles_autostep:
            if self._currentAction.autostepRunning:
                log.debug(
                    "ignoring the continue-clicked signal - autostep is running"
                )
                return
            elif not self._currentAction.autostepDone:
                self._currentAction.autostep()
                return

        if not window.get_may_continue(
        ) or window != self._currentAction.window:
            return

        # The continue button may still be clickable between this handler finishing
        # and the next window being displayed, so turn the button off.
        window.set_may_continue(False)

        # If we're on the last screen, clicking Continue quits.
        if len(self._actions) == 1:
            # save the screenshots to the installed system before killing Anaconda
            # (the kickstart post scripts run to early, so we need to copy the screenshots now)
            util.save_screenshots()
            Gtk.main_quit()
            return

        nextAction = None
        ndx = 0

        # If the current action wants us to jump to an arbitrary point ahead,
        # look for where that is now.
        if self._currentAction.skipTo:
            found = False
            for ndx in range(1, len(self._actions)):
                if self._actions[
                        ndx].__class__.__name__ == self._currentAction.skipTo:
                    found = True
                    break

            # If we found the point in question, compose a new actions list
            # consisting of the current action, the one to jump to, and all
            # the ones after.  That means the rest of the code below doesn't
            # have to change.
            if found:
                self._actions = [self._actions[0]] + self._actions[ndx:]

        # _instantiateAction returns None for actions that should not be
        # displayed (because they're already completed, for instance) so skip
        # them here.
        while not nextAction:
            nextAction = self._instantiateAction(self._actions[1])
            if not nextAction:
                self._actions.pop(1)

            if not self._actions:
                sys.exit(0)
                return

        nextAction.initialize()
        nextAction.window.set_beta(self._currentAction.window.get_beta())
        nextAction.window.set_property("distribution",
                                       self._distributionText().upper())

        if not nextAction.showable:
            self._currentAction.window.hide()
            self._actions.pop(0)
            self._on_continue_clicked(nextAction)
            return

        self._currentAction.exited.emit(self._currentAction)

        nextAction.refresh()

        # Do this last.  Setting up curAction could take a while, and we want
        # to leave something on the screen while we work.
        self.mainWindow.setCurrentAction(nextAction)
        # the new spoke should be now visible, trigger the entered signal
        nextAction.entered.emit(nextAction)
        self._currentAction = nextAction
        self._actions.pop(0)
Exemple #2
0
    def _on_continue_clicked(self, window, user_data=None):
        # Autostep needs to be triggered just before switching to the next screen
        # (or before quiting the installation if there are no more screens) to be consistent
        # in both fully automatic kickstart installation and for installation with an incomplete
        # kickstart. Therefore we basically "hook" the continue-clicked signal, start autostepping
        # and ignore any other continue-clicked signals until autostep is done.
        # Once autostep finishes, it emits the appropriate continue-clicked signal itself,
        # switching to the next screen (if any).
        if self.data.autostep.seen and self._currentAction.handles_autostep:
            if self._currentAction.autostepRunning:
                log.debug("ignoring the continue-clicked signal - autostep is running")
                return
            elif not self._currentAction.autostepDone:
                self._currentAction.autostep()
                return

        if not window.get_may_continue() or window != self._currentAction.window:
            return

        # The continue button may still be clickable between this handler finishing
        # and the next window being displayed, so turn the button off.
        window.set_may_continue(False)

        # If we're on the last screen, clicking Continue quits.
        if len(self._actions) == 1:
            # save the screenshots to the installed system before killing Anaconda
            # (the kickstart post scripts run to early, so we need to copy the screenshots now)
            util.save_screenshots()
            Gtk.main_quit()
            return

        nextAction = None
        ndx = 0

        # If the current action wants us to jump to an arbitrary point ahead,
        # look for where that is now.
        if self._currentAction.skipTo:
            found = False
            for ndx in range(1, len(self._actions)):
                if self._actions[ndx].__class__.__name__ == self._currentAction.skipTo:
                    found = True
                    break

            # If we found the point in question, compose a new actions list
            # consisting of the current action, the one to jump to, and all
            # the ones after.  That means the rest of the code below doesn't
            # have to change.
            if found:
                self._actions = [self._actions[0]] + self._actions[ndx:]

        # _instantiateAction returns None for actions that should not be
        # displayed (because they're already completed, for instance) so skip
        # them here.
        while not nextAction:
            nextAction = self._instantiateAction(self._actions[1])
            if not nextAction:
                self._actions.pop(1)

            if not self._actions:
                sys.exit(0)
                return

        nextAction.initialize()
        nextAction.window.set_beta(self._currentAction.window.get_beta())
        nextAction.window.set_property("distribution", self._distributionText().upper())

        if not nextAction.showable:
            self._currentAction.window.hide()
            self._actions.pop(0)
            self._on_continue_clicked(nextAction)
            return

        self._currentAction.exited.emit(self._currentAction)

        nextAction.refresh()

        # Do this last.  Setting up curAction could take a while, and we want
        # to leave something on the screen while we work.
        self.mainWindow.setCurrentAction(nextAction)
        # the new spoke should be now visible, trigger the entered signal
        nextAction.entered.emit(nextAction)
        self._currentAction = nextAction
        self._actions.pop(0)