135 Commits

Author SHA1 Message Date
Ghostkeeper
da289b51d0
Deprecate additionalRights property
Consumers should now use the permissions system which gets the permissions from the account via a separate API call.

Contributes to issue CURA-9220.
2022-08-01 10:49:29 +02:00
Ghostkeeper
f3403ff856
Add property to get the list of permissions for the user
The QML code can read this list and see if certain keys are in the list.

Contributes to issue CURA-9220.
2022-07-25 15:57:51 +02:00
Ghostkeeper
c529f2b31a
Upon syncing, get account permissions from API
This incurs another request every minute. But it's not provided by the log-in itself and can change, so that'll be necessary.

Contributes to issue CURA-9220.
2022-07-25 15:33:46 +02:00
Jaime van Kessel
124602d2ad Return account widget to it's former glory 2022-03-31 14:19:41 +02:00
Remco Burema
97da0b9183
Qt5->Qt6: Fix another stack-overflow error for newer Python/Qt.
part of CURA-8591
2021-12-29 10:15:14 +01:00
Remco Burema
7021ff0b67
Qt5->Qt6: Replace QT_ENUMS with pyqtEnum.
part of CURA-8591
2021-12-28 14:59:25 +01:00
Remco Burema
abe7c1bf7f
Search/replace Qt5->Qt6.
part of upgrading Qt to v6.2: CURA-8591
2021-12-28 14:46:02 +01:00
Jelle Spijker
70504f1b04
Modernize typing usage
Some boyscouting.
2021-11-23 11:10:22 +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
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
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
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
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
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
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
Jelle Spijker
e845462e5d
Merge pull request #10198 from Ultimaker/CURA-8418_update_messages_with_new_types
Update messages to use the message_types
2021-07-28 11:36:49 +02:00
Jaime van Kessel
7cce2f770d
Change warning logging to debug
Since it's triggered every boot of Cura, it makes no sense to leave it
a warning...
2021-07-27 16:13:50 +02:00
Jaime van Kessel
900db57f0f
Update messages to use the message_types
CURA-8418
2021-07-27 11:54:43 +02:00
Jaime van Kessel
b7ee3298c2
Add extra logging to auth server 2021-07-23 10:40:30 +02:00
Jaime van Kessel
c800c2850c
Decrease update interval to 60 sec
It's the same as what the rest uses and it should decrease the load on our servers a lot
2021-04-30 10:51:15 +02:00
Kostas Karmas
72080a3cca Delete the auth data on upgrade from 4.8 if the scope doesn't match
If the user account scope is outdated, delete it when upgrading from 4.8 to 4.9. This means that
the user will have to log in again, to make sure they get the correct account scope.

CURA-8093
2021-04-08 12:46:52 +02:00
Kostas Karmas
43615a57b6 Change client scope in the Account
CURA-7868
2020-12-18 14:34:29 +01:00
Nino van Hooff
979407eddf Additional typing fixes
CURA-7473
2020-06-29 11:10:50 +02:00
Nino van Hooff
8e62a6d6d7
Apply suggestions from code review
Typing suggestions by Jaime

CURA-7473

Co-authored-by: Jaime van Kessel <nallath@gmail.com>
2020-06-29 10:35:49 +02:00
Nino van Hooff
294afdb7ca Connect sync timer to sync() for consistency and add unit tests.
Also rename a function to camelCase

CURA-7473
2020-06-26 16:09:33 +02:00
Nino van Hooff
4f1a18f102 Add Install Pending Updates button to Account popup
CURA-7473
2020-06-26 11:37:01 +02:00
Nino van Hooff
5c52dcc5c4
Merge pull request #7935 from Ultimaker/CURA-7418-update-profile-window
CURA-7418 update profile window
2020-06-17 15:35:19 +02:00
Jaime van Kessel
f6e9bc7c3c
Merge branch 'master' of github.com:Ultimaker/Cura into CURA-7418-update-profile-window 2020-06-15 14:10:20 +02:00
Nino van Hooff
994f9fbde7 Re-implement ConnectionStatus by adding a pyqtSignal to HttpRequestMgr
and using ConnectionStatus as proxy for it.

