mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 11:17:49 -06:00
Prevent deleting objects while a tooloperation is ongoing
This commit is contained in:
parent
42673c7c68
commit
c1c2c0030e
1 changed files with 9 additions and 0 deletions
|
@ -292,6 +292,9 @@ class CuraApplication(QtApplication):
|
||||||
# Remove all selected objects from the scene.
|
# Remove all selected objects from the scene.
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def deleteSelection(self):
|
def deleteSelection(self):
|
||||||
|
if not self.getController().getToolsEnabled():
|
||||||
|
return
|
||||||
|
|
||||||
op = GroupedOperation()
|
op = GroupedOperation()
|
||||||
nodes = Selection.getAllSelectedObjects()
|
nodes = Selection.getAllSelectedObjects()
|
||||||
for node in nodes:
|
for node in nodes:
|
||||||
|
@ -305,6 +308,9 @@ class CuraApplication(QtApplication):
|
||||||
# Note that this only removes an object if it is selected.
|
# Note that this only removes an object if it is selected.
|
||||||
@pyqtSlot("quint64")
|
@pyqtSlot("quint64")
|
||||||
def deleteObject(self, object_id):
|
def deleteObject(self, object_id):
|
||||||
|
if not self.getController().getToolsEnabled():
|
||||||
|
return
|
||||||
|
|
||||||
node = self.getController().getScene().findObject(object_id)
|
node = self.getController().getScene().findObject(object_id)
|
||||||
|
|
||||||
if not node and object_id != 0: #Workaround for tool handles overlapping the selected object
|
if not node and object_id != 0: #Workaround for tool handles overlapping the selected object
|
||||||
|
@ -364,6 +370,9 @@ class CuraApplication(QtApplication):
|
||||||
## Delete all mesh data on the scene.
|
## Delete all mesh data on the scene.
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def deleteAll(self):
|
def deleteAll(self):
|
||||||
|
if not self.getController().getToolsEnabled():
|
||||||
|
return
|
||||||
|
|
||||||
nodes = []
|
nodes = []
|
||||||
for node in DepthFirstIterator(self.getController().getScene().getRoot()):
|
for node in DepthFirstIterator(self.getController().getScene().getRoot()):
|
||||||
if type(node) is not SceneNode:
|
if type(node) is not SceneNode:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue