on xenial help sign in
fixed indicator client
commite70ab63bd729760bc3abc7173864c53ee99d1aa5 authorNick Dedekind <nick.dedekind@canonical.com> dateFri 3 Oct 2014, 11:10 (12 years ago) parentb0e0a81
3 files changed+27−36
qml/Panel/Indicators/client/IndicatorsPage.qml → qml/Panel/Indicators/client/IndicatorRepresentation.qml+21−10 qml/Panel/Indicators/client/IndicatorsList.qml+2−2 qml/Panel/Indicators/client/IndicatorsTree.qml+4−24
qml/Panel/Indicators/client/IndicatorsPage.qml → qml/Panel/Indicators/client/IndicatorRepresentation.qmlrenamed+21−10
@@ -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}
qml/Panel/Indicators/client/IndicatorsList.qml+2−2
@@ -57,8 +57,8 @@ Page {
5757 text: identifier
5858
5959 onClicked: {
60− var new_page = Qt.createComponent("IndicatorsPage.qml");
61− page.pageStack.push(new_page.createObject(pages), {"indicatorProperties" : model.indicatorProperties, "pageSource" : model.pageSource});
60+ var new_page = Qt.createComponent("IndicatorRepresentation.qml");
61+ page.pageStack.push(new_page.createObject(pages), {"indicatorProperties" : model.indicatorProperties });
6262 }
6363 }
6464 }
qml/Panel/Indicators/client/IndicatorsTree.qml+4−24
@@ -20,34 +20,14 @@
2020import QtQuick 2.0
2121import Ubuntu.Components 0.1
2222import Unity.Indicators 0.1 as Indicators
23−import QMenuModel 0.1
24−import Ubuntu.Components.ListItems 0.1 as ListItem
23+import ".."
2524
26−Page {
27− id: page
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− }
25+IndicatorBase {
26+ id: root
4727
4828 Indicators.ModelPrinter {
4929 id: printer
50− model: unityModel
30+ model: root.menuModel
5131 }
5232
5333 Flickable {