fix clayout preview, js errors

.exec_() and webengineview don't seem to play nicely together
This commit is contained in:
Damien Elmes 2016-07-07 12:32:27 +10:00
parent f8e300ab1d
commit d94c011c88
2 changed files with 5 additions and 11 deletions

View File

@ -48,7 +48,8 @@ class CardLayout(QDialog):
self.setLayout(v1)
self.redraw()
restoreGeom(self, "CardLayout")
self.exec_()
self.setWindowModality(Qt.ApplicationModal)
self.show()
def redraw(self):
self.cards = self.col.previewCards(self.note, 2)
@ -227,12 +228,10 @@ Please create a new card type first."""))
base = getBase(self.mw.col)
self.tab['pform'].frontWeb.stdHtml(
ti(mungeQA(self.mw.col, c.q(reload=True))), self.mw.reviewer._styles(),
bodyClass="card card%d" % (c.ord+1), head=base,
js=anki.js.browserSel)
bodyClass="card card%d" % (c.ord+1), head=base),
self.tab['pform'].backWeb.stdHtml(
ti(mungeQA(self.mw.col, c.a()), type='a'), self.mw.reviewer._styles(),
bodyClass="card card%d" % (c.ord+1), head=base,
js=anki.js.browserSel)
bodyClass="card card%d" % (c.ord+1), head=base),
clearAudioQueue()
if c.id not in self.playedAudio:
playFromText(c.q())

View File

@ -458,12 +458,7 @@ class Editor(object):
ord = self.card.ord
else:
ord = 0
# passing parentWindow leads to crash on windows at the moment
if isWin:
parent=None
else:
parent=self.parentWindow
CardLayout(self.mw, self.note, ord=ord, parent=parent,
CardLayout(self.mw, self.note, ord=ord, parent=self.parentWindow,
addMode=self.addMode)
if isWin:
self.parentWindow.activateWindow()