T466: Fixed Nothing to slice bug

This commit is contained in:
Victor Larchenko 2016-11-09 14:53:23 +06:00 committed by Youness Alaoui
parent 2b2eec5643
commit be3a945fb0
3 changed files with 33 additions and 43 deletions

View file

@ -541,13 +541,10 @@ class CuraApplication(QtApplication):
def loadFile(self, file):
scene = self.getController().getScene()
def findAny():
for node1 in DepthFirstIterator(scene.getRoot()):
if hasattr(node1, "gcode") and getattr(node1, "gcode") is True:
return True
return False
if findAny():
self.deleteAll()
for node1 in DepthFirstIterator(scene.getRoot()):
if hasattr(node1, "gcode") and getattr(node1, "gcode") is True:
self.deleteAll()
break
if not file.isValid():
return