mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
_fields -> fields
This commit is contained in:
parent
2245be962a
commit
8865ca6131
6 changed files with 15 additions and 11 deletions
|
@ -93,9 +93,9 @@ class AddCards(QDialog):
|
|||
# copy fields from old fact
|
||||
if oldFact:
|
||||
self.removeTempFact(oldFact)
|
||||
for n in range(len(fact._fields)):
|
||||
for n in range(len(fact.fields)):
|
||||
try:
|
||||
fact._fields[n] = oldFact._fields[n]
|
||||
fact.fields[n] = oldFact.fields[n]
|
||||
except IndexError:
|
||||
break
|
||||
self.editor.setFact(fact)
|
||||
|
@ -107,7 +107,7 @@ class AddCards(QDialog):
|
|||
self.mw.deck._delFacts([fact.id])
|
||||
|
||||
def addHistory(self, fact):
|
||||
txt = stripHTMLMedia(",".join(fact._fields))[:30]
|
||||
txt = stripHTMLMedia(",".join(fact.fields))[:30]
|
||||
self.history.append((fact.id, txt))
|
||||
self.history = self.history[-15:]
|
||||
self.historyButton.setEnabled(True)
|
||||
|
|
|
@ -195,7 +195,7 @@ class DeckModel(QAbstractTableModel):
|
|||
return self.formatQA(c.a())
|
||||
elif type == "factFld":
|
||||
f = c.fact()
|
||||
return self.formatQA(f._fields[f.model().sortIdx()])
|
||||
return self.formatQA(f.fields[f.model().sortIdx()])
|
||||
elif type == "template":
|
||||
return c.template()['name']
|
||||
elif type == "cardDue":
|
||||
|
|
|
@ -311,7 +311,7 @@ class Editor(object):
|
|||
# focus lost or key/button pressed?
|
||||
if str.startswith("blur") or str.startswith("key"):
|
||||
(type, txt) = str.split(":", 1)
|
||||
self.fact._fields[self.currentField] = self.mungeHTML(txt)
|
||||
self.fact.fields[self.currentField] = self.mungeHTML(txt)
|
||||
if type == "blur":
|
||||
if not self._keepButtons:
|
||||
self.disableButtons()
|
||||
|
@ -405,7 +405,7 @@ class Editor(object):
|
|||
def fieldsAreBlank(self):
|
||||
if not self.fact:
|
||||
return True
|
||||
for f in self.fact._fields:
|
||||
for f in self.fact.fields:
|
||||
if f:
|
||||
return False
|
||||
return True
|
||||
|
@ -420,10 +420,10 @@ class Editor(object):
|
|||
form.setupUi(d)
|
||||
d.connect(form.buttonBox, SIGNAL("helpRequested()"),
|
||||
lambda: aqt.openHelp("HtmlEditor"))
|
||||
form.textEdit.setPlainText(self.fact._fields[self.currentField])
|
||||
form.textEdit.setPlainText(self.fact.fields[self.currentField])
|
||||
form.textEdit.moveCursor(QTextCursor.End)
|
||||
d.exec_()
|
||||
self.fact._fields[self.currentField] = unicode(
|
||||
self.fact.fields[self.currentField] = unicode(
|
||||
form.textEdit.toPlainText())
|
||||
self.loadFact(self.currentField)
|
||||
|
||||
|
@ -503,7 +503,7 @@ class Editor(object):
|
|||
showInfo(_("Please add a cloze deletion model."),
|
||||
help="ClozeDeletion")
|
||||
return
|
||||
f = self.fact._fields[self.currentField]
|
||||
f = self.fact.fields[self.currentField]
|
||||
# find the highest existing cloze
|
||||
m = re.findall("\{\{c(\d+)::", f)
|
||||
if m:
|
||||
|
|
|
@ -238,7 +238,7 @@ title="%s">%s</button>''' % (
|
|||
def onUpgrade(self, db):
|
||||
self.upgrading = True
|
||||
self.progress.setupDB(db)
|
||||
self.progress.start(label=_("Upgrading..."))
|
||||
self.progress.start(label=_("Upgrading. Please be patient..."))
|
||||
|
||||
# Deck loading
|
||||
##########################################################################
|
||||
|
|
|
@ -6,6 +6,10 @@ import time
|
|||
from PyQt4.QtGui import *
|
||||
from PyQt4.QtCore import *
|
||||
|
||||
# fixme: if mw->subwindow opens a progress dialog with mw as the parent, mw
|
||||
# gets raised on finish on compiz. perhaps we should be using the progress
|
||||
# dialog as the parent?
|
||||
|
||||
# Progress info
|
||||
##########################################################################
|
||||
|
||||
|
|
|
@ -378,7 +378,7 @@ div#filler {
|
|||
ord = self.typeAns()
|
||||
try:
|
||||
cor = self.mw.deck.media.strip(
|
||||
stripHTML(self.card.fact()._fields[ord]))
|
||||
stripHTML(self.card.fact().fields[ord]))
|
||||
except IndexError:
|
||||
self.card.template()['typeAns'] = None
|
||||
self.card.model().flush()
|
||||
|
|
Loading…
Reference in a new issue