diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index fb478f8f7c..3e8cbfd500 100644 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -480,71 +480,6 @@ class MachineManager(QObject): if extruder_stack != self._active_container_stack and extruder_stack.getProperty(key, "value") != new_value: extruder_stack.getTop().setProperty(key, "value", new_value) - @pyqtSlot(str, result=str) - def duplicateContainer(self, container_id): - if not self._active_container_stack: - return "" - containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id = container_id) - if containers: - new_name = self._createUniqueName("quality", "", containers[0].getName(), catalog.i18nc("@label", "Custom profile")) - - new_container = containers[0].duplicate(new_name, new_name) - - UM.Settings.ContainerRegistry.getInstance().addContainer(new_container) - - return new_name - - return "" - - @pyqtSlot(str, str) - def renameQualityContainer(self, container_id, new_name): - containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id = container_id, type = "quality") - if containers: - new_name = self._createUniqueName("quality", containers[0].getName(), new_name, - catalog.i18nc("@label", "Custom profile")) - - if containers[0].getName() == new_name: - # Nothing to do. - return - - # As we also want the id of the container to be changed (so that profile name is the name of the file - # on disk. We need to create a new instance and remove it (so the old file of the container is removed) - # If we don't do that, we might get duplicates & other weird issues. - new_container = UM.Settings.InstanceContainer("") - new_container.deserialize(containers[0].serialize()) - - # Actually set the name - new_container.setName(new_name) - new_container._id = new_name # Todo: Fix proper id change function for this. - - # Add the "new" container. - UM.Settings.ContainerRegistry.getInstance().addContainer(new_container) - - # Ensure that the renamed profile is saved -before- we remove the old profile. - Application.getInstance().saveSettings() - - # Actually set & remove new / old quality. - self.setActiveQuality(new_name) - self.removeQualityContainer(containers[0].getId()) - - @pyqtSlot(str) - def removeQualityContainer(self, container_id): - containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id = container_id) - if not containers or not self._active_container_stack: - return - - # If the container that is being removed is the currently active container, set another machine as the active container - activate_new_container = container_id == self.activeQualityId - - UM.Settings.ContainerRegistry.getInstance().removeContainer(container_id) - - if activate_new_container: - definition_id = "fdmprinter" if not self.filterQualityByMachine else self.activeDefinitionId - containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(type = "quality", definition = definition_id) - if containers: - self.setActiveQuality(containers[0].getId()) - self.activeQualityChanged.emit() - @pyqtSlot(str) def setActiveMaterial(self, material_id): containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id = material_id) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 02dcd10897..612de89fe8 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -765,10 +765,6 @@ UM.MainWindow addMachineDialog.visible = true addMachineDialog.firstRun = false } - onClearAllFocus: - { - contentItem.focus = true - } } Timer