From 08747747bffc22e286b3ead88641e7c9dfbe4157 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 10 Jan 2017 18:32:48 +1000 Subject: [PATCH] prevent preview stealing focus in clayout setHtml() steals focus due to webengine bug - fixes https://anki.tenderapp.com/discussions/beta-testing/206-anki-210-alpha-7#comment_41700440 --- aqt/clayout.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aqt/clayout.py b/aqt/clayout.py index 993889142..87efb71ce 100644 --- a/aqt/clayout.py +++ b/aqt/clayout.py @@ -226,12 +226,16 @@ Please create a new card type first.""")) c = self.card ti = self.maybeTextInput base = self.mw.baseHTML() + self.tab['pform'].frontWeb.setEnabled(False) + self.tab['pform'].backWeb.setEnabled(False) 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), 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), + self.tab['pform'].frontWeb.setEnabled(True) + self.tab['pform'].backWeb.setEnabled(True) clearAudioQueue() if c.id not in self.playedAudio: playFromText(c.q())