81 Commits

Author SHA1 Message Date
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
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
Konstantinos Karmas
87add2c8de Revert "Revert "Use optional last output (file) name from output-dev to set project name.""
This reverts commit 24ff3692bd5b73828a1c5a58cdd55400cdddad9c.
2021-09-15 12:26:18 +02:00
Konstantinos Karmas
4e89ee0ccc Check against the correct SDK version
Since the `self.setLastOutputName` is available in 4.12 (SDK 7.8.0) onwards.

CURA-8566
2021-09-14 16:05:04 +02:00
Jaime van Kessel
c593f62271 Only set the lastOutputName if the SDK is high enough
This ensures that the DF plugin is backwards compatible

CURA-8358
2021-09-14 14:43:10 +02:00
Ghostkeeper
8ed2e7bd44
Increment version number of Digital Library plug-in to 1.1
Contributes to issue CURA-8551.
2021-09-10 16:49:14 +02:00
Ghostkeeper
24ff3692bd
Revert "Use optional last output (file) name from output-dev to set project name."
This reverts commit c2c53d51c1954315324982bd916b8aad5c19946d.
2021-09-10 16:46:53 +02:00
Ghostkeeper
9e2b556ce8
Revert "Only change project name when saving to project files."
This reverts commit b97920e5b155caaab6a8b3bb167853a00ae4b604.
2021-09-10 16:46:39 +02:00
Jaime van Kessel
3caee3f143
Merge pull request #10328 from Ultimaker/CURA-8358_Retain_last_saved_filename
Retain the last saved filename after saving a file
2021-09-02 09:54:35 +02:00
Remco Burema
b97920e5b1
Only change project name when saving to project files.
CURA-8358
2021-09-01 18:11:10 +02:00
Remco Burema
c2c53d51c1
Use optional last output (file) name from output-dev to set project name.
Instead of relying on the filename emitted when the workspace is changed. This is done so the user can also change the project name when saving to an output device, such as a local file, or the digital library, that supports changeing the (file)name.

CURA-8358
2021-09-01 16:04:05 +02:00
Jaime van Kessel
183fbfad41 Disable save to DF if the textfield is in an invalid state
CURA-8502
2021-08-30 11:09:55 +02:00
Jaime van Kessel
668624e13d Set lifetimes correctly 2021-08-19 10:01:01 +02:00
Konstantinos Karmas
9f31e1421b Make lifetime optional in the getBackwardsCompatibleMessage
This should fix the failing tests
2021-08-18 17:18:21 +02:00
Ghostkeeper
a40c7e7410
Default lifetime for successful upload messages
There is no real reason to keep this visible indefinitely.
2021-08-18 15:36:41 +02:00
Remco Burema
3061490675
Fix look for string in enum-type.
CURA-8473
2021-08-12 10:05:16 +02:00
Remco Burema
ecf820f3db
Fix tests.
CURA-8473
2021-08-11 12:35:54 +02:00
Remco Burema
5d7804deae
Digital Library plugin needs to be backwards compatible.
Message-types are a new parameter to Messages, so they can't be used in SDK/API versions smaller than 7.7.0.

CURA-8473
2021-08-11 12:14:02 +02:00
Jaime van Kessel
8b2904ee3b Merge branch 'CURA-8441_campaign_links' of github.com:Ultimaker/Cura 2021-08-09 14:09:27 +02:00
Konstantinos Karmas
97c779cc53 Use the old icon names
So that they can still be found in 4.9 and 4.10 Cura version.

CURA-8444
2021-08-06 09:50:04 +02:00
Konstantinos Karmas
10ec9e2754 Remove the tooltipWidth property
The `tooltipWidth` property is not available in 4.9 and 4.10. This property was added to make sure that the tooltip has a smaller width than the DigitalLibrary window, or else the tooltip doesn't get drawn at all, which is confusing. Since it was not available in 4.9 and 4.10, the tooltip text smaller had to become smaller to make sure that it will fit.

CURA-8444
2021-08-06 09:49:29 +02:00
Konstantinos Karmas
22e407207f Manually add the magnifier icon in the search bar in DL
The `leftIcon` property, which is not available in 4.9 and 4.10, so the DigitalLibrary window wasn't getting drawn. To keep having the icon, I manually added the RecolorImage in the search textfield.

CURA-8444
2021-08-06 09:47:47 +02:00
Jaime van Kessel
57e66a5796 Add campaign links
CURA-8441
2021-08-05 15:42:23 +02:00
Jelle Spijker
2263969d5f
Updated message with message types
Contributes to CURA-8418
2021-07-28 08:45:42 +02:00
Jaime van Kessel
900db57f0f
Update messages to use the message_types
CURA-8418
2021-07-27 11:54:43 +02:00
Ghostkeeper
50e0885b55
Apply clipping paths in this image
QtSVG doesn't support clipping paths. QtSVG only supports the SVG 1.2 Tiny specification. See https://doc.qt.io/qt-5/svgrendering.html for more information on exact support.
2021-07-21 13:10:14 +02:00
Remco Burema
86d104afe7
DL: Allow 1 char filenames (not counting extension).
CURA-8395
2021-07-20 18:01:44 +02:00
Remco Burema
71937bf828
DL: Align with online backend on allowed characters.
CURA-8395
2021-07-20 17:58:29 +02:00
Remco Burema
f9557295fa
Allow non-ASCII characters for DL project names.
CURA-8395
2021-07-16 12:39:41 +02:00
Ghostkeeper
cc82ff97a7
Merge branch 'CURA-8112_Inform_the_user_about_their_subscription_limits' 2021-07-16 10:04:43 +02:00
Konstantinos Karmas
82c189327d Change link of "Upgrade plan" button
CURA-8112
2021-07-15 16:36:49 +02:00
Jaime van Kessel
e9ecba1374
Remove bindingloop in project selector 2021-07-14 16:03:06 +02:00
Konstantinos Karmas
11d86b98ef Merge branch 'master' into CURA-8112_Inform_the_user_about_their_subscription_limits 2021-07-14 15:52:27 +02:00
Konstantinos Karmas
fd322c0512 Fix having no "load more projects" available when using the search
When the `_onGetProjectsFirstPageFinished` is reached, the pagination manager already contains the correct pagination metadata and links, so calling `clear()` there resets them giving the impression that there is no next page.

