mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-12 17:27:51 -06:00
Add mime type to AbstractMachine
Cura-9277 Co-authored-by: joeydelarago <joeydelarago@gmail.com>
This commit is contained in:
parent
544ac33537
commit
c4be0e298c
1 changed files with 13 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue