mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
show parent limit in options
This commit is contained in:
parent
21e1fc202c
commit
0b3291d589
2 changed files with 30 additions and 0 deletions
|
@ -140,6 +140,20 @@ class DeckConf(QDialog):
|
|||
def listToUser(self, l):
|
||||
return " ".join([str(x) for x in l])
|
||||
|
||||
def parentLimText(self, type="new"):
|
||||
# top level?
|
||||
if "::" not in self.deck['name']:
|
||||
return ""
|
||||
lim = -1
|
||||
for d in self.mw.col.decks.parents(self.deck['id']):
|
||||
c = self.mw.col.decks.confForDid(d)
|
||||
x = c[type]['perDay']
|
||||
if lim == -1:
|
||||
lim = x
|
||||
else:
|
||||
lim = min(x, lim)
|
||||
return _("(parent limit: %d)") % lim
|
||||
|
||||
def loadConf(self):
|
||||
self.conf = self.mw.col.decks.confForDid(self.deck['id'])
|
||||
# new
|
||||
|
@ -151,6 +165,7 @@ class DeckConf(QDialog):
|
|||
f.newOrder.setCurrentIndex(c['order'])
|
||||
f.newPerDay.setValue(c['perDay'])
|
||||
f.separate.setChecked(c['separate'])
|
||||
f.newplim.setText(self.parentLimText('new'))
|
||||
# rev
|
||||
c = self.conf['rev']
|
||||
f.revPerDay.setValue(c['perDay'])
|
||||
|
@ -159,6 +174,7 @@ class DeckConf(QDialog):
|
|||
f.easyBonus.setValue(c['ease4']*100)
|
||||
f.fi1.setValue(c['fi'][0])
|
||||
f.fi2.setValue(c['fi'][1])
|
||||
f.revplim.setText(self.parentLimText('rev'))
|
||||
# lapse
|
||||
c = self.conf['lapse']
|
||||
f.lapSteps.setText(self.listToUser(c['delays']))
|
||||
|
|
|
@ -166,6 +166,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QLabel" name="newplim">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
@ -326,6 +333,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="revplim">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
|
Loading…
Reference in a new issue