This commit fixed that by calling the `clear()` function should when the search filter is applied, instead.

CURA-8009
2021-07-14 15:32:57 +02:00
Konstantinos Karmas
016371d771 Add the external link icon to the Upgrade plan button
CURA-8112
2021-07-14 14:34:00 +02:00
Konstantinos Karmas
7027a8f904 Fix mypy complaint again
Mypy doesn't recognize that the check for `None` has happened before calling the `callbackWrap` (before the get request has been made).

CURA-8112
2021-07-14 13:08:51 +02:00
Konstantinos Karmas
300176cdc6 Check for the maximum **private** projects
When checking whether the user is allowed to create a new library project, we need to retrieve the **private** (aka non-shared) projects that are linked to the user's account. If the user has reached the maximum private projects, then they are no longer allowed to create new ones.

**Note**: We need to set the `pagination_manager` to `None` when doing this get request, or else the next/previous links of the pagination will become mixed up with the pagination links of the list of projects shown to the user, corrupting them and creating the wrong "get more projects" link.

CURA-8112
2021-07-14 13:03:03 +02:00
Konstantinos Karmas
3dbbe7276b Remove check for account subscriptions
Since the variable `self._user_has_access` already contains the information on whether the user can access the Digital Library.

CURA-8112
2021-07-14 12:55:28 +02:00
Konstantinos Karmas
2961d20c04 Fix mypy complaint
CURA-8112
2021-07-13 17:38:15 +02:00
Konstantinos Karmas
f643f19af6 Fix tooltip not shown when the tooltip text is too long
When the tooltip text is too long and the tooltip width ends up being longer than the window it is supposed to be drawn into, the tooltip is not drawn at all. This commit fixed that by allowing the tooltip width of the ActionButton to be changed within QML, limiting it to a certain size that fits the purpose.

CURA-8112
2021-07-13 17:30:30 +02:00
Konstantinos Karmas
2d45b8c2cd Show an "Upgrade plan" button to users that have reached maximum projects
Instead of letting users go through the project creation process only to get rejected with a "subscription limits reached" message, now the "New Library project" button is being replaced with an "Upgrade plan" button when the maximum allowed projects have been reached for the specific amount. The button is accompanied by a tooltip that explains the situation to the user. Once clicked, the user is redirected to the subscriptions page.

CURA-8112
2021-07-13 17:28:38 +02:00
Jaime van Kessel
888f62a9ea
Add missing typing
CURA-8009
2021-07-13 16:55:28 +02:00
Konstantinos Karmas
9d8286d90c Set the correct initial value in the feature budget attributes
They were defined as `Optional[int]` but started with the default value as `False`.

CURA-8112
2021-07-13 16:52:36 +02:00
Ghostkeeper
7f2e951b9c
Update tests to test filter too
Contributes to issue CURA-8009.
2021-07-13 16:24:21 +02:00
Ghostkeeper
72eb839d07
Add missing search filter parameter to refresh query
Thank you, automated tests.

Contributes to issue CURA-8009.
2021-07-13 16:18:36 +02:00
Ghostkeeper
eb2a315e42
Specify spacing between search bar and button
Instead of using the default of 5 pixels, we should use this element from the theme to match the margin around the page.

Contributes to issue CURA-8009.
2021-07-13 16:09:02 +02:00
Ghostkeeper
7fdf1dbdd4
Fix height of search bar
Because this item is in a layout, the height gets overridden. We should use the preferredHeight, or the one it defaults to, implicitHeight.

Contributes to issue CURA-8009.
2021-07-13 16:02:29 +02:00
Ghostkeeper
bec83920e4
Keep showing search icon while typing search query
This adds an option to the TextField element to show an icon on the left side in the text field. The icon remains visible when the user types in something (it's not part of the placeholder string).
Then we use that optional icon for the search bar in the Digital Library.

Contributes to issue CURA-8009.
2021-07-13 15:47:21 +02:00
Ghostkeeper
1566a282dc
Replace text and image if there's no projects due to search
It's a bit weird if it shows that you didn't add any projects yet if you just type in a gibberish search keyword.

Contributes to issue CURA-8009.
2021-07-13 15:16:09 +02:00
Ghostkeeper
13ca30ed98
Stylise search bar
This is the standard style for text fields in Cura. The spacing around the search icon is customised with the best approximation I could get using a simple string of placeholderText.

Contributes to issue CURA-8009.
2021-07-13 14:40:04 +02:00