7628 Commits

Author SHA1 Message Date
Jaime van Kessel
61c43fb765 Only show "can't find location message" when it couldn't find location
Bit of a silly mistake, but easy enough to fix!

CURA-8649
2021-10-28 13:53:52 +02:00
Jaime van Kessel
59be3e195d Use category as fallback translation for intents instead of "unkown" 2021-10-28 13:48:09 +02:00
Jaime van Kessel
8f1cf4a963 Move openSYncAllWindow to the right class
CURA-8609
2021-10-28 09:43:12 +02:00
Remco Burema
ce61f8ef60
Merge branch 'master' into bremco-graphics_buffer_update 2021-10-27 18:47:51 +02:00
Jaime van Kessel
79117d5898 Fix merge mistakes
CURA-8609
2021-10-27 14:48:12 +02:00
Ghostkeeper
88d08b27d1
Merge branch 'master' into CURA-8609_sync_materials_to_printer
Conflicts:
	cura/Machines/Models/MaterialManagementModel.py -> On Master we had temporarily reverted the action of this button because it became apparent that the sync wasn't going to be in 4.12. That revert is no longer necessary if this is merged.
2021-10-27 14:21:05 +02:00
Ghostkeeper
273e933145
Reset sync status when closing and re-opening sync window
Otherwise when you want to sync again, it'll just say that you're done. Not what a user would expect, I reckon.

Contributes to issue CURA-8609.
2021-10-27 14:13:49 +02:00
Ghostkeeper
116046a8b2
Fix binding printer_id to response callbacks
With the lambda it would capture the variable of printer_id. It wouldn't actually store the value of printer_id in teh created lambda. As a result, it was using the current value of printer_id when the lambda executes, rather than the value of printer_id when the lambda is constructed. A bit weird how that works in Python's lambdas.

With partial functions it works properly.

Contributes to issue CURA-8609.
2021-10-27 14:06:04 +02:00
Ghostkeeper
f99fedc58b
Fix API misalignments with confirm material upload action
The API endpoint got renamed (without my awareness). It also needed to be a POST request, probably since the beginning. And apparently it needs everything to be in a sub-field called 'data' for some reason.

Contributes to issue CURA-8609.
2021-10-27 13:38:58 +02:00
Ghostkeeper
1c6ad019a3
Response data is contained in sub-field 'data'
The entire response is contained in a lone 'data' field in the response. Why this is necessary I don't know, because indeed everything the server can tell us is data so everything would be in a 'data' field. But that's how the API reacts so that's how we'll have to parse it.

Contributes to issue CURA-8609.
2021-10-27 13:16:39 +02:00
Ghostkeeper
82441f97b1
Clarify context of error message for translators
This should improve the translation for next time.

Contributes to issue CURA-8638.
2021-10-25 15:22:28 +02:00
Jaime van Kessel
1f6e1942d7 Disable the material sync message again
CURA-8639
2021-10-21 10:39:47 +02:00
Remco Burema
8c8ec5391f
Revert settings-version to the one for Arachne-builds. 2021-10-20 11:01:13 +02:00
Remco Burema
6d93c651ec
Merge pull request #10639 from Ultimaker/CURA-8514_inconsistent_material_naming
Use the material name instead of brand + type + color
2021-10-20 10:47:32 +02:00
Remco Burema
86046a32b3
Merge branch 'master' into merge_main_20211019 2021-10-20 08:38:01 +02:00
Jaime van Kessel
2baada8a70 Use the material name instead of brand + type + color
CURA-8514
Fixes #10421
2021-10-19 11:23:21 +02:00
Jelle Spijker
666880ad20
Only show certain App Switcher icons when account has DF access
Added a dictionary where additional user rights can be set.
A plugin such as the DigitalFactory can update this dictionary
if certain account rights change. The `account.additionalRights`
is intended to allow us some flexibility, without breaking the API
in the future.

The Application Switcher now queries the additional account rights,
which is updated by the DF plugin to only show `My printers`,
`Digital Library` and `Print jobs` when the user has access to the
DF.

