if can't connect to internet, download will automatically be disabled.

This commit is contained in:
raphael60650 2021-06-19 22:04:17 +02:00
parent 6af12b562c
commit ffb75f868d
2 changed files with 8 additions and 1 deletions

View file

@ -1,4 +1,4 @@
from . import * from tkinter import messagebox
import requests import requests
import zipfile import zipfile
import json import json
@ -40,5 +40,11 @@ def check_update(self):
os.startfile(os.path.realpath("./Updater/Updater.exe")) os.startfile(os.path.realpath("./Updater/Updater.exe"))
sys.exit() 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: except:
self.log_error() self.log_error()

View file

@ -1,5 +1,6 @@
{ {
"en": { "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 main.dol": "Patch main.dol",
"Patch lecode.bin": "Patch lecode.bin", "Patch lecode.bin": "Patch lecode.bin",
"Installation du mod": "Installing mod", "Installation du mod": "Installing mod",