fix error when opening old deck options in python 3.10

Closes #1616
This commit is contained in:
Damien Elmes 2022-02-11 10:59:04 +10:00
parent 6c8cdc0a0c
commit 62426279ff

View File

@ -204,7 +204,7 @@ class DeckConf(QDialog):
f.lrnSteps.setText(self.listToUser(c["delays"])) f.lrnSteps.setText(self.listToUser(c["delays"]))
f.lrnGradInt.setValue(c["ints"][0]) f.lrnGradInt.setValue(c["ints"][0])
f.lrnEasyInt.setValue(c["ints"][1]) f.lrnEasyInt.setValue(c["ints"][1])
f.lrnFactor.setValue(c["initialFactor"] / 10.0) f.lrnFactor.setValue(int(c["initialFactor"] / 10.0))
f.newOrder.setCurrentIndex(c["order"]) f.newOrder.setCurrentIndex(c["order"])
f.newPerDay.setValue(c["perDay"]) f.newPerDay.setValue(c["perDay"])
f.bury.setChecked(c.get("bury", True)) f.bury.setChecked(c.get("bury", True))
@ -212,7 +212,7 @@ class DeckConf(QDialog):
# rev # rev
c = self.conf["rev"] c = self.conf["rev"]
f.revPerDay.setValue(c["perDay"]) f.revPerDay.setValue(c["perDay"])
f.easyBonus.setValue(c["ease4"] * 100) f.easyBonus.setValue(int(c["ease4"] * 100))
f.fi1.setValue(c["ivlFct"] * 100) f.fi1.setValue(c["ivlFct"] * 100)
f.maxIvl.setValue(c["maxIvl"]) f.maxIvl.setValue(c["maxIvl"])
f.revplim.setText(self.parentLimText("rev")) f.revplim.setText(self.parentLimText("rev"))
@ -224,7 +224,7 @@ class DeckConf(QDialog):
# lapse # lapse
c = self.conf["lapse"] c = self.conf["lapse"]
f.lapSteps.setText(self.listToUser(c["delays"])) f.lapSteps.setText(self.listToUser(c["delays"]))
f.lapMult.setValue(c["mult"] * 100) f.lapMult.setValue(int(c["mult"] * 100))
f.lapMinInt.setValue(c["minInt"]) f.lapMinInt.setValue(c["minInt"])
f.leechThreshold.setValue(c["leechFails"]) f.leechThreshold.setValue(c["leechFails"])
f.leechAction.setCurrentIndex(c["leechAction"]) f.leechAction.setCurrentIndex(c["leechAction"])