mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-21 12:09:13 +08:00
Add mime type to AbstractMachine
Cura-9277 Co-authored-by: joeydelarago <joeydelarago@gmail.com>
This commit is contained in:
parent
544ac33537
commit
c4be0e298c
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user