27073 Commits

Author SHA1 Message Date
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
Ghostkeeper
f0cbdeb903
Use docstring format for this documentation
Contributes to issue CURA-8539.
2021-11-22 10:50:06 +01:00
Ghostkeeper
9dd251975d
Test for result of callback with a callable
In this case the callback should get called immediately (no wait) so it is safe to test for this callback, albeit slightly implementation-defined.

Contributes to issue CURA-8539.
2021-11-22 10:48:45 +01:00
Ghostkeeper
30d19844f2
Always callback if there is a callback, even if no auth data
Because not having auth data is a reason to return no profile too. Otherwise the other side might wait for a response for a long time.

Contributes to issue CURA-8539.
2021-11-22 10:45:01 +01:00
Ghostkeeper
1636cca601
Add missing return
We're calling back that there is no auth data, so we should stop here and not try to obtain a user profile.

Contributes to issue CURA-8539.
2021-11-22 10:34:39 +01:00
casper
6be0d58039 Add handling of missing printJob status cases
The `printJob` now also contains a status for detecting aborted prints
that were awaiting cleanup, preventing the need for the additional
checks in the `await_cleanup` status.
2021-11-19 17:22:13 +01:00
Ghostkeeper
ffb891fb69
Fix call to failed_callback
It provides 2 arguments (reply and error) which we both ignore and proceed to call failed_callback. And failed_callback may also be None in which case we don't call anything.

Contributes to issue CURA-8539.
2021-11-19 17:09:33 +01:00
Ghostkeeper
9895015235
Call getAccessTokenUsingRefreshToken asynchronously
Getting into nested inline functions into inline functions here. Let's see what the reviewer thinks of all this!

Contributes to issue CURA-8539.
2021-11-19 17:04:37 +01:00
Ghostkeeper
7091c5f3aa
Make getAuthenticationTokenUsingXYZ asynchronous
As a result, the local webserver now needs to synchronise that with a lock. Otherwise the do_GET function would no longer block, and wouldn't properly be able to return the correct redirect URL.

Contributes to issue CURA-8539.
2021-11-19 16:55:45 +01:00
Ghostkeeper
9b55ae6dda
Remove unused imports of requests
This was the objective, really.

Contributes to issue CURA-8539.
2021-11-19 16:25:50 +01:00
Ghostkeeper
acbbf83510
Deal with absence of callback function
It may be None, so then we don't need to call back. The consumer may just take it from self._user_profile.

Contributes to issue CURA-8539.
2021-11-19 16:23:48 +01:00
Ghostkeeper
a5202b61d2
Don't emit with new profile
The signal can't accept it because it's not a QObject.

Contributes to issue CURA-8539.
2021-11-19 16:22:41 +01:00
Ghostkeeper
bfb8440a04
Get user profile asynchronously when restoring from preferences
Do not stop the start-up process for it. Let the callback handle the updating if necessary.

Contributes to issue CURA-8539.
2021-11-19 16:20:00 +01:00
Ghostkeeper
92437a920d
Store account information asynchronously when completing request
And make the PyQt properties listen to the signal of completion.

Contributes to issue CURA-8539.
2021-11-19 16:02:25 +01:00
Ghostkeeper
591a2f89b8
Make getUserProfile return profile asynchronously
All via callbacks. Quite a mess.

Contributes to issue CURA-8539.
2021-11-19 15:29:29 +01:00
Remco Burema
c8b491e9e7
(High) limits for number of walls to prevent engine crash.
The engine would reserve space for each outline that should be there according to the count, not for each wall that was actually printed. Values of 999999 where chosen after discussion for _some_ of these (but not anything to do wit hskirt-brim, since we use those in the frontend for dissalowed areas) becasue then you can just fill a number of nines to get a completely 'walled' model printed.
2021-11-19 14:46:24 +01:00
Ghostkeeper
240e154be7
Merge branch 'feature_extruder_warning_icon' of https://github.com/fieldOfView/Cura into fieldOfView-feature_extruder_warning_icon 2021-11-19 14:13:49 +01:00
fieldOfView
e537fa562e Hide badge for disabled extruders
A configuration error or warning in a disabled extruder does not affect slicing or the available profiles for other extruder
2021-11-19 14:11:37 +01:00
Ghostkeeper
6601728741
Merge branch 'feature_extruder_warning_icon' of https://github.com/fieldOfView/Cura into fieldOfView-feature_extruder_warning_icon 2021-11-19 13:48:45 +01:00
fieldOfView
c805aac3cc Deactivate tooltip hover if there is no tooltip to show 2021-11-19 13:43:34 +01:00
Ghostkeeper
920d9b9d44
Make _parseJWT asynchronous as well
Now it calls checkToken correctly. However now this _parseJWT is not called correctly since there are things calling this one in an attempt to be synchronous again.
There is the additional issue that we can't call getAccessTokenUsingRefreshToken synchronously now, because this runs on the main thread and it will then block the main thread until the request is made, which is never because the request is also done on the main thread via Qt's event loop.

Contributes to issue CURA-8539.
2021-11-18 17:33:39 +01:00
Ghostkeeper
aff0764c1d
Add failed callback for when the request fails
Maybe we should add a parameter to this to respond with an error message. But maybe later.

Contributes to issue CURA-8539.
2021-11-18 17:19:05 +01:00
Ghostkeeper
a9990eaa75
Make parseJWT asynchronous
This involves returning the user profile via a callback.
No longer use the Requests library, which doesn't properly use the SSL certificates locally on the computer like the QNetworkManager does.

Contributes to issue CURA-8539.
2021-11-18 17:11:27 +01:00
Remco Burema
4a6f6475ee
Merge branch '4.12' 2021-11-18 16:05:50 +01:00
Remco Burema
26ad9766df
Merge pull request #10872 from Ultimaker/update-change-log
Update change log
4.12.1
2021-11-18 11:44:18 +01:00
Ghostkeeper
d6f8984cf0
Use integer positions for fixed items too
Pynest2d requires it. It seems the SIP version we're using is lenient for this, but newer SIP versions are not.

Fixes #10801.
2021-11-18 11:44:09 +01:00
fvrmr
d569742800 Update change log 2021-11-18 11:42:04 +01:00
Karl Nilsson
e0e227404f
Fix picking pixel on integer indices
The QImage.pixel() function should only get integers.
In theory an input position of -2,-2 would get rounded to 0 now. However that shouldn't occur because the user can't click outside of the window. And if it does occur, it's not really a problem either that it's theoretically picking a position inside of the window when you click slightly next to it.

Fixes #10785.
2021-11-18 11:36:20 +01:00
fvrmr
d266a9c8a1 Update change log
Updated the change log with two bug fixes
2021-11-18 11:25:13 +01:00
Ghostkeeper
3466404782
Expand limits for flow and 2nd and 3rd layers of bridging too
We removed the limit of density for the first bridging layer, but there are more settings for that, and there's a similar arbitrary limit for flow in place.

Contributes to issue CURA-8639 and #10736.
2021-11-18 11:10:09 +01:00
fieldOfView
9ebd8524ad Use badge icons 2021-11-18 10:53:35 +01:00
fieldOfView
77cfd8218a Add warning and error badge icons 2021-11-18 10:23:53 +01:00
fieldOfView
c6b6af668d Fix shader compilation on some GPUs
Some GPUs (rightly) complain about the difference between a float and an int. Fixes #10837
2021-11-18 08:04:14 +01:00
Jelle Spijker
52d639f980
fixed missing , in json 2021-11-17 19:50:15 +01:00
Jaime van Kessel
6a988c8fa0 Remove incorrect authors of profiles
Ultimaker didn't make these profiles, so it shouldn't be listed here
2021-11-17 17:01:30 +01:00
Remco Burema
71c6df8829
Fix capitalization in what (should) refer(s) to a key-value.
CURA-8701
2021-11-17 14:35:29 +01:00
Remco Burema
291d047fac
Revert "fixed top bottom pattern zigzag in profiles"
This reverts commit 3abbcc99c07b3b434a95183968e2b2e1cf7664ab.
2021-11-17 14:35:28 +01:00
Ghostkeeper
f1c763ad9f
Use HttpRequestManager to acquire new tokens
This is a re-write from a previous attempt. Instead of requests, which doesn't properly use SSL certificates installed on the computer among other things, we'll now use the HttpRequestManager which uses QNetworkManager under the hood and properly uses system settings.
The QNetworkManager is asynchronous which would normally be very nice, but due to the nature of this call we want to make it synchronous so we'll use a lock here.

Contributes to issue CURA-8539.
2021-11-17 14:32:53 +01:00
Jaime van Kessel
34aa7240d4 Merge branch 'PP-55_reduce-cross3D-top-layer-bridge-distance_Arachne' of github.com:Ultimaker/Cura into libArachne_rebased 2021-11-17 14:25:57 +01:00
Philip Rueker
5e9becc4f9 Fix initial layer bed and print head temperature in start gcode script for Snapmaker 2021-11-16 11:05:37 -08:00
fieldOfView
452aa4cc1c Add a tooltip explaining the status of the extruder 2021-11-16 16:05:02 +01:00
fieldOfView
d1f21ec7c4 Adjust size and position of extruder warning "badges" 2021-11-16 15:34:10 +01:00
Ghostkeeper
a292524af6
Correct German translation of indicating a time
This is better grammar.

Further improvement for #10718.
2021-11-16 15:16:18 +01:00
fieldOfView
19dbd1f168 Merge branch 'master' into feature_extruder_warning_icon 2021-11-16 14:56:43 +01:00
Ghostkeeper
caa9a6bfc4
Merge branch 'patch-1' of https://github.com/Ladnessness/Cura into Ladnessness-patch-1 2021-11-16 14:54:58 +01:00