only play audio once

This commit is contained in:
Damien Elmes 2010-12-01 02:45:04 +09:00
parent 56c5bafe97
commit a7a7ae1cf2

View file

@ -63,6 +63,7 @@ class CardLayout(QDialog):
def setupCards(self): def setupCards(self):
self.needFormatRebuild = False self.needFormatRebuild = False
self.updatingCards = False self.updatingCards = False
self.playedAudio = False
# replace with more appropriate size hints # replace with more appropriate size hints
for e in ("cardQuestion", "cardAnswer"): for e in ("cardQuestion", "cardAnswer"):
w = getattr(self.form, e) w = getattr(self.form, e)
@ -249,8 +250,10 @@ order by n""", id=card.id)
c) c)
+ "</body></html>") + "</body></html>")
clearAudioQueue() clearAudioQueue()
playFromText(c.question) if not self.playedAudio:
playFromText(c.answer) playFromText(c.question)
playFromText(c.answer)
self.playedAudio = True
def reject(self): def reject(self):
modified = False modified = False