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:
Ghostkeeper 2021-10-11 13:11:54 +02:00
parent 9729f4f3d2
commit e7b49ee551
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A
3 changed files with 30 additions and 5 deletions

View file

@ -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.