Fix 'Could not get metadata of container <empty string>'

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.
This commit is contained in:
Ghostkeeper 2017-10-30 11:15:41 +01:00
parent 8bbb6c1af5
commit 839c8ccc52
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A
3 changed files with 6 additions and 2 deletions

View file

@ -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

View file

@ -41,7 +41,7 @@ TabView
Tab
{
title: catalog.i18nc("@title","Information")
title: catalog.i18nc("@title", "Information")
anchors.margins: UM.Theme.getSize("default_margin").width

View file

@ -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")
{