diff --git a/plugins/3MFWriter/ThreeMFWriter.py b/plugins/3MFWriter/ThreeMFWriter.py index cbbb635d21..2bfb152217 100644 --- a/plugins/3MFWriter/ThreeMFWriter.py +++ b/plugins/3MFWriter/ThreeMFWriter.py @@ -310,7 +310,7 @@ class ThreeMFWriter(MeshWriter): "package_version": package_data.get("package_version") if package_data.get("package_version") else "", "sdk_version_semver": package_data.get("sdk_version_semver") if package_data.get( "sdk_version_semver") else "", - "type": "backend_plugin", + "type": "plugin", } # Storing in a dict and fetching values to avoid duplicates diff --git a/plugins/Marketplace/MissingPackageList.py b/plugins/Marketplace/MissingPackageList.py index 385e78b95f..018e977823 100644 --- a/plugins/Marketplace/MissingPackageList.py +++ b/plugins/Marketplace/MissingPackageList.py @@ -20,7 +20,6 @@ class MissingPackageList(RemotePackageList): def __init__(self, packages_metadata: List[Dict[str, str]], parent: Optional["QObject"] = None) -> None: super().__init__(parent) self._packages_metadata: List[Dict[str, str]] = packages_metadata - self._package_type_filter = "material" self._search_type = "package_ids" self._requested_search_string = ",".join(map(lambda package: package["id"], packages_metadata)) @@ -38,7 +37,14 @@ class MissingPackageList(RemotePackageList): for package_metadata in self._packages_metadata: if package_metadata["id"] not in returned_packages_ids: - package = PackageModel.fromIncompletePackageInformation(package_metadata["display_name"], package_metadata["package_version"], self._package_type_filter) + package_type = package_metadata["type"] if "type" in package_metadata else "material" + # When this feature was originally introduced only missing materials were detected. With the inclusion + # of backend plugins this system was extended to also detect missing plugins. With that change the type + # of the package was added to the metadata. Project files before this change do not have this type. So + # if the type is not present we assume it is a material. + package = PackageModel.fromIncompletePackageInformation(package_metadata["display_name"], + package_metadata["package_version"], + package_type) self.appendItem({"package": package}) self.itemsChanged.emit() diff --git a/plugins/Marketplace/PackageModel.py b/plugins/Marketplace/PackageModel.py index fa909b4120..afc6e0ce73 100644 --- a/plugins/Marketplace/PackageModel.py +++ b/plugins/Marketplace/PackageModel.py @@ -87,12 +87,22 @@ class PackageModel(QObject): self._is_missing_package_information = False @classmethod - def fromIncompletePackageInformation(cls, display_name: str, package_version: str, package_type: str) -> "PackageModel": + def fromIncompletePackageInformation(cls, display_name: str, package_version: str, + package_type: str) -> "PackageModel": + description = "" + match package_type: + case "material": + description = catalog.i18nc("@label:label Ultimaker Marketplace is a brand name, don't translate", + "The material package associated with the Cura project could not be found on the Ultimaker Marketplace. Use the partial material profile definition stored in the Cura project file at your own risk.") + case "plugin": + description = catalog.i18nc("@label:label Ultimaker Marketplace is a brand name, don't translate", + "The plugin associated with the Cura project could not be found on the Ultimaker Marketplace. As the plugin may be required to slice the project it might not be possible to correctly slice the file.") + package_data = { "display_name": display_name, "package_version": package_version, "package_type": package_type, - "description": catalog.i18nc("@label:label Ultimaker Marketplace is a brand name, don't translate", "The material package associated with the Cura project could not be found on the Ultimaker Marketplace. Use the partial material profile definition stored in the Cura project file at your own risk.") + "description": description, } package_model = cls(package_data) package_model.setIsMissingPackageInformation(True)