~kevang/mnemosyne-proj/grade-shortcuts-improvements

« back to all changes in this revision

Viewing changes to mnemosyne/mnemosyne/pyqt_ui/review_wdgt.py

  • Committer: pbienst
  • Date: 2008-07-23 09:59:16 UTC
  • Revision ID: svn-v3-trunk0:e5e6b78b-db40-0410-9517-b98c64f8d2c1:trunk:467
Progress dump.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
 
13
13
from ui_review_wdgt import *
14
14
 
 
15
from mnemosyne.libmnemosyne.plugin_manager import get_ui_controller
 
16
from mnemosyne.libmnemosyne.config import config
 
17
 
 
18
 
15
19
 
16
20
##############################################################################
17
21
#
18
 
# ReviewWdget
 
22
# ReviewWdgettable {margin-left:auto; margin-right:auto; height:100%;}
19
23
#
20
24
##############################################################################
21
25
 
34
38
 
35
39
 
36
40
        self.question.setHtml("""
37
 
<html>
38
 
<head>
 
41
<html><head>
 
42
 
39
43
<style type="text/css">
40
44
 
41
 
body {
42
 
        color: black;
 
45
table { margin-left: auto;
 
46
        margin-right: auto; /* Centers the table, but not it's contents. */
 
47
        height: 100%; }
 
48
 
 
49
body {  color: black;
43
50
        background-color: white;
44
51
        margin: 0;
45
52
        padding: 0;
46
53
        border: thin solid #8F8F8F; }
47
54
 
48
55
#q { font-weight: bold;
49
 
     text-align: center; }
 
56
     text-align: center; } /* Align contents within the cell. */
50
57
        
51
58
#a { color: green;
52
59
     text-align: center; }
53
60
        
54
 
</style>
55
 
</head>
56
 
<body>
57
 
<table height="100%" align="center">
58
 
<tr>
59
 
<td>
 
61
</style></head>
 
62
<body><table><tr><td>
 
63
 
60
64
<p id='q'>
61
65
question
62
66
</p>
64
68
answer
65
69
</p>
66
70
 
67
 
</td>
68
 
</tr>
69
 
</table>
70
 
</body>
71
 
</html>
 
71
</td></tr></table></body></html>
72
72
""")
73
73
 
74
74
 
75
 
        self.controller = controller
 
75
        self.controller = get_ui_controller()
76
76
 
77
77
        self.card = None # To controller?
78
78
 
183
183
 
184
184
    def updateDialog(self):
185
185
 
 
186
        # TODO: throw this option out?
 
187
 
186
188
        # Update toolbar.
187
189
 
188
 
        if get_config("hide_toolbar") == True:
189
 
            self.toolBar.hide()
190
 
            self.actionShowToolbar.setChecked(0)
191
 
        else:
192
 
            self.toolBar.show()
193
 
            self.actionShowToolbar.setChecked(1)
 
190
        #if config["hide_toolbar"] == True:
 
191
        #    self.parent.toolbar.hide()
 
192
        #    self.actionShowToolbar.setChecked(0)
 
193
        #else:
 
194
        #    self.parent.toolbar.show()
 
195
        #    self.actionShowToolbar.setChecked(1)
194
196
 
195
197
        # Update question and answer font.
196
198
 
197
 
        if get_config("QA_font") != None:
 
199
        if config["QA_font"] != None:
198
200
            font = QFont()
199
 
            font.fromString(get_config("QA_font"))
 
201
            font.fromString(config["QA_font"])
200
202
        else:
201
203
            font = self.show_button.font()
202
204
 
217
219
 
218
220
        # Update status bar.
219
221
 
220
 
        self.sched .setText(self.trUtf8("Scheduled: ").append(QString(\
221
 
                            str(scheduled_cards()))))
222
 
        self.notmem.setText(self.trUtf8("Not memorised: ").append(QString(\
223
 
                            str(non_memorised_cards()))))
224
 
        self.all   .setText(self.trUtf8("All: ").append(QString(\
225
 
                            str(active_cards()))))
 
222
 
 
223
        # TODO: move to main window controller
 
224
 
 
225
        #self.sched .setText(self.trUtf8("Scheduled: ").append(QString(\
 
226
        #                    str(scheduled_cards()))))
 
227
        #self.notmem.setText(self.trUtf8("Not memorised: ").append(QString(\
 
228
        #                    str(non_memorised_cards()))))
 
229
        #self.all   .setText(self.trUtf8("All: ").append(QString(\
 
230
        #                    str(active_cards()))))
226
231
 
227
232
        # TODO: autoshrinking?
228
233
        #if self.shrink == True: