def onStart(self): self.showStatus() if Updater.status.isRunnable(): if DB.termsOfService.getAgreedTime() == None: self.openTermsOfService() else: App.exit()
def handleDownloadResult(self, downloader): if downloader.status.terminateState.isTrue(): error = downloader.status.getError() if error != None: if error == Exceptions.FileSystemError: Utils.info(*Messages.INFO.FILE_SYSTEM_ERROR) elif error == Exceptions.NetworkError: Utils.info(*Messages.INFO.NETWORK_ERROR) else: Utils.info(*Messages.INFO.DOWNLOAD_ERROR) elif DB.general.isAutoCloseEnabled( ) and not downloader.setup.downloadInfo.type.isClip(): App.exit() else: fileName = downloader.setup.downloadInfo.getAbsoluteFileName() if Utils.ask("download-complete", "{}\n\n{}".format(T("#Download completed."), fileName), okText="open", cancelText="ok"): try: Utils.openFile(fileName) except: Utils.info(*Messages.INFO.FILE_NOT_FOUND)
def shutdown(self): self.saveWindow() App.exit()