Add a selector for the intent profile

CURA-6534
This commit is contained in:
Jaime van Kessel 2019-06-05 11:13:32 +02:00
parent 2d8c19203e
commit 35ec70a3cf
5 changed files with 95 additions and 4 deletions

View file

@ -0,0 +1,44 @@
// Copyright (c) 2019 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7
import QtQuick.Controls 1.4
import UM 1.2 as UM
import Cura 1.6 as Cura
Menu
{
id: menu
title: "Intent"
property int extruderIndex: 0
Cura.IntentModel
{
id: intentModel
}
Instantiator
{
model: intentModel
MenuItem
{
text: model.name
checkable: true
checked: false
Binding on checked
{
when: Cura.MachineManager.activeStack != null
value: Cura.MachineManager.activeStack.intent == model.container
}
exclusiveGroup: group
onTriggered: Cura.MachineManager.activeStack.intent = model.container
}
onObjectAdded: menu.insertItem(index, object)
onObjectRemoved: menu.removeItem(object)
}
ExclusiveGroup { id: group }
}