26766 Commits

Author SHA1 Message Date
Ghostkeeper
6f8a4e93e7
Fix name of capability to filter on
Contributes to issue CURA-8671.
2021-12-03 13:26:51 +01:00
Ghostkeeper
6d9142579a
Add debuging repr to print more nicely
Otherwise you just see <CloudClusterResponse object> when you try to print this.

Contributes to issue CURA-8671.
2021-12-03 13:26:29 +01:00
Ghostkeeper
0477ba44b2
Encode capabilities as comma-separated list
Previously it was encoded as a stringified Python list of strings, which is much harder to parse.
This would go wrong if any of these capabilities have a comma in them, but I think that would be bad practice for keywords like this anyway.

Contributes to issue CURA-8671.
2021-12-03 13:25:41 +01:00
Ghostkeeper
b76df21b4b
Filter printer list by capabilities
And an example of such usage: In the material sync via cloud we only want to sync with printers that can receive those materials.

We might want to add a message for the user to also make sure the firmware is up to date. Because if the firmware is not up to date now it will show no printers and instruct the user how to connect the printer to the cloud.

Contributes to issue CURA-8671.
2021-12-02 17:55:53 +01:00
Remco Burema
f5604dfb1e
Add 'capabilities' to ignored metadata.
part of CURA-8671
2021-12-02 12:23:57 +01:00
Remco Burema
1253b41537
Only perform materials-sync-job for capable printers.
part of CURA-8671
2021-12-02 12:22:55 +01:00
Evangelos Trantos
95f0b692a6
Merge pull request #10977 from Ultimaker/CURA-8696_Show_whats_new_after_beta
CURA-8696 Show whats new after beta
2021-12-01 20:40:04 +01:00
Jaime van Kessel
83b56726ba CHange _getBuiltinWelcomePagePath to be static
SHould have been static, so boyscouting it now

CURA-8696
2021-12-01 10:33:05 +01:00
Jaime van Kessel
22fcdf5c7b Change whatsnew to whats_new
They are seperate words, so should have an _ in between

CURA-8696
2021-12-01 10:30:52 +01:00
Jaime van Kessel
051c3ee2e2 Fix up documentation of WelcomePageModel
Some more boyscouting

CURA-8696
2021-12-01 10:29:31 +01:00
Jaime van Kessel
6bce9453e4 Fix warnings in newpages model
Boyscouting. These somehow snuck through code review

CURA-8696
2021-12-01 10:21:07 +01:00
Jaime van Kessel
a057cbe481 Minor codestyle cleanup
Boyscouting

CURA-8696
2021-12-01 10:18:04 +01:00
Rijk van Manen
26d6a02c32 gradual infill not implemented for cross (3d) pattern 2021-12-01 09:03:08 +01:00
Jaime van Kessel
ab2cbbfecc
Merge pull request #10920 from sustmi/czech-translations-v4.12.1
Add Czech translations for v4.12.1
2021-11-30 14:40:52 +01:00
Ghostkeeper
5da63fda26
Also catch BlockingIOError when getting a keyring attribute
This occurs when there's a timeout, on some systems, when asking for the password to the keyring. We'll interpret a timeout as a refusal to enter a password.

Fixes Sentry issue CURA-332.
2021-11-30 13:27:32 +01:00
Jaime van Kessel
2f999ca399
Merge pull request #10858 from Ultimaker/PP-25_close-to-100%-density-infill-behaviour
PP-25 close to 100% density infill behaviour
2021-11-29 10:47:48 +01:00
Miroslav Sustek
45bf7b3bfc Add Czech translations for v4.12.1 2021-11-25 01:45:26 +01:00
Ghostkeeper
9a4836a7b0
Increase top distance by 1 layer for profiles using tree support
We changed tree support to have a correct top distance now. If you ask for 0 top distance, you get 0 top distance. If you ask for 0.2mm top distance, you get 0.2mm top distance (rounded to layers). Previously the top distance was too high. Yet it seems that people were happy with how easily Tree Support was removed from the print. So this is a best-effort attempt to keep the final result similar to what it was originally.
It won't work for everything, I fear. But it's about as good as we can make it.

