Delete all now correctly handles grouped objects

fixes CURA-111
This commit is contained in:
Jaime van Kessel 2015-09-08 11:56:05 +02:00
parent 56e8b01f22
commit f3eefd7be1

View File

@ -297,8 +297,12 @@ class CuraApplication(QtApplication):
def deleteAll(self): def deleteAll(self):
nodes = [] nodes = []
for node in DepthFirstIterator(self.getController().getScene().getRoot()): for node in DepthFirstIterator(self.getController().getScene().getRoot()):
if type(node) is not SceneNode or not node.getMeshData(): if type(node) is not SceneNode:
continue continue
if not node.getMeshData() and not node.callDecoration("isGroup"):
continue #Node that doesnt have a mesh and is not a group.
if node.getParent() and node.getParent().callDecoration("isGroup"):
continue #Grouped nodes don't need resetting as their parent (the group) is resetted)
nodes.append(node) nodes.append(node)
if nodes: if nodes:
op = GroupedOperation() op = GroupedOperation()