Contributes to CURA-8624
2021-10-18 15:37:06 +02:00
Ghostkeeper
8bd6fe7c2b
API changed: material_profile_name instead of file_name
Contributes to issue CURA-8609.
2021-10-18 15:15:37 +02:00
Ghostkeeper
c9d53cbbde
Renamed OAuth scope
This got renamed since the API was communicated to us.

Contributes to issue CURA-8609.
2021-10-18 15:15:05 +02:00
Ghostkeeper
0d350b5f96
Merge branch '4.12' into CURA-8609_sync_materials_to_printer 2021-10-18 13:23:29 +02:00
Ghostkeeper
bf6dd443b2
Add material profile writing permission
The API needs this new scope name.

Contributes to issue CURA-8609.
2021-10-18 12:59:32 +02:00
Ghostkeeper
0378531f13
Handle QML exposing of filterConnectionType if not filtering
It should expose it as -1 then.

Contributes to issue CURA-8609.
2021-10-15 16:24:43 +02:00
Ghostkeeper
0583814dfa
Fix HttpNetworkManager not providing error parameter if there is no error
Contributes to issue CURA-8609.
2021-10-15 16:00:54 +02:00
Ghostkeeper
889000242d
Document UploadMaterialsJob class better
Including all of its signals and methods.

Contributes to issue CURA-8609.
2021-10-15 15:42:12 +02:00
Ghostkeeper
e05fa87b48
Handle errors reading material archive back in
It could be that this archive is not accessible any more for whatever reason. Write-only file systems, quarantined files, etc. Whatever the reason, Cura shouldn't crash on this because it's not in Cura's control.

Contributes to issue CURA-8609.
2021-10-15 15:24:05 +02:00
Ghostkeeper
4262dfaf5d
Better handle errors in local part of upload job
It could be that the archive fails to save because the user doesn't have access to its own temporary folder, the firewall quarantines the archive, there's not enough disk space, whatever. These errors need to be handled and not crash Cura.

Contributes to issue CURA-8609.
2021-10-15 15:17:59 +02:00
Ghostkeeper
dfcefe11cc
Use enum for printer status constants
This indicates how we're using it, and also allows for use of symbols in the code rather than strings, which integrate better with tooling.

Contributes to issue CURA-8609.
2021-10-15 14:51:07 +02:00
Ghostkeeper
2b4a31c9de
Change type of filter to Optional[ConnectionType]
It's a bit more semantic this way.

Contributes to issue CURA-8609.
2021-10-15 14:35:07 +02:00
Ghostkeeper
24cd2046f8
Initialise _printer_metadata as a list instead of a dict
It should become a list later on, in any case.

Contributes to issue CURA-8609.
2021-10-13 10:13:06 +02:00
Ghostkeeper
af54316690
Typing fixes
Some things the CI is complaining about.

Contributes to issue CURA-8609.
2021-10-13 10:00:22 +02:00
Ghostkeeper
a703e6b882
Use lambdas instead of functools
Partialmethod is not callable apparently. I think the problem is that it's calling the method outside of the scope of the class here. I'm probably not using it right. Lambas are easier since they automatically take their scope along with them.

Contributes to issue CURA-8609.
2021-10-12 17:47:05 +02:00
Ghostkeeper
2d53a548dc
Remove superfluous error handling
If there is an error, it'll go into onError and handle the error there.

Contributes to issue CURA-8609.
2021-10-12 17:38:47 +02:00
Ghostkeeper
cf860829c7
Provide upload request metadata as body of a PUT request
Apparently the API is now a PUT request rather than a GET request. It needs a bit more metadata which can be hard-coded for our client.

Contributes to issue CURA-8609.
2021-10-12 17:21:25 +02:00
Ghostkeeper
2b6a82ecf1
Match on strings for metadata
It doesn't automatically cast these in the query.

Contributes to issue CURA-8609.
2021-10-12 17:08:58 +02:00
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
c3d392c5cf
Show upload error or success in header once completed
According to the brand new design.

Contributes to issue CURA-8609.
2021-10-11 15:27:54 +02:00
Ghostkeeper
ffd3277854
Show error if the upload failed
Contributes to issue CURA-8609.
2021-10-11 14:57:21 +02:00