on xenial help sign in
changed parseRootElement function to rootMenuType property
369daaeNick Dedekind
Panel/Indicators/NetworkIndicatorWidget.qml+1−7
@@ -28,6 +28,7 @@ Indicators.IndicatorWidget {
28
28
29 property int signalStrength: 0
29 property int signalStrength: 0
30 property int connectionState: Indicators.NetworkConnection.Initial
30 property int connectionState: Indicators.NetworkConnection.Initial
31+ rootMenuType: "com.canonical.indicator.root.network"
31
32
32 // FIXME : Should us Ubuntu.Icon . results in low res images
33 // FIXME : Should us Ubuntu.Icon . results in low res images
33 Image {
34 Image {
@@ -40,13 +41,6 @@ Indicators.IndicatorWidget {
40 anchors.centerIn: parent
41 anchors.centerIn: parent
41 }
42 }
42
43
43− function parseRootElement(type) {
44− if (type == "com.canonical.indicator.root.network") {
45− return true;
46− }
47− return false;
48− }
49−
50 onActionStateChanged: {
44 onActionStateChanged: {
51 if (action == undefined || !action.valid) {
45 if (action == undefined || !action.valid) {
52 return;
46 return;
modules/Unity/Indicators/qml/IndicatorWidget.qml+4−10
@@ -23,10 +23,11 @@ import Unity.Indicators 0.1 as Indicators
23IndicatorBase {
23IndicatorBase {
24 id: indicatorWidget
24 id: indicatorWidget
25
25
26−// enabled: false // FIXME : should be enabled when we have desktop indicators
26+// enabled: false // FIXME : should be disabled until bus available when we have desktop indicators
27 property var action: undefined
27 property var action: undefined
28 property bool started: (busType != 0) && (busName != "") && (deviceMenuObjectPath != "")
28 property bool started: (busType != 0) && (busName != "") && (deviceMenuObjectPath != "")
29 property int iconSize: height - units.gu(0.5)
29 property int iconSize: height - units.gu(0.5)
30+ property string rootMenuType: "com.canonical.indicator.root"
30
31
31 signal actionStateChanged()
32 signal actionStateChanged()
32
33
@@ -34,8 +35,7 @@ IndicatorBase {
34 if (started) {
35 if (started) {
35 proxyModel.start();
36 proxyModel.start();
36 actionGroup.start();
37 actionGroup.start();
37− }
38− else {
38+ } else {
39 proxyModel.stop();
39 proxyModel.stop();
40 actionGroup.stop();
40 actionGroup.stop();
41 }
41 }
@@ -55,17 +55,11 @@ IndicatorBase {
55 return;
55 return;
56 }
56 }
57
57
58− if (parseRootElement(extra.canonical_type)) {
58+ if (extra.canonical_type === rootMenuType) {
59 action = actionGroup.action(proxyModel.data(0, Indicators.FlatMenuProxyModelRole.Action));
59 action = actionGroup.action(proxyModel.data(0, Indicators.FlatMenuProxyModelRole.Action));
60 }
60 }
61 }
61 }
62
62
63− function parseRootElement(type) {
64− if (type == "com.canonical.indicator.root")
65− return true;
66− return false;
67− }
68−
69 Connections {
63 Connections {
70 target: action == undefined ? null : action
64 target: action == undefined ? null : action
71 onStateChanged: actionStateChanged()
65 onStateChanged: actionStateChanged()