fix connection error msg on vanilla DL

This commit is contained in:
Mauricio 2020-08-08 00:20:52 -04:00
parent 268482ed6b
commit 1edee085a1

View File

@ -17,10 +17,13 @@ def downloadVanilla():
circus.setValue(value) circus.setValue(value)
def setLabelText(msg): def setLabelText(msg):
circus.setLabelText(msg) circus.setLabelText(msg)
def showMessageBox(icon, title, msg):
getattr(QtGui.QMessageBox, icon)(None, title, msg)
thr = downloadThread(circus) thr = downloadThread(circus)
thr.progressValue.connect(setProgressValue) thr.progressValue.connect(setProgressValue)
thr.labelText.connect(setLabelText) thr.labelText.connect(setLabelText)
thr.showMessageBox.connect(showMessageBox)
thr.finished.connect(circus.close) thr.finished.connect(circus.close)
thr.start() thr.start()
@ -36,6 +39,7 @@ def downloadVanilla():
class downloadThread(QtCore.QThread): class downloadThread(QtCore.QThread):
progressValue = QtCore.pyqtSignal(int) progressValue = QtCore.pyqtSignal(int)
labelText = QtCore.pyqtSignal(str) labelText = QtCore.pyqtSignal(str)
showMessageBox = QtCore.pyqtSignal(str, str, str)
finished = QtCore.pyqtSignal() finished = QtCore.pyqtSignal()
def __init__(self, jm): def __init__(self, jm):
@ -48,9 +52,7 @@ class downloadThread(QtCore.QThread):
try: try:
manifest = json.load(urllib.urlopen("http://s3.wasabisys.com/ao-manifests/assets.json")) manifest = json.load(urllib.urlopen("http://s3.wasabisys.com/ao-manifests/assets.json"))
except: except:
msgbox[0] = "critical" self.showMessageBox.emit("critical", "Download failed", "Could not check for latest AO vanilla version.\nPlease check your internet connection.")
msgbox[1] = "Download failed"
msgbox[2] = "Could not check for latest AO vanilla version.\nPlease check your internet connection."
return return
latest_version = manifest["versions"][0]["version"] latest_version = manifest["versions"][0]["version"]