Fixed delete selection issues.

CURA-616
This commit is contained in:
Jaime van Kessel 2016-01-05 12:26:39 +01:00
parent f65c848944
commit 3523b709c4
2 changed files with 15 additions and 5 deletions

View File

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

View File

@ -518,10 +518,7 @@ UM.MainWindow
deleteSelection.onTriggered:
{
if(objectContextMenu.objectId != 0)
{
Printer.deleteObject(objectContextMenu.objectId);
}
Printer.deleteSelection()
}
deleteObject.onTriggered: