diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 71f8993385..a89ea7fe0b 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -281,7 +281,20 @@ class CuraApplication(QtApplication): def jobName(self): return self._job_name - ## Remove an object from the scene + # Remove all selected objects from the scene. + @pyqtSlot() + def deleteSelection(self): + op = GroupedOperation() + nodes = Selection.getAllSelectedObjects() + for node in nodes: + op.addOperation(RemoveSceneNodeOperation(node)) + + op.push() + + pass + + ## Remove an object from the scene. + # Note that this only removes an object if it is selected. @pyqtSlot("quint64") def deleteObject(self, object_id): node = self.getController().getScene().findObject(object_id) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 8901667425..7668509eee 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -518,10 +518,7 @@ UM.MainWindow deleteSelection.onTriggered: { - if(objectContextMenu.objectId != 0) - { - Printer.deleteObject(objectContextMenu.objectId); - } + Printer.deleteSelection() } deleteObject.onTriggered: