83 Commits

Author SHA1 Message Date
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
Ghostkeeper
5851ad52c6
Add property to tell if the list is currently loading or loading more
We'll need to display a spinner of some kind in the front-end, I think.

Contributes to issue CURA-8556.
2021-10-21 15:15:56 +02:00
Ghostkeeper
0f5c923d93
Add model to represent packages and export information to QML
We'll construct a bunch of these when we receive information from the API.

Contributes to issue CURA-8556.
2021-10-21 15:03:41 +02:00
Ghostkeeper
cf2b0d2777
Add empty ListModel to store list of packages with
This model does nothing yet.

Contributes to issue CURA-8556.
2021-10-19 17:48:21 +02:00