2
# review_widget.py <Peter.Bienstman@UGent.be>
5
from mnemosyne.libmnemosyne.ui_component import UiComponent
8
class ReviewWidget(UiComponent):
10
"""Describes the interface that the review widget needs to implement
11
in order to be used by the review controller.
13
Note that also the review widget is instantiated late, even though we
14
always need one right from the start of the program. The reason is that
15
there could be many review widgets defined through plugins, and
16
instantiating them all at the start of the program could be slow,
17
especially on mobile devices.
21
component_type = "review_widget"
23
def set_question_box_visible(self, is_visible):
26
def set_answer_box_visible(self, is_visible):
29
def set_question_label(self, text):
32
def set_question(self, text):
35
def set_answer(self, text):
38
def clear_question(self):
41
def clear_answer(self):
44
def update_show_button(self, text, is_default, is_enabled):
47
def set_grades_enabled(self, is_enabled):
49
"""Enable whole grade area, including title."""
53
def set_grade_enabled(self, grade, is_enabled):
55
"""Enable just a single grade button."""
59
def set_default_grade(self, grade):
62
def set_grades_title(self, text):
65
def set_grade_text(self, grade, text):
68
def set_grade_tooltip(self, grade, text):
71
def update_status_bar_counters(self):
74
def repaint_now(self):
76
"""Tell the widget that now would be a good time to repaint
77
immediately. Some toolkits queue repaint events until there is no more
78
processing going on, but this defeats libmnemosyne's optimisation of
79
trying to show the next question before the grading of the previous
80
question is completed.