Add intents per category to the intent menu

They are in the wrong order currently. The section headers all appear at the end and they are not greyed out. This must be fixed. The order might prove difficult... We'll see, but I want this locked in now because it works.

Contributes to issue CURA-6597.
This commit is contained in:
Ghostkeeper 2019-07-05 11:45:01 +02:00
parent 45cb34c3e4
commit 32c5118ae4
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276

View file

@ -14,27 +14,47 @@ Menu
property int extruderIndex: 0
Cura.IntentModel
Cura.IntentCategoryModel
{
id: intentModel
id: intentCategoryModel
}
Instantiator
{
model: intentModel
model: intentCategoryModel
MenuItem
MenuItem //Section header.
{
text: model.name
checkable: true
checkable: false
checked: false
Binding on checked
property var per_category_intents: Cura.IntentModel
{
when: Cura.MachineManager.activeStack != null
value: Cura.MachineManager.activeStack.intent == model.container
id: intentModel
intentCategory: model.intent_category
}
property var intent_instantiator: Instantiator
{
model: intentModel
MenuItem
{
text: model.name
checkable: true
checked: false
Binding on checked
{
when: Cura.MachineManager.activeStack != null
value: Cura.MachineManager.activeStack.intent.metaData["intent_category"] == intentModel.intentCategory && Cura.MachineManager.activeStack.quality.metaData["quality_type"] == model.quality_type
}
exclusiveGroup: group
onTriggered: Cura.IntentManager.selectIntent(intentModel.intentCategory, model.quality_type)
}
onObjectAdded: menu.insertItem(index, object)
onObjectRemoved: menu.removeItem(object)
}
exclusiveGroup: group
onTriggered: Cura.MachineManager.activeStack.intent = model.container
}
onObjectAdded: menu.insertItem(index, object)