Example #1
0
class Widget(QtGui.QWidget, ScreenWidget):
    title = _("System Repair")
    help = _("""
<font size="+2">System Repair</font>
<font size="+1">
<p>
There is no help available for this section.
</p>
</font>
""")

    def __init__(self, *args):
        QtGui.QWidget.__init__(self,None)
        self.ui = Ui_GoodByeWidget()
        self.ui.setupUi(self)

        self.steps = YaliSteps()

    def installBootLoader(self):
        # Install bootloader
        ctx.yali.installBootloader(ctx.installData.rescuePartition)
        return True

    def takeBackPisi(self):
        try:
            yali.pisiiface.takeBack(ctx.takeBackOperation.no)
        except Exception, e:
            ctx.debugger.log("Exception occured while taking back the system.")
            ctx.debugger.log(e)
            return False
        return True
Example #2
0
class Widget(QtGui.QWidget, ScreenWidget):
    title = "Goodbye"
    # FIXME
    helpSummary = _("Selametle")
    help = _("""
<p>
You have successfully installed Pardus on your computer. After restarting
your computer, you can finally enjoy the full benefits of Pardus.
</p>
<P>
Click Next to proceed. One note: You remember your password, don't you?
</p>
""")

    def __init__(self, *args):
        QtGui.QWidget.__init__(self,None)
        self.ui = Ui_GoodByeWidget()
        self.ui.setupUi(self)

        self.steps = YaliSteps()

    def shown(self):
        ctx.mainScreen.disableNext()
        ctx.interface.informationWindow.update(_("Running post-install operations..."))
        ctx.mainScreen.disableBack()
        ctx.yali.processPendingActions(self)
        self.steps.slotRunOperations()
        if not ctx.mainScreen.ui.helpContent.isVisible():
            ctx.mainScreen.slotToggleHelp()
        self.ui.label.setPixmap(QtGui.QPixmap(":/gui/pics/goodbye.png"))
        ctx.interface.informationWindow.hide()
        ctx.mainScreen.enableNext()

    def execute(self):
        ctx.mainScreen.disableNext()

        ctx.logger.debug("Show restart dialog.")
        InfoDialog(_("Press <b>Restart</b> to restart the computer."), _("Restart"))

        ctx.interface.informationWindow.update(_("<b>Please wait while restarting...</b>"))

        # remove cd...
        if not ctx.yali.install_type == YALI_FIRSTBOOT:
            ctx.logger.debug("Trying to eject the CD.")
            yali.util.eject()

        ctx.logger.debug("Yali, reboot calling..")

        ctx.mainScreen.processEvents()
        time.sleep(4)
        yali.util.reboot()
Example #3
0
 def __init__(self):
     QWidget.__init__(self)
     self.ui = Ui_GoodByeWidget()
     self.ui.setupUi(self)
Example #4
0
class Widget(QWidget, ScreenWidget):
    name = "goodbye"

    def __init__(self):
        QWidget.__init__(self)
        self.ui = Ui_GoodByeWidget()
        self.ui.setupUi(self)

    def shown(self):
        ctx.mainScreen.disableNext()
        ctx.mainScreen.disableBack()

        ctx.interface.informationWindow.update(
            _("Running post-install operations..."))
        self.runOperations()
        ctx.mainScreen.pds_helper.toggleHelp()
        self.ui.label.setPixmap(QPixmap(":/gui/pics/goodbye.png"))
        ctx.interface.informationWindow.hide()
        ctx.mainScreen.enableNext()

    def execute(self):
        ctx.mainScreen.disableNext()

        if not ctx.flags.install_type == ctx.STEP_FIRST_BOOT:
            ctx.logger.debug("Show restart dialog.")
            InfoDialog(_("Press <b>Restart</b> to restart the computer."),
                       _("Restart"))
            ctx.interface.informationWindow.update(
                _("<b>Please wait while restarting...</b>"))
            ctx.logger.debug("Trying to eject the CD.")
            yali.util.eject()
            ctx.logger.debug("Yali, reboot calling..")
            ctx.mainScreen.processEvents()
            time.sleep(4)
            yali.util.reboot()
        else:
            sys.exit(0)

    def runOperations(self):
        postInstallOperations = []

        if not (ctx.flags.install_type == ctx.STEP_RESCUE
                or ctx.flags.install_type == ctx.STEP_FIRST_BOOT):
            postInstallOperations.append(
                yali.postinstall.Operation(_("Setting timezone..."),
                                           yali.postinstall.setupTimeZone))
            postInstallOperations.append(
                yali.postinstall.Operation(
                    _("Migrating Xorg configuration..."),
                    yali.postinstall.setKeymapLayout))
            postInstallOperations.append(
                yali.postinstall.Operation(_("Copying repository index..."),
                                           yali.postinstall.setupRepoIndex))

        if ctx.flags.install_type == ctx.STEP_DEFAULT or ctx.flags.install_type == ctx.STEP_BASE or ctx.flags.install_type == ctx.STEP_FIRST_BOOT:
            postInstallOperations.append(
                yali.postinstall.Operation(_("Setting hostname..."),
                                           yali.postinstall.setHostName))
            postInstallOperations.append(
                yali.postinstall.Operation(_("Setting root password..."),
                                           yali.postinstall.setAdminPassword))

        if ctx.flags.install_type == ctx.STEP_RESCUE and ctx.installData.rescueMode == ctx.RESCUE_PASSWORD:
            postInstallOperations.append(
                yali.postinstall.Operation(_("Resetting user password..."),
                                           yali.postinstall.setUserPassword))

        if ctx.flags.install_type == ctx.STEP_BASE:
            postInstallOperations.append(
                yali.postinstall.Operation(_("Setup First-Boot..."),
                                           yali.postinstall.setupFirstBoot))

        if ctx.flags.install_type == ctx.STEP_FIRST_BOOT:
            postInstallOperations.append(
                yali.postinstall.Operation(_("Teardown First-Boot..."),
                                           yali.postinstall.teardownFirstBoot))

        if ctx.flags.install_type == ctx.STEP_FIRST_BOOT or ctx.flags.install_type == ctx.STEP_DEFAULT:
            postInstallOperations.append(
                yali.postinstall.Operation(_("Adding users..."),
                                           yali.postinstall.setupUsers))

        if (ctx.flags.install_type == ctx.STEP_BASE or ctx.flags.install_type == ctx.STEP_DEFAULT or \
            (ctx.flags.install_type == ctx.STEP_RESCUE and ctx.installData.rescueMode == ctx.RESCUE_GRUB)) and \
            ctx.bootloader.stage1Device:
            postInstallOperations.append(
                yali.postinstall.Operation(_("Installing bootloader..."),
                                           yali.postinstall.installBootloader))
            postInstallOperations.append(
                yali.postinstall.Operation(_("Writing bootloader config..."),
                                           yali.postinstall.writeBootLooder))
            postInstallOperations.append(
                yali.postinstall.Operation(_("Stopping to D-Bus..."),
                                           yali.util.stop_dbus))
            postInstallOperations.append(
                yali.postinstall.Operation(_("Teardown storage subsystem..."),
                                           yali.postinstall.teardownStorage))
        elif ctx.flags.install_type == ctx.STEP_BASE or ctx.flags.install_type == ctx.STEP_DEFAULT:
            postInstallOperations.append(
                yali.postinstall.Operation(_("Writing bootloader config..."),
                                           yali.postinstall.writeBootLooder))

        if ctx.flags.install_type == ctx.STEP_DEFAULT or ctx.flags.install_type == ctx.STEP_BASE or ctx.flags.install_type == ctx.STEP_RESCUE:
            postInstallOperations.append(
                yali.postinstall.Operation(_("Stopping to D-Bus..."),
                                           yali.util.stop_dbus))
            postInstallOperations.append(
                yali.postinstall.Operation(_("Teardown storage subsystem..."),
                                           yali.postinstall.teardownStorage))

        for operation in postInstallOperations:
            if not operation.status:
                operation.run()
Example #5
0
    def __init__(self, *args):
        QtGui.QWidget.__init__(self,None)
        self.ui = Ui_GoodByeWidget()
        self.ui.setupUi(self)

        self.steps = YaliSteps()
Example #6
0
 def __init__(self):
     QWidget.__init__(self)
     self.ui = Ui_GoodByeWidget()
     self.ui.setupUi(self)
Example #7
0
class Widget(QWidget, ScreenWidget):
    name = "goodbye"

    def __init__(self):
        QWidget.__init__(self)
        self.ui = Ui_GoodByeWidget()
        self.ui.setupUi(self)

    def shown(self):
        ctx.mainScreen.disableNext()
        ctx.mainScreen.disableBack()

        ctx.interface.informationWindow.update(_("Running post-install operations..."))
        self.runOperations()
        ctx.mainScreen.pds_helper.toggleHelp()
        self.ui.label.setPixmap(QPixmap(":/gui/pics/goodbye.png"))
        ctx.interface.informationWindow.hide()
        ctx.mainScreen.enableNext()

    def execute(self):
        ctx.mainScreen.disableNext()

        if not ctx.flags.install_type == ctx.STEP_FIRST_BOOT:
            ctx.logger.debug("Show restart dialog.")
            InfoDialog(_("Press <b>Restart</b> to restart the computer."), _("Restart"))
            ctx.interface.informationWindow.update(_("<b>Please wait while restarting...</b>"))
            ctx.logger.debug("Trying to eject the CD.")
            yali.util.eject()
            ctx.logger.debug("Yali, reboot calling..")
            ctx.mainScreen.processEvents()
            time.sleep(4)
            yali.util.reboot()
        else:
            sys.exit(0)

    def runOperations(self):
        postInstallOperations = []

        if not (ctx.flags.install_type == ctx.STEP_RESCUE or ctx.flags.install_type == ctx.STEP_FIRST_BOOT):
            postInstallOperations.append(yali.postinstall.Operation(_("Setting timezone..."), yali.postinstall.setupTimeZone))
            postInstallOperations.append(yali.postinstall.Operation(_("Migrating Xorg configuration..."), yali.postinstall.setKeymapLayout))
            postInstallOperations.append(yali.postinstall.Operation(_("Copying repository index..."), yali.postinstall.setupRepoIndex))

        if ctx.flags.install_type == ctx.STEP_DEFAULT or ctx.flags.install_type == ctx.STEP_BASE or ctx.flags.install_type == ctx.STEP_FIRST_BOOT:
            postInstallOperations.append(yali.postinstall.Operation(_("Setting hostname..."), yali.postinstall.setHostName))
            postInstallOperations.append(yali.postinstall.Operation(_("Setting root password..."), yali.postinstall.setAdminPassword))

        if ctx.flags.install_type == ctx.STEP_RESCUE and ctx.installData.rescueMode == ctx.RESCUE_PASSWORD:
            postInstallOperations.append(yali.postinstall.Operation(_("Resetting user password..."), yali.postinstall.setUserPassword))

        if ctx.flags.install_type == ctx.STEP_BASE:
            postInstallOperations.append(yali.postinstall.Operation(_("Setup First-Boot..."), yali.postinstall.setupFirstBoot))

        if ctx.flags.install_type == ctx.STEP_FIRST_BOOT:
            postInstallOperations.append(yali.postinstall.Operation(_("Teardown First-Boot..."), yali.postinstall.teardownFirstBoot))


        if ctx.flags.install_type == ctx.STEP_FIRST_BOOT or ctx.flags.install_type == ctx.STEP_DEFAULT:
            postInstallOperations.append(yali.postinstall.Operation(_("Adding users..."), yali.postinstall.setupUsers))

        if (ctx.flags.install_type == ctx.STEP_BASE or ctx.flags.install_type == ctx.STEP_DEFAULT or \
            (ctx.flags.install_type == ctx.STEP_RESCUE and ctx.installData.rescueMode == ctx.RESCUE_GRUB)) and \
            ctx.bootloader.stage1Device:
            postInstallOperations.append(yali.postinstall.Operation(_("Installing bootloader..."), yali.postinstall.installBootloader))
            postInstallOperations.append(yali.postinstall.Operation(_("Writing bootloader config..."), yali.postinstall.writeBootLooder))
            postInstallOperations.append(yali.postinstall.Operation(_("Stopping to D-Bus..."), yali.util.stop_dbus))
            postInstallOperations.append(yali.postinstall.Operation(_("Teardown storage subsystem..."), yali.postinstall.teardownStorage))
        elif ctx.flags.install_type == ctx.STEP_BASE or ctx.flags.install_type == ctx.STEP_DEFAULT:
            postInstallOperations.append(yali.postinstall.Operation(_("Writing bootloader config..."), yali.postinstall.writeBootLooder))

        if ctx.flags.install_type == ctx.STEP_DEFAULT or ctx.flags.install_type == ctx.STEP_BASE or ctx.flags.install_type == ctx.STEP_RESCUE:
            postInstallOperations.append(yali.postinstall.Operation(_("Stopping to D-Bus..."), yali.util.stop_dbus))
            postInstallOperations.append(yali.postinstall.Operation(_("Teardown storage subsystem..."), yali.postinstall.teardownStorage))

        for operation in postInstallOperations:
            if not operation.status:
                operation.run()