fix options leaking into other fields

This commit is contained in:
Damien Elmes 2010-12-01 02:41:52 +09:00
parent 2a36c4aaaf
commit 56c5bafe97

View file

@ -337,19 +337,23 @@ order by n""", id=card.id)
def readField(self): def readField(self):
field = self.field field = self.field
self.updatingFields = True
self.form.fieldName.setText(field.name) self.form.fieldName.setText(field.name)
self.form.fieldUnique.setChecked(field.unique) self.form.fieldUnique.setChecked(field.unique)
self.form.fieldRequired.setChecked(field.required) self.form.fieldRequired.setChecked(field.required)
self.form.numeric.setChecked(field.numeric) self.form.numeric.setChecked(field.numeric)
if field.quizFontFamily: if not field.quizFontFamily:
self.form.fontFamily.setCurrentFont(QFont( # backwards compat
field.quizFontFamily)) field.quizFontFamily = u"Arial"
self.form.fontFamily.setCurrentFont(QFont(
field.quizFontFamily))
self.form.fontSize.setValue(field.quizFontSize or 20) self.form.fontSize.setValue(field.quizFontSize or 20)
self.form.fontSizeEdit.setValue(field.editFontSize or 20) self.form.fontSizeEdit.setValue(field.editFontSize or 20)
self.form.fontColour.setPalette(QPalette(QColor( self.form.fontColour.setPalette(QPalette(QColor(
field.quizFontColour or "#000000"))) field.quizFontColour or "#000000")))
self.form.rtl.setChecked(not not field.features) self.form.rtl.setChecked(not not field.features)
self.form.preserveWhitespace.setChecked(not not field.editFontFamily) self.form.preserveWhitespace.setChecked(not not field.editFontFamily)
self.updatingFields = False
def saveField(self, *args): def saveField(self, *args):
self.needFieldRebuild = True self.needFieldRebuild = True