mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 06:33:55 -06:00
Override getConfigurationTypeFromSerialized for GlobalStack
CURA-3975 GlobalStack has metadata type "machine", which is different from what is registered in the VersionUpgradeManager "machine_stack". This commit makes sure that Cura can find the correct upgrade route for the GlobalStack files.
This commit is contained in:
parent
42858b4715
commit
3d48024a47
1 changed files with 12 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
||||||
# Copyright (c) 2017 Ultimaker B.V.
|
# Copyright (c) 2017 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the AGPLv3 or higher.
|
# Cura is released under the terms of the AGPLv3 or higher.
|
||||||
|
|
||||||
from typing import Any, Dict
|
from typing import Any, Dict, Optional
|
||||||
|
|
||||||
from PyQt5.QtCore import pyqtProperty
|
from PyQt5.QtCore import pyqtProperty
|
||||||
|
|
||||||
|
@ -42,6 +42,17 @@ class GlobalStack(CuraContainerStack):
|
||||||
def getLoadingPriority(cls) -> int:
|
def getLoadingPriority(cls) -> int:
|
||||||
return 2
|
return 2
|
||||||
|
|
||||||
|
def getConfigurationTypeFromSerialized(self, serialized: str) -> Optional[str]:
|
||||||
|
configuration_type = None
|
||||||
|
try:
|
||||||
|
parser = self._readAndValidateSerialized(serialized)
|
||||||
|
configuration_type = parser["metadata"].get("type")
|
||||||
|
if configuration_type == "machine":
|
||||||
|
configuration_type = "machine_stack"
|
||||||
|
except Exception as e:
|
||||||
|
Logger.log("e", "Could not get configuration type: %s", e)
|
||||||
|
return configuration_type
|
||||||
|
|
||||||
## Add an extruder to the list of extruders of this stack.
|
## Add an extruder to the list of extruders of this stack.
|
||||||
#
|
#
|
||||||
# \param extruder The extruder to add.
|
# \param extruder The extruder to add.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue