mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 07:03:56 -06:00
An empty quality container will now give a "not supported" warning
CURA-2236
This commit is contained in:
parent
51d653beba
commit
3227507297
4 changed files with 22 additions and 5 deletions
|
@ -180,6 +180,7 @@ class CuraApplication(QtApplication):
|
|||
ContainerRegistry.getInstance().addContainer(empty_material_container)
|
||||
empty_quality_container = copy.deepcopy(empty_container)
|
||||
empty_quality_container._id = "empty_quality"
|
||||
empty_quality_container.setName("Not supported")
|
||||
empty_quality_container.addMetaDataEntry("type", "quality")
|
||||
ContainerRegistry.getInstance().addContainer(empty_quality_container)
|
||||
empty_quality_changes_container = copy.deepcopy(empty_container)
|
||||
|
|
|
@ -7,7 +7,7 @@ from PyQt5.QtWidgets import QMessageBox
|
|||
from UM.Application import Application
|
||||
from UM.Preferences import Preferences
|
||||
from UM.Logger import Logger
|
||||
|
||||
from UM.Message import Message
|
||||
from UM.Settings.SettingRelation import RelationType
|
||||
|
||||
import UM.Settings
|
||||
|
@ -856,7 +856,6 @@ class MachineManager(QObject):
|
|||
containers = container_registry.findInstanceContainers(**search_criteria)
|
||||
if containers:
|
||||
return containers[0]
|
||||
|
||||
# We still weren't able to find a quality for this specific material.
|
||||
# Try to find qualities for a generic version of the material.
|
||||
material_search_criteria = { "type": "material", "material": material_container.getMetaDataEntry("material"), "color_name": "Generic"}
|
||||
|
@ -873,7 +872,6 @@ class MachineManager(QObject):
|
|||
material_search_criteria["variant"] = variant_container.id
|
||||
else:
|
||||
material_search_criteria["definition"] = "fdmprinter"
|
||||
|
||||
material_containers = container_registry.findInstanceContainers(**material_search_criteria)
|
||||
if material_containers:
|
||||
search_criteria["material"] = material_containers[0].getId()
|
||||
|
@ -891,6 +889,9 @@ class MachineManager(QObject):
|
|||
if containers:
|
||||
return containers[0]
|
||||
|
||||
# Notify user that we were unable to find a matching quality
|
||||
message = Message(catalog.i18nc("@info:status", "Unable to find a quality profile for this combination, using an empty one instead."))
|
||||
message.show()
|
||||
return self._empty_quality_container
|
||||
|
||||
## Finds a quality-changes container to use if any other container
|
||||
|
|
|
@ -277,7 +277,7 @@ Column
|
|||
height: UM.Theme.getSize("setting_control").height
|
||||
tooltip: Cura.MachineManager.activeQualityName
|
||||
style: UM.Theme.styles.sidebar_header_button
|
||||
|
||||
property var valueWarning: Cura.MachineManager.activeQualityId == "empty_quality"
|
||||
menu: ProfileMenu { }
|
||||
|
||||
UM.SimpleButton
|
||||
|
|
|
@ -11,7 +11,22 @@ QtObject {
|
|||
property Component sidebar_header_button: Component {
|
||||
ButtonStyle {
|
||||
background: Rectangle {
|
||||
color: control.enabled ? Theme.getColor("setting_control") : Theme.getColor("setting_control_disabled")
|
||||
color:
|
||||
{
|
||||
if(control.enabled)
|
||||
{
|
||||
if(control.valueWarning)
|
||||
{
|
||||
return Theme.getColor("setting_validation_warning");
|
||||
} else
|
||||
{
|
||||
return Theme.getColor("setting_control");
|
||||
}
|
||||
} else {
|
||||
return Theme.getColor("setting_control_disabled");
|
||||
}
|
||||
}
|
||||
|
||||
border.width: Theme.getSize("default_lining").width
|
||||
border.color: !control.enabled ? Theme.getColor("setting_control_disabled_border") :
|
||||
control.hovered ? Theme.getColor("setting_control_border_highlight") : Theme.getColor("setting_control_border")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue