From 839c8ccc52563811234bbd754dd2cbc4dd76a734 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 30 Oct 2017 11:15:41 +0100 Subject: [PATCH] Fix 'Could not get metadata of container ' Turns out that the side bar header was requesting the metadata before the active material was set. Now I'm just saying that if the active material was not set, it should not be compatible. Contributes to issue CURA-4243, side-ways. --- cura/Settings/MachineManager.py | 2 +- resources/qml/Preferences/MaterialView.qml | 2 +- resources/qml/SidebarHeader.qml | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index c5dec6b6cc..2a77032a33 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -151,7 +151,7 @@ class MachineManager(QObject): if not self._global_container_stack: return - containers = ContainerRegistry.getInstance().findInstanceContainersMetadata(type="variant", definition=self._global_container_stack.getBottom().getId(), name=hotend_id) + containers = ContainerRegistry.getInstance().findInstanceContainersMetadata(type = "variant", definition = self._global_container_stack.getBottom().getId(), name = hotend_id) if containers: # New material ID is known extruder_manager = ExtruderManager.getInstance() machine_id = self.activeMachineId diff --git a/resources/qml/Preferences/MaterialView.qml b/resources/qml/Preferences/MaterialView.qml index 143f29c86e..311150c6b9 100644 --- a/resources/qml/Preferences/MaterialView.qml +++ b/resources/qml/Preferences/MaterialView.qml @@ -41,7 +41,7 @@ TabView Tab { - title: catalog.i18nc("@title","Information") + title: catalog.i18nc("@title", "Information") anchors.margins: UM.Theme.getSize("default_margin").width diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index f3887e2885..551d85ac13 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -252,6 +252,10 @@ Column visible: Cura.MachineManager.hasMaterials property var valueError: { + if(Cura.MachineManager.activeMaterialId === "") + { + return false + } var data = Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeMaterialId, "compatible") if(data == "False") {