mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
fix bug with preview
This commit is contained in:
parent
d239049c18
commit
a188f9d5c1
1 changed files with 3 additions and 2 deletions
|
@ -501,7 +501,7 @@ class FactEditor(object):
|
||||||
w.moveCursor(QTextCursor.PreviousCharacter)
|
w.moveCursor(QTextCursor.PreviousCharacter)
|
||||||
|
|
||||||
def onPreview(self):
|
def onPreview(self):
|
||||||
PreviewDialog(self.parent, self.deck, self.fact).exec_()
|
PreviewDialog(self.parent, self.deck, self.fact)
|
||||||
|
|
||||||
def onHtmlEdit(self):
|
def onHtmlEdit(self):
|
||||||
def helpRequested():
|
def helpRequested():
|
||||||
|
@ -643,7 +643,7 @@ class PreviewDialog(QDialog):
|
||||||
cards = self.deck.previewFact(self.fact)
|
cards = self.deck.previewFact(self.fact)
|
||||||
if not cards:
|
if not cards:
|
||||||
ui.utils.showInfo(_("No cards to preview."),
|
ui.utils.showInfo(_("No cards to preview."),
|
||||||
parent=self.parent)
|
parent=parent)
|
||||||
return
|
return
|
||||||
self.cards = cards
|
self.cards = cards
|
||||||
self.currentCard = 0
|
self.currentCard = 0
|
||||||
|
@ -655,6 +655,7 @@ class PreviewDialog(QDialog):
|
||||||
self.onChange)
|
self.onChange)
|
||||||
self.updateCard()
|
self.updateCard()
|
||||||
restoreGeom(self, "preview")
|
restoreGeom(self, "preview")
|
||||||
|
self.exec_()
|
||||||
|
|
||||||
def updateCard(self):
|
def updateCard(self):
|
||||||
c = self.cards[self.currentCard]
|
c = self.cards[self.currentCard]
|
||||||
|
|
Loading…
Reference in a new issue