Allow plugins to add additional components to Machines detail pane

CURA-2276
This commit is contained in:
fieldOfView 2016-09-12 10:35:00 +02:00
parent 244332a807
commit 55c0095b30

View File

@ -122,13 +122,16 @@ UM.ManagementPage
Row Row
{ {
id: machineInfo
anchors.top: machineActions.visible ? machineActions.bottom : machineActions.anchors.top anchors.top: machineActions.visible ? machineActions.bottom : machineActions.anchors.top
anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
spacing: UM.Theme.getSize("default_margin").height spacing: UM.Theme.getSize("default_margin").height
visible: base.currentItem
Label Label
{ {
text: catalog.i18nc("@label", "Type") text: catalog.i18nc("@label", "Type")
@ -139,6 +142,35 @@ UM.ManagementPage
} }
} }
Column {
id: additionalComponentsColumn
anchors.left: parent.left
anchors.right: parent.right
anchors.top: machineInfo.visible ? machineInfo.bottom : machineInfo.anchors.top
anchors.topMargin: UM.Theme.getSize("default_margin").width
spacing: UM.Theme.getSize("default_margin").width
Component.onCompleted:
{
for (var component in Printer.additionalComponents["machinesDetailPane"]) {
Printer.additionalComponents["machinesDetailPane"][component].parent = additionalComponentsColumn
}
}
}
Connections {
target: Printer
onAdditionalComponentsChanged:
{
if(areaId == "machinesDetailPane") {
for (var component in Printer.additionalComponents["machinesDetailPane"]) {
Printer.additionalComponents["machinesDetailPane"][component].parent = additionalComponentsColumn
}
}
}
}
UM.I18nCatalog { id: catalog; name: "uranium"; } UM.I18nCatalog { id: catalog; name: "uranium"; }
UM.ConfirmRemoveDialog UM.ConfirmRemoveDialog