def keyPressEvent(self, event): if self.review_controller().is_answer_showing(): if event.key() in [QtCore.Qt.Key_0, QtCore.Qt.Key_1, QtCore.Qt.Key_W]: return self.grade_answer(0) elif event.key() in [QtCore.Qt.Key_2, QtCore.Qt.Key_3, QtCore.Qt.Key_4, QtCore.Qt.Key_5, QtCore.Qt.Key_R]: return self.grade_answer(5) ReviewWdgt.keyPressEvent(self, event)
def keyPressEvent(self, event): if self.review_controller().is_answer_showing(): if event.key() in [ QtCore.Qt.Key_0, QtCore.Qt.Key_1, QtCore.Qt.Key_W ]: return self.grade_answer(0) elif event.key() in [ QtCore.Qt.Key_2, QtCore.Qt.Key_3, QtCore.Qt.Key_4, QtCore.Qt.Key_5, QtCore.Qt.Key_R ]: return self.grade_answer(5) ReviewWdgt.keyPressEvent(self, event)
def __init__(self, component_manager): ReviewWdgt.__init__(self, component_manager) self.auto_focus_grades = False # Change shortcuts for the grade buttons. self.grade_0_button.setShortcut("q") self.grade_1_button.setShortcut("w") self.grade_2_button.setShortcut("e") self.grade_3_button.setShortcut("r") self.grade_4_button.setShortcut("t") self.grade_5_button.setShortcut("y")
def __init__(self, component_manager): ReviewWdgt.__init__(self, component_manager) self.grade_0_button.setText(_("&Wrong")) self.grade_1_button.hide() self.line.hide() self.grade_2_button.hide() self.grade_3_button.hide() self.grade_4_button.hide() self.grade_5_button.setText(_("&Right")) self.grade_5_button.setFocus() parent = self.parent() self.wrong = QtGui.QLabel("", parent.statusbar) self.unseen = QtGui.QLabel("", parent.statusbar) self.active = QtGui.QLabel("", parent.statusbar) parent.clear_statusbar() parent.add_to_statusbar(self.wrong) parent.add_to_statusbar(self.unseen) parent.add_to_statusbar(self.active)
def __init__(self, component_manager): ReviewWdgt.__init__(self, component_manager) self.grade_0_button.setText(_("&Wrong")) self.grade_1_button.hide() self.line.hide() self.grade_2_button.hide() self.grade_3_button.hide() self.grade_4_button.hide() self.grade_5_button.setText(_("&Right")) self.grade_5_button.setFocus() parent = self.parent() self.wrong = QtGui.QLabel("", parent.status_bar) self.unseen = QtGui.QLabel("", parent.status_bar) self.active = QtGui.QLabel("", parent.status_bar) parent.clear_status_bar() parent.add_to_status_bar(self.wrong) parent.add_to_status_bar(self.unseen) parent.add_to_status_bar(self.active)
def __init__(self, component_manager): ReviewWdgt.__init__(self, component_manager) self.auto_focus_grades = False self.number_keys_show_answer = False