From 55c0095b30b0453461c82bb0d412e455d98ce1d9 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Mon, 12 Sep 2016 10:35:00 +0200 Subject: [PATCH] Allow plugins to add additional components to Machines detail pane CURA-2276 --- resources/qml/Preferences/MachinesPage.qml | 34 +++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index 3135ab1df6..4e3e075ac5 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -122,13 +122,16 @@ UM.ManagementPage Row { + id: machineInfo + anchors.top: machineActions.visible ? machineActions.bottom : machineActions.anchors.top anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.left: parent.left anchors.right: parent.right - spacing: UM.Theme.getSize("default_margin").height + visible: base.currentItem + Label { 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.ConfirmRemoveDialog