def log(self, o): if o['extra']: if o['extra'][0] == 'check-end' and o['extra'][1]['allowUpgrade']: reply = MessageBox.question( self.parentWidget(), Util.lang('msg_title', 'Information'), Util.lang( 'allow_upgrade', 'There is a newer version, do you want to download it?' ), QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes) if reply == QMessageBox.Yes: mainScript = Util.getScriptName() self.updater.runScriptFile(self.updater.updaterFilePath, ' -s' + mainScript) sys.exit()
def loadData(self, splash=None): self._widget.loadUrl(Util.getConfigValue('url')) if Util.isWindows(): self.addSystemTray() #check upgrade mainScript = Util.getScriptName() t1 = threading.Thread(target=self.updater.checkUpgrade, args=(False, mainScript)) t1.setDaemon(True) t1.start() #splash if splash: splash.showMessage("Loading... 100%", Qt.AlignHCenter | Qt.AlignBottom, Qt.white) qApp.processEvents()