Fix for showing printer connect button on component load, use newer CuraApplication as target

This commit is contained in:
ChrisTerBeke 2017-12-08 16:02:22 +01:00
parent baea9eb1e0
commit 2986a17c1d
5 changed files with 39 additions and 26 deletions

View file

@ -135,14 +135,19 @@ Item {
spacing: UM.Theme.getSize("default_margin").width
}
Component.onCompleted: {
addAdditionalComponents("saveButton")
}
Connections {
target: Printer
onAdditionalComponentsChanged:
{
if(areaId == "saveButton") {
for (var component in CuraApplication.additionalComponents["saveButton"]) {
CuraApplication.additionalComponents["saveButton"][component].parent = additionalComponentsRow
}
target: CuraApplication
onAdditionalComponentsChanged: addAdditionalComponents
}
function addAdditionalComponents (areaId) {
if(areaId == "saveButton") {
for (var component in CuraApplication.additionalComponents["saveButton"]) {
CuraApplication.additionalComponents["saveButton"][component].parent = additionalComponentsRow
}
}
}