Contributes to issue CURA-7624.
2021-11-24 13:03:33 +01:00
Ghostkeeper
1df859e046
Catch IndexError when logging errors
And log that error too, then.

Fixes Sentry issue CURA-32J.
2021-11-23 19:04:33 +01:00
Ghostkeeper
2f1c157547
Don't attempt writing a workspace before there is a global stack
This is normally not possible from the interface. However on MacOS, the application menu gets carried to the top bar of the operating system. It is not blocked there, and the user could write a project file before they even add a printer. This prevents Cura from crashing when they do that.

Fixes Sentry issue CURA-2ZR.
2021-11-23 17:54:26 +01:00
Ghostkeeper
cecd033430
Merge branch 'CURA-8541_Aborted_state_not_reflected_correctly_in_Cura_Monitor_Page' 2021-11-23 16:28:46 +01:00
Jelle Spijker
8427555d6a
Merge pull request #10901 from Ultimaker/CURA-8539_oauth_via_httprequestmanager
OAuth via HttpRequestManager
2021-11-23 13:59:45 +01:00
Jelle Spijker
36e28a245c
Fixed typing issues
Contributes to: CURA-8539
2021-11-23 13:56:04 +01:00
Jelle Spijker
0a43366ffc
Fixed some styling and typing issues
Some boyscouting.
Contributes to: CURA-8539
2021-11-23 11:10:22 +01:00
Jelle Spijker
70504f1b04
Modernize typing usage
Some boyscouting.
2021-11-23 11:10:22 +01:00
Ghostkeeper
487ececb82
Merge branch 'master' of github.com:Ultimaker/Cura 2021-11-23 11:01:30 +01:00
Ghostkeeper
7bf9ed9237
Merge branch 'master' of https://github.com/prueker/Cura into prueker-master 2021-11-23 10:57:20 +01:00
Remco Burema
1eaacacc6a
Merge branch 'fieldOfView-fix_simulation_view_crash' 2021-11-23 09:28:20 +01:00
Remco Burema
ac8d5fc12c
More explicit float's in shader just to be sure.
CURA-8714
2021-11-23 09:27:25 +01:00
Remco Burema
5b99de1ebd
Merge branch 'fix_simulation_view_crash' of https://github.com/fieldOfView/Cura into fieldOfView-fix_simulation_view_crash 2021-11-23 09:13:48 +01:00
Ghostkeeper
677b64f068
Remove unnecessary import
We're not using this library any more now. Not even in the tests.

Contributes to issue CURA-8539.
2021-11-22 19:08:17 +01:00
Ghostkeeper
3f92b46ac8
Don't restart refresh token while it's already processing
If two requests to the API occur at the same time, they will both see at the same time that they need an access token, and if it is expired they will both see that it needs refreshing. The server then sees two refreshes, both with the same refresh token. This is not allowed. The second one then gets a failure to refresh the token, which causes the user to log out.
Instead, we'll stop one of the refresh requests. They were fire-and-forget anyway, so it's not needed to actually continue the request.

Contributes to issue CURA-8539.
2021-11-22 18:52:43 +01:00
Ghostkeeper
608cce491d
Remove tests checking for data in UserProfile
The UserProfile is being stored in the account with a simple assignment, and these are just some property getters with a fallback. I don't think we need to test that.
The actual getting of a user profile (and whether that returns correctly when logged out and such) is already tested as part of the OAuth flow where that code lives.

Contributes to issue CURA-8539.
2021-11-22 18:45:04 +01:00
Ghostkeeper
1cdeb7d56b
Typing: When the user profile changes, it may also become None
This happens when logging out.

Contributes to issue CURA-8539.
2021-11-22 16:30:03 +01:00
Ghostkeeper
0196fd54ea
Add a few missing types
The return type missing caused the type checker to think it returned Any, which is clearly not true. And the type missing from _user_profile caused it to think it always had to be None, which is nonsense in any application.

Contributes to issue CURA-8539.
2021-11-22 16:24:22 +01:00
Ghostkeeper
1ee9f73075
Only call success_callback if it's not None
It could also be called as a fire-and-forget update thing.

Contributes to issue CURA-8539.
2021-11-22 16:20:37 +01:00
Ghostkeeper
595a6580f5
Use error callback and with correct number of parameters
It gives two parameters, additionally an error code. However our callback wrapper gets the error code from the reply itself so it doesn't need it.

Contributes to issue CURA-8539.
2021-11-22 16:17:30 +01:00
Ghostkeeper
4b5d698325
Fix assertion of resulting profile via callback
Needs to work differently with the asynchronous workflow.

Contributes to issue CURA-8539.
2021-11-22 15:54:42 +01:00
Ghostkeeper
fbbf1427b3
Fix patching of getUserProfile
The actual profile is not necessary for this test. But this function always returns None and we shouldn't patch it to make it return something else.

Contributes to issue CURA-8539.
2021-11-22 15:52:24 +01:00
Ghostkeeper
c5e22c53cc
Fix checking return values in log-in/log-out flow test
Contributes to issue CURA-8539.
2021-11-22 15:48:29 +01:00
Ghostkeeper
a8a41381cb
Remove test simulating request error in user profile
We're no longer generating that error. We're generating a QNetworkReply with a built-in error code and those errors are handled the same way as the failed requests tested above.

Contributes to issue CURA-8539.
2021-11-22 15:14:05 +01:00
Ghostkeeper
4139350496
Fix test checking for failure of refresh token to reset auth
It was previously mocking some return values that should now get returned via callbacks. And it was previously relying on a web service which might not connect at all.

Contributes to issue CURA-8539.
2021-11-22 15:11:35 +01:00
Ghostkeeper
3236be1c20
Also mock POST command and a failed response
Otherwise it'll end up using actual internet connections anyway. Not what we want.

Contributes to issue CURA-8539.
2021-11-22 14:45:44 +01:00
Ghostkeeper
8ea8cc752f
Also call processing functions for error callbacks
Otherwise the appropriate callbacks might not get called.

Contributes to issue CURA-8539.
2021-11-22 14:44:52 +01:00
Ghostkeeper
e8f9e92f02
Simulate an actual expired authentication token
The test should trigger the refresh token to be used to get a new authentication token.

Contributes to issue CURA-8539.
2021-11-22 14:26:15 +01:00
Ghostkeeper
70924f17aa
Mock HttpRequestManager getting the profile with refresh token
I'm not sure the refresh token is actually used though. I might want to try to guarantee that.

Contributes to issue CURA-8539.
2021-11-22 13:44:46 +01:00
Ghostkeeper
3b6ff15d60
Rewrite test to mock HttpRequestManager with authentication failure
That's the expected outcome of the premise of this test.

Contributes to issue CURA-8539.
2021-11-22 13:25:15 +01:00
Ghostkeeper
937d48a4e8
Add missing failed_callback
If it fails to check the token, respond through the callback with None as well.

Contributes to issue CURA-8539.
2021-11-22 13:24:06 +01:00
Ghostkeeper
c8aff57bfe
Actually mock a reply from the auth server
The reply is not really relevant. The reply is mocked through readJSON.
So it turns out that so far, our tests have been making actual requests to the authentication server, and depended on it being online. Not good. Mock those external dependencies!

Contributes to issue CURA-8539.
2021-11-22 12:11:45 +01:00
Ghostkeeper
c36863da56
Only call failed_callback if provided
Otherwise we'd crash because NoneType can't be called.

Contributes to issue CURA-8539.
2021-11-22 11:59:23 +01:00