mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
option to toggle cloze behaviour in clayout
This commit is contained in:
parent
c3b0d51f1c
commit
d081a3f864
2 changed files with 12 additions and 0 deletions
|
@ -104,6 +104,7 @@ class CardLayout(QDialog):
|
||||||
c(f.allowEmptyAnswer, SIGNAL("clicked()"), self.saveCard)
|
c(f.allowEmptyAnswer, SIGNAL("clicked()"), self.saveCard)
|
||||||
c(f.typeAnswer, SIGNAL("activated(int)"), self.saveCard)
|
c(f.typeAnswer, SIGNAL("activated(int)"), self.saveCard)
|
||||||
c(f.flipButton, SIGNAL("clicked()"), self.onFlip)
|
c(f.flipButton, SIGNAL("clicked()"), self.onFlip)
|
||||||
|
c(f.clozectx, SIGNAL("clicked()"), self.saveCard)
|
||||||
def linkClicked(url):
|
def linkClicked(url):
|
||||||
QDesktopServices.openUrl(QUrl(url))
|
QDesktopServices.openUrl(QUrl(url))
|
||||||
f.preview.page().setLinkDelegationPolicy(
|
f.preview.page().setLinkDelegationPolicy(
|
||||||
|
@ -162,6 +163,8 @@ class CardLayout(QDialog):
|
||||||
f.typeAnswer.setCurrentIndex(0)
|
f.typeAnswer.setCurrentIndex(0)
|
||||||
else:
|
else:
|
||||||
f.typeAnswer.setCurrentIndex(t['typeAns'] + 1)
|
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
|
self.updatingCards = False
|
||||||
|
|
||||||
def fillCardList(self):
|
def fillCardList(self):
|
||||||
|
@ -199,6 +202,7 @@ class CardLayout(QDialog):
|
||||||
t['typeAns'] = None
|
t['typeAns'] = None
|
||||||
else:
|
else:
|
||||||
t['typeAns'] = idx-1
|
t['typeAns'] = idx-1
|
||||||
|
self.model.conf['clozectx'] = self.form.clozectx.isChecked()
|
||||||
self.renderPreview()
|
self.renderPreview()
|
||||||
|
|
||||||
def chooseColour(self, button, type="field"):
|
def chooseColour(self, button, type="field"):
|
||||||
|
|
|
@ -216,6 +216,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="clozectx">
|
||||||
|
<property name="text">
|
||||||
|
<string>Include context in cloze answers</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -559,6 +566,7 @@
|
||||||
<tabstop>typeAnswer</tabstop>
|
<tabstop>typeAnswer</tabstop>
|
||||||
<tabstop>questionInAnswer</tabstop>
|
<tabstop>questionInAnswer</tabstop>
|
||||||
<tabstop>allowEmptyAnswer</tabstop>
|
<tabstop>allowEmptyAnswer</tabstop>
|
||||||
|
<tabstop>clozectx</tabstop>
|
||||||
<tabstop>buttonBox</tabstop>
|
<tabstop>buttonBox</tabstop>
|
||||||
<tabstop>fieldList</tabstop>
|
<tabstop>fieldList</tabstop>
|
||||||
<tabstop>fieldAdd</tabstop>
|
<tabstop>fieldAdd</tabstop>
|
||||||
|
|
Loading…
Reference in a new issue