mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Fix various quality related issues
This commit is contained in:
parent
3095140bc3
commit
b014800eac
4 changed files with 20 additions and 31 deletions
|
@ -527,18 +527,7 @@ class MachineManager(QObject):
|
|||
return quality_changes.getId()
|
||||
return ""
|
||||
|
||||
@pyqtProperty(str, notify=activeQualityChanged)
|
||||
def globalQualityId(self) -> str:
|
||||
if self._global_container_stack:
|
||||
quality = self._global_container_stack.qualityChanges
|
||||
if quality and not isinstance(quality, type(self._empty_quality_changes_container)):
|
||||
return quality.getId()
|
||||
quality = self._global_container_stack.quality
|
||||
if quality:
|
||||
return quality.getId()
|
||||
return ""
|
||||
|
||||
@pyqtProperty(str, notify=activeVariantChanged)
|
||||
@pyqtProperty(str, notify = activeVariantChanged)
|
||||
def globalVariantName(self) -> str:
|
||||
if self._global_container_stack:
|
||||
variant = self._global_container_stack.variant
|
||||
|
@ -546,21 +535,21 @@ class MachineManager(QObject):
|
|||
return variant.getName()
|
||||
return ""
|
||||
|
||||
@pyqtProperty(str, notify = activeQualityChanged)
|
||||
@pyqtProperty(str, notify = activeQualityGroupChanged)
|
||||
def activeQualityType(self) -> str:
|
||||
quality_type = ""
|
||||
if self._active_container_stack:
|
||||
quality = self._active_container_stack.quality
|
||||
if quality:
|
||||
return quality.getMetaDataEntry("quality_type")
|
||||
return ""
|
||||
if self._current_quality_group:
|
||||
quality_type = self._current_quality_group.quality_type
|
||||
return quality_type
|
||||
|
||||
@pyqtProperty(bool, notify = activeQualityChanged)
|
||||
@pyqtProperty(bool, notify = activeQualityGroupChanged)
|
||||
def isActiveQualitySupported(self) -> bool:
|
||||
if self._active_container_stack:
|
||||
quality = self._active_container_stack.quality
|
||||
if quality:
|
||||
return Util.parseBool(quality.getMetaDataEntry("supported", True))
|
||||
return False
|
||||
is_supported = False
|
||||
if self._global_container_stack:
|
||||
if self._current_quality_group:
|
||||
is_supported = self._current_quality_group.is_available
|
||||
return is_supported
|
||||
|
||||
## Returns whether there is anything unsupported in the current set-up.
|
||||
#
|
||||
|
|
|
@ -36,8 +36,8 @@ Tab
|
|||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.right: parent.right
|
||||
text: (styleData.value.substr(0,1) == "=") ? catalog.i18nc("@info:status", "Calculated") : styleData.value
|
||||
font.strikeout: styleData.column == 1 && setting.user_value != "" // TODO && quality == Cura.MachineManager.globalQualityId
|
||||
font.italic: setting.profile_value_source == "quality_changes" || (setting.user_value != "") // TODO: (setting.user_value != "" && quality == Cura.MachineManager.globalQualityId)
|
||||
font.strikeout: styleData.column == 1 && setting.user_value != "" && qualityItem.name == Cura.MachineManager.activeQualityOrQualityChangesName
|
||||
font.italic: setting.profile_value_source == "quality_changes" || (setting.user_value != "" && qualityItem.name == Cura.MachineManager.activeQualityOrQualityChangesName)
|
||||
opacity: font.strikeout ? 0.5 : 1
|
||||
color: styleData.textColor
|
||||
elide: Text.ElideRight
|
||||
|
@ -63,7 +63,7 @@ Tab
|
|||
{
|
||||
role: "user_value"
|
||||
title: catalog.i18nc("@title:column", "Current");
|
||||
visible: true // TODO quality == Cura.MachineManager.globalQualityId
|
||||
visible: qualityItem.name == Cura.MachineManager.activeQualityOrQualityChangesName
|
||||
width: (parent.width * 0.18) | 0
|
||||
delegate: itemDelegate
|
||||
}
|
||||
|
|
|
@ -408,14 +408,14 @@ Item
|
|||
height: childrenRect.height
|
||||
|
||||
Label {
|
||||
text: base.currentItem.name // TODO
|
||||
text: base.currentItem.name
|
||||
font: UM.Theme.getFont("large")
|
||||
}
|
||||
}
|
||||
|
||||
Flow {
|
||||
id: currentSettingsActions
|
||||
visible: true // TODO //currentItem && currentItem.id == Cura.MachineManager.activeQualityId
|
||||
visible: base.hasCurrentItem && base.currentItem.name == Cura.MachineManager.activeQualityOrQualityChangesName
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: profileName.bottom
|
||||
|
@ -424,7 +424,7 @@ Item
|
|||
Button
|
||||
{
|
||||
text: catalog.i18nc("@action:button", "Update profile with current settings/overrides")
|
||||
enabled: Cura.MachineManager.hasUserSettings && !Cura.MachineManager.isReadOnly(Cura.MachineManager.activeQualityId)
|
||||
enabled: Cura.MachineManager.hasUserSettings && !base.currentItem.is_read_only
|
||||
onClicked: Cura.ContainerManager.updateQualityChanges()
|
||||
}
|
||||
|
||||
|
@ -453,7 +453,7 @@ Item
|
|||
}
|
||||
Label {
|
||||
id: noCurrentSettingsMessage
|
||||
visible: currentItem && currentItem.id == Cura.MachineManager.activeQualityId && !Cura.MachineManager.hasUserSettings
|
||||
visible: base.isCurrentItemActivated && !Cura.MachineManager.hasUserSettings
|
||||
text: catalog.i18nc("@action:label", "Your current settings match the selected profile.")
|
||||
wrapMode: Text.WordWrap
|
||||
width: parent.width
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
import QtQuick 2.8
|
||||
import QtQuick.Controls 2.0
|
||||
|
||||
import "Settings"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue