on xenial help sign in
fixed indicator client
e70ab63Nick Dedekind
qml/Panel/Indicators/client/IndicatorsPage.qml → qml/Panel/Indicators/client/IndicatorRepresentation.qmlrenamed+21−10
@@ -21,13 +21,13 @@
21import QtQuick 2.0
21import QtQuick 2.0
22import Ubuntu.Components 0.1
22import Ubuntu.Components 0.1
23import Ubuntu.Components.ListItems 0.1 as ListItem
23import Ubuntu.Components.ListItems 0.1 as ListItem
24+import "../.."
24
25
25Page {
26Page {
26− id: page
27+ id: root
27
28
28 title: indicatorProperties && indicatorProperties.title ? indicatorProperties.title : ""
29 title: indicatorProperties && indicatorProperties.title ? indicatorProperties.title : ""
29 property variant indicatorProperties
30 property variant indicatorProperties
30− property string pageSource : pageLoader.source
31
31
32 anchors.fill: parent
32 anchors.fill: parent
33
33
@@ -44,6 +44,7 @@ Page {
44 id: pageLoader
44 id: pageLoader
45 objectName: "pageLoader"
45 objectName: "pageLoader"
46 clip:true
46 clip:true
47+ asynchronous: true
47
48
48 Rectangle {
49 Rectangle {
49 anchors.fill: pageLoader
50 anchors.fill: pageLoader
@@ -58,15 +59,25 @@ Page {
58 topMargin: units.gu(2)
59 topMargin: units.gu(2)
59 bottomMargin: units.gu(2)
60 bottomMargin: units.gu(2)
60 }
61 }
61− source : visualCheck.checked ? page.pageSource : "IndicatorsTree.qml"
62+ sourceComponent: visualCheck.checked ? page : tree
62
63
63− onLoaded: {
64+ Component {
65+ id: page
66+ IndicatorPage {
67+ identifier: model.identifier
64− for(var pName in indicatorProperties) {
68+ busName: indicatorProperties.busName
65− if (item.hasOwnProperty(pName)) {
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
66− item[pName] = indicatorProperties[pName];
78+ actionsObjectPath: indicatorProperties.actionsObjectPath
67− }
79+ menuObjectPath: indicatorProperties.menuObjectPath
68 }
80 }
69− item.start();
70 }
81 }
71 }
82 }
72
83
@@ -85,7 +96,7 @@ Page {
85 left: parent.left
96 left: parent.left
86 }
97 }
87 text: "Back"
98 text: "Back"
88− onClicked: page.pageStack.reset()
99+ onClicked: root.pageStack.reset()
89 }
100 }
90 }
101 }
91}
102}
qml/Panel/Indicators/client/IndicatorsList.qml+2−2
@@ -57,8 +57,8 @@ Page {
57 text: identifier
57 text: identifier
58
58
59 onClicked: {
59 onClicked: {
60− var new_page = Qt.createComponent("IndicatorsPage.qml");
60+ var new_page = Qt.createComponent("IndicatorRepresentation.qml");
61− page.pageStack.push(new_page.createObject(pages), {"indicatorProperties" : model.indicatorProperties, "pageSource" : model.pageSource});
61+ page.pageStack.push(new_page.createObject(pages), {"indicatorProperties" : model.indicatorProperties });
62 }
62 }
63 }
63 }
64 }
64 }
qml/Panel/Indicators/client/IndicatorsTree.qml+4−24
@@ -20,34 +20,14 @@
20import QtQuick 2.0
20import QtQuick 2.0
21import Ubuntu.Components 0.1
21import Ubuntu.Components 0.1
22import Unity.Indicators 0.1 as Indicators
22import Unity.Indicators 0.1 as Indicators
23−import QMenuModel 0.1
23+import ".."
24−import Ubuntu.Components.ListItems 0.1 as ListItem
25
24
26−Page {
25+IndicatorBase {
27− id: page
26+ id: root
28− anchors.fill: parent
29−
30− property string busName: unityModel.busName
31− property string actionsObjectPath
32− property string menuObjectPath
33−
34− function start() {
35− }
36−
37− UnityMenuModel {
38− id: unityModel
39− busName: page.busName
40− actions: { "indicator": page.actionsObjectPath }
41− menuObjectPath: page.menuObjectPath
42− }
43−
44− Indicators.RootActionState {
45− menu: unityModel
46− }
47
27
48 Indicators.ModelPrinter {
28 Indicators.ModelPrinter {
49 id: printer
29 id: printer
50− model: unityModel
30+ model: root.menuModel
51 }
31 }
52
32
53 Flickable {
33 Flickable {