diff --git a/aqt/preferences.py b/aqt/preferences.py
index 5a570a18b..8a9b81676 100644
--- a/aqt/preferences.py
+++ b/aqt/preferences.py
@@ -5,7 +5,8 @@
import datetime, time
from aqt.qt import *
import anki.lang
-from aqt.utils import openFolder, showWarning, getText, openHelp, showInfo
+from aqt.utils import openFolder, showWarning, getText, openHelp, showInfo, \
+ askUser
import aqt
class Preferences(QDialog):
@@ -86,6 +87,8 @@ class Preferences(QDialog):
f.dayLearnFirst.setChecked(qc.get("dayLearnFirst", False))
if self.mw.col.schedVer() != 2:
f.dayLearnFirst.setVisible(False)
+ else:
+ f.newSched.setChecked(True)
def updateCollection(self):
f = self.form
@@ -100,8 +103,30 @@ class Preferences(QDialog):
qc['addToCur'] = not f.useCurrent.currentIndex()
qc['dayLearnFirst'] = f.dayLearnFirst.isChecked()
self._updateDayCutoff()
+ self._updateSchedVer(f.newSched.isChecked())
d.setMod()
+ # Scheduler version
+ ######################################################################
+
+ def _updateSchedVer(self, wantNew):
+ haveNew = self.mw.col.schedVer() == 2
+
+ # nothing to do?
+ if haveNew == wantNew:
+ return
+
+ if haveNew and not wantNew:
+ if not askUser(_("This will reset any cards in learning, clear filtered decks, and change the scheduler version. Proceed?")):
+ return
+ self.mw.col.changeSchedulerVer(1)
+ return
+
+ if not askUser(_("The experimental scheduler could cause incorrect scheduling. Please ensure you have read the documentation first. Proceed?")):
+ return
+
+ self.mw.col.changeSchedulerVer(2)
+
# Day cutoff
######################################################################
diff --git a/designer/preferences.ui b/designer/preferences.ui
index 45ff8e9e0..a8c2839fa 100644
--- a/designer/preferences.ui
+++ b/designer/preferences.ui
@@ -7,7 +7,7 @@
0
0
405
- 455
+ 469
@@ -30,7 +30,16 @@
12
-
+
+ 12
+
+
+ 12
+
+
+ 12
+
+
12
-
@@ -92,6 +101,13 @@
+ -
+
+
+ Experimental V2 scheduler
+
+
+
-
-
@@ -217,7 +233,16 @@
12
-
+
+ 12
+
+
+ 12
+
+
+ 12
+
+
12
-
@@ -322,7 +347,16 @@
12
-
+
+ 12
+
+
+ 12
+
+
+ 12
+
+
12
-
@@ -445,12 +479,12 @@
pastePNG
nightMode
dayLearnFirst
+ newSched
useCurrent
newSpread
dayOffset
lrnCutoff
timeLimit
- buttonBox
numBackups
syncOnProgramOpen
tabWidget