mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 14:17:13 -05:00
add audio preview back to card layout
This commit is contained in:
parent
d9fdf6dc01
commit
b181f274b0
1 changed files with 6 additions and 0 deletions
|
|
@ -25,6 +25,7 @@ class CardLayout(QDialog):
|
||||||
self.model = note.model()
|
self.model = note.model()
|
||||||
self.mw.checkpoint(_("Card Layout"))
|
self.mw.checkpoint(_("Card Layout"))
|
||||||
self.addMode = addMode
|
self.addMode = addMode
|
||||||
|
self.playedAudio = {}
|
||||||
if addMode:
|
if addMode:
|
||||||
# save it to DB temporarily
|
# save it to DB temporarily
|
||||||
note.flush()
|
note.flush()
|
||||||
|
|
@ -180,6 +181,11 @@ Please create a new card first."""))
|
||||||
html % (base, "", ti(mungeQA(c.q(reload=True)))))
|
html % (base, "", ti(mungeQA(c.q(reload=True)))))
|
||||||
self.tab['pform'].back.setHtml(
|
self.tab['pform'].back.setHtml(
|
||||||
html % (base, "", ti(mungeQA(c.a()), 'a')))
|
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'):
|
def maybeTextInput(self, txt, type='q'):
|
||||||
if type == 'q':
|
if type == 'q':
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue