mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
support changing time offset
This commit is contained in:
parent
b9db00e668
commit
ec932d6f39
4 changed files with 49 additions and 4 deletions
|
@ -77,6 +77,9 @@ class DeckProperties(QDialog):
|
||||||
self.drawSourcesTable()
|
self.drawSourcesTable()
|
||||||
# models
|
# models
|
||||||
self.updateModelsList()
|
self.updateModelsList()
|
||||||
|
# hour shift
|
||||||
|
self.dialog.timeOffset.setText(str(
|
||||||
|
(self.d.utcOffset - time.timezone) / 60.0 / 60.0))
|
||||||
|
|
||||||
def drawSourcesTable(self):
|
def drawSourcesTable(self):
|
||||||
self.dialog.sourcesTable.clear()
|
self.dialog.sourcesTable.clear()
|
||||||
|
@ -227,6 +230,13 @@ class DeckProperties(QDialog):
|
||||||
self.updateField(self.d, 'newCardsPerDay', v)
|
self.updateField(self.d, 'newCardsPerDay', v)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
|
# hour shift
|
||||||
|
try:
|
||||||
|
self.updateField(self.d, 'utcOffset',
|
||||||
|
float(str(self.dialog.timeOffset.text()))
|
||||||
|
*60*60 + time.timezone)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
self.updateField(self.d, 'collapseTime',
|
self.updateField(self.d, 'collapseTime',
|
||||||
self.dialog.collapse.isChecked() and 1 or 0)
|
self.dialog.collapse.isChecked() and 1 or 0)
|
||||||
self.updateField(self.d,
|
self.updateField(self.d,
|
||||||
|
|
|
@ -251,6 +251,7 @@ class AnkiQt(QMainWindow):
|
||||||
if self.state == "deckFinished":
|
if self.state == "deckFinished":
|
||||||
# don't try refresh if the deck is closed during a sync
|
# don't try refresh if the deck is closed during a sync
|
||||||
if self.deck:
|
if self.deck:
|
||||||
|
self.deck.checkDailyStats()
|
||||||
self.deck.markExpiredCardsDue()
|
self.deck.markExpiredCardsDue()
|
||||||
self.moveToState("getQuestion")
|
self.moveToState("getQuestion")
|
||||||
if self.state != "deckFinished":
|
if self.state != "deckFinished":
|
||||||
|
|
|
@ -24,7 +24,7 @@ class LatestVersionFinder(QThread):
|
||||||
# calculate stats before we start a new thread
|
# calculate stats before we start a new thread
|
||||||
if self.main.deck != None:
|
if self.main.deck != None:
|
||||||
deckSize = self.main.deck.cardCount()
|
deckSize = self.main.deck.cardCount()
|
||||||
stats = anki.stats.globalStats(self.main.deck.s)
|
stats = anki.stats.globalStats(self.main.deck)
|
||||||
deckRecall = "%0.2f" % (
|
deckRecall = "%0.2f" % (
|
||||||
(stats.matureEase3 + stats.matureEase4) /
|
(stats.matureEase3 + stats.matureEase4) /
|
||||||
float(stats.matureEase0 +
|
float(stats.matureEase0 +
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>388</width>
|
<width>389</width>
|
||||||
<height>408</height>
|
<height>408</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>372</width>
|
<width>373</width>
|
||||||
<height>342</height>
|
<height>342</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -446,7 +446,7 @@ p, li { white-space: pre-wrap; }
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>372</width>
|
<width>373</width>
|
||||||
<height>342</height>
|
<height>342</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -615,6 +615,40 @@ p, li { white-space: pre-wrap; }
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_25" >
|
||||||
|
<property name="text" >
|
||||||
|
<string><h1>Day Rollover</h1></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout" >
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_29" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Hours to shift midnight</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_2" >
|
||||||
|
<property name="orientation" >
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0" >
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="timeOffset" />
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer" >
|
<spacer name="verticalSpacer" >
|
||||||
<property name="orientation" >
|
<property name="orientation" >
|
||||||
|
|
Loading…
Reference in a new issue