option to toggle cloze behaviour in clayout

This commit is contained in:
Damien Elmes 2011-04-17 06:54:36 +09:00
parent c3b0d51f1c
commit d081a3f864
2 changed files with 12 additions and 0 deletions

View file

@ -104,6 +104,7 @@ class CardLayout(QDialog):
c(f.allowEmptyAnswer, SIGNAL("clicked()"), self.saveCard)
c(f.typeAnswer, SIGNAL("activated(int)"), self.saveCard)
c(f.flipButton, SIGNAL("clicked()"), self.onFlip)
c(f.clozectx, SIGNAL("clicked()"), self.saveCard)
def linkClicked(url):
QDesktopServices.openUrl(QUrl(url))
f.preview.page().setLinkDelegationPolicy(
@ -162,6 +163,8 @@ class CardLayout(QDialog):
f.typeAnswer.setCurrentIndex(0)
else:
f.typeAnswer.setCurrentIndex(t['typeAns'] + 1)
# model-level, but there's nowhere else to put this
f.clozectx.setChecked(self.model.conf['clozectx'])
self.updatingCards = False
def fillCardList(self):
@ -199,6 +202,7 @@ class CardLayout(QDialog):
t['typeAns'] = None
else:
t['typeAns'] = idx-1
self.model.conf['clozectx'] = self.form.clozectx.isChecked()
self.renderPreview()
def chooseColour(self, button, type="field"):

View file

@ -216,6 +216,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="clozectx">
<property name="text">
<string>Include context in cloze answers</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
@ -559,6 +566,7 @@
<tabstop>typeAnswer</tabstop>
<tabstop>questionInAnswer</tabstop>
<tabstop>allowEmptyAnswer</tabstop>
<tabstop>clozectx</tabstop>
<tabstop>buttonBox</tabstop>
<tabstop>fieldList</tabstop>
<tabstop>fieldAdd</tabstop>