mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 10:09:02 +08:00
Merge branch '3.0'
This commit is contained in:
commit
17f0be6d56
@ -1,11 +1,11 @@
|
||||
# Copyright (c) 2016 Ultimaker B.V.
|
||||
# Copyright (c) 2017 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import collections
|
||||
|
||||
from PyQt5.QtCore import pyqtProperty, pyqtSignal, Qt
|
||||
|
||||
import UM.Logger
|
||||
from UM.Logger import Logger
|
||||
import UM.Qt
|
||||
from UM.Application import Application
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
@ -97,7 +97,7 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel):
|
||||
|
||||
containers = self._container_registry.findInstanceContainers(id = self._quality_id)
|
||||
if not containers:
|
||||
UM.Logger.log("w", "Could not find a quality container with id %s", self._quality_id)
|
||||
Logger.log("w", "Could not find a quality container with id %s", self._quality_id)
|
||||
return
|
||||
|
||||
quality_container = None
|
||||
@ -116,7 +116,7 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel):
|
||||
|
||||
quality_container = self._container_registry.findInstanceContainers(**criteria)
|
||||
if not quality_container:
|
||||
UM.Logger.log("w", "Could not find a quality container matching quality changes %s", quality_changes_container.getId())
|
||||
Logger.log("w", "Could not find a quality container matching quality changes %s", quality_changes_container.getId())
|
||||
return
|
||||
quality_container = quality_container[0]
|
||||
|
||||
@ -160,7 +160,7 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel):
|
||||
containers = self._container_registry.findInstanceContainers(**criteria)
|
||||
|
||||
if not containers:
|
||||
UM.Logger.log("w", "Could not find any quality containers matching the search criteria %s" % str(criteria))
|
||||
Logger.log("w", "Could not find any quality containers matching the search criteria %s" % str(criteria))
|
||||
return
|
||||
|
||||
if quality_changes_container:
|
||||
|
@ -416,6 +416,7 @@ class XmlMaterialProfile(InstanceContainer):
|
||||
|
||||
## Overridden from InstanceContainer
|
||||
def deserialize(self, serialized):
|
||||
containers_to_add = []
|
||||
# update the serialized data first
|
||||
from UM.Settings.Interfaces import ContainerInterface
|
||||
serialized = ContainerInterface.deserialize(self, serialized)
|
||||
@ -573,7 +574,7 @@ class XmlMaterialProfile(InstanceContainer):
|
||||
new_material._dirty = False
|
||||
|
||||
if is_new_material:
|
||||
ContainerRegistry.getInstance().addContainer(new_material)
|
||||
containers_to_add.append(new_material)
|
||||
|
||||
hotends = machine.iterfind("./um:hotend", self.__namespaces)
|
||||
for hotend in hotends:
|
||||
@ -632,7 +633,10 @@ class XmlMaterialProfile(InstanceContainer):
|
||||
new_hotend_material._dirty = False
|
||||
|
||||
if is_new_material:
|
||||
ContainerRegistry.getInstance().addContainer(new_hotend_material)
|
||||
containers_to_add.append(new_hotend_material)
|
||||
|
||||
for container_to_add in containers_to_add:
|
||||
ContainerRegistry.getInstance().addContainer(container_to_add)
|
||||
|
||||
def _addSettingElement(self, builder, instance):
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user