Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorc.lamboo <casperlamboo@gmail.com>2022-08-22 12:57:18 +0300
committerc.lamboo <casperlamboo@gmail.com>2022-08-22 12:57:18 +0300
commitc4be0e298caaab54a0135ddfab336a8ffba10744 (patch)
tree4c81713b77a966dbbac798876abe613c7c5de7bf /cura/Settings
parent544ac33537a0d0f078bcf73ae4175e9c615faaac (diff)
Add mime type to `AbstractMachine`
Cura-9277 Co-authored-by: joeydelarago <joeydelarago@gmail.com>
Diffstat (limited to 'cura/Settings')
-rw-r--r--cura/Settings/AbstractMachine.py13
1 files changed, 13 insertions, 0 deletions
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)