53 Commits

Author SHA1 Message Date
Jelle Spijker
ca76bcc29c
Show a conformation message after a successful manage action
Contributes to: CURA-8587
2021-12-07 12:23:04 +01:00
Jelle Spijker
f6966c25fb
Some final tweaks and added missing documentation
Contributes to: CURA-8587
2021-12-07 09:48:48 +01:00
casper
71a43060a6 Open separate license dialog with each plugin install
Previously the license dialog was instanciated once and re-used for each
install. As the dialog is only shown after the plugin is downloaded it
was possible to click install for multiple plugins. Plugins that finish
downloading later would override the dialog of earlier downloaded
plugins. Clicking "accept" would then only install the latest downloaded
plugin.

Now for each install a separate dialog is shown. Accepting the license
agreement would only install the recently accepted plugin.

Note: in the current form the license agreement does not show any
identification to what plugin triggered the dialog. As multiple dialogs
can be shown at once this might be unclear.

cura 8587
2021-12-06 19:34:02 +01:00
casper
28b21628b4 Remove unused package_name property and add package_id in license model
The `_to_be_installed_package_id` and `_to_be_installed_package_path`
can now be removed from the class as they can requested from the model
itself. This we make sure that the we alway install the package for
which the license was recently accepted.

cura 8587
2021-12-06 18:07:44 +01:00
casper
324b456cbd Merge branch 'CURA-8587_disable_update_install_and_uninstall' into cura-8587_disable_update_install_and_update/licence_agreement 2021-12-06 17:23:31 +01:00
Ghostkeeper
aec643fd44
Fix several typing issues
Contributes to issue CURA-8587.
2021-12-06 17:22:07 +01:00
casper
4848c474e8 Implement UX design for maketplace license dialog
cura 8587
2021-12-06 17:10:13 +01:00
casper
0cc9d8db68 Use existing plugin registry
Fix after merge

cura 8587
2021-12-06 15:51:19 +01:00
casper
ec58cd2d0e Merge branch 'CURA-8587_disable_update_install_and_uninstall' into cura-8587_disable_update_install_and_update/licence_agreement
# Conflicts:
#	plugins/Marketplace/PackageList.py
2021-12-06 15:49:21 +01:00
casper
c3665d7440 Correctly handle actions from marketplace license prompt
Install package on accept
And stop spinner on decline

cura 8587
2021-12-06 15:45:27 +01:00
casper
09e221d64a Add license dialog to the Marketplace
cura 8587
2021-12-06 14:49:50 +01:00
Jelle Spijker
28b6bfb729
Fixed the update button busy state
Contributes to: CURA-8587
2021-12-06 13:53:44 +01:00
Jelle Spijker
579cc7bdbc
Enable or disable a plugin functionality added
Contributes to: CURA-8587
2021-12-06 11:34:36 +01:00
Jelle Spijker
325783ca46
Persistent handled state across Package Lists
Contributes to: CURA-8587
2021-12-06 10:19:14 +01:00
Jelle Spijker
863e92d0d2
Fixed state of manage buttons
Contributes to: CURA-8587
2021-12-06 09:14:40 +01:00
Jelle Spijker
bd2f270803
Added typing
Contributes to: CURA-8587
2021-12-05 15:18:51 +01:00
Jelle Spijker
743ac67cdb
un-/subscribe the user to installed packages
Contributes to: CURA-8587
2021-12-03 17:08:28 +01:00
Jelle Spijker
a83a598e96
Added error handling when downloading packages failed
A simple callback function which ensures that the proper signals
are emitted when we fail to retrieve the package.

Contributes to: CURA-8587
2021-12-03 15:50:51 +01:00
Jelle Spijker
00acfe9d72
Added uninstall functionality
Get it in a sharable state

Contributes to: CURA-8587
2021-12-03 13:27:30 +01:00
Jelle Spijker
3b3d986058
Groundwork for installing/updating packages
Contributes to: CURA-8587
2021-12-03 13:27:26 +01:00
Jelle Spijker
ff5a4a4f5a
Adding functionality to the manageButtons
Contributes to: CURA-8587
2021-12-03 13:27:16 +01:00
Jelle Spijker
327b434788
fix merge conflict
Contributes to: CURA-8587
2021-12-03 13:27:10 +01:00
Jelle Spijker
02e2e0a1c6
Filter already installed packages from the install listviews
Contributes to: CURA-8587
2021-12-03 13:25:46 +01:00
Jelle Spijker
6514fdf9f2
Check the server if a package can be updated
The server is queried using the local packages_id and version to
determine if they can be updated. The Manage button state is set
accordingly. This is done in an async way to keep the UI responsive

A.t.m I'm not sure if I might need to move this logic out, since
we also need to make this query when check periodically for updates.
when the list is not shown. But that would also entail creating
the installed packages list before the Manage Packages tab is ever
created in the Marketplace.

Contributes to: CURA-8587
2021-12-03 13:25:43 +01:00
Jelle Spijker
11b3b08198
Implemented code review suggestions
Contributes to CURA-8558
2021-11-04 08:23:46 +01:00
Jelle Spijker
3a94fc0ced
Apply suggestions from code review
Applied code review comments

Co-authored-by: Jaime van Kessel <nallath@gmail.com>
2021-11-03 17:58:16 +01:00
Jelle Spijker
07fcf8b533
Fixed missing qoutes
:face_palm:

Contributes to CURA-8558
2021-11-03 16:01:43 +01:00
Jelle Spijker
8785198a0e
Merge branch 'marketplace_redesign' into CURA-8558_introduce_manage_package_list 2021-11-03 15:54:40 +01:00
j.spijker@ultimaker.com
edc71f12a3
Updated documentation and typing
Contributes to CURA-8558
2021-11-03 15:15:46 +01:00
Jaime van Kessel
7c5bfef318 Fix crash when switching between material & plugin tab 2021-11-02 16:47:08 +01:00
j.spijker@ultimaker.com
3f700e5d0c
Only show Footer when the packagelist is paginated
It doesn't make sense to show a footer when items are retrieved in one
go. Except when an error occurs.

Contributes to CURA-8558
2021-11-02 14:34:36 +01:00
Jelle Spijker
86d5d315bc
Differentiate between local and remote packages
There is a distinction between packages which are already
installed on the local machine and packages which are
available on the remote server. Even with this difference
it is important that they are handled the same and can be
reused in the same GUI elements.

In order to reduce code duplication I created a parent object
PackageList which contains the base logic and interface for
the QML and let both RemotePackageList and LocalPackageList
inherit from this.

UX specified that the gear icon (Settings.svg) should be
separate from the tabs of material and plugins. This also
ment that the current tab  item couldn't set the pageTitle
anymore. This is now defined in the Package component and
set when the loader has loaded the external QML file.

Contributes to CURA-8558
2021-11-01 17:12:18 +01:00
Jaime van Kessel
7e674a18b3 Change the logging of operationcancelled to debug instead of error
THe operation being cancelled is not an error; it's an expected action, since
it happens after the user closes the window.

CURA-8557
2021-10-29 11:34:11 +02:00
Ghostkeeper
3e64b7cb66
Abort request when PackageList gets deleted
This is a consequence of lazy loading and the re-loading we do when the Marketplace window gets closed. This solves a crash with reproduction steps:
1. Open the Marketplace.
2. Quickly close the Marketplace.
3. Quickly re-open the Marketplace.
4. The API responds to the request made by the first opening of the Marketplace.

This crashed because when the Marketplace first opened, it made a request to the API with the HttpRequestManager. This request takes a while to respond to. If you close and re-open the Marketplace, the PackageList gets destroyed and a new one gets made. The HttpRequestManager eventually gets a response and wants to call the callback of the first PackageList, but that one got destroyed in the Qt engine so it'll throw an error saying that the object doesn't exist any more.

Contributes to issue CURA-8557.
2021-10-29 10:10:57 +02:00
Ghostkeeper
4b86f7bb29
Revert "Only show plugin and material packages"
This reverts commit cdf05a56065321d9fc15767490d846680f3dc63f.
It's no longer necessary since we filter on package type now anyway.

Contributes to issue CURA-8557.
2021-10-28 21:45:58 +02:00
Ghostkeeper
cbd1b8fbf7
Implement filter on PackageList
The filter affects the URL. So we can't just start a request in the init. We need to request once all of the properties have been set.
We also can't start the request when the filter changes, because there will be more filters and we don't want to start multiple requests. It needs to be manual.

Contributes to issue CURA-8557.
2021-10-28 18:59:03 +02:00
Jelle Spijker
cdf05a5606
Only show plugin and material packages
It was showing all packages available in the marketplace.
This included `cloud` DF integrations. It will now filter
on packages and plugins.

Contributes to CURA-8556
2021-10-28 16:08:51 +02:00
Ghostkeeper
a3c364d65a
Clarify import documentation
Contributes to issue CURA-8556.
2021-10-25 16:28:25 +02:00
Ghostkeeper
6b6b6f613f
Remove superfluous pyqtSlot marking
This can already be set via the isLoading property. What's more, it really only ever needs to be called from Python. I just added the fset because we have the setter anyway.

Contributes to issue CURA-8556.
2021-10-25 15:43:41 +02:00
Jaime van Kessel
43b8476572 Remove unneeded parenthesis
CURA-8556
2021-10-25 10:38:36 +02:00
Jaime van Kessel
37ccf5b823 Add missing return types on init
CURA-8556
2021-10-25 10:37:02 +02:00
Ghostkeeper
daf450142b
Implement error handling and showing error state
If an error occurs, the error message is stored in the list model, so that it can be shown with the list.

Contributes to issue CURA-8556.
2021-10-25 01:56:57 +02:00
Ghostkeeper
e3cd5606f0
Make load more button load more packages
This adds the functionality of the button.

Contributes to issue CURA-8556.
2021-10-21 18:26:29 +02:00
Ghostkeeper
8776294932
Set loading state to False once parsing has completed
This allows the user to request the next one.

Contributes to issue CURA-8556.
2021-10-21 18:23:19 +02:00
Ghostkeeper
27da03d862
Add a property to see whether there are any more packages to load
Contributes to issue CURA-8556.
2021-10-21 17:10:32 +02:00
Ghostkeeper
031c8efbe6
Implement pagination for package list
The simplest way I can think of.
Currently we only call the request function once, so we can only get the first page. Before calling it multiple times, we should check if there are more pages by checking if the request URL is an empty string.

Contributes to issue CURA-8556.
2021-10-21 16:56:53 +02:00
Ghostkeeper
38038b3752
Store items directly in listModel when parsing them
No need to use a custom list in Python and update the ListModel from that. This is much simpler and more efficient.

Contributes to issue CURA-8556.
2021-10-21 16:10:23 +02:00
Ghostkeeper
6415a2649e
Parse responses from package API call
Only positive responses so far. Error handling is not implemented yet.

Contributes to issue CURA-8556.
2021-10-21 16:02:46 +02:00
Ghostkeeper
3138452f94
Allow PackageList to be used as a model from QML
QML is leading here and holding the pointers for creation and destruction.

Contributes to issue CURA-8556.
2021-10-21 15:46:46 +02:00
Ghostkeeper
4337e81b77
Make request to Marketplace API when package list loads
We don't parse the response just yet, but this is part of the work.

Contributes to issue CURA-8556.
2021-10-21 15:33:37 +02:00