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