From a7e22e82b6c8f05ac7b539ec82fc25b4376ec94c Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 15 Jul 2016 11:20:08 +0200 Subject: [PATCH 1/3] Duplication now works regardles how deeply group nested a node is CURA-1578 --- cura/CuraApplication.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 800f2a3b95..08d46af4df 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -585,18 +585,16 @@ class CuraApplication(QtApplication): node = Selection.getSelectedObject(0) if node: + current_node = node + # Find the topmost group + while current_node.getParent() and current_node.getParent().callDecoration("isGroup"): + current_node = current_node.getParent() + + new_node = copy.deepcopy(current_node) + op = GroupedOperation() for _ in range(count): - if node.getParent() and node.getParent().callDecoration("isGroup"): - new_node = copy.deepcopy(node.getParent()) #Copy the group node. - new_node.callDecoration("recomputeConvexHull") - - op.addOperation(AddSceneNodeOperation(new_node,node.getParent().getParent())) - else: - new_node = copy.deepcopy(node) - new_node.callDecoration("recomputeConvexHull") - op.addOperation(AddSceneNodeOperation(new_node, node.getParent())) - + op.addOperation(AddSceneNodeOperation(new_node, current_node.getParent())) op.push() ## Center object on platform. From 951e7bf629887118ee9a0837974a573106ec4bba Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 15 Jul 2016 11:40:43 +0200 Subject: [PATCH 2/3] Refusing to change material actually prevents material from being changed CURA-1909 --- cura/Settings/MachineManager.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 23335e3e63..fe451e74f6 100644 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -126,6 +126,9 @@ class MachineManager(QObject): self._auto_change_material_hotend_flood_time = time.time() self._auto_change_material_hotend_flood_last_choice = button + if button == QMessageBox.No: + return + Logger.log("d", "Setting hotend variant of hotend %d to %s" % (index, hotend_id)) extruder_manager = ExtruderManager.getInstance() @@ -174,6 +177,9 @@ class MachineManager(QObject): self._auto_change_material_hotend_flood_time = time.time() self._auto_change_material_hotend_flood_last_choice = button + if button == QMessageBox.No: + return + Logger.log("d", "Setting material of hotend %d to %s" % (index, material_id)) extruder_manager = ExtruderManager.getInstance() From 806197f56bbde3dc9587ceaad4d489d680324e3a Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 15 Jul 2016 12:10:09 +0200 Subject: [PATCH 3/3] Only basename is used for the name CURA-1680 --- cura/PrintInformation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index 5432da5dcc..52c53a34a7 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -81,6 +81,9 @@ class PrintInformation(QObject): @pyqtSlot(str) def setJobName(self, name): + # Ensure that we don't use entire path but only filename + name = os.path.basename(name) + # when a file is opened using the terminal; the filename comes from _onFileLoaded and still contains its # extension. This cuts the extension off if necessary. name = os.path.splitext(name)[0]