mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-22 22:23:57 -06:00
Disable sync button while in progress
Need to show a bit more feedback I think. Let's see what the design said... Contributes to issue CURA-8609.
This commit is contained in:
parent
9729f4f3d2
commit
e7b49ee551
3 changed files with 30 additions and 5 deletions
|
@ -11,6 +11,7 @@ from cura.UltimakerCloud import UltimakerCloudConstants # To know where the API
|
|||
from cura.UltimakerCloud.UltimakerCloudScope import UltimakerCloudScope # To know how to communicate with this server.
|
||||
from UM.Job import Job
|
||||
from UM.Logger import Logger
|
||||
from UM.Signal import Signal
|
||||
from UM.TaskManagement.HttpRequestManager import HttpRequestManager # To call the API.
|
||||
from UM.TaskManagement.HttpRequestScope import JsonDecoratorScope
|
||||
|
||||
|
@ -33,6 +34,8 @@ class UploadMaterialsJob(Job):
|
|||
super().__init__()
|
||||
self._scope = JsonDecoratorScope(UltimakerCloudScope(cura.CuraApplication.CuraApplication.getInstance())) # type: JsonDecoratorScope
|
||||
|
||||
uploadCompleted = Signal()
|
||||
|
||||
def run(self):
|
||||
archive_file = tempfile.NamedTemporaryFile("wb", delete = False)
|
||||
archive_file.close()
|
||||
|
@ -78,6 +81,7 @@ class UploadMaterialsJob(Job):
|
|||
self.setResult(self.Result.FAILED)
|
||||
return
|
||||
self.setResult(self.Result.SUCCESS)
|
||||
self.uploadCompleted.emit()
|
||||
|
||||
def onError(self, reply: "QNetworkReply", error: Optional["QNetworkReply.NetworkError"]):
|
||||
pass # TODO: Handle errors.
|
Loading…
Add table
Add a link
Reference in a new issue