play sounds when previewing

This commit is contained in:
Damien Elmes 2008-11-23 17:17:28 +09:00
parent 8cbf2f04f5
commit 9a696a48ec

View file

@ -6,6 +6,7 @@ from PyQt4.QtGui import *
from PyQt4.QtCore import * from PyQt4.QtCore import *
import re, os, sys import re, os, sys
from anki.utils import parseTags, stripHTML, tidyHTML from anki.utils import parseTags, stripHTML, tidyHTML
from anki.sound import playFromText
import anki.sound import anki.sound
from ankiqt import ui from ankiqt import ui
import ankiqt import ankiqt
@ -628,6 +629,8 @@ class PreviewDialog(QDialog):
"<style>" + self.deck.css + "</style>" + "<style>" + self.deck.css + "</style>" +
mungeQA(self.deck, c.htmlQuestion()) + mungeQA(self.deck, c.htmlQuestion()) +
mungeQA(self.deck, c.htmlAnswer())) mungeQA(self.deck, c.htmlAnswer()))
playFromText(c.question)
playFromText(c.answer)
def onChange(self, idx): def onChange(self, idx):
self.currentCard = idx self.currentCard = idx