mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-03 03:54:01 -06:00
Introduce a GlobalStack class
This will allow us to codify some of the assumptions made about the global stack Contributes to CURA-3497
This commit is contained in:
parent
3b0fdecb60
commit
12c50dbac8
1 changed files with 22 additions and 0 deletions
22
cura/Settings/GlobalStack.py
Normal file
22
cura/Settings/GlobalStack.py
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
# Copyright (c) 2017 Ultimaker B.V.
|
||||||
|
# Cura is released under the terms of the AGPLv3 or higher.
|
||||||
|
|
||||||
|
from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase
|
||||||
|
from UM.Settings.ContainerStack import ContainerStack
|
||||||
|
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||||
|
|
||||||
|
class CannotSetNextStackError(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class GlobalStack(ContainerStack):
|
||||||
|
def __init__(self, container_id, *args, **kwargs):
|
||||||
|
super().__init__(container_id, *args, **kwargs)
|
||||||
|
|
||||||
|
global_stack_mime = MimeType(
|
||||||
|
name = "application/x-cura-globalstack",
|
||||||
|
comment = "Cura Global Stack",
|
||||||
|
suffixes = [ "global.cfg" ]
|
||||||
|
)
|
||||||
|
|
||||||
|
MimeTypeDatabase.addMimeType(global_stack_mime)
|
||||||
|
ContainerRegistry.addContainerTypeByName(GlobalStack, "global_stack", global_stack_mime.name)
|
Loading…
Add table
Add a link
Reference in a new issue