mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-16 18:35:53 +08:00
Merge branch 'master' of github.com:Ultimaker/Cura
This commit is contained in:
commit
717437647b
@ -327,29 +327,31 @@ class CuraApplication(QtApplication):
|
|||||||
f.write(data)
|
f.write(data)
|
||||||
|
|
||||||
for stack in ContainerRegistry.getInstance().findContainerStacks():
|
for stack in ContainerRegistry.getInstance().findContainerStacks():
|
||||||
if not stack.isDirty():
|
self.saveStack(stack)
|
||||||
continue
|
|
||||||
|
|
||||||
try:
|
def saveStack(self, stack):
|
||||||
data = stack.serialize()
|
if not stack.isDirty():
|
||||||
except NotImplementedError:
|
return
|
||||||
continue
|
try:
|
||||||
except Exception:
|
data = stack.serialize()
|
||||||
Logger.logException("e", "An exception occurred when serializing container %s", instance.getId())
|
except NotImplementedError:
|
||||||
continue
|
return
|
||||||
|
except Exception:
|
||||||
|
Logger.logException("e", "An exception occurred when serializing container %s", stack.getId())
|
||||||
|
return
|
||||||
|
|
||||||
mime_type = ContainerRegistry.getMimeTypeForContainer(type(stack))
|
mime_type = ContainerRegistry.getMimeTypeForContainer(type(stack))
|
||||||
file_name = urllib.parse.quote_plus(stack.getId()) + "." + mime_type.preferredSuffix
|
file_name = urllib.parse.quote_plus(stack.getId()) + "." + mime_type.preferredSuffix
|
||||||
stack_type = stack.getMetaDataEntry("type", None)
|
stack_type = stack.getMetaDataEntry("type", None)
|
||||||
path = None
|
path = None
|
||||||
if not stack_type or stack_type == "machine":
|
if not stack_type or stack_type == "machine":
|
||||||
path = Resources.getStoragePath(self.ResourceTypes.MachineStack, file_name)
|
path = Resources.getStoragePath(self.ResourceTypes.MachineStack, file_name)
|
||||||
elif stack_type == "extruder_train":
|
elif stack_type == "extruder_train":
|
||||||
path = Resources.getStoragePath(self.ResourceTypes.ExtruderStack, file_name)
|
path = Resources.getStoragePath(self.ResourceTypes.ExtruderStack, file_name)
|
||||||
if path:
|
if path:
|
||||||
stack.setPath(path)
|
stack.setPath(path)
|
||||||
with SaveFile(path, "wt", -1, "utf-8") as f:
|
with SaveFile(path, "wt", -1, "utf-8") as f:
|
||||||
f.write(data)
|
f.write(data)
|
||||||
|
|
||||||
|
|
||||||
@pyqtSlot(str, result = QUrl)
|
@pyqtSlot(str, result = QUrl)
|
||||||
|
@ -746,7 +746,10 @@ class ContainerManager(QObject):
|
|||||||
if not global_stack.getMetaDataEntry("has_machine_quality"):
|
if not global_stack.getMetaDataEntry("has_machine_quality"):
|
||||||
quality_changes.setDefinition(self._container_registry.findContainers(id = "fdmprinter")[0])
|
quality_changes.setDefinition(self._container_registry.findContainers(id = "fdmprinter")[0])
|
||||||
else:
|
else:
|
||||||
quality_changes.setDefinition(global_stack.getBottom())
|
definition = global_stack.getBottom()
|
||||||
|
definition_id = definition.getMetaDataEntry("quality_definition", definition.getId())
|
||||||
|
definition = self._container_registry.findContainers(id=definition_id)[0]
|
||||||
|
quality_changes.setDefinition(definition)
|
||||||
|
|
||||||
if global_stack.getMetaDataEntry("has_materials"):
|
if global_stack.getMetaDataEntry("has_materials"):
|
||||||
material = quality_container.getMetaDataEntry("material")
|
material = quality_container.getMetaDataEntry("material")
|
||||||
|
@ -235,7 +235,6 @@ Column
|
|||||||
property var valueError:
|
property var valueError:
|
||||||
{
|
{
|
||||||
var data = Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeMaterialId, "compatible")
|
var data = Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeMaterialId, "compatible")
|
||||||
print(data)
|
|
||||||
if(data == "" || data == "True")
|
if(data == "" || data == "True")
|
||||||
{
|
{
|
||||||
return false
|
return false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user