mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 14:44:13 -06:00
Fix exporting with new quality changes groups
Those groups are starting to become a bit cumbersome... Contributes to issue CURA-6600.
This commit is contained in:
parent
4f936f5c23
commit
1b9e710f72
2 changed files with 7 additions and 5 deletions
|
@ -4,7 +4,7 @@
|
||||||
import os
|
import os
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
import uuid
|
import uuid
|
||||||
from typing import Dict, Union, Any, TYPE_CHECKING, List
|
from typing import Any, cast, Dict, List, TYPE_CHECKING, Union
|
||||||
|
|
||||||
from PyQt5.QtCore import QObject, QUrl
|
from PyQt5.QtCore import QObject, QUrl
|
||||||
from PyQt5.QtWidgets import QMessageBox
|
from PyQt5.QtWidgets import QMessageBox
|
||||||
|
@ -31,8 +31,6 @@ if TYPE_CHECKING:
|
||||||
from cura.Machines.MaterialNode import MaterialNode
|
from cura.Machines.MaterialNode import MaterialNode
|
||||||
from cura.Machines.QualityChangesGroup import QualityChangesGroup
|
from cura.Machines.QualityChangesGroup import QualityChangesGroup
|
||||||
|
|
||||||
from cura.Machines.QualityManager import QualityManager
|
|
||||||
|
|
||||||
catalog = i18nCatalog("cura")
|
catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
|
|
||||||
|
@ -448,7 +446,10 @@ class ContainerManager(QObject):
|
||||||
if not path:
|
if not path:
|
||||||
return
|
return
|
||||||
|
|
||||||
container_list = [n.container for n in quality_changes_group.getAllNodes() if n.container is not None]
|
container_registry = cura.CuraApplication.CuraApplication.getInstance().getContainerRegistry()
|
||||||
|
container_list = [cast(InstanceContainer, container_registry.findContainers(id = quality_changes_group.metadata_for_global["id"])[0])] # type: List[InstanceContainer]
|
||||||
|
for metadata in quality_changes_group.metadata_per_extruder.values():
|
||||||
|
container_list.append(cast(InstanceContainer, container_registry.findContainers(id = metadata["id"])[0]))
|
||||||
cura.CuraApplication.CuraApplication.getInstance().getContainerRegistry().exportQualityProfile(container_list, path, file_type)
|
cura.CuraApplication.CuraApplication.getInstance().getContainerRegistry().exportQualityProfile(container_list, path, file_type)
|
||||||
|
|
||||||
__instance = None # type: ContainerManager
|
__instance = None # type: ContainerManager
|
||||||
|
|
|
@ -101,7 +101,8 @@ class CuraContainerRegistry(ContainerRegistry):
|
||||||
|
|
||||||
## Exports an profile to a file
|
## Exports an profile to a file
|
||||||
#
|
#
|
||||||
# \param container_list \type{list} the containers to export
|
# \param container_list \type{list} the containers to export. This is not
|
||||||
|
# necessarily in any order!
|
||||||
# \param file_name \type{str} the full path and filename to export to.
|
# \param file_name \type{str} the full path and filename to export to.
|
||||||
# \param file_type \type{str} the file type with the format "<description> (*.<extension>)"
|
# \param file_type \type{str} the file type with the format "<description> (*.<extension>)"
|
||||||
# \return True if the export succeeded, false otherwise.
|
# \return True if the export succeeded, false otherwise.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue