def onClearPW(self): r = utils.questionBox("Do you really want to clear your LaTeX server " "password and all saved email " "passwords for all classes?", "Clear passwords?") if r == QMessageBox.Yes: ui.prefs.wipeAllPasswords(self.databaseConfig) utils.informationBox("All saved passwords have been cleared.", "Success")
def reject(self): if self.hasSaved and self.displayCloseConfirm: r = utils.questionBox("If you return to the settings now, no " "history entry will be saved for this quiz and the selected " "new set(s) will not be scheduled for review. You should " "continue only if you do not want to use this quiz in your " "class. Really continue?", "Really cancel reschedule?") if r != QMessageBox.Yes: return self.parent.previewResult = False QDialog.reject(self)
def accept(self): r = utils.questionBox("Rescheduling will place your selected new sets " "into review and schedule any review sets " "further into the future. Rescheduling cannot " "be undone. Continue?", "Confirm Reschedule") if r == QMessageBox.Yes: self.parent.quiz.rewriteSchedule() self.parent.previewResult = True utils.informationBox("The quiz was exported successfully. " "Sets have been rescheduled.", "Quiz generated") QDialog.accept(self)
def onDeleteResults(self): r = utils.questionBox( "Are you sure you want to delete these results? " "You will no longer be able to view them, but if " "you still have the TurningPoint statistics, you " "can import them again.") if not r: return db.results.delResults(self.zid) historyItem = HistoryItem(self.zid) historyItem.rewriteResultsFlag(0) self.accept() # interpreted by caller as needing a table refresh
def toggleShowPW(self): doShow = self.form.showPWCheck.isChecked() if doShow: # if password was saved in the config, don't let it be shown in # plaintext for some basic security if self.passwordWasLoaded: r = utils.questionBox("For security reasons, you cannot view " "any part of a saved password. Would you like to erase " "the saved password?", "Erase Password") if r == QMessageBox.Yes: self.form.passwordBox.setText("") self.passwordWasLoaded = False else: self.form.showPWCheck.setChecked(False) return self.form.passwordBox.setEchoMode(QLineEdit.Normal) else: self.form.passwordBox.setEchoMode(QLineEdit.Password)
def onEmailResults(self): obj = self.tableModel.getObj(self.form.tableView.currentIndex()) if obj.resultsFlag == 2: r = utils.questionBox( "You have already successfully emailed the " "results of this quiz to all students. Do you really want " "to do it again?", " Really send email again?") if r != QMessageBox.Yes: return ew = ui.emailing.EmailingDialog(self, self._currentClass(), self._currentZid(), self.dbConf, self.qConf) success = ew.exec_() if success: utils.informationBox("The results were emailed successfully.", "Email complete") obj = self.tableModel.getObj(self.form.tableView.currentIndex()) obj.rewriteResultsFlag(2) # results emailed