on xenial help sign in
removed references to IndicatorsLegacy
commitd870f413de5d8df61abbc2a94812441d040f23ef authorNick Dedekind <nicholas.dedekind@gmail.com> dateMon 9 Sep 2013, 10:21 (13 years ago) parentd3b225c
18 files changed+76−637
Panel/Indicators/DatetimeIndicatorPage.qml−97 Panel/Indicators/DatetimeIndicatorWidget.qml−67 Panel/Indicators/DefaultIndicatorPage.qml+1−1 Panel/Indicators/DefaultIndicatorPage2.qml−25 Panel/Indicators/DefaultIndicatorWidget.qml+45−23 Panel/Indicators/DefaultIndicatorWidget2.qml−103 Panel/Indicators/MessagingIndicatorPage.qml−35 Panel/Indicators/MessagingIndicatorWidget.qml−25 Panel/Indicators/NetworkIndicatorPage.qml+2−3 Panel/Indicators/NetworkIndicatorPage2.qml−82 Panel/Indicators/NetworkIndicatorWidget.qml−112 Panel/Indicators/SoundIndicatorWidget.qml−26 Panel/Indicators/client/IndicatorsList.qml+12−9 Panel/IndicatorsDataModel.qml+9−23 plugins/Unity/CMakeLists.txt−1 plugins/Unity/Indicators/Messaging/qml/QuickReply.qml+1−1 plugins/Unity/Indicators/indicatorsmodel.cpp+5−3 tests/autopilot/unity8/indicators_client/emulators/main_window.py+1−1
Panel/Indicators/DatetimeIndicatorPage.qmldeleted−97
@@ -1,97 +0,0 @@
1−/*
2− * Copyright 2013 Canonical Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU Lesser General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Authors:
17− * Renato Araujo Oliveira Filho <renato@canonical.com>
18− * Ubo Riboni <ugo.riboni@canonical.com>
19− */
20−
21−import QtQuick 2.0
22−import Ubuntu.Components 0.1
23−
24−Flickable {
25− id: page
26−
27− contentHeight: image.height
28−
29− Image {
30− id: image
31− anchors {
32− left: parent.left
33− right: parent.right
34− }
35− source: "../graphics/time_and_date@18.png"
36− fillMode: Image.PreserveAspectFit
37− }
38−
39− Item {
40− anchors {
41− top: parent.top
42− topMargin: units.gu(5)
43− left: parent.left
44− right: parent.right
45− }
46−
47− height: units.gu(30)
48−
49− Label {
50− id: timeLabel
51− anchors {
52− horizontalCenter: parent.horizontalCenter
53− verticalCenter: parent.verticalCenter
54− }
55−
56− text: ""
57− color: Theme.palette.selected.backgroundText
58− font.weight: Font.Light
59− font.pixelSize: units.gu(6)
60− }
61−
62− Label {
63− id: dateLabel
64−
65− anchors {
66− left: parent.left
67− leftMargin: units.gu(2)
68− bottom: parent.bottom
69− bottomMargin: units.gu(1.5)
70− }
71− text: ""
72− color: Theme.palette.selected.backgroundText
73− fontSize: "small"
74− }
75− }
76−
77− Timer {
78− interval: 1000 * 10 // 10 seconds
79− running: true
80− repeat: true
81− triggeredOnStart: true
82− onTriggered: updateTime();
83− }
84−
85− function updateTime() {
86− var dt = new Date();
87− var time = Qt.formatTime(dt);
88− var space = time.indexOf(" ");
89− timeLabel.text = time.substr(0, space > 0 ? space : 5);
90− dateLabel.text = Qt.formatDateTime(dt, "dddd,\ndd MMMM");
91− }
92−
93− // Make it compatible with the PluginItem interface
94− function start() {}
95− function stop() {}
96− function reset() {}
97−}
Panel/Indicators/DatetimeIndicatorWidget.qmldeleted−67
@@ -1,67 +0,0 @@
1−/*
2− * Copyright 2013 Canonical Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU Lesser General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Authors:
17− * Nick Dedekind <nick.dedekind@canonical.com>
18− */
19−
20−import QtQuick 2.0
21−import Ubuntu.Components 0.1
22−import Unity.IndicatorsLegacy 0.1 as Indicators
23−
24−Indicators.IndicatorWidget {
25− id: indicatorWidget
26−
27− width: timeLabel.width + units.gu(1)
28− rootMenuType: "com.canonical.indicator.root.time"
29−
30− property alias label: timeLabel.text
31−
32− Label {
33− id: timeLabel
34− objectName: "timeLabel"
35− color: Theme.palette.selected.backgroundText
36− opacity: 0.8
37− font.family: "Ubuntu"
38− fontSize: "medium"
39− anchors.centerIn: parent
40− text: Qt.formatTime(timer.dateNow)
41− }
42−
43− Timer {
44− id: timer
45− interval: 1000 * 10
46− running: indicatorWidget.visible
47− repeat: true
48− triggeredOnStart: true
49− property date dateNow
50−
51− onTriggered: dateNow = new Date
52− }
53−
54− onActionStateChanged: {
55− if (action == undefined || !action.valid) {
56− enabled = false;
57− return;
58− }
59−
60− if (action.state == undefined) {
61− enabled = false;
62− return;
63− }
64−
65− enabled = action.state[3];
66− }
67−}
Panel/Indicators/DefaultIndicatorPage.qml+1−1
@@ -18,7 +18,7 @@
1818 */
1919
2020import QtQuick 2.0
21−import Unity.IndicatorsLegacy 0.1 as Indicators
21+import Unity.Indicators 0.1 as Indicators
2222
2323Indicators.IndicatorPage {
2424 anchors.fill: parent
Panel/Indicators/DefaultIndicatorPage2.qmldeleted−25
@@ -1,25 +0,0 @@
1−/*
2− * Copyright 2013 Canonical Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU Lesser General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Authors:
17− * Nick Dedekind <nick.dedekind@canonical.com>
18− */
19−
20−import QtQuick 2.0
21−import Unity.Indicators 0.1 as Indicators
22−
23−Indicators.IndicatorPage {
24− anchors.fill: parent
25−}
Panel/Indicators/DefaultIndicatorWidget.qml+45−23
@@ -19,15 +19,16 @@
1919
2020import QtQuick 2.0
2121import Ubuntu.Components 0.1
22−import Unity.IndicatorsLegacy 0.1 as Indicators
22+import Unity.Indicators 0.1 as Indicators
2323
2424Indicators.IndicatorWidget {
2525 id: indicatorWidget
2626
2727 width: itemRow.width + units.gu(0.5)
2828
29− property alias label: itemLabel.text
30− property alias iconSource: itemImage.source
29+ property alias leftLabel: itemLeftLabel.text
30+ property alias rightLabel: itemRightLabel.text
31+ property var icons: undefined
3132
3233 Row {
3334 id: itemRow
@@ -39,19 +40,43 @@ Indicators.IndicatorWidget {
3940 }
4041 spacing: units.gu(0.5)
4142
42− // FIXME : Should us Ubuntu.Icon . results in low res images
43− Image {
44− id: itemImage
45− objectName: "itemImage"
46− visible: source != ""
47− height: indicatorWidget.iconSize
48− width: indicatorWidget.iconSize
43+ Label {
44+ id: itemLeftLabel
45+ objectName: "leftLabel"
46+ color: Theme.palette.selected.backgroundText
47+ opacity: 0.8
48+ font.family: "Ubuntu"
49+ fontSize: "medium"
4950 anchors.verticalCenter: parent.verticalCenter
51+ visible: text != ""
52+ }
53+
54+ Row {
55+ width: childrenRect.width
56+ anchors {
57+ top: parent.top
58+ bottom: parent.bottom
59+ }
60+ spacing: units.gu(0.5)
61+
62+ Repeater {
63+ model: indicatorWidget.icons
64+
65+ Image {
66+ id: itemImage
67+ objectName: "itemImage"
68+ visible: source != ""
69+ source: modelData
70+ height: indicatorWidget.iconSize
71+ width: indicatorWidget.iconSize
72+ anchors.verticalCenter: parent.verticalCenter
73+ }
74+ }
5075 }
5176
5277 Label {
53− id: itemLabel
54− objectName: "itemLabel"
78+ id: itemRightLabel
79+ objectName: "rightLabel"
5580 color: Theme.palette.selected.backgroundText
5681 opacity: 0.8
5782 font.family: "Ubuntu"
@@ -62,20 +87,17 @@ Indicators.IndicatorWidget {
6287 }
6388
6489 onActionStateChanged: {
65− if (action == undefined || !action.valid) {
66− enabled = false;
67− return;
68− }
69−
70− if (action.state == undefined) {
71− label = "";
72− iconSource = "";
90+ if (actionState == undefined) {
91+ leftLabel = "";
92+ rightLabel = "";
93+ icons = undefined;
7394 enabled = false;
7495 return;
7596 }
7697
77− label = action.state[Indicators.ActionState.Label];
78− iconSource = "image://gicon/" + action.state[Indicators.ActionState.IconSource];
79− enabled = action.state[Indicators.ActionState.Visible];
98+ leftLabel = actionState.leftLabel ? actionState.leftLabel : "";
99+ rightLabel = actionState.rightLabel ? actionState.rightLabel : "";
100+ icons = actionState.icons;
101+ enabled = actionState.visible;
80102 }
81103}
Panel/Indicators/DefaultIndicatorWidget2.qmldeleted−103
@@ -1,103 +0,0 @@
1−/*
2− * Copyright 2013 Canonical Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU Lesser General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Authors:
17− * Nick Dedekind <nick.dedekind@canonical.com>
18− */
19−
20−import QtQuick 2.0
21−import Ubuntu.Components 0.1
22−import Unity.Indicators 0.1 as Indicators
23−
24−Indicators.IndicatorWidget {
25− id: indicatorWidget
26−
27− width: itemRow.width + units.gu(0.5)
28−
29− property alias leftLabel: itemLeftLabel.text
30− property alias rightLabel: itemRightLabel.text
31− property var icons: undefined
32−
33− Row {
34− id: itemRow
35− objectName: "itemRow"
36− anchors {
37− top: parent.top
38− bottom: parent.bottom
39− horizontalCenter: parent.horizontalCenter
40− }
41− spacing: units.gu(0.5)
42−
43− Label {
44− id: itemLeftLabel
45− objectName: "leftLabel"
46− color: Theme.palette.selected.backgroundText
47− opacity: 0.8
48− font.family: "Ubuntu"
49− fontSize: "medium"
50− anchors.verticalCenter: parent.verticalCenter
51− visible: text != ""
52− }
53−
54− Row {
55− width: childrenRect.width
56− anchors {
57− top: parent.top
58− bottom: parent.bottom
59− }
60− spacing: units.gu(0.5)
61−
62− Repeater {
63− model: indicatorWidget.icons
64−
65− Image {
66− id: itemImage
67− objectName: "itemImage"
68− visible: source != ""
69− source: modelData
70− height: indicatorWidget.iconSize
71− width: indicatorWidget.iconSize
72− anchors.verticalCenter: parent.verticalCenter
73− }
74− }
75− }
76−
77− Label {
78− id: itemRightLabel
79− objectName: "rightLabel"
80− color: Theme.palette.selected.backgroundText
81− opacity: 0.8
82− font.family: "Ubuntu"
83− fontSize: "medium"
84− anchors.verticalCenter: parent.verticalCenter
85− visible: text != ""
86− }
87− }
88−
89− onActionStateChanged: {
90− if (actionState == undefined) {
91− leftLabel = "";
92− rightLabel = "";
93− icons = undefined;
94− enabled = false;
95− return;
96− }
97−
98− leftLabel = actionState.leftLabel ? actionState.leftLabel : "";
99− rightLabel = actionState.rightLabel ? actionState.rightLabel : "";
100− icons = actionState.icons;
101− enabled = actionState.visible;
102− }
103−}
Panel/Indicators/MessagingIndicatorPage.qmldeleted−35
@@ -1,35 +0,0 @@
1−/*
2− * Copyright 2013 Canonical Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU Lesser General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Authors:
17− * Nick Dedekind <nick.dedekind@canonical.com>
18− */
19−
20−import QtQuick 2.0
21−import Ubuntu.Components 0.1
22−import Unity.IndicatorsLegacy 0.1 as Indicators
23−
24−Indicators.IndicatorPage {
25− anchors.fill: parent
26−
27− highlightFollowsCurrentItem: false
28− emptyText: "You have no more outstanding messages."
29−
30− function stop() {
31− // never stops the service
32− // this will keep all objects in memory, consume more memory
33− // but will optimize the menu contruction on the screen
34− }
35−}
Panel/Indicators/MessagingIndicatorWidget.qmldeleted−25
@@ -1,25 +0,0 @@
1−/*
2− * Copyright 2013 Canonical Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU Lesser General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Authors:
17− * Nick Dedekind <nick.dedekind@canonical.com>
18− */
19−
20−import QtQuick 2.0
21−
22−DefaultIndicatorWidget {
23− // default the icon so we have something to show when we don't have the bus.
24− iconSource: "image://gicon/indicator-messages"
25−}
Panel/Indicators/NetworkIndicatorPage.qml+2−3
@@ -18,8 +18,8 @@
1818 */
1919
2020import QtQuick 2.0
21−import Unity.IndicatorsLegacy 0.1 as Indicators
22−import Unity.IndicatorsLegacy.Network 0.1 as ICNetwork
21+import Unity.Indicators 0.1 as Indicators
22+import Unity.Indicators.Network 0.1 as ICNetwork
2323import Ubuntu.Components 0.1
2424
2525PageStack {
@@ -32,7 +32,6 @@ PageStack {
3232
3333 property alias title: _mainPage.title
3434 property alias emptyText: pluginItem.emptyText
35− property alias busType: pluginItem.busType
3635 property alias busName: pluginItem.busName
3736 property alias actionsObjectPath : pluginItem.actionsObjectPath
3837 property alias menuObjectPaths : pluginItem.menuObjectPaths
Panel/Indicators/NetworkIndicatorPage2.qmldeleted−82
@@ -1,82 +0,0 @@
1−/*
2− * Copyright 2013 Canonical Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU Lesser General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Authors:
17− * Renato Araujo Oliveira Filho <renato@canonical.com>
18− */
19−
20−import QtQuick 2.0
21−import Unity.Indicators 0.1 as Indicators
22−import Unity.Indicators.Network 0.1 as ICNetwork
23−import Ubuntu.Components 0.1
24−
25−PageStack {
26− id: networkPage
27− // Stops the search for a parent tree node.
28− // We don't want it going up to the indicator tabs.
29− // FIXME: need a better way of doing this.
30− // https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1211704
31− __propagated: null
32−
33− property alias title: _mainPage.title
34− property alias emptyText: pluginItem.emptyText
35− property alias busName: pluginItem.busName
36− property alias actionsObjectPath : pluginItem.actionsObjectPath
37− property alias menuObjectPaths : pluginItem.menuObjectPaths
38−
39− anchors.fill: parent
40−
41− Page {
42− id: _mainPage
43−
44− Indicators.IndicatorPage {
45− id: pluginItem
46− anchors.fill: parent
47− }
48− }
49−
50− Component {
51− id: passwordPageComponent
52−
53− ICNetwork.PasswordPage {
54− agent: networkAgent
55− }
56− }
57−
58− ICNetwork.NetworkAgent {
59− id: networkAgent
60−
61− onSecretRequested: {
62− networkPage.push(passwordPageComponent, {"token": token});
63− }
64− }
65−
66− function start()
67− {
68− push(_mainPage);
69− pluginItem.start();
70− }
71−
72− function stop()
73− {
74− clear();
75− pluginItem.stop();
76− }
77−
78− function reset()
79− {
80− pluginItem.reset();
81− }
82−}
Panel/Indicators/NetworkIndicatorWidget.qmldeleted−112
@@ -1,112 +0,0 @@
1−/*
2− * Copyright 2013 Canonical Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU Lesser General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Authors:
17− * Nick Dedekind <nick.dedekind@canonical.com>
18− */
19−
20−import QtQuick 2.0
21−import Ubuntu.Components 0.1
22−import Unity.IndicatorsLegacy 0.1 as Indicators
23−
24−Indicators.IndicatorWidget {
25− id: indicatorWidget
26−
27− width: networkIcon.width + units.gu(0.5)
28−
29− property int signalStrength: 0
30− property int connectionState: Indicators.NetworkConnection.Initial
31− rootMenuType: "com.canonical.indicator.root.network"
32−
33− // FIXME : Should us Ubuntu.Icon . results in low res images
34− Image {
35− id: networkIcon
36− objectName: "itemImage"
37− source: get_icon_for_signal(connectionState, signalStrength)
38− visible: source != ""
39− height: indicatorWidget.iconSize
40− width: indicatorWidget.iconSize
41− anchors.centerIn: parent
42− }
43−
44− onActionStateChanged: {
45− if (action == undefined || !action.valid) {
46− enabled = false;
47− return;
48− }
49−
50− if (action.state == undefined) {
51− enabled = false;
52− connectionState = 0;
53− return;
54− }
55−
56− enabled = true;
57− connectionState = action.state[Indicators.NetworkActionState.Connection];
58− if (connectionState == Indicators.NetworkConnection.Activated) {
59− signalStrength = action.state[Indicators.NetworkActionState.SignalStrength];
60− }
61− }
62−
63− NumberAnimation {
64− id: activation_animation
65− target: indicatorWidget
66− property: "signalStrength"
67− from: 0
68− to: 100
69− duration: 2500 // 5 states in 2.5 seconds
70− loops: Animation.Infinite
71− }
72−
73− states: [
74− State {
75− name: "unknown"
76− when: connectionState < Indicators.NetworkConnection.Activating || connectionState > Indicators.NetworkConnection.Deactivating
77− PropertyChanges { target: activation_animation; running: false }
78− },
79− State {
80− name: "activating"
81− when: connectionState == Indicators.NetworkConnection.Activating
82− PropertyChanges { target: activation_animation; running: true }
83− },
84− State {
85− name: "activated"
86− when: connectionState == Indicators.NetworkConnection.Activated
87− PropertyChanges { target: activation_animation; running: false }
88− },
89− State {
90− name: "deactivating"
91− when: connectionState == Indicators.NetworkConnection.Deactivating
92− PropertyChanges { target: activation_animation; running: true }
93− }
94− ]
95−
96−
97− function get_icon_for_signal(con_state, value) {
98− if (con_state >= Indicators.NetworkConnection.Activating && con_state <= Indicators.NetworkConnection.Deactivating) {
99− if (value == 0) {
100− return "image://gicon/nm-signal-00";
101− } else if (value <= 25) {
102− return "image://gicon/nm-signal-25";
103− } else if (value <= 50) {
104− return "image://gicon/nm-signal-50";
105− } else if (value <= 75) {
106− return "image://gicon/nm-signal-75";
107− }
108− return "image://gicon/nm-signal-100";
109− }
110− return "image://gicon/wifi-none";
111− }
112−}
Panel/Indicators/SoundIndicatorWidget.qmldeleted−26
@@ -1,26 +0,0 @@
1−/*
2− * Copyright 2013 Canonical Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU Lesser General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− *
16− * Authors:
17− * Nick Dedekind <nick.dedekind@canonical.com>
18− */
19−
20−import QtQuick 2.0
21−
22−DefaultIndicatorWidget {
23− // default the icon so we have something to show when we don't have the bus.
24− iconSource: "image://gicon/audio-volume-high"
25− enabled: true
26−}
Panel/Indicators/client/IndicatorsList.qml+12−9
@@ -20,7 +20,7 @@
2020import QtQuick 2.0
2121import Ubuntu.Components 0.1
2222import Ubuntu.Components.ListItems 0.1 as ListItem
23−import Unity.IndicatorsLegacy 0.1 as Indicators
23+import Unity.Indicators 0.1 as Indicators
2424import "../.."
2525
2626Page {
@@ -38,18 +38,13 @@ Page {
3838 anchors.fill: parent
3939 model: indicatorsModel
4040
41− delegate: Indicators.MenuItem {
41+ delegate: Indicators.FramedMenuItem {
4242 anchors.left: parent.left
4343 anchors.right: parent.right
44− progression: isValid
44+ progression: true
4545 objectName: identifier
4646
47− Label {
48− anchors.left: parent.left
49− anchors.leftMargin: units.gu(0.5)
50− anchors.verticalCenter: parent.verticalCenter
51− text: title
52− }
47+ text: title
5348
5449 onClicked: {
5550 if (progression) {
@@ -57,6 +52,14 @@ Page {
5752 page.pageStack.push(new_page.createObject(pages), {"indicatorProperties" : model.indicatorProperties, "pageSource" : model.pageSource});
5853 }
5954 }
55+
56+ Rectangle {
57+ id: background
58+
59+ anchors.fill: parent
60+ color: "#221e1c"
61+ z: -1
62+ }
6063 }
6164 }
6265}
Panel/IndicatorsDataModel.qml+9−23
@@ -29,51 +29,37 @@ Indicators.IndicatorsModel {
2929 indicatorData : {
3030 'indicator-location' : {
3131 'title': 'Location',
32− 'description' : '',
33− 'widgetSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorWidget2.qml',
34− 'pageSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorPage2.qml'
32+ 'description' : ''
3533 },
3634 'indicator-bluetooth' : {
3735 'title': 'Bluetooth',
38− 'description' : '',
39− 'widgetSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorWidget2.qml',
40− 'pageSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorPage2.qml'
36+ 'description' : ''
4137 },
4238 'indicator-messages' : {
4339 'title': 'Messaging',
44− 'description' : '',
45− 'widgetSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorWidget2.qml',
46− 'pageSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorPage2.qml'
40+ 'description' : ''
4741 },
4842 'indicator-sound' : {
4943 'title': 'Sound',
50− 'description' : '',
51− 'widgetSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorWidget2.qml',
52− 'pageSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorPage2.qml'
44+ 'description' : ''
5345 },
5446 'indicator-network' : {
5547 'title': 'Networks',
5648 'description' : '',
57− 'widgetSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorWidget2.qml',
58− 'pageSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/NetworkIndicatorPage2.qml'
49+ 'widgetSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorWidget.qml',
50+ 'pageSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/NetworkIndicatorPage.qml'
5951 },
6052 'indicator-power' : {
6153 'title': 'Battery',
62− 'description' : '',
63− 'widgetSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorWidget2.qml',
64− 'pageSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorPage2.qml'
54+ 'description' : ''
6555 },
6656 'indicator-session' : {
6757 'title': 'Session',
68− 'description' : '',
69− 'widgetSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorWidget2.qml',
70− 'pageSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorPage2.qml'
58+ 'description' : ''
7159 },
7260 'indicator-datetime' : {
7361 'title': 'Date and Time',
74− 'description' : '',
75− 'widgetSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorWidget2.qml',
76− 'pageSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorPage2.qml'
62+ 'description' : ''
7763 }
7864 }
7965}
plugins/Unity/CMakeLists.txt−1
@@ -2,7 +2,6 @@
22include(Plugins)
33
44add_subdirectory(Indicators)
5−add_subdirectory(IndicatorsLegacy)
65
76# Dependencies
87include(FindPkgConfig)
plugins/Unity/Indicators/Messaging/qml/QuickReply.qml+1−1
@@ -20,7 +20,7 @@
2020
2121import QtQuick 2.0
2222import Ubuntu.Components 0.1
23−import Unity.IndicatorsLegacy 0.1 as Indicators
23+import Unity.Indicators 0.1 as Indicators
2424
2525Item {
2626 id: quickReply
plugins/Unity/Indicators/indicatorsmodel.cpp+5−3
@@ -228,9 +228,9 @@ QVariant IndicatorsModel::defaultData(Indicator::Ptr indicator, int role)
228228 case IndicatorsModelRole::Description:
229229 return "";
230230 case IndicatorsModelRole::WidgetSource:
231− return shellAppDirectory()+"/Panel/Indicators/DefaultIndicatorWidget2.qml";
231+ return shellAppDirectory()+"/Panel/Indicators/DefaultIndicatorWidget.qml";
232232 case IndicatorsModelRole::PageSource:
233− return shellAppDirectory()+"/Panel/Indicators/DefaultIndicatorPage2.qml";
233+ return shellAppDirectory()+"/Panel/Indicators/DefaultIndicatorPage.qml";
234234 }
235235 return QVariant();
236236}
@@ -284,7 +284,9 @@ QVariant IndicatorsModel::indicatorData(const Indicator::Ptr& indicator, int rol
284284 if (indicator && m_parsed_indicator_data.contains(indicator->identifier()))
285285 {
286286 QVariantMap data = m_parsed_indicator_data[indicator->identifier()];
287− return data.value(roleNames()[role], QVariant());
287+ if (data.contains(roleNames()[role])) {
288+ data[roleNames()[role]];
289+ };
288290 }
289291 return defaultData(indicator, role);
290292}
tests/autopilot/unity8/indicators_client/emulators/main_window.py+1−1
@@ -24,4 +24,4 @@ class MainWindow(object):
2424
2525 def get_battery_menu(self):
2626 """Get the battery menu from the list"""
27− return self.app.select_single("BasicMenuItem", objectName="indicator-battery");
27+ return self.app.select_single("BaseMenuItem", objectName="indicator-battery");