From ffb75f868d7299caf3b0b3de866dca7690ea35a3 Mon Sep 17 00:00:00 2001 From: raphael60650 Date: Sat, 19 Jun 2021 22:04:17 +0200 Subject: [PATCH] if can't connect to internet, download will automatically be disabled. --- source/check_update.py | 8 +++++++- translation.json | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/source/check_update.py b/source/check_update.py index 5d6def6..d08d77f 100644 --- a/source/check_update.py +++ b/source/check_update.py @@ -1,4 +1,4 @@ -from . import * +from tkinter import messagebox import requests import zipfile import json @@ -40,5 +40,11 @@ def check_update(self): os.startfile(os.path.realpath("./Updater/Updater.exe")) sys.exit() + except requests.ConnectionError: + messagebox.showwarning(self.translate("Attention"), + self.translate("Impossible de se connecter à internet. Le téléchargement sera " + "automatiquement désactivé.")) + self.option["disable_download"] = True + except: self.log_error() diff --git a/translation.json b/translation.json index 504e193..3c0a791 100644 --- a/translation.json +++ b/translation.json @@ -1,5 +1,6 @@ { "en": { + "Impossible de se connecter à internet. Le téléchargement sera automatiquement désactivé.": "Can't connect to internet, download will automatically be disabled.", "Patch main.dol": "Patch main.dol", "Patch lecode.bin": "Patch lecode.bin", "Installation du mod": "Installing mod",