mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Replace quality(changes) in machine manager now uses new API as well
CURA-3497
This commit is contained in:
parent
a028297cb2
commit
ab6240bd31
1 changed files with 9 additions and 12 deletions
|
@ -906,18 +906,15 @@ class MachineManager(QObject):
|
||||||
|
|
||||||
def _replaceQualityOrQualityChangesInStack(self, stack, container, postpone_emit = False):
|
def _replaceQualityOrQualityChangesInStack(self, stack, container, postpone_emit = False):
|
||||||
# Disconnect the signal handling from the old container.
|
# Disconnect the signal handling from the old container.
|
||||||
old_container = stack.findContainer(type=container.getMetaDataEntry("type"))
|
container_type = container.getMetaDataEntry("type")
|
||||||
if old_container:
|
if container_type == "quality":
|
||||||
old_container.nameChanged.disconnect(self._onQualityNameChanged)
|
stack.quality.nameChanged.disconnect(self._onQualityNameChanged)
|
||||||
else:
|
stack.setQuality(container)
|
||||||
Logger.log("e", "Could not find container of type %s in stack %s while replacing quality (changes) with container %s", container.getMetaDataEntry("type"), stack.getId(), container.getId())
|
stack.qualityChanges.nameChanged.disconnect(self._onQualityNameChanged)
|
||||||
return
|
elif container_type == "quality_changes":
|
||||||
|
stack.qualityChanges.nameChanged.disconnect(self._onQualityNameChanged)
|
||||||
# Swap in the new container into the stack.
|
stack.setQualityChanges(container)
|
||||||
stack.replaceContainer(stack.getContainerIndex(old_container), container, postpone_emit = postpone_emit)
|
stack.qualityChanges.nameChanged.disconnect(self._onQualityNameChanged)
|
||||||
|
|
||||||
# Attach the needed signal handling.
|
|
||||||
container.nameChanged.connect(self._onQualityNameChanged)
|
|
||||||
|
|
||||||
def _askUserToKeepOrClearCurrentSettings(self):
|
def _askUserToKeepOrClearCurrentSettings(self):
|
||||||
Application.getInstance().discardOrKeepProfileChanges()
|
Application.getInstance().discardOrKeepProfileChanges()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue