From c4be0e298caaab54a0135ddfab336a8ffba10744 Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Mon, 22 Aug 2022 11:57:18 +0200 Subject: [PATCH] Add mime type to `AbstractMachine` Cura-9277 Co-authored-by: joeydelarago --- cura/Settings/AbstractMachine.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cura/Settings/AbstractMachine.py b/cura/Settings/AbstractMachine.py index 7bf8454a49..50321d9a9f 100644 --- a/cura/Settings/AbstractMachine.py +++ b/cura/Settings/AbstractMachine.py @@ -2,6 +2,8 @@ from typing import List from UM.Settings.ContainerStack import ContainerStack from cura.Settings.GlobalStack import GlobalStack +from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase +from UM.Settings.ContainerRegistry import ContainerRegistry class AbstractMachine(GlobalStack): @@ -19,3 +21,14 @@ class AbstractMachine(GlobalStack): printer_type = self.definition.getId() cloud_printer_type = 3 return [machine for machine in registry.findContainerStacks(type="machine") if machine.definition.id == printer_type and cloud_printer_type in machine.configuredConnectionTypes] + + +## private: +abstract_machine_mime = MimeType( + name = "application/x-cura-abstract-machine", + comment = "Cura Abstract Machine", + suffixes = ["global.cfg"] +) + +MimeTypeDatabase.addMimeType(abstract_machine_mime) +ContainerRegistry.addContainerTypeByName(AbstractMachine, "abstract_machine", abstract_machine_mime.name)