mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 16:26:40 -04:00
only mark deck modified if study options changed
This commit is contained in:
parent
4d8446826a
commit
c89356f6f1
1 changed files with 22 additions and 9 deletions
|
@ -1012,6 +1012,7 @@ your deck."""))
|
||||||
self.mainWin.minuteLimit.text()) * 60
|
self.mainWin.minuteLimit.text()) * 60
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
|
self.deck.flushMod()
|
||||||
self.updateStudyStats()
|
self.updateStudyStats()
|
||||||
|
|
||||||
def onNewLimitChanged(self, qstr):
|
def onNewLimitChanged(self, qstr):
|
||||||
|
@ -1020,6 +1021,7 @@ your deck."""))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
self.deck.checkDue()
|
self.deck.checkDue()
|
||||||
|
self.deck.flushMod()
|
||||||
self.statusView.redraw()
|
self.statusView.redraw()
|
||||||
self.updateStudyStats()
|
self.updateStudyStats()
|
||||||
|
|
||||||
|
@ -1129,23 +1131,34 @@ day = :d""", d=yesterday)
|
||||||
self.mainWin.failedCardsOption.setCurrentIndex(self.deck.getFailedCardPolicy())
|
self.mainWin.failedCardsOption.setCurrentIndex(self.deck.getFailedCardPolicy())
|
||||||
|
|
||||||
def onStartReview(self):
|
def onStartReview(self):
|
||||||
|
def uf(obj, field, value):
|
||||||
|
if getattr(obj, field) != value:
|
||||||
|
setattr(obj, field, value)
|
||||||
|
self.deck.flushMod()
|
||||||
self.mainWin.studyOptionsFrame.hide()
|
self.mainWin.studyOptionsFrame.hide()
|
||||||
# make sure the size is updated before button stack shown
|
# make sure the size is updated before button stack shown
|
||||||
self.app.processEvents()
|
self.app.processEvents()
|
||||||
self.config['showStudyOptions'] = self.mainWin.optionsButton.isChecked()
|
self.config['showStudyOptions'] = self.mainWin.optionsButton.isChecked()
|
||||||
try:
|
try:
|
||||||
self.deck.newCardsPerDay = int(self.mainWin.newPerDay.text())
|
uf(self.deck, 'newCardsPerDay', int(self.mainWin.newPerDay.text()))
|
||||||
self.deck.sessionTimeLimit = min(float(
|
uf(self.deck, 'sessionTimeLimit', min(float(
|
||||||
self.mainWin.minuteLimit.text()), 3600) * 60
|
self.mainWin.minuteLimit.text()), 3600) * 60)
|
||||||
self.deck.sessionRepLimit = int(self.mainWin.questionLimit.text())
|
uf(self.deck, 'sessionRepLimit',
|
||||||
|
int(self.mainWin.questionLimit.text()))
|
||||||
except (ValueError, OverflowError):
|
except (ValueError, OverflowError):
|
||||||
pass
|
pass
|
||||||
self.deck.newCardOrder = self.mainWin.newCardOrder.currentIndex()
|
uf(self.deck, 'newCardOrder',
|
||||||
self.deck.newCardSpacing = self.mainWin.newCardScheduling.currentIndex()
|
self.mainWin.newCardOrder.currentIndex())
|
||||||
self.deck.revCardOrder = self.mainWin.revCardOrder.currentIndex()
|
uf(self.deck, 'newCardSpacing',
|
||||||
self.deck.setFailedCardPolicy(self.mainWin.failedCardsOption.currentIndex())
|
self.mainWin.newCardScheduling.currentIndex())
|
||||||
|
uf(self.deck, 'revCardOrder',
|
||||||
|
self.mainWin.revCardOrder.currentIndex())
|
||||||
|
if (self.deck.getFailedCardPolicy() !=
|
||||||
|
self.mainWin.failedCardsOption.currentIndex()):
|
||||||
|
self.deck.setFailedCardPolicy(
|
||||||
|
self.mainWin.failedCardsOption.currentIndex())
|
||||||
|
self.deck.flushMod()
|
||||||
self.deck.startSession()
|
self.deck.startSession()
|
||||||
self.deck.flushMod()
|
|
||||||
self.moveToState("getQuestion")
|
self.moveToState("getQuestion")
|
||||||
|
|
||||||
def onStudyOptions(self):
|
def onStudyOptions(self):
|
||||||
|
|
Loading…
Reference in a new issue