diff --git a/ankiqt/ui/deckproperties.py b/ankiqt/ui/deckproperties.py index 35edf5b0e..92ae60da4 100644 --- a/ankiqt/ui/deckproperties.py +++ b/ankiqt/ui/deckproperties.py @@ -54,7 +54,7 @@ class DeckProperties(QDialog): getattr(self.dialog, type + "Max").setText(str(v)) self.dialog.delay0.setText(unicode(self.d.delay0/60.0)) self.dialog.delay1.setText(unicode(self.d.delay1)) - self.dialog.delay2.setText(unicode(self.d.delay2)) + self.dialog.delay2.setText(unicode(int(self.d.delay2*100))) self.dialog.collapse.setCheckState(self.d.collapseTime and Qt.Checked or Qt.Unchecked) self.dialog.perDay.setCheckState(self.d.getBool("perDay") @@ -67,6 +67,9 @@ class DeckProperties(QDialog): # leeches self.dialog.suspendLeeches.setChecked(self.d.getBool("suspendLeeches")) self.dialog.leechFails.setValue(self.d.getInt("leechFails")) + # spacing + self.dialog.newSpacing.setText(unicode(self.d.getFloat("newSpacing")/60.0)) + self.dialog.revSpacing.setText(unicode(int(self.d.getFloat("revSpacing")*100))) def updateModelsList(self): idx = self.dialog.modelsList.currentRow() @@ -187,8 +190,8 @@ class DeckProperties(QDialog): v2 = int(self.dialog.delay1.text()) v2 = max(0, v2) self.updateField(self.d, 'delay1', v2) - v = float(self.dialog.delay2.text()) - self.updateField(self.d, 'delay2', min(v, 1)) + v = float(self.dialog.delay2.text()) / 100.0 + self.updateField(self.d, 'delay2', max(0, min(100, v))) except ValueError: pass try: @@ -198,6 +201,12 @@ class DeckProperties(QDialog): int(self.dialog.leechFails.value())) except ValueError: pass + try: + self.d.setVar("newSpacing", float(self.dialog.newSpacing.text()) * 60) + self.d.setVar("revSpacing", float( + self.dialog.revSpacing.text()) / 100.0) + except ValueError: + pass # hour shift try: offset = float(str(self.dialog.timeOffset.text())) diff --git a/designer/deckproperties.ui b/designer/deckproperties.ui index 5967987fb..6730f0652 100644 --- a/designer/deckproperties.ui +++ b/designer/deckproperties.ui @@ -9,8 +9,8 @@ 0 0 - 379 - 396 + 373 + 452 @@ -208,7 +208,7 @@ 6 - + @@ -216,23 +216,15 @@ 0 - - - - - - Min + + + 50 + 16777215 + - - - - Min - - - - + @@ -240,6 +232,12 @@ 0 + + + 50 + 16777215 + + @@ -256,14 +254,17 @@ - + - Max + ~ + + + Qt::AlignCenter - + @@ -271,9 +272,21 @@ 0 + + + 50 + 0 + + + + + 50 + 16777215 + + - + @@ -281,16 +294,25 @@ 0 - - - - - - Max + + + 50 + 16777215 + - + + + + ~ + + + Qt::AlignCenter + + + + @@ -298,9 +320,15 @@ 0 + + + 50 + 16777215 + + - + @@ -308,19 +336,27 @@ 0 - - - - - - Min + + + 50 + 0 + + + + + 50 + 16777215 + - + - Max + ~ + + + Qt::AlignCenter @@ -331,16 +367,6 @@ - - - - - 0 - 0 - - - - @@ -348,28 +374,21 @@ - - - - mins - - - - + days - + days - + days @@ -412,14 +431,43 @@ - - - - days + + + + Qt::Horizontal - + + + + + 0 + 0 + + + + + 50 + 0 + + + + + 50 + 16777215 + + + + + + + + minutes + + + + @@ -427,9 +475,15 @@ 0 + + + 50 + 16777215 + + - + @@ -437,50 +491,36 @@ 0 - - - - - - Qt::Horizontal - - - - - - - - - Qt::Horizontal - - - - - - - - - New day starts at - - - - - - - Qt::Horizontal - - + - 40 - 20 + 50 + 16777215 - + - - + + + + days + + - + + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + + Show failed cards early @@ -490,64 +530,192 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + + + + 0 + 0 + + - - - - Suspend leeches - - - - - - - - - - - - - - Leech failure threshold - - - - - - - + Per-day scheduling - + + + + 0 + 0 + + + + + + Leech threshold + + + + + + + + 0 + 0 + + + + + 50 + 16777215 + + + + + + + + Shift midnight by + + + + + + + + 0 + 0 + + + + + 50 + 16777215 + + + + + + + + New card spacing + + + + + + + + 0 + 0 + + + + + 50 + 16777215 + + + + + + + + minutes + + + + + + + Suspend leeches + + + + + + + + 0 + 0 + + + + + + + + + + + Review card spacing + + + + + + + + 0 + 0 + + + + + 50 + 16777215 + + + + + + + + % + + + + + + + % + + + + + + + + 0 + 0 + + + + hours + + + + + + + failures + + + @@ -599,11 +767,13 @@ midMax easyMin easyMax - collapse - perDay - timeOffset - suspendLeeches leechFails + timeOffset + newSpacing + revSpacing + collapse + suspendLeeches + perDay