display time difference & more info in clock off msg; i18n it

This commit is contained in:
Damien Elmes 2013-10-20 10:26:11 +09:00
parent bab63de768
commit 58f13f1e9a
2 changed files with 22 additions and 12 deletions

View File

@ -808,16 +808,23 @@ title="%s">%s</button>''' % (
def newMsg(self, data):
aqt.update.showMessages(self, data)
def clockIsOff(self):
showWarning("""\
def clockIsOff(self, diff):
warn = _("""\
In order to ensure your collection works correctly when moved between \
devices, Anki requires the system clock to be set correctly. Your system \
clock appears to be wrong by more than 5 minutes.
devices, Anki requires your computer's internal clock to be set correctly. \
The internal clock can be wrong even if your system is showing the correct \
local time.
This can be because the \
clock is slow or fast, because the date is set incorrectly, or because \
the timezone or daylight savings information is incorrect. Please correct \
the problem and restart Anki.""")
Please go to the time settings on your computer and check the following:
- AM/PM
- Clock drift
- Day, month and year
- Timezone
- Daylight savings
Difference to correct time: %d seconds.""") % diff
showWarning(warn)
self.app.closeAllWindows()
# Count refreshing

View File

@ -1,14 +1,17 @@
# Copyright: Damien Elmes <anki@ichi2.net>
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import urllib
import urllib2
import time
from aqt.qt import *
import urllib, urllib2, time
import aqt
import platform
from aqt.utils import openLink
from anki.utils import json, isWin, isMac, platDesc
from anki.utils import json, platDesc
from aqt.utils import showText
class LatestVersionFinder(QThread):
def __init__(self, main):
@ -45,7 +48,7 @@ class LatestVersionFinder(QThread):
self.emit(SIGNAL("newVerAvail"), resp['ver'])
diff = resp['time'] - time.time()
if abs(diff) > 300:
self.emit(SIGNAL("clockIsOff"))
self.emit(SIGNAL("clockIsOff"), diff)
def askAndUpdate(mw, ver):
baseStr = (