mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
make sure to display current card in preview, not last
This commit is contained in:
parent
8de899c3f7
commit
7d476586f7
1 changed files with 7 additions and 9 deletions
|
@ -87,13 +87,13 @@ class CardLayout(QDialog):
|
||||||
right = QWidget()
|
right = QWidget()
|
||||||
pform = aqt.forms.preview.Ui_Form()
|
pform = aqt.forms.preview.Ui_Form()
|
||||||
pform.setupUi(right)
|
pform.setupUi(right)
|
||||||
self.frontWeb = AnkiWebView()
|
pform.frontWeb = AnkiWebView()
|
||||||
pform.frontPrevBox.addWidget(self.frontWeb)
|
pform.frontPrevBox.addWidget(pform.frontWeb)
|
||||||
self.backWeb = AnkiWebView()
|
pform.backWeb = AnkiWebView()
|
||||||
pform.backPrevBox.addWidget(self.backWeb)
|
pform.backPrevBox.addWidget(pform.backWeb)
|
||||||
def linkClicked(url):
|
def linkClicked(url):
|
||||||
openLink(url)
|
openLink(url)
|
||||||
for wig in self.frontWeb, self.backWeb:
|
for wig in pform.frontWeb, pform.backWeb:
|
||||||
wig.page().setLinkDelegationPolicy(
|
wig.page().setLinkDelegationPolicy(
|
||||||
QWebPage.DelegateExternalLinks)
|
QWebPage.DelegateExternalLinks)
|
||||||
c(wig, SIGNAL("linkClicked(QUrl)"), linkClicked)
|
c(wig, SIGNAL("linkClicked(QUrl)"), linkClicked)
|
||||||
|
@ -180,14 +180,12 @@ Please create a new card type first."""))
|
||||||
|
|
||||||
def renderPreview(self):
|
def renderPreview(self):
|
||||||
c = self.card
|
c = self.card
|
||||||
html = '''<html><head>%s</head><body class=card>
|
|
||||||
<style>%s</style>%s</body></html>'''
|
|
||||||
ti = self.maybeTextInput
|
ti = self.maybeTextInput
|
||||||
base = getBase(self.mw.col)
|
base = getBase(self.mw.col)
|
||||||
self.frontWeb.stdHtml(
|
self.tab['pform'].frontWeb.stdHtml(
|
||||||
ti(mungeQA(c.q(reload=True))), self.mw.reviewer._styles(),
|
ti(mungeQA(c.q(reload=True))), self.mw.reviewer._styles(),
|
||||||
bodyClass="card", head=base)
|
bodyClass="card", head=base)
|
||||||
self.backWeb.stdHtml(
|
self.tab['pform'].backWeb.stdHtml(
|
||||||
ti(mungeQA(c.a())), self.mw.reviewer._styles(),
|
ti(mungeQA(c.a())), self.mw.reviewer._styles(),
|
||||||
bodyClass="card", head=base)
|
bodyClass="card", head=base)
|
||||||
clearAudioQueue()
|
clearAudioQueue()
|
||||||
|
|
Loading…
Reference in a new issue