CURA-7492
2020-06-15 11:39:06 +02:00
Kostas Karmas
9bf9bf9a3f Fix typing
CURA-7492
2020-06-15 09:45:39 +02:00
Kostas Karmas
ddf312eca5 Refactor the connection status to be informed by the autosync
The autosync, which happens every 30 seconds, will now also inform the
connection status when the get request succeeds or fails, which is an
indicator of whether the internet is reachable.

CURA-7492
2020-06-15 09:34:56 +02:00
Jaime van Kessel
d33529f932
Use property & states instead of listening to changed signal
It makes a lot more sense to me to use states and an actual property.

CURA-7418
2020-06-11 17:31:19 +02:00
Nino van Hooff
1024879f9d Process Review feedback for CURA-7438
Renames UltimakerCloudAuthentication to UltimakerCloudConstants

Cura-7438
2020-06-09 13:41:30 +02:00
Jaime van Kessel
fd2a7689cc
Remove overly spammy logging 2020-06-04 14:32:37 +02:00
Nino van Hooff
89f0970a88 Remove trailing whitespace from Python files 2020-05-29 14:30:33 +02:00
Nino van Hooff
58ffc9dcae Merge remote-tracking branch 'origin/master' into doxygen_to_restructuredtext_comments
# Conflicts:
#	cura/API/__init__.py
#	cura/Settings/CuraContainerRegistry.py
#	cura/Settings/ExtruderManager.py
#	plugins/PostProcessingPlugin/scripts/PauseAtHeight.py
#	plugins/UM3NetworkPrinting/src/Cloud/CloudApiClient.py
#	plugins/UM3NetworkPrinting/src/Cloud/ToolPathUploader.py
#	plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDeviceManager.py
2020-05-28 17:31:24 +02:00
Konstantinos Karmas
56e8827d00
Merge pull request #7831 from Ultimaker/CURA-7437_no_internet_cloud_status
CURA-7437_no_internet_cloud_status
2020-05-28 10:02:15 +02:00
Nino van Hooff
fbddf88462 Change connection status checking interval to 10s
CURA-7437
2020-05-28 09:56:41 +02:00
Jaime van Kessel
280d3f07a6
Merge branch 'CURA-7290_manual_account_sync' of github.com:Ultimaker/Cura 2020-05-26 11:52:14 +02:00
Kostas Karmas
fad02193ab Fix sync button not appearing when opening popup after clicking away
This was achieved by adding an IDLE state, which is the default state
when opening the account management popup. The state is now reseted
when the popup opens instead of when it closes. In addition, now either
the "You are in sync with your account" label or the "Check account for
updates" button will appear in the popup based on the state, not both.

Finally, with theses changes, if the popup is open and an autosync
occurs, the user will be informed that the account is synced and he/she
will have to close and reopen the popup in order to trigger a manual
update.

CURA-7290
2020-05-26 09:49:58 +02:00
Nino van Hooff
b135da866a Add Cura.API.connectionStatus
CURA-7437
2020-05-20 16:06:10 +02:00
Nino van Hooff
7388829fc1 Change account sync date format back to dd/mm/YYYY
For consistency with the rest of the application
2020-05-19 14:32:02 +02:00
Nino van Hooff
23c039a873
Add type hint in cura/API/Account.py
Co-authored-by: Jaime van Kessel <nallath@gmail.com>
2020-05-19 14:14:39 +02:00
Nino van Hooff
050878bbfe
Update cura/API/Account.py
Co-authored-by: Jaime van Kessel <nallath@gmail.com>
2020-05-19 14:14:10 +02:00
Nino van Hooff
c6e6c76962 Merge remote-tracking branch 'origin/master' into doxygen_to_restructuredtext_comments
# Conflicts:
#	cura/API/Account.py
#	plugins/SimulationView/SimulationView.py
2020-05-15 13:38:37 +02:00
Nino van Hooff
94f094380b Log sync state transitions
CURA-7290
2020-05-15 11:59:22 +02:00
Nino van Hooff
a9692e3d27 Refactor setManualSyncEnabled
CURA-7290
2020-05-14 15:15:16 +02:00
Nino van Hooff
59b40c72f0 Additional scenarios for enabling/disabling the manual sync button
CURA-7290
2020-05-13 17:32:57 +02:00
Nino van Hooff
f78fa884c1 Only show the manual sync button after the account popup was closed
CURA-7290
2020-05-13 17:19:20 +02:00