mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-11 00:37:50 -06:00
Show user profiles based on Not Supported
CURA-4807
This commit is contained in:
parent
abece3c415
commit
8a570c4b01
3 changed files with 13 additions and 2 deletions
|
@ -1,17 +1,21 @@
|
||||||
# Copyright (c) 2016 Ultimaker B.V.
|
# Copyright (c) 2016 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
from UM.Application import Application
|
from UM.Application import Application
|
||||||
|
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||||
|
|
||||||
from cura.QualityManager import QualityManager
|
from cura.QualityManager import QualityManager
|
||||||
from cura.Settings.ProfilesModel import ProfilesModel
|
from cura.Settings.ProfilesModel import ProfilesModel
|
||||||
from cura.Settings.ExtruderManager import ExtruderManager
|
from cura.Settings.ExtruderManager import ExtruderManager
|
||||||
|
|
||||||
|
|
||||||
## QML Model for listing the current list of valid quality and quality changes profiles.
|
## QML Model for listing the current list of valid quality and quality changes profiles.
|
||||||
#
|
#
|
||||||
class QualityAndUserProfilesModel(ProfilesModel):
|
class QualityAndUserProfilesModel(ProfilesModel):
|
||||||
def __init__(self, parent = None):
|
def __init__(self, parent = None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
|
||||||
|
self._empty_quality = ContainerRegistry.getInstance().findInstanceContainers(id = "empty_quality")[0]
|
||||||
|
|
||||||
## Fetch the list of containers to display.
|
## Fetch the list of containers to display.
|
||||||
#
|
#
|
||||||
# See UM.Settings.Models.InstanceContainersModel._fetchInstanceContainers().
|
# See UM.Settings.Models.InstanceContainersModel._fetchInstanceContainers().
|
||||||
|
@ -35,6 +39,8 @@ class QualityAndUserProfilesModel(ProfilesModel):
|
||||||
|
|
||||||
# Filter the quality_change by the list of available quality_types
|
# Filter the quality_change by the list of available quality_types
|
||||||
quality_type_set = set([x.getMetaDataEntry("quality_type") for x in quality_list])
|
quality_type_set = set([x.getMetaDataEntry("quality_type") for x in quality_list])
|
||||||
|
# Also show custom profiles based on "Not Supported" quality profile
|
||||||
|
quality_type_set.add(self._empty_quality.getMetaDataEntry("quality_type"))
|
||||||
filtered_quality_changes = {qc.getId(): qc for qc in quality_changes_list if
|
filtered_quality_changes = {qc.getId(): qc for qc in quality_changes_list if
|
||||||
qc.getMetaDataEntry("quality_type") in quality_type_set and
|
qc.getMetaDataEntry("quality_type") in quality_type_set and
|
||||||
qc.getMetaDataEntry("extruder") is not None and
|
qc.getMetaDataEntry("extruder") is not None and
|
||||||
|
|
|
@ -107,7 +107,7 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel):
|
||||||
else:
|
else:
|
||||||
quality_changes_container = containers[0]
|
quality_changes_container = containers[0]
|
||||||
|
|
||||||
if quality_changes_container.getMetaDataEntry("quality_type") == "not_supported":
|
if quality_changes_container.getMetaDataEntry("quality_type") == self._empty_quality.getMetaDataEntry("quality_type"):
|
||||||
quality_container = self._empty_quality
|
quality_container = self._empty_quality
|
||||||
else:
|
else:
|
||||||
criteria = {
|
criteria = {
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
from UM.Application import Application
|
from UM.Application import Application
|
||||||
|
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||||
|
|
||||||
from cura.QualityManager import QualityManager
|
from cura.QualityManager import QualityManager
|
||||||
from cura.Settings.ProfilesModel import ProfilesModel
|
from cura.Settings.ProfilesModel import ProfilesModel
|
||||||
from cura.Settings.ExtruderManager import ExtruderManager
|
from cura.Settings.ExtruderManager import ExtruderManager
|
||||||
|
@ -22,6 +24,8 @@ class UserProfilesModel(ProfilesModel):
|
||||||
for material in self.__current_materials:
|
for material in self.__current_materials:
|
||||||
material.metaDataChanged.connect(self._onContainerChanged)
|
material.metaDataChanged.connect(self._onContainerChanged)
|
||||||
|
|
||||||
|
self._empty_quality = ContainerRegistry.getInstance().findContainers(id = "empty_quality")[0]
|
||||||
|
|
||||||
## Fetch the list of containers to display.
|
## Fetch the list of containers to display.
|
||||||
#
|
#
|
||||||
# See UM.Settings.Models.InstanceContainersModel._fetchInstanceContainers().
|
# See UM.Settings.Models.InstanceContainersModel._fetchInstanceContainers().
|
||||||
|
@ -45,6 +49,7 @@ class UserProfilesModel(ProfilesModel):
|
||||||
|
|
||||||
# Filter the quality_change by the list of available quality_types
|
# Filter the quality_change by the list of available quality_types
|
||||||
quality_type_set = set([x.getMetaDataEntry("quality_type") for x in quality_list])
|
quality_type_set = set([x.getMetaDataEntry("quality_type") for x in quality_list])
|
||||||
|
quality_type_set.add(self._empty_quality.getMetaDataEntry("quality_type"))
|
||||||
|
|
||||||
filtered_quality_changes = {qc.getId():qc for qc in quality_changes_list if
|
filtered_quality_changes = {qc.getId():qc for qc in quality_changes_list if
|
||||||
qc.getMetaDataEntry("quality_type") in quality_type_set and
|
qc.getMetaDataEntry("quality_type") in quality_type_set and
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue