def __init__(self, *args): QtGui.QWidget.__init__(self, None) self.ui = Ui_RescuePasswordWidget() self.ui.setupUi(self) self.ui.pass_error.setVisible(False) self.ui.caps_error.setVisible(False) self.ui.caps_error.setText(_('Caps Lock is on!')) self.ui.updatePassword.setEnabled(False) self.steps = YaliSteps() self.steps.setOperations([{ "text": _("Starting DBUS..."), "operation": yali4.sysutils.chrootDbus }, { "text": _("Trying to connect DBUS..."), "operation": yali4.postinstall.connectToDBus }, { "text": _("Getting user list ..."), "operation": self.fillUserList }]) self.connect(self.ui.updatePassword, SIGNAL("clicked()"), self.updatePassword) self.connect(self.ui.userList, SIGNAL("itemChanged(QListWidgetItem*)"), self.resetWidgets) self.connect(self.ui.pass1, SIGNAL("textChanged(const QString &)"), self.slotTextChanged) self.connect(self.ui.pass2, SIGNAL("textChanged(const QString &)"), self.slotTextChanged)
class Widget(QtGui.QWidget, ScreenWidget): title = _('Goodbye from YALI') desc = _('Enjoy your fresh Pardus !...') help = _(''' <font size="+2">Congratulations</font> <font size="+1"> <p> You have successfully installed Pardus, a very easy to use desktop system on your machine. Now you can start playing with your system and stay productive all the time. </p> <P> Click on the Next button to proceed. One note: You remember your password, don't you? </p> </font> ''') 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.yali.info.updateAndShow(_("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.yali.info.hide() ctx.mainScreen.enableNext() def execute(self): ctx.mainScreen.disableNext() ctx.debugger.log("Show reboot dialog.") InfoDialog(_("Press <b>Reboot</b> button to restart your system."), _("Reboot")) ctx.yali.info.updateAndShow(_('<b>Rebooting system. Please wait!</b>')) # remove cd... if not ctx.yali.install_type == YALI_FIRSTBOOT: ctx.debugger.log("Trying to eject the CD.") yali4.sysutils.ejectCdrom() ctx.debugger.log("Yali, reboot calling..") ctx.mainScreen.processEvents() time.sleep(4) yali4.sysutils.reboot()
class Widget(QtGui.QWidget, ScreenWidget): title = _('Goodbye from YALI') desc = _('Enjoy your fresh Pardus !...') help = _(''' <font size="+2">Congratulations</font> <font size="+1"> <p> You have successfully installed Pardus, a very easy to use desktop system on your machine. Now you can start playing with your system and stay productive all the time. </p> <P> Click on the Next button to proceed. One note: You remember your password, don't you? </p> </font> ''') 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.yali.info.updateAndShow(_("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.yali.info.hide() ctx.mainScreen.enableNext() def execute(self): ctx.mainScreen.disableNext() ctx.debugger.log("Show reboot dialog.") InfoDialog(_("Press <b>Reboot</b> button to restart your system."), _("Reboot")) ctx.yali.info.updateAndShow(_('<b>Rebooting system. Please wait!</b>')) # remove cd... if not ctx.yali.install_type in [YALI_FIRSTBOOT, YALI_LIVEINSTALL]: ctx.debugger.log("Trying to eject the CD.") yali4.sysutils.ejectCdrom() ctx.debugger.log("Yali, reboot calling..") ctx.mainScreen.processEvents() time.sleep(4) yali4.sysutils.reboot()
def __init__(self, *args): QtGui.QWidget.__init__(self,None) self.ui = Ui_RescuePisiWidget() self.ui.setupUi(self) self.steps = YaliSteps() self.steps.setOperations([{"text":_("Starting DBUS..."),"operation":yali4.sysutils.chrootDbus}, {"text":_("Trying to connect DBUS..."),"operation":yali4.postinstall.connectToDBus}, {"text":_("Getting history ..."),"operation":self.fillHistoryList}]) self.connect(self.ui.buttonSelectConnection, SIGNAL("clicked()"), self.showConnections) self.connectionWidget = None
class Widget(QtGui.QWidget, ScreenWidget): title = _('Rescue Mode for Pisi History') desc = _('You can take back your system ...') icon = "iconInstall" help = _(''' <font size="+2">Pisi History</font> <font size="+1"></font> ''') def __init__(self, *args): QtGui.QWidget.__init__(self,None) self.ui = Ui_RescuePisiWidget() self.ui.setupUi(self) self.steps = YaliSteps() self.steps.setOperations([{"text":_("Starting DBUS..."),"operation":yali4.sysutils.chrootDbus}, {"text":_("Trying to connect DBUS..."),"operation":yali4.postinstall.connectToDBus}, {"text":_("Getting history ..."),"operation":self.fillHistoryList}]) self.connect(self.ui.buttonSelectConnection, SIGNAL("clicked()"), self.showConnections) def showConnections(self): connections = ConnectionWidget(self) connections.show() def fillHistoryList(self): ui = PisiUI() ctx.debugger.log("PisiUI is creating..") yali4.pisiiface.initialize(ui, with_comar = True) try: history = yali4.pisiiface.getHistory() for hist in history: HistoryItem(self.ui.historyList, hist) except: return False return True def shown(self): ctx.mainScreen.disableBack() self.ui.buttonSelectConnection.setEnabled(False) ctx.yali.info.show() self.steps.slotRunOperations() ctx.yali.info.hide() self.ui.buttonSelectConnection.setEnabled(True) def execute(self): ctx.takeBackOperation = self.ui.historyList.currentItem().getInfo() ctx.mainScreen.moveInc = 2 return True def backCheck(self): ctx.mainScreen.moveInc = 2 return True
def __init__(self, *args): QtGui.QWidget.__init__(self,None) self.ui = Ui_RescuePisiWidget() self.ui.setupUi(self) self.steps = YaliSteps() self.steps.setOperations([{"text":_("Starting DBUS..."),"operation":yali4.sysutils.chroot_dbus}, {"text":_("Trying to connect DBUS..."),"operation":yali4.postinstall.connectToDBus}, {"text":_("Getting history ..."),"operation":self.fillHistoryList}]) self.connect(self.ui.buttonSelectConnection, SIGNAL("clicked()"), self.showConnections)
def __init__(self, *args): QtGui.QWidget.__init__(self,None) self.ui = Ui_RescuePasswordWidget() self.ui.setupUi(self) self.ui.pass_error.setVisible(False) self.ui.caps_error.setVisible(False) self.ui.caps_error.setText(_('Caps Lock is on!')) self.ui.updatePassword.setEnabled(False) self.steps = YaliSteps() self.steps.setOperations([{"text":_("Starting DBUS..."),"operation":yali4.sysutils.chrootDbus}, {"text":_("Trying to connect DBUS..."),"operation":yali4.postinstall.connectToDBus}, {"text":_("Getting user list ..."),"operation":self.fillUserList}]) self.connect(self.ui.updatePassword, SIGNAL("clicked()"), self.updatePassword) self.connect(self.ui.userList, SIGNAL("itemChanged(QListWidgetItem*)"), self.resetWidgets) self.connect(self.ui.pass1, SIGNAL("textChanged(const QString &)"), self.slotTextChanged) self.connect(self.ui.pass2, SIGNAL("textChanged(const QString &)"), self.slotTextChanged)
class Widget(QtGui.QWidget, ScreenWidget): title = _('Rescue Mode for Pisi History') desc = _('You can take back your system ...') icon = "iconInstall" help = _(''' <font size="+2">Pisi History</font> <font size="+1"></font> ''') def __init__(self, *args): QtGui.QWidget.__init__(self, None) self.ui = Ui_RescuePisiWidget() self.ui.setupUi(self) self.steps = YaliSteps() self.steps.setOperations([{ "text": _("Starting DBUS..."), "operation": yali4.sysutils.chrootDbus }, { "text": _("Trying to connect DBUS..."), "operation": yali4.postinstall.connectToDBus }, { "text": _("Getting history ..."), "operation": self.fillHistoryList }]) self.connect(self.ui.buttonSelectConnection, SIGNAL("clicked()"), self.showConnections) def showConnections(self): connections = ConnectionWidget(self) connections.show() def fillHistoryList(self): ui = PisiUI() ctx.debugger.log("PisiUI is creating..") yali4.pisiiface.initialize(ui, with_comar=True) try: history = yali4.pisiiface.getHistory() for hist in history: HistoryItem(self.ui.historyList, hist) except: return False return True def shown(self): ctx.mainScreen.disableBack() self.ui.buttonSelectConnection.setEnabled(False) ctx.yali.info.show() self.steps.slotRunOperations() ctx.yali.info.hide() self.ui.buttonSelectConnection.setEnabled(True) def execute(self): ctx.takeBackOperation = self.ui.historyList.currentItem().getInfo() ctx.mainScreen.moveInc = 2 return True def backCheck(self): ctx.mainScreen.moveInc = 2 return True
def __init__(self, *args): QtGui.QWidget.__init__(self,None) self.ui = Ui_GoodByeWidget() self.ui.setupUi(self) self.steps = YaliSteps()
class Widget(QtGui.QWidget, ScreenWidget): title = _('Goodbye from YALI') desc = _('Enjoy your freash Pardus !..') help = _(''' <font size="+2">Congratulations</font> <font size="+1"> <p> You have successfully installed Pardus, a very easy to use desktop system on your machine. Now you can start playing with your system and stay productive all the time. </p> <P> Click on the Next button to proceed. One note: You remember your password, don't you? </p> </font> ''') 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.disableBack() ctx.yali.processPendingActions(self) self.steps.slotRunOperations() def execute(self): ctx.mainScreen.disableNext() if not ctx.yali.install_type == YALI_FIRSTBOOT: try: ctx.debugger.log("Trying to umount %s" % (ctx.consts.target_dir + "/home")) yali4.sysutils.umount(ctx.consts.target_dir + "/home") ctx.debugger.log("Trying to umount %s" % (ctx.consts.target_dir)) yali4.sysutils.umount(ctx.consts.target_dir) except: ctx.debugger.log("Umount Failed.") pass w = RebootWidget(self) ctx.debugger.log("Show reboot dialog.") self.dialog = WarningDialog(w, self) self.dialog.exec_() ctx.mainScreen.processEvents() ctx.yali.info.updateAndShow(_('<b>Rebooting system. Please wait!</b>')) # remove cd... if not ctx.yali.install_type == YALI_FIRSTBOOT: ctx.debugger.log("Trying to eject the CD.") yali4.sysutils.eject_cdrom() ctx.debugger.log("Yali, fastreboot calling..") # store log content if ctx.debugEnabled: open(ctx.consts.log_file,"w").write(str(ctx.debugger.traceback.plainLogs)) ctx.mainScreen.processEvents() time.sleep(4) yali4.sysutils.fastreboot()
def __init__(self, *args): QtGui.QWidget.__init__(self, None) self.ui = Ui_GoodByeWidget() self.ui.setupUi(self) self.steps = YaliSteps()
class Widget(QtGui.QWidget, ScreenWidget): title = _('Rescue Mode for Password Recovery') desc = _('You can recover your password ...') icon = "iconInstall" help = _(''' <font size="+2">Password Recovery</font> <font size="+1"></font> ''') def __init__(self, *args): QtGui.QWidget.__init__(self,None) self.ui = Ui_RescuePasswordWidget() self.ui.setupUi(self) self.ui.pass_error.setVisible(False) self.ui.caps_error.setVisible(False) self.ui.caps_error.setText(_('Caps Lock is on!')) self.ui.updatePassword.setEnabled(False) self.steps = YaliSteps() self.steps.setOperations([{"text":_("Starting DBUS..."),"operation":yali4.sysutils.chrootDbus}, {"text":_("Trying to connect DBUS..."),"operation":yali4.postinstall.connectToDBus}, {"text":_("Getting user list ..."),"operation":self.fillUserList}]) self.connect(self.ui.updatePassword, SIGNAL("clicked()"), self.updatePassword) self.connect(self.ui.userList, SIGNAL("itemChanged(QListWidgetItem*)"), self.resetWidgets) self.connect(self.ui.pass1, SIGNAL("textChanged(const QString &)"), self.slotTextChanged) self.connect(self.ui.pass2, SIGNAL("textChanged(const QString &)"), self.slotTextChanged) def resetWidgets(self): self.ui.pass1.clear() self.ui.pass2.clear() self.ui.updatePassword.setEnabled(False) def showError(self,message): self.ui.pass_error.setText("<center>%s</center>" % message) self.ui.pass_error.setVisible(True) self.ui.updatePassword.setEnabled(False) def checkCapsLock(self): if pardus.xorg.capslock.isOn(): self.ui.caps_error.setVisible(True) else: self.ui.caps_error.setVisible(False) def keyReleaseEvent(self, e): self.checkCapsLock() def updatePassword(self): password = unicode(self.ui.pass1.text()) uid = int(self.ui.userList.currentItem().getInfo()[0]) yali4.postinstall.setUserPass(uid, password) InfoDialog(_("Password changed"), title = _("Info")) self.resetWidgets() def slotTextChanged(self): p1 = self.ui.pass1.text() p2 = self.ui.pass2.text() if not self.ui.userList.currentItem(): return user = self.ui.userList.currentItem().getInfo() if not p1 == '' and (str(p1).lower() == str(user[1]).lower() or \ str(p1).lower() == str(user[2]).lower()): self.showError(_('Don\'t use your user name or name as a password.')) return elif p2 != p1 and p2: self.showError(_('Passwords do not match!')) return elif len(p1) == len(p2) and len(p2) < 4 and not p1=='': self.showError(_('Password is too short!')) return elif p1 == '' or p2 == '': self.ui.pass_error.setVisible(False) return else: self.ui.pass_error.setVisible(False) self.ui.updatePassword.setEnabled(True) def shown(self): ctx.mainScreen.disableBack() ctx.yali.info.show() self.steps.slotRunOperations() ctx.yali.info.hide() def fillUserList(self): users = yali4.postinstall.getUserList() for user in users: UserItem(self.ui.userList, user) def execute(self): return True def backCheck(self): ctx.mainScreen.moveInc = 3 return True
class Widget(QtGui.QWidget, ScreenWidget): title = _('Rescue Mode for Password Recovery') desc = _('You can recover your password ...') icon = "iconInstall" help = _(''' <font size="+2">Password Recovery</font> <font size="+1"></font> ''') def __init__(self, *args): QtGui.QWidget.__init__(self, None) self.ui = Ui_RescuePasswordWidget() self.ui.setupUi(self) self.ui.pass_error.setVisible(False) self.ui.caps_error.setVisible(False) self.ui.caps_error.setText(_('Caps Lock is on!')) self.ui.updatePassword.setEnabled(False) self.steps = YaliSteps() self.steps.setOperations([{ "text": _("Starting DBUS..."), "operation": yali4.sysutils.chrootDbus }, { "text": _("Trying to connect DBUS..."), "operation": yali4.postinstall.connectToDBus }, { "text": _("Getting user list ..."), "operation": self.fillUserList }]) self.connect(self.ui.updatePassword, SIGNAL("clicked()"), self.updatePassword) self.connect(self.ui.userList, SIGNAL("itemChanged(QListWidgetItem*)"), self.resetWidgets) self.connect(self.ui.pass1, SIGNAL("textChanged(const QString &)"), self.slotTextChanged) self.connect(self.ui.pass2, SIGNAL("textChanged(const QString &)"), self.slotTextChanged) def resetWidgets(self): self.ui.pass1.clear() self.ui.pass2.clear() self.ui.updatePassword.setEnabled(False) def showError(self, message): self.ui.pass_error.setText("<center>%s</center>" % message) self.ui.pass_error.setVisible(True) self.ui.updatePassword.setEnabled(False) def checkCapsLock(self): if pardus.xorg.capslock.isOn(): self.ui.caps_error.setVisible(True) else: self.ui.caps_error.setVisible(False) def keyReleaseEvent(self, e): self.checkCapsLock() def updatePassword(self): password = unicode(self.ui.pass1.text()) uid = int(self.ui.userList.currentItem().getInfo()[0]) yali4.postinstall.setUserPass(uid, password) InfoDialog(_("Password changed"), title=_("Info")) self.resetWidgets() def slotTextChanged(self): p1 = self.ui.pass1.text() p2 = self.ui.pass2.text() if not self.ui.userList.currentItem(): return user = self.ui.userList.currentItem().getInfo() if not p1 == '' and (str(p1).lower() == str(user[1]).lower() or \ str(p1).lower() == str(user[2]).lower()): self.showError( _('Don\'t use your user name or name as a password.')) return elif p2 != p1 and p2: self.showError(_('Passwords do not match!')) return elif len(p1) == len(p2) and len(p2) < 4 and not p1 == '': self.showError(_('Password is too short!')) return elif p1 == '' or p2 == '': self.ui.pass_error.setVisible(False) return else: self.ui.pass_error.setVisible(False) self.ui.updatePassword.setEnabled(True) def shown(self): ctx.mainScreen.disableBack() ctx.yali.info.show() self.steps.slotRunOperations() ctx.yali.info.hide() def fillUserList(self): users = yali4.postinstall.getUserList() for user in users: UserItem(self.ui.userList, user) def execute(self): return True def backCheck(self): ctx.mainScreen.moveInc = 3 return True