mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
fix reading generation sticking
This commit is contained in:
parent
9f2572d6ef
commit
5421029176
1 changed files with 6 additions and 3 deletions
|
@ -47,6 +47,7 @@ class FactEditor(object):
|
||||||
os.chdir(self.deck.mediaDir(create=True))
|
os.chdir(self.deck.mediaDir(create=True))
|
||||||
|
|
||||||
def setupFields(self):
|
def setupFields(self):
|
||||||
|
# init for later
|
||||||
self.fields = {}
|
self.fields = {}
|
||||||
# top level vbox
|
# top level vbox
|
||||||
self.fieldsBox = QVBoxLayout(self.widget)
|
self.fieldsBox = QVBoxLayout(self.widget)
|
||||||
|
@ -174,7 +175,6 @@ class FactEditor(object):
|
||||||
self.latexMathEnv.setEnabled(False)
|
self.latexMathEnv.setEnabled(False)
|
||||||
self.iconsBox.addWidget(self.latexMathEnv)
|
self.iconsBox.addWidget(self.latexMathEnv)
|
||||||
self.latexMathEnv.setStyle(self.plastiqueStyle)
|
self.latexMathEnv.setStyle(self.plastiqueStyle)
|
||||||
|
|
||||||
self.fieldsFrame = None
|
self.fieldsFrame = None
|
||||||
self.widget.setLayout(self.fieldsBox)
|
self.widget.setLayout(self.fieldsBox)
|
||||||
|
|
||||||
|
@ -242,8 +242,11 @@ class FactEditor(object):
|
||||||
def loadFields(self, check=True, font=True):
|
def loadFields(self, check=True, font=True):
|
||||||
"Update field text (if changed) and font/colours."
|
"Update field text (if changed) and font/colours."
|
||||||
# text
|
# text
|
||||||
for (name, (field, w)) in self.fields.items():
|
for field in self.fact.fields:
|
||||||
new = self.fact[name]
|
w = self.fields[field.name][1]
|
||||||
|
self.fields[field.name] = (field, w)
|
||||||
|
self.widgets[w] = field
|
||||||
|
new = self.fact[field.name]
|
||||||
old = tidyHTML(unicode(w.toHtml()))
|
old = tidyHTML(unicode(w.toHtml()))
|
||||||
# only update if something has changed, to preserve the cursor
|
# only update if something has changed, to preserve the cursor
|
||||||
if new != old:
|
if new != old:
|
||||||
|
|
Loading…
Reference in a new issue