sticky fields; add forget option to leeches

This commit is contained in:
Damien Elmes 2011-04-17 05:33:00 +09:00
parent 344b111b80
commit 3c269d5fba
3 changed files with 7 additions and 2 deletions

View file

@ -17,7 +17,7 @@ defaultConf = {
'minInt': 1,
'relearn': True,
'leechFails': 16,
# [type, data], where type 0=suspend, 1=tagonly
# [type, data], where type 0=suspend, 1=tagonly, 2=forget
'leechAction': [0],
},
'cram': {

View file

@ -26,6 +26,7 @@ defaultField = {
'esize': 20,
'qcol': "#000",
'pre': True,
'sticky': False,
}
defaultTemplate = {

View file

@ -542,9 +542,13 @@ queue = 2 %s and due <= :lim order by %s limit %d""" % (
f.addTag("leech")
f.flush()
# handle
if conf['leechAction'][0] == 0:
a = conf['leechAction'][0]
if a == 0:
self.suspendCards([card.id])
card.queue = -1
elif a == 2:
self.resetCards([card.id])
card.due = 1000000
# notify UI
runHook("leech", card)