diff --git a/ankiqt/config.py b/ankiqt/config.py index 15d783e71..2ed484669 100644 --- a/ankiqt/config.py +++ b/ankiqt/config.py @@ -63,6 +63,7 @@ class Config(dict): 'iconSize': 32, 'id': genID(), 'interfaceLang': "", + 'lastMsg': -1, 'loadLastDeck': False, 'mainWindowGeom': None, 'mainWindowState': None, diff --git a/ankiqt/ui/main.py b/ankiqt/ui/main.py index 12f8d2ae5..f20ef9931 100755 --- a/ankiqt/ui/main.py +++ b/ankiqt/ui/main.py @@ -2621,12 +2621,16 @@ This deck already exists on your computer. Overwrite the local copy?"""), def setupAutoUpdate(self): self.autoUpdate = ui.update.LatestVersionFinder(self) self.connect(self.autoUpdate, SIGNAL("newVerAvail"), self.newVerAvail) + self.connect(self.autoUpdate, SIGNAL("newMsg"), self.newMsg) self.connect(self.autoUpdate, SIGNAL("clockIsOff"), self.clockIsOff) self.autoUpdate.start() - def newVerAvail(self, version): - if self.config['suppressUpdate'] < version['latestVersion']: - ui.update.askAndUpdate(self, version) + def newVerAvail(self, data): + if self.config['suppressUpdate'] < data['latestVersion']: + ui.update.askAndUpdate(self, data) + + def newMsg(self, data): + ui.update.showMessages(self, data) def clockIsOff(self, diff): if diff < 0: diff --git a/ankiqt/ui/update.py b/ankiqt/ui/update.py index 273ff7a8d..9e73d1b0a 100644 --- a/ankiqt/ui/update.py +++ b/ankiqt/ui/update.py @@ -23,6 +23,7 @@ class LatestVersionFinder(QThread): "pver": pver, "plat": plat, "id": self.config['id'], + "lm": self.config['lastMsg'], "conf": self.config['created']} self.stats = d @@ -41,6 +42,8 @@ class LatestVersionFinder(QThread): except: # behind proxy, corrupt message, etc return + if resp['msg']: + self.emit(SIGNAL("newMsg"), resp) if resp['latestVersion'] > ankiqt.appVersion: self.emit(SIGNAL("newVerAvail"), resp) diff = resp['currentTime'] - time.time() @@ -51,10 +54,7 @@ class LatestVersionFinder(QThread): def askAndUpdate(parent, version=None): version = version['latestVersion'] baseStr = ( - _('''