Both timeout cases now abort the upload

CURA-1851
This commit is contained in:
Jaime van Kessel 2016-08-17 13:07:20 +02:00
parent 26eaedaa2c
commit f60871e068

View File

@ -234,6 +234,12 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
self._connection_state_before_timeout = self._connection_state self._connection_state_before_timeout = self._connection_state
self._connection_message = Message(i18n_catalog.i18nc("@info:status", "The connection with the printer was lost. Check your network-connections.")) self._connection_message = Message(i18n_catalog.i18nc("@info:status", "The connection with the printer was lost. Check your network-connections."))
self._connection_message.show() self._connection_message.show()
# Check if we were uploading something. Abort if this is the case.
# Some operating systems handle this themselves, others give weird issues.
if self._post_reply:
self._post_reply.abort()
self._post_reply.uploadProgress.disconnect(self._onUploadProgress)
self._progress_message.hide()
self.setConnectionState(ConnectionState.error) self.setConnectionState(ConnectionState.error)
if self._authentication_state == AuthState.NotAuthenticated: if self._authentication_state == AuthState.NotAuthenticated:
@ -486,6 +492,9 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
# Some operating systems handle this themselves, others give weird issues. # Some operating systems handle this themselves, others give weird issues.
if self._post_reply: if self._post_reply:
self._post_reply.abort() self._post_reply.abort()
self._post_reply.uploadProgress.disconnect(self._onUploadProgress)
self._progress_message.hide()
self.setConnectionState(ConnectionState.error) self.setConnectionState(ConnectionState.error)
return return