mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
CURA-5035 No more crash without internet connection
Still needs a timer or something to show the fetch failed though.
This commit is contained in:
parent
f7ca8cbf68
commit
4e62c58ee6
3 changed files with 32 additions and 2 deletions
|
@ -314,8 +314,9 @@ class Toolbox(QObject, Extension):
|
|||
return
|
||||
|
||||
def resetDownload(self):
|
||||
self._download_reply.abort()
|
||||
self._download_reply.downloadProgress.disconnect(self._onDownloadProgress)
|
||||
if self._download_reply:
|
||||
self._download_reply.abort()
|
||||
self._download_reply.downloadProgress.disconnect(self._onDownloadProgress)
|
||||
self._download_reply = None
|
||||
self._download_request = None
|
||||
self.setDownloadProgress(0)
|
||||
|
@ -333,11 +334,13 @@ class Toolbox(QObject, Extension):
|
|||
|
||||
if reply.error() == QNetworkReply.TimeoutError:
|
||||
Logger.log("w", "Got a timeout.")
|
||||
self.setViewPage("errored")
|
||||
self.resetDownload()
|
||||
return
|
||||
|
||||
if reply.error() == QNetworkReply.HostNotFoundError:
|
||||
Logger.log("w", "Unable to reach server.")
|
||||
self.setViewPage("errored")
|
||||
self.resetDownload()
|
||||
return
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue