CURA-4525 fix accidently remove all scenenodes when deleteAll

This commit is contained in:
Jack Ha 2017-11-13 16:51:07 +01:00
parent 8e5e555344
commit 97f61366a8
2 changed files with 3 additions and 3 deletions

View File

@ -1040,7 +1040,7 @@ class CuraApplication(QtApplication):
nodes = [] nodes = []
for node in DepthFirstIterator(self.getController().getScene().getRoot()): for node in DepthFirstIterator(self.getController().getScene().getRoot()):
if not issubclass(type(node), SceneNode): if type(node) not in {SceneNode, CuraSceneNode}:
continue continue
if (not node.getMeshData() and not node.callDecoration("getLayerData")) and not node.callDecoration("isGroup"): if (not node.getMeshData() and not node.callDecoration("getLayerData")) and not node.callDecoration("isGroup"):
continue # Node that doesnt have a mesh and is not a group. continue # Node that doesnt have a mesh and is not a group.

View File

@ -54,7 +54,7 @@ Rectangle
anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.leftMargin: UM.Theme.getSize("default_margin").width
//anchors.right: parent.right //anchors.right: parent.right
width: parent.width - 2 * UM.Theme.getSize("default_margin").width - 30 width: parent.width - 2 * UM.Theme.getSize("default_margin").width - 30
text: Cura.ObjectManager.getItem(index).name; text: Cura.ObjectManager.getItem(index) ? Cura.ObjectManager.getItem(index).name : "";
color: Cura.ObjectManager.getItem(index).isSelected ? palette.highlightedText : (Cura.ObjectManager.getItem(index).isOutsideBuildArea ? palette.mid : palette.text) color: Cura.ObjectManager.getItem(index).isSelected ? palette.highlightedText : (Cura.ObjectManager.getItem(index).isOutsideBuildArea ? palette.mid : palette.text)
elide: Text.ElideRight elide: Text.ElideRight
} }
@ -66,7 +66,7 @@ Rectangle
anchors.left: nodeNameLabel.right anchors.left: nodeNameLabel.right
anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.leftMargin: UM.Theme.getSize("default_margin").width
anchors.right: parent.right anchors.right: parent.right
text: Cura.ObjectManager.getItem(index).buildPlateNumber; text: Cura.ObjectManager.getItem(index) ? Cura.ObjectManager.getItem(index).buildPlateNumber : 0;
color: Cura.ObjectManager.getItem(index).isSelected ? palette.highlightedText : palette.text color: Cura.ObjectManager.getItem(index).isSelected ? palette.highlightedText : palette.text
elide: Text.ElideRight elide: Text.ElideRight
} }