From f8e2d4f035849edf95b5138dcc43476e8164fa5e Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Tue, 12 Jan 2016 10:14:34 +0100 Subject: [PATCH 1/5] Disable toolbar while running tooloperation --- resources/qml/Toolbar.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/Toolbar.qml b/resources/qml/Toolbar.qml index 4eca81a4a6..371c90042b 100644 --- a/resources/qml/Toolbar.qml +++ b/resources/qml/Toolbar.qml @@ -97,6 +97,7 @@ Item { y: UM.Theme.sizes.default_margin.height; source: UM.ActiveTool.valid ? UM.ActiveTool.activeToolPanel : ""; + enabled: UM.Controller.toolsEnabled; } } } From 42673c7c68ae6509b99f9020cd595ace33cd9b60 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 21 Jan 2016 14:57:58 +0100 Subject: [PATCH 2/5] Disable using the toolbar while a tooloperation is ongoing --- resources/qml/Toolbar.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Toolbar.qml b/resources/qml/Toolbar.qml index 371c90042b..46bafb9296 100644 --- a/resources/qml/Toolbar.qml +++ b/resources/qml/Toolbar.qml @@ -33,7 +33,7 @@ Item { checkable: true; checked: model.active; - enabled: UM.Selection.hasSelection; + enabled: UM.Selection.hasSelection && UM.Controller.toolsEnabled; style: UM.Theme.styles.tool_button; From c1c2c0030e7544cea14bc18a5d6c8a027b46b69e Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 21 Jan 2016 15:31:50 +0100 Subject: [PATCH 3/5] Prevent deleting objects while a tooloperation is ongoing --- cura/CuraApplication.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 6007083f07..7c9f993e21 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -292,6 +292,9 @@ class CuraApplication(QtApplication): # Remove all selected objects from the scene. @pyqtSlot() def deleteSelection(self): + if not self.getController().getToolsEnabled(): + return + op = GroupedOperation() nodes = Selection.getAllSelectedObjects() for node in nodes: @@ -305,6 +308,9 @@ class CuraApplication(QtApplication): # Note that this only removes an object if it is selected. @pyqtSlot("quint64") def deleteObject(self, object_id): + if not self.getController().getToolsEnabled(): + return + node = self.getController().getScene().findObject(object_id) 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. @pyqtSlot() def deleteAll(self): + if not self.getController().getToolsEnabled(): + return + nodes = [] for node in DepthFirstIterator(self.getController().getScene().getRoot()): if type(node) is not SceneNode: From 3768975aaec7196ddc810190520dffaa9b33282e Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 21 Jan 2016 15:45:52 +0100 Subject: [PATCH 4/5] Disable actions while tooloperation is ongoing --- resources/qml/Actions.qml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/qml/Actions.qml b/resources/qml/Actions.qml index eb4f150f86..64e9b3b1a2 100644 --- a/resources/qml/Actions.qml +++ b/resources/qml/Actions.qml @@ -127,6 +127,7 @@ Item { id: deleteSelectionAction; text: catalog.i18nc("@action:inmenu menubar:edit","Delete &Selection"); + enabled: UM.Controller.toolsEnabled; iconName: "edit-delete"; shortcut: StandardKey.Delete; } @@ -135,6 +136,7 @@ Item { id: deleteObjectAction; text: catalog.i18nc("@action:inmenu","Delete Object"); + enabled: UM.Controller.toolsEnabled; iconName: "edit-delete"; } @@ -179,6 +181,7 @@ Item { id: deleteAllAction; text: catalog.i18nc("@action:inmenu menubar:edit","&Clear Build Platform"); + enabled: UM.Controller.toolsEnabled; iconName: "edit-delete"; shortcut: "Ctrl+D"; } From 6ef5aeb02b8f31e61deb0ec72dce62f39b65f451 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 22 Jan 2016 15:25:08 +0100 Subject: [PATCH 5/5] Remove superfluous comment This should be obvious. The thought process was that now we're using the builder instead of making the MeshData object directly, but that has only relevance if you still remember what the old code was. Contributes to issue CURA-625. --- cura/ConvexHullNode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/ConvexHullNode.py b/cura/ConvexHullNode.py index b9cf925eef..7f0f87ade5 100644 --- a/cura/ConvexHullNode.py +++ b/cura/ConvexHullNode.py @@ -48,7 +48,7 @@ class ConvexHullNode(SceneNode): if len(hull_points) < 3: return None - mesh_builder = MeshBuilder() #Create a mesh using the mesh builder. + mesh_builder = MeshBuilder() point_first = Vector(hull_points[0][0], self._mesh_height, hull_points[0][1]) point_previous = Vector(hull_points[1][0], self._mesh_height, hull_points[1][1]) for point in hull_points[2:]: #Add the faces in the order of a triangle fan.