mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 23:46:22 -06:00
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
This commit is contained in:
parent
31dcf21a3e
commit
cdf05a5606
1 changed files with 4 additions and 2 deletions
|
@ -33,6 +33,7 @@ class PackageList(ListModel):
|
||||||
PackageRole = Qt.UserRole + 1
|
PackageRole = Qt.UserRole + 1
|
||||||
|
|
||||||
ITEMS_PER_PAGE = 20 # Pagination of number of elements to download at once.
|
ITEMS_PER_PAGE = 20 # Pagination of number of elements to download at once.
|
||||||
|
INCLUDED_PACKAGE_TYPE = ("material", "plugin") # Only show these kind of packages
|
||||||
|
|
||||||
def __init__(self, parent: "QObject" = None) -> None:
|
def __init__(self, parent: "QObject" = None) -> None:
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
@ -121,8 +122,9 @@ class PackageList(ListModel):
|
||||||
return
|
return
|
||||||
|
|
||||||
for package_data in response_data["data"]:
|
for package_data in response_data["data"]:
|
||||||
package = PackageModel(package_data, parent = self)
|
if package_data["package_type"] in self.INCLUDED_PACKAGE_TYPE:
|
||||||
self.appendItem({"package": package}) # Add it to this list model.
|
package = PackageModel(package_data, parent = self)
|
||||||
|
self.appendItem({"package": package}) # Add it to this list model.
|
||||||
|
|
||||||
self._request_url = response_data["links"].get("next", "") # Use empty string to signify that there is no next page.
|
self._request_url = response_data["links"].get("next", "") # Use empty string to signify that there is no next page.
|
||||||
self.hasMoreChanged.emit()
|
self.hasMoreChanged.emit()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue