18 Commits

Author SHA1 Message Date
Ghostkeeper
3ffffad1ed
Send progress update when failed
And update all of the printer statuses to make them appear failed, if we have a general failure in an earlier stage.

Contributes to issue CURA-8609.
2021-10-12 16:15:58 +02:00
Ghostkeeper
0fa6f650f6
Expose printer status updates via progress update signal
This way we can ask the printer status from QML even if it's updated via a job on a different thread and different class and all that.

Contributes to issue CURA-8609.
2021-10-12 16:06:53 +02:00
Ghostkeeper
8607eb5cff
Store printer sync status flag per printer
Because we'll need to display it per printer.

Contributes to issue CURA-8609.
2021-10-12 15:49:43 +02:00
Ghostkeeper
54d51536b0
Improve error-handling per printer
We can now know which printers failed to sync and which succeeded.

Contributes to issue CURA-8609.
2021-10-12 13:55:03 +02:00
Ghostkeeper
d4d17095bb
Implement confirming for all printers to send material sync
We need to make this request for every printer.

Contributes to issue CURA-8609.
2021-10-12 13:39:04 +02:00
Ghostkeeper
f677b338fd
Always provide error message if upload failed
Contributes to issue CURA-8609.
2021-10-12 13:19:09 +02:00
Ghostkeeper
a6b6b075ea
Always provide error message if upload failed
Contributes to issue CURA-8609.
2021-10-12 13:16:28 +02:00
Ghostkeeper
4ccd4caaad
Store material profile ID received from the upload request
We'll need this later to be able to tell the server which material archive it should send to certain printers.

Contributes to issue CURA-8609.
2021-10-12 13:04:22 +02:00
Ghostkeeper
bdc269f8ab
Provide file size and an arbitrary name to the upload request
Apparently the Cloud will need to know the file size before it gets uploaded. It is used as a redundancy code to verify that it's not corrupt there.
Perhaps they should ask for a CRC instead, being more reliable against an upload containing only null bytes or whatever, but that is not up to me to decide.

Contributes to issue CURA-8609.
2021-10-12 13:00:08 +02:00
Ghostkeeper
f0d69cbef2
Add file data to PUT request
The main point of the whole request, really.

Contributes to issue CURA-8609.
2021-10-12 12:56:19 +02:00
Ghostkeeper
d5e3ed4c0e
New material API endpoint URL
This is the new URL they have settled on.

Contributes to issue CURA-8609.
2021-10-12 11:39:26 +02:00
Ghostkeeper
125c80430b
Show more information about errors we're getting
Show the error code we received in the GUI, and allow expansion for different types of errors.

Contributes to issue CURA-8609.
2021-10-12 11:30:12 +02:00
Ghostkeeper
025ef743ee
Track progress from export job
This way we can show a progress bar.

Contributes to issue CURA-8609.
2021-10-12 10:24:07 +02:00
Ghostkeeper
4661b02e4c
Move code and status related to uploading materials to separate class
There's quite a lot of status to track, errors and progress. It's better kept separate.

Contributes to issue CURA-8609.
2021-10-12 09:43:21 +02:00
Ghostkeeper
ffd3277854
Show error if the upload failed
Contributes to issue CURA-8609.
2021-10-11 14:57:21 +02:00
Ghostkeeper
e7b49ee551
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.
2021-10-11 13:11:54 +02:00
Ghostkeeper
2b785343b5
Implement basic uploading of material
Steps involved are:
- Create an archive of all materials.
- Request the cloud API to provide a URL to upload the archive to.
- Upload the archive to that API.

Currently the two internet requests are asynchronous, meaning that the job will 'end' before the upload is complete. Most likely the job instance will even be deleted before we get a response from the server. So this won't work, really. Need to structure that a bit differently. But I want to save this progress because it embodies the happy path well.

Contributes to issue CURA-8609.
2021-10-08 16:02:31 +02:00
Ghostkeeper
599c59bd3a
Add a background job to upload material archives
It creates the archive now. It doesn't yet upload it.

Contributes to issue CURA-8609.
2021-10-08 15:15:57 +02:00