Cura/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml
j.delarago a87695cd8d Added new intent selection buttons and resolution drop down to replace the matrix.
We are now selecting intents first and then quality, however the container hierarchy quality -> intents. This is the reason for the new functions inside machine manager.

CURA-8849
2022-06-14 11:41:38 +02:00

49 lines
1.4 KiB
QML

// Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10
import QtQuick.Controls 2.3
import QtQuick.Layouts 2.10
import UM 1.5 as UM
import Cura 1.7 as Cura
import ".."
Item
{
id: qualityRow
height: childrenRect.height
RowLayout
{
id: intentRow
width: parent.width
Repeater
{
model: Cura.IntentSelectionModel {}
RecommendedQualityProfileSelectorButton
{
text: model.name
iconSource: UM.Theme.getIcon(model.icon)
selected: Cura.MachineManager.activeIntentCategory == model.intent_category
onClicked: {
var qualityType
if (Cura.MachineManager.intentCategoryHasQuality(model.intent_category, Cura.MachineManager.activeQualityType))
{
qualityType = Cura.MachineManager.activeQualityType
} else {
qualityType = Cura.MachineManager.getDefaultQualityTypeForIntent(model.intent_category)
print(Cura.MachineManager.getDefaultQualityTypeForIntent(model.intent_category))
}
Cura.IntentManager.selectIntent(model.intent_category, qualityType)
}
}
}
}
}