mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
sticky fields; add forget option to leeches
This commit is contained in:
parent
344b111b80
commit
3c269d5fba
3 changed files with 7 additions and 2 deletions
|
@ -17,7 +17,7 @@ defaultConf = {
|
||||||
'minInt': 1,
|
'minInt': 1,
|
||||||
'relearn': True,
|
'relearn': True,
|
||||||
'leechFails': 16,
|
'leechFails': 16,
|
||||||
# [type, data], where type 0=suspend, 1=tagonly
|
# [type, data], where type 0=suspend, 1=tagonly, 2=forget
|
||||||
'leechAction': [0],
|
'leechAction': [0],
|
||||||
},
|
},
|
||||||
'cram': {
|
'cram': {
|
||||||
|
|
|
@ -26,6 +26,7 @@ defaultField = {
|
||||||
'esize': 20,
|
'esize': 20,
|
||||||
'qcol': "#000",
|
'qcol': "#000",
|
||||||
'pre': True,
|
'pre': True,
|
||||||
|
'sticky': False,
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultTemplate = {
|
defaultTemplate = {
|
||||||
|
|
|
@ -542,9 +542,13 @@ queue = 2 %s and due <= :lim order by %s limit %d""" % (
|
||||||
f.addTag("leech")
|
f.addTag("leech")
|
||||||
f.flush()
|
f.flush()
|
||||||
# handle
|
# handle
|
||||||
if conf['leechAction'][0] == 0:
|
a = conf['leechAction'][0]
|
||||||
|
if a == 0:
|
||||||
self.suspendCards([card.id])
|
self.suspendCards([card.id])
|
||||||
card.queue = -1
|
card.queue = -1
|
||||||
|
elif a == 2:
|
||||||
|
self.resetCards([card.id])
|
||||||
|
card.due = 1000000
|
||||||
# notify UI
|
# notify UI
|
||||||
runHook("leech", card)
|
runHook("leech", card)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue