From b181f274b08604a6297c40f40bc168cdf0e5b8ff Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 13 Feb 2012 13:37:28 +0900 Subject: [PATCH] add audio preview back to card layout --- aqt/clayout.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aqt/clayout.py b/aqt/clayout.py index 51e76ce6b..db87d6190 100644 --- a/aqt/clayout.py +++ b/aqt/clayout.py @@ -25,6 +25,7 @@ class CardLayout(QDialog): self.model = note.model() self.mw.checkpoint(_("Card Layout")) self.addMode = addMode + self.playedAudio = {} if addMode: # save it to DB temporarily note.flush() @@ -180,6 +181,11 @@ Please create a new card first.""")) html % (base, "", ti(mungeQA(c.q(reload=True))))) self.tab['pform'].back.setHtml( html % (base, "", ti(mungeQA(c.a()), 'a'))) + clearAudioQueue() + if c.id not in self.playedAudio: + playFromText(c.q()) + playFromText(c.a()) + self.playedAudio[c.id] = True def maybeTextInput(self, txt, type='q'): if type == 'q':