mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 17:57:55 -06:00
Merge branch 'STAR-322_cloud-connection' of github.com:Ultimaker/Cura into STAR-322_cloud-connection
This commit is contained in:
commit
f04db63594
4 changed files with 6 additions and 20 deletions
|
@ -203,7 +203,7 @@ class NetworkClient:
|
|||
## Does a POST request with form data to the given URL.
|
||||
def postForm(self, url: str, header_data: str, body_data: bytes,
|
||||
on_finished: Optional[Callable[[QNetworkReply], None]],
|
||||
on_progress: Callable = None) -> None:
|
||||
on_progress: Optional[Callable[[int, int], None]] = None) -> None:
|
||||
post_part = QHttpPart()
|
||||
post_part.setHeader(QNetworkRequest.ContentDispositionHeader, header_data)
|
||||
post_part.setBody(body_data)
|
||||
|
@ -212,7 +212,7 @@ class NetworkClient:
|
|||
## Does a POST request with form parts to the given URL.
|
||||
def postFormWithParts(self, target: str, parts: List[QHttpPart],
|
||||
on_finished: Optional[Callable[[QNetworkReply], None]],
|
||||
on_progress: Callable = None) -> Optional[QNetworkReply]:
|
||||
on_progress: Optional[Callable[[int, int], None]] = None) -> Optional[QNetworkReply]:
|
||||
self._validateManager()
|
||||
|
||||
request = self._createEmptyRequest(target, content_type = None)
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
# Copyright (c) 2018 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
from UM.OutputDevice.OutputDevice import OutputDevice
|
||||
from cura.PrinterOutput.PrinterOutputController import PrinterOutputController
|
||||
|
||||
|
||||
class CloudOutputController(PrinterOutputController):
|
||||
def __init__(self, output_device):
|
||||
def __init__(self, output_device: OutputDevice):
|
||||
super().__init__(output_device)
|
||||
|
||||
# The cloud connection only supports fetching the printer and queue status and adding a job to the queue.
|
||||
|
|
|
@ -323,8 +323,7 @@ class CloudOutputDevice(NetworkedPrinterOutputDevice):
|
|||
Message(
|
||||
text = message,
|
||||
title = T.ERROR,
|
||||
lifetime = 10,
|
||||
dismissable = True
|
||||
lifetime = 10
|
||||
).show()
|
||||
self._sending_job = False # the upload has finished so we're not sending a job anymore
|
||||
self.writeError.emit()
|
||||
|
@ -337,8 +336,7 @@ class CloudOutputDevice(NetworkedPrinterOutputDevice):
|
|||
Message(
|
||||
text = T.UPLOAD_SUCCESS_TEXT,
|
||||
title = T.UPLOAD_SUCCESS_TITLE,
|
||||
lifetime = 5,
|
||||
dismissable = True,
|
||||
lifetime = 5
|
||||
).show()
|
||||
self._sending_job = False # the upload has finished so we're not sending a job anymore
|
||||
self.writeFinished.emit()
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 52.2 (67145) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>noun_Cloud_377836</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Icon/-group-printer/-cloud" transform="translate(-14.000000, -18.000000)" fill="#3282FF" stroke="#FFFFFF">
|
||||
<g id="noun_Cloud_377836" transform="translate(15.000000, 19.000000)">
|
||||
<path d="M12.3440271,3.61701809 C13.6201197,4.04206192 14.5,5.3142474 14.5,6.82575758 C14.5,8.61355846 13.1725736,10.1363636 11.55,10.1363636 C9.95687956,10.1363636 9.95687956,10.1363636 7.03230084,10.1363636 C5.5144815,10.1363636 5.5144815,10.1363636 4.18278423,10.1363636 C3.03720902,10.1363636 3.03720902,10.1363636 2.45,10.1363636 C0.827426402,10.1363636 -0.5,8.61355846 -0.5,6.82575758 C-0.5,5.37705632 0.379590151,4.08194163 1.60957212,3.69458679 C1.75103656,1.3361233 3.44417494,-0.5 5.6,-0.5 C6.82422325,-0.5 7.98499907,0.153804932 8.73228719,1.21519021 C8.95750893,1.14169648 9.19251064,1.10606061 9.45,1.10606061 C10.8613861,1.10606061 12.0466587,2.17389831 12.3440271,3.61701809 Z" id="Path"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.4 KiB |
Loading…
Add table
Add a link
Reference in a new issue