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

« back to all changes in this revision

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

  • Committer: Kilian Evang
  • Date: 2015-05-12 13:44:26 UTC
  • Revision ID: noreply@texttheater.net-20150512134426-qla5fmyglw5mfnwk
ReviewWdgt no longer associates shortcuts with grade buttons, instead handles
all key presses in the keyPressEvent method. I think this allows for a more
unified, less error-prone treatment of the keyboard interface.

In addition, it now always avoids reacting to auto-repeated grade key presses.
For example, if you press a number key to show the answer and hold it down for
too long, it would previously immediately grade the card. This is no longer the
case. There was no obvious way to solve this problem with the shortcuts.

Furthermore, it now always avoids grading the current card when the answer is
not showing. Previously, there was a race condition that could lead to two
cards being graded in a row when the user accidentally hit two grade keys at
once, see https://code.launchpad.net/~kevang/mnemosyne-proj/grade_only_if_showing/+merge/235605
for a detailed description.

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
            <property name="text">
116
116
             <string>0</string>
117
117
            </property>
118
 
            <property name="shortcut">
119
 
             <string>0</string>
120
 
            </property>
121
118
           </widget>
122
119
          </item>
123
120
          <item>
125
122
            <property name="text">
126
123
             <string>1</string>
127
124
            </property>
128
 
            <property name="shortcut">
129
 
             <string>1</string>
130
 
            </property>
131
125
           </widget>
132
126
          </item>
133
127
          <item>
142
136
            <property name="text">
143
137
             <string>2</string>
144
138
            </property>
145
 
            <property name="shortcut">
146
 
             <string>2</string>
147
 
            </property>
148
139
           </widget>
149
140
          </item>
150
141
          <item>
152
143
            <property name="text">
153
144
             <string>3</string>
154
145
            </property>
155
 
            <property name="shortcut">
156
 
             <string>3</string>
157
 
            </property>
158
146
           </widget>
159
147
          </item>
160
148
          <item>
162
150
            <property name="text">
163
151
             <string>4</string>
164
152
            </property>
165
 
            <property name="shortcut">
166
 
             <string>4</string>
167
 
            </property>
168
153
           </widget>
169
154
          </item>
170
155
          <item>
172
157
            <property name="text">
173
158
             <string>5</string>
174
159
            </property>
175
 
            <property name="shortcut">
176
 
             <string>5</string>
177
 
            </property>
178
160
           </widget>
179
161
          </item>
180
162
         </layout>