on xenial help sign in
removed references to IndicatorsLegacy
d870f41Nick Dedekind
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 @@
18 */
18 */
19
19
20import QtQuick 2.0
20import QtQuick 2.0
21−import Unity.IndicatorsLegacy 0.1 as Indicators
21+import Unity.Indicators 0.1 as Indicators
22
22
23Indicators.IndicatorPage {
23Indicators.IndicatorPage {
24 anchors.fill: parent
24 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 @@
19
19
20import QtQuick 2.0
20import QtQuick 2.0
21import Ubuntu.Components 0.1
21import Ubuntu.Components 0.1
22−import Unity.IndicatorsLegacy 0.1 as Indicators
22+import Unity.Indicators 0.1 as Indicators
23
23
24Indicators.IndicatorWidget {
24Indicators.IndicatorWidget {
25 id: indicatorWidget
25 id: indicatorWidget
26
26
27 width: itemRow.width + units.gu(0.5)
27 width: itemRow.width + units.gu(0.5)
28
28
29− property alias label: itemLabel.text
29+ property alias leftLabel: itemLeftLabel.text
30− property alias iconSource: itemImage.source
30+ property alias rightLabel: itemRightLabel.text
31+ property var icons: undefined
31
32
32 Row {
33 Row {
33 id: itemRow
34 id: itemRow
@@ -39,19 +40,43 @@ Indicators.IndicatorWidget {
39 }
40 }
40 spacing: units.gu(0.5)
41 spacing: units.gu(0.5)
41
42
42− // FIXME : Should us Ubuntu.Icon . results in low res images
43+ Label {
43− Image {
44+ id: itemLeftLabel
44− id: itemImage
45− objectName: "itemImage"
45+ objectName: "leftLabel"
46− visible: source != ""
46+ color: Theme.palette.selected.backgroundText
47− height: indicatorWidget.iconSize
47+ opacity: 0.8
48− width: indicatorWidget.iconSize
48+ font.family: "Ubuntu"
49+ fontSize: "medium"
49 anchors.verticalCenter: parent.verticalCenter
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+ }
50 }
75 }
51
76
52 Label {
77 Label {
53− id: itemLabel
78+ id: itemRightLabel
54− objectName: "itemLabel"
79+ objectName: "rightLabel"
55 color: Theme.palette.selected.backgroundText
80 color: Theme.palette.selected.backgroundText
56 opacity: 0.8
81 opacity: 0.8
57 font.family: "Ubuntu"
82 font.family: "Ubuntu"
@@ -62,20 +87,17 @@ Indicators.IndicatorWidget {
62 }
87 }
63
88
64 onActionStateChanged: {
89 onActionStateChanged: {
65− if (action == undefined || !action.valid) {
90+ if (actionState == undefined) {
66− enabled = false;
91+ leftLabel = "";
67− return;
92+ rightLabel = "";
68− }
93+ icons = undefined;
69−
70− if (action.state == undefined) {
71− label = "";
72− iconSource = "";
73 enabled = false;
94 enabled = false;
74 return;
95 return;
75 }
96 }
76
97
77− label = action.state[Indicators.ActionState.Label];
98+ leftLabel = actionState.leftLabel ? actionState.leftLabel : "";
78− iconSource = "image://gicon/" + action.state[Indicators.ActionState.IconSource];
99+ rightLabel = actionState.rightLabel ? actionState.rightLabel : "";
79− enabled = action.state[Indicators.ActionState.Visible];
100+ icons = actionState.icons;
101+ enabled = actionState.visible;
80 }
102 }
81}
103}
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 @@
18 */
18 */
19
19
20import QtQuick 2.0
20import QtQuick 2.0
21−import Unity.IndicatorsLegacy 0.1 as Indicators
21+import Unity.Indicators 0.1 as Indicators
22−import Unity.IndicatorsLegacy.Network 0.1 as ICNetwork
22+import Unity.Indicators.Network 0.1 as ICNetwork
23import Ubuntu.Components 0.1
23import Ubuntu.Components 0.1
24
24
25PageStack {
25PageStack {
@@ -32,7 +32,6 @@ PageStack {
32
32
33 property alias title: _mainPage.title
33 property alias title: _mainPage.title
34 property alias emptyText: pluginItem.emptyText
34 property alias emptyText: pluginItem.emptyText
35− property alias busType: pluginItem.busType
36 property alias busName: pluginItem.busName
35 property alias busName: pluginItem.busName
37 property alias actionsObjectPath : pluginItem.actionsObjectPath
36 property alias actionsObjectPath : pluginItem.actionsObjectPath
38 property alias menuObjectPaths : pluginItem.menuObjectPaths
37 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 @@
20import QtQuick 2.0
20import QtQuick 2.0
21import Ubuntu.Components 0.1
21import Ubuntu.Components 0.1
22import Ubuntu.Components.ListItems 0.1 as ListItem
22import Ubuntu.Components.ListItems 0.1 as ListItem
23−import Unity.IndicatorsLegacy 0.1 as Indicators
23+import Unity.Indicators 0.1 as Indicators
24import "../.."
24import "../.."
25
25
26Page {
26Page {
@@ -38,18 +38,13 @@ Page {
38 anchors.fill: parent
38 anchors.fill: parent
39 model: indicatorsModel
39 model: indicatorsModel
40
40
41− delegate: Indicators.MenuItem {
41+ delegate: Indicators.FramedMenuItem {
42 anchors.left: parent.left
42 anchors.left: parent.left
43 anchors.right: parent.right
43 anchors.right: parent.right
44− progression: isValid
44+ progression: true
45 objectName: identifier
45 objectName: identifier
46
46
47− Label {
48− anchors.left: parent.left
49− anchors.leftMargin: units.gu(0.5)
50− anchors.verticalCenter: parent.verticalCenter
51− text: title
47+ text: title
52− }
53
48
54 onClicked: {
49 onClicked: {
55 if (progression) {
50 if (progression) {
@@ -57,6 +52,14 @@ Page {
57 page.pageStack.push(new_page.createObject(pages), {"indicatorProperties" : model.indicatorProperties, "pageSource" : model.pageSource});
52 page.pageStack.push(new_page.createObject(pages), {"indicatorProperties" : model.indicatorProperties, "pageSource" : model.pageSource});
58 }
53 }
59 }
54 }
55+
56+ Rectangle {
57+ id: background
58+
59+ anchors.fill: parent
60+ color: "#221e1c"
61+ z: -1
62+ }
60 }
63 }
61 }
64 }
62}
65}
Panel/IndicatorsDataModel.qml+9−23
@@ -29,51 +29,37 @@ Indicators.IndicatorsModel {
29 indicatorData : {
29 indicatorData : {
30 'indicator-location' : {
30 'indicator-location' : {
31 'title': 'Location',
31 'title': 'Location',
32− 'description' : '',
32+ 'description' : ''
33− 'widgetSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorWidget2.qml',
34− 'pageSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorPage2.qml'
35 },
33 },
36 'indicator-bluetooth' : {
34 'indicator-bluetooth' : {
37 'title': 'Bluetooth',
35 'title': 'Bluetooth',
38− 'description' : '',
36+ 'description' : ''
39− 'widgetSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorWidget2.qml',
40− 'pageSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorPage2.qml'
41 },
37 },
42 'indicator-messages' : {
38 'indicator-messages' : {
43 'title': 'Messaging',
39 'title': 'Messaging',
44− 'description' : '',
40+ 'description' : ''
45− 'widgetSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorWidget2.qml',
46− 'pageSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorPage2.qml'
47 },
41 },
48 'indicator-sound' : {
42 'indicator-sound' : {
49 'title': 'Sound',
43 'title': 'Sound',
50− 'description' : '',
44+ 'description' : ''
51− 'widgetSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorWidget2.qml',
52− 'pageSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorPage2.qml'
53 },
45 },
54 'indicator-network' : {
46 'indicator-network' : {
55 'title': 'Networks',
47 'title': 'Networks',
56 'description' : '',
48 'description' : '',
57− 'widgetSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorWidget2.qml',
49+ 'widgetSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorWidget.qml',
58− 'pageSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/NetworkIndicatorPage2.qml'
50+ 'pageSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/NetworkIndicatorPage.qml'
59 },
51 },
60 'indicator-power' : {
52 'indicator-power' : {
61 'title': 'Battery',
53 'title': 'Battery',
62− 'description' : '',
54+ 'description' : ''
63− 'widgetSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorWidget2.qml',
64− 'pageSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorPage2.qml'
65 },
55 },
66 'indicator-session' : {
56 'indicator-session' : {
67 'title': 'Session',
57 'title': 'Session',
68− 'description' : '',
58+ 'description' : ''
69− 'widgetSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorWidget2.qml',
70− 'pageSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorPage2.qml'
71 },
59 },
72 'indicator-datetime' : {
60 'indicator-datetime' : {
73 'title': 'Date and Time',
61 'title': 'Date and Time',
74− 'description' : '',
62+ 'description' : ''
75− 'widgetSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorWidget2.qml',
76− 'pageSource' : ApplicationPaths.shellAppDirectory()+'/Panel/Indicators/DefaultIndicatorPage2.qml'
77 }
63 }
78 }
64 }
79}
65}
plugins/Unity/CMakeLists.txt−1
@@ -2,7 +2,6 @@
2include(Plugins)
2include(Plugins)
3
3
4add_subdirectory(Indicators)
4add_subdirectory(Indicators)
5−add_subdirectory(IndicatorsLegacy)
6
5
7# Dependencies
6# Dependencies
8include(FindPkgConfig)
7include(FindPkgConfig)
plugins/Unity/Indicators/Messaging/qml/QuickReply.qml+1−1
@@ -20,7 +20,7 @@
20
20
21import QtQuick 2.0
21import QtQuick 2.0
22import Ubuntu.Components 0.1
22import Ubuntu.Components 0.1
23−import Unity.IndicatorsLegacy 0.1 as Indicators
23+import Unity.Indicators 0.1 as Indicators
24
24
25Item {
25Item {
26 id: quickReply
26 id: quickReply
plugins/Unity/Indicators/indicatorsmodel.cpp+5−3
@@ -228,9 +228,9 @@ QVariant IndicatorsModel::defaultData(Indicator::Ptr indicator, int role)
228 case IndicatorsModelRole::Description:
228 case IndicatorsModelRole::Description:
229 return "";
229 return "";
230 case IndicatorsModelRole::WidgetSource:
230 case IndicatorsModelRole::WidgetSource:
231− return shellAppDirectory()+"/Panel/Indicators/DefaultIndicatorWidget2.qml";
231+ return shellAppDirectory()+"/Panel/Indicators/DefaultIndicatorWidget.qml";
232 case IndicatorsModelRole::PageSource:
232 case IndicatorsModelRole::PageSource:
233− return shellAppDirectory()+"/Panel/Indicators/DefaultIndicatorPage2.qml";
233+ return shellAppDirectory()+"/Panel/Indicators/DefaultIndicatorPage.qml";
234 }
234 }
235 return QVariant();
235 return QVariant();
236}
236}
@@ -284,7 +284,9 @@ QVariant IndicatorsModel::indicatorData(const Indicator::Ptr& indicator, int rol
284 if (indicator && m_parsed_indicator_data.contains(indicator->identifier()))
284 if (indicator && m_parsed_indicator_data.contains(indicator->identifier()))
285 {
285 {
286 QVariantMap data = m_parsed_indicator_data[indicator->identifier()];
286 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+ };
288 }
290 }
289 return defaultData(indicator, role);
291 return defaultData(indicator, role);
290}
292}
tests/autopilot/unity8/indicators_client/emulators/main_window.py+1−1
@@ -24,4 +24,4 @@ class MainWindow(object):
24
24
25 def get_battery_menu(self):
25 def get_battery_menu(self):
26 """Get the battery menu from the list"""
26 """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");