From d081a3f86405808cce55b73caa9d1465e468bfa6 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 17 Apr 2011 06:54:36 +0900 Subject: [PATCH] option to toggle cloze behaviour in clayout --- aqt/clayout.py | 4 ++++ designer/clayout.ui | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/aqt/clayout.py b/aqt/clayout.py index 5b3549627..216034ab2 100644 --- a/aqt/clayout.py +++ b/aqt/clayout.py @@ -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"): diff --git a/designer/clayout.ui b/designer/clayout.ui index cf6d1b64d..ed134990b 100644 --- a/designer/clayout.ui +++ b/designer/clayout.ui @@ -216,6 +216,13 @@ + + + + Include context in cloze answers + + + @@ -559,6 +566,7 @@ typeAnswer questionInAnswer allowEmptyAnswer + clozectx buttonBox fieldList fieldAdd