@@ -21,13 +21,13 @@
2121import QtQuick 2.0
2222import Ubuntu.Components 0.1
2323import Ubuntu.Components.ListItems 0.1 as ListItem
24+import "../.."
2425
2526Page {
26− id: page
27+ id: root
2728
2829 title: indicatorProperties && indicatorProperties.title ? indicatorProperties.title : ""
2930 property variant indicatorProperties
30− property string pageSource : pageLoader.source
3131
3232 anchors.fill: parent
3333
@@ -44,6 +44,7 @@ Page {
4444 id: pageLoader
4545 objectName: "pageLoader"
4646 clip:true
47+ asynchronous: true
4748
4849 Rectangle {
4950 anchors.fill: pageLoader
@@ -58,15 +59,25 @@ Page {
5859 topMargin: units.gu(2)
5960 bottomMargin: units.gu(2)
6061 }
61− source : visualCheck.checked ? page.pageSource : "IndicatorsTree.qml"
62+ sourceComponent: visualCheck.checked ? page : tree
6263
63− onLoaded: {
64− for(var pName in indicatorProperties) {
65− if (item.hasOwnProperty(pName)) {
66− item[pName] = indicatorProperties[pName];
67− }
64+ Component {
65+ id: page
66+ IndicatorPage {
67+ identifier: model.identifier
68+ busName: indicatorProperties.busName
69+ actionsObjectPath: indicatorProperties.actionsObjectPath
70+ menuObjectPath: indicatorProperties.menuObjectPath
71+ }
72+ }
73+ Component {
74+ id: tree
75+ IndicatorsTree {
76+ identifier: model.identifier
77+ busName: indicatorProperties.busName
78+ actionsObjectPath: indicatorProperties.actionsObjectPath
79+ menuObjectPath: indicatorProperties.menuObjectPath
6880 }
69− item.start();
7081 }
7182 }
7283
@@ -85,7 +96,7 @@ Page {
8596 left: parent.left
8697 }
8798 text: "Back"
88− onClicked: page.pageStack.reset()
99+ onClicked: root.pageStack.reset()
89100 }
90101 }
91102}