on xenial help sign in
Merged with trunk, fixed failing autopilot-tests again.
852b6a5Mirco Müller
Components/ApplicationManagerWrapper.qml+2
@@ -29,6 +29,8 @@ Item {
29 property bool keyboardVisible: ApplicationManager.keyboardVisible
29 property bool keyboardVisible: ApplicationManager.keyboardVisible
30 property int keyboardHeight: ApplicationManager.keyboardHeight
30 property int keyboardHeight: ApplicationManager.keyboardHeight
31
31
32+ property bool fake: ApplicationManager.fake ? ApplicationManager.fake : false
33+
32 Component.onCompleted: {
34 Component.onCompleted: {
33 // Start the watcher so that the ApplicationManager applications model can be populated.
35 // Start the watcher so that the ApplicationManager applications model can be populated.
34 ApplicationManager.startWatcher();
36 ApplicationManager.startWatcher();
Components/CrossFadeImage.qml+3−1
@@ -85,7 +85,7 @@ Item {
85 Connections {
85 Connections {
86 target: __nextImage
86 target: __nextImage
87 onStatusChanged: {
87 onStatusChanged: {
88− if (__nextImage.status == Image.Ready) {
88+ if (__nextImage.status == Image.Ready || __nextImage.status == Image.Error) {
89 swapImages();
89 swapImages();
90 }
90 }
91 }
91 }
@@ -96,6 +96,7 @@ Item {
96 anchors.fill: parent
96 anchors.fill: parent
97 cache: false
97 cache: false
98 asynchronous: true
98 asynchronous: true
99+ fillMode: Image.PreserveAspectCrop
99 z: 1
100 z: 1
100 }
101 }
101
102
@@ -104,6 +105,7 @@ Item {
104 anchors.fill: parent
105 anchors.fill: parent
105 cache: false
106 cache: false
106 asynchronous: true
107 asynchronous: true
108+ fillMode: Image.PreserveAspectCrop
107 z: 0
109 z: 0
108 }
110 }
109
111
Dash/DashVideos.qml+1−1
@@ -118,7 +118,7 @@ ScopeView {
118 var dataItem;
118 var dataItem;
119 // VideosCarousel and VideosFilterGrid have different
119 // VideosCarousel and VideosFilterGrid have different
120 // clicked signals, accomodate for that
120 // clicked signals, accomodate for that
121− if (categoryId == 1) {
121+ if (categoryId == "featured") {
122 var fileUri = delegateItem.model.uri.replace(/^[^:]+:/, "")
122 var fileUri = delegateItem.model.uri.replace(/^[^:]+:/, "")
123 dataItem = {fileUri: fileUri, nfoUri: delegateItem.model.comment}
123 dataItem = {fileUri: fileUri, nfoUri: delegateItem.model.comment}
124 } else {
124 } else {
Greeter/Greeter.qml+2−3
@@ -34,7 +34,7 @@ Showable {
34
34
35 property alias dragHandleWidth: dragHandle.width
35 property alias dragHandleWidth: dragHandle.width
36 property alias model: greeterContentLoader.model
36 property alias model: greeterContentLoader.model
37− property bool locked: shown && multiUser && !greeterContentLoader.promptless
37+ property bool locked: shown && !LightDM.Greeter.promptless
38
38
39 readonly property bool narrowMode: !multiUser && width <= units.gu(60)
39 readonly property bool narrowMode: !multiUser && width <= units.gu(60)
40 readonly property bool multiUser: LightDM.Users.count > 1
40 readonly property bool multiUser: LightDM.Users.count > 1
@@ -59,7 +59,6 @@ Showable {
59 anchors.fill: parent
59 anchors.fill: parent
60 property var model: LightDM.Users
60 property var model: LightDM.Users
61 property int currentIndex: 0
61 property int currentIndex: 0
62− property bool promptless: item ? item.promptless : false
63 property var infographicModel: LightDM.Infographic
62 property var infographicModel: LightDM.Infographic
64
63
65 source: required ? "GreeterContent.qml" : ""
64 source: required ? "GreeterContent.qml" : ""
@@ -113,7 +112,7 @@ Showable {
113 // UI element)
112 // UI element)
114 distanceThreshold: 0
113 distanceThreshold: 0
115
114
116− enabled: !greeter.locked
115+ enabled: greeter.narrowMode || !greeter.locked
117
116
118 direction: Direction.Leftwards
117 direction: Direction.Leftwards
119 }
118 }
Greeter/GreeterContent.qml−2
@@ -23,7 +23,6 @@ MouseArea {
23 id: root
23 id: root
24 anchors.fill: parent
24 anchors.fill: parent
25
25
26− property bool promptless: loginLoader.status == Loader.Ready && LightDM.Greeter.promptless
27 property bool ready: wallpaper.status == Image.Ready
26 property bool ready: wallpaper.status == Image.Ready
28 property bool leftTeaserPressed: teasingMouseArea.pressed &&
27 property bool leftTeaserPressed: teasingMouseArea.pressed &&
29 teasingMouseArea.mouseX < teasingMouseArea.width / 2
28 teasingMouseArea.mouseX < teasingMouseArea.width / 2
@@ -38,7 +37,6 @@ MouseArea {
38
37
39 source: shell.background
38 source: shell.background
40 anchors.fill: parent
39 anchors.fill: parent
41− crossFade: false
42 fadeInFirst: false
40 fadeInFirst: false
43 }
41 }
44
42
Greeter/Lockscreen.qml+9−9
@@ -69,7 +69,7 @@ Showable {
69 left: parent.left
69 left: parent.left
70 right: parent.right
70 right: parent.right
71 verticalCenter: parent.verticalCenter
71 verticalCenter: parent.verticalCenter
72− verticalCenterOffset: root.alphaNumeric ? -units.gu(10) : 0
72+ verticalCenterOffset: root.alphaNumeric ? -units.gu(10) : -units.gu(4)
73 }
73 }
74 property bool resetting: false
74 property bool resetting: false
75
75
@@ -107,11 +107,11 @@ Showable {
107 Column {
107 Column {
108 anchors {
108 anchors {
109 left: parent.left
109 left: parent.left
110− top: pinPadLoader.bottom
111− topMargin: units.gu(4)
112− right: parent.right
113 bottom: parent.bottom
110 bottom: parent.bottom
111+ bottomMargin: units.gu(4)
112+ right: parent.right
114 }
113 }
114+ height: childrenRect.height
115 spacing: units.gu(1)
115 spacing: units.gu(1)
116
116
117 Icon {
117 Icon {
@@ -120,8 +120,8 @@ Showable {
120 width: height
120 width: height
121 anchors.horizontalCenter: parent.horizontalCenter
121 anchors.horizontalCenter: parent.horizontalCenter
122 name: "phone-app-call-symbolic"
122 name: "phone-app-call-symbolic"
123− color: "white"
123+ color: "#f3f3e7"
124− opacity: 0.9
124+ opacity: 0.6
125
125
126 MouseArea {
126 MouseArea {
127 anchors.fill: parent
127 anchors.fill: parent
@@ -130,9 +130,9 @@ Showable {
130 }
130 }
131
131
132 Label {
132 Label {
133− text: i18n.tr("Emergency call")
133+ text: i18n.tr("Emergency Call")
134− color: "white"
134+ color: "#f3f3e7"
135− opacity: 0.9
135+ opacity: 0.6
136 fontSize: "medium"
136 fontSize: "medium"
137 anchors.horizontalCenter: parent.horizontalCenter
137 anchors.horizontalCenter: parent.horizontalCenter
138 }
138 }
Greeter/PinLockscreen.qml+110−41
@@ -16,15 +16,17 @@
16
16
17import QtQuick 2.0
17import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19+import Ubuntu.Components.ListItems 0.1
19import "../Components"
20import "../Components"
20
21
21Column {
22Column {
22 id: root
23 id: root
23 anchors.centerIn: parent
24 anchors.centerIn: parent
24− spacing: units.gu(2.5)
25+ spacing: units.gu(3.5)
25
26
26 property alias placeholderText: pinentryField.placeholderText
27 property alias placeholderText: pinentryField.placeholderText
27− property int padWidth: units.gu(32)
28+ property int padWidth: units.gu(34)
29+ property int padHeight: units.gu(28)
28 property int pinLength: 4
30 property int pinLength: 4
29
31
30 signal entered(string passphrase)
32 signal entered(string passphrase)
@@ -37,70 +39,137 @@ Column {
37 }
39 }
38 }
40 }
39
41
40− TextField {
42+
43+ UbuntuShape {
41 id: pinentryField
44 id: pinentryField
42 objectName: "pinentryField"
45 objectName: "pinentryField"
43 anchors.horizontalCenter: parent.horizontalCenter
46 anchors.horizontalCenter: parent.horizontalCenter
44− width: units.gu(32)
47+ color: "#55000000"
48+ width:root.padWidth
45 height: units.gu(5)
49 height: units.gu(5)
46− echoMode: TextInput.Password
50+ radius: "medium"
47− font.pixelSize: units.dp(44)
51+ property string text: ""
48− color: "white"
52+ property string placeholderText: ""
49− opacity: 0.9
50− hasClearButton: false
51− horizontalAlignment: Text.AlignHCenter
52−
53 onTextChanged: {
53 onTextChanged: {
54+ pinentryFieldLabel.text = "";
55+ for (var i = 0; i < text.length; ++i) {
56+ pinentryFieldLabel.text += "•";
57+ }
54− if (pinentryField.text.length === root.pinLength) {
58+ if (text.length === root.pinLength) {
55− root.entered(pinentryField.text);
59+ root.entered(text);
56 }
60 }
57 }
61 }
58
62
59− // Using a MouseArea to eat clicks. We don't want to disable the TextField for styling reasons
63+ Label {
60− MouseArea {
64+ id: pinentryFieldLabel
61− anchors.fill: parent
65+ anchors.centerIn: parent
66+ font.pixelSize: units.dp(44)
67+ color: "#f3f3e7"
68+ opacity: 0.6
69+ }
70+ Label {
71+ id: pinentryFieldPlaceHolder
72+ anchors.centerIn: parent
73+ color: "grey"
74+ text: parent.placeholderText
75+ visible: pinentryFieldLabel.text.length == 0
62 }
76 }
63 }
77 }
64
78
65− Grid {
79+ UbuntuShape {
66 anchors {
80 anchors {
67 left: parent.left
81 left: parent.left
68 right: parent.right
82 right: parent.right
69 margins: (parent.width - root.padWidth) / 2
83 margins: (parent.width - root.padWidth) / 2
70 }
84 }
85+ height: root.padHeight
86+ color: "#55000000"
87+ radius: "medium"
88+
89+ ThinDivider {
90+ anchors {
91+ left: parent.left
92+ right: parent.right
93+ top: parent.top
94+ topMargin: root.padHeight / 4
95+ }
96+ }
97+ ThinDivider {
98+ anchors {
99+ left: parent.left
100+ right: parent.right
101+ verticalCenter: parent.verticalCenter
102+ }
103+ }
104+ ThinDivider {
105+ anchors {
106+ left: parent.left
107+ right: parent.right
108+ bottom: parent.bottom
109+ bottomMargin: root.padHeight / 4
110+ }
111+ }
71
112
72− columns: 3
113+ ThinDivider {
73− spacing: units.gu(1)
114+ anchors.centerIn: parent
115+ anchors.horizontalCenterOffset: -root.padWidth / 6
116+ width: root.padHeight
117+ rotation: -90
118+ }
119+ ThinDivider {
120+ anchors.centerIn: parent
121+ anchors.horizontalCenterOffset: root.padWidth / 6
122+ width: root.padHeight
123+ rotation: -90
124+ }
74
125
75− Repeater {
126+ Grid {
76− model: 9
127+ anchors {
128+ left: parent.left
129+ right: parent.right
130+ margins: (parent.width - root.padWidth) / 2
131+ }
77
132
133+ columns: 3
134+
135+ Repeater {
136+ model: 9
137+
78− PinPadButton {
138+ PinPadButton {
79− objectName: "pinPadButton" + (index + 1)
139+ objectName: "pinPadButton" + (index + 1)
140+ width: root.padWidth / 3
141+ height: root.padHeight / 4
80− text: index + 1
142+ text: index + 1
81
143
82− onClicked: {
144+ onClicked: {
83− pinentryField.text = pinentryField.text + text
145+ pinentryField.text = pinentryField.text + text;
146+ }
84 }
147 }
85 }
148 }
86− }
87
149
88− PinPadButton {
150+ PinPadButton {
89− objectName: "pinPadButtonBack"
151+ objectName: "pinPadButtonBack"
152+ width: root.padWidth / 3
153+ height: root.padHeight / 4
90− iconName: "back"
154+ iconName: "back"
91− onClicked: root.cancel();
155+ onClicked: root.cancel();
156+ }
92
157
93− }
94− PinPadButton {
158+ PinPadButton {
95− objectName: "pinPadButton0"
159+ objectName: "pinPadButton0"
160+ width: root.padWidth / 3
161+ height: root.padHeight / 4
96− text: "0"
162+ text: "0"
97− onClicked: pinentryField.text = pinentryField.text + text
163+ onClicked: pinentryField.text = pinentryField.text + text
164+ }
98
165
99− }
100− PinPadButton {
166+ PinPadButton {
101− objectName: "pinPadButtonErase"
167+ objectName: "pinPadButtonErase"
168+ width: root.padWidth / 3
169+ height: root.padHeight / 4
102− iconName: "erase"
170+ iconName: "erase"
103− onClicked: pinentryField.text = pinentryField.text.substring(0, pinentryField.text.length-1)
171+ onClicked: pinentryField.text = pinentryField.text.substring(0, pinentryField.text.length-1)
172+ }
104 }
173 }
105 }
174 }
106
175
Greeter/PinPadButton.qml+5−16
@@ -17,28 +17,20 @@
17import QtQuick 2.0
17import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19
19
20−UbuntuShape {
20+Item {
21 id: root
21 id: root
22− width: units.gu(10)
23− height: units.gu(7)
24− radius: "medium"
25
22
26 property alias text: label.text
23 property alias text: label.text
27 property alias iconName: icon.name
24 property alias iconName: icon.name
28
25
29 signal clicked()
26 signal clicked()
30
27
31− Behavior on color {
32− ColorAnimation { duration: 100 }
33− }
34−
35 Label {
28 Label {
36 id: label
29 id: label
37 anchors.centerIn: parent
30 anchors.centerIn: parent
38− color: "white"
31+ color: "#f3f3e7"
39− fontSize: "x-large"
32+ fontSize: "large"
40− font.weight: Font.Light
33+ font.weight: Font.DemiBold
41− opacity: 0.9
42 }
34 }
43
35
44 Icon {
36 Icon {
@@ -46,14 +38,11 @@ UbuntuShape {
46 height: units.gu(3)
38 height: units.gu(3)
47 width: height
39 width: height
48 anchors.centerIn: parent
40 anchors.centerIn: parent
49− color: "white"
41+ color: "#f3f3e7"
50− opacity: 0.9
51 }
42 }
52
43
53 MouseArea {
44 MouseArea {
54 anchors.fill: parent
45 anchors.fill: parent
55 onClicked: root.clicked()
46 onClicked: root.clicked()
56− onPressed: root.color = Qt.rgba(0, 0, 0, 0.3)
57− onReleased: root.color = Qt.rgba(0, 0, 0, 0)
58 }
47 }
59}
48}
Panel/Indicators/client/IndicatorsClient.qml+8−9
@@ -27,16 +27,15 @@ Rectangle {
27
27
28 PageStack {
28 PageStack {
29 id: pages
29 id: pages
30−
31 anchors.fill: parent
30 anchors.fill: parent
32− Component.onCompleted: root.reset()
31+ Component.onCompleted: reset()
33− }
34
32
35− function reset() {
33+ function reset() {
36− pages.clear();
34+ clear();
37− var component = Qt.createComponent("IndicatorsList.qml");
35+ var component = Qt.createComponent("IndicatorsList.qml");
38− var page = component.createObject(pages);
36+ var page = component.createObject(pages);
39− console.log(component.errorString());
37+ console.log(component.errorString());
40− pages.push(page);
38+ push(page);
39+ }
41 }
40 }
42}
41}
Panel/Indicators/client/IndicatorsPage.qml+57−12
@@ -15,35 +15,80 @@
15 *
15 *
16 * Authors:
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18+ * Nick Dedekind <nick.dedekind@canonical.com>
18 */
19 */
19
20
20import QtQuick 2.0
21import QtQuick 2.0
21import Ubuntu.Components 0.1
22import Ubuntu.Components 0.1
23+import Ubuntu.Components.ListItems 0.1 as ListItem
22
24
23Page {
25Page {
24− id: _page
26+ id: page
25
27
26 title: indicatorProperties && indicatorProperties.title ? indicatorProperties.title : ""
28 title: indicatorProperties && indicatorProperties.title ? indicatorProperties.title : ""
27 property variant indicatorProperties
29 property variant indicatorProperties
28− property alias pageSource : page_loader.source
30+ property string pageSource : pageLoader.source
29
31
30 anchors.fill: parent
32 anchors.fill: parent
31
33
34+ ListItem.Standard {
35+ id: visualCheckItem
36+ text: "Enable Visual Representation"
37+ control: Switch {
38+ id: visualCheck
39+ checked: true
40+ }
41+ }
42+
32 Loader {
43 Loader {
33− id: page_loader
44+ id: pageLoader
34− objectName: "page_loader"
45+ objectName: "pageLoader"
35
46
36− anchors.fill: parent
47+ anchors {
48+ top: visualCheckItem.bottom
49+ left: parent.left
50+ right: parent.right
51+ bottom: buttons.top
52+ topMargin: units.gu(2)
53+ bottomMargin: units.gu(2)
54+ }
55+ source : visualCheck.checked ? page.pageSource : "IndicatorsTree.qml"
37
56
38− onStatusChanged: {
57+ onLoaded: {
39− if (status == Loader.Ready) {
40− for(var pName in indicatorProperties) {
58+ for(var pName in indicatorProperties) {
41− if (item.hasOwnProperty(pName)) {
59+ if (item.hasOwnProperty(pName)) {
42− item[pName] = indicatorProperties[pName];
60+ item[pName] = indicatorProperties[pName];
43− }
44 }
61 }
45− item.start();
46 }
62 }
63+ item.start();
64+ }
65+ }
66+
67+ Item {
68+ id: buttons
69+ anchors {
70+ left: parent.left
71+ right: parent.right
72+ bottom: parent.bottom
73+ margins: units.gu(1)
74+ }
75+ height: childrenRect.height
76+
77+ Button {
78+ anchors {
79+ left: parent.left
80+ }
81+ text: "Back"
82+ onClicked: page.pageStack.reset()
83+ }
84+ Button {
85+ id: refresh
86+ visible: !visualCheck.checked
87+ anchors {
88+ right: parent.right
89+ }
90+ text: "Refresh"
91+ onClicked: pageLoader.item.refresh()
47 }
92 }
48 }
93 }
49}
94}
Panel/Indicators/client/IndicatorsTree.qmlnew file+62
@@ -0,0 +1,62 @@
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.dededkind@canonical.com>
18+ */
19+
20+import QtQuick 2.0
21+import Ubuntu.Components 0.1
22+import Unity.Indicators 0.1 as Indicators
23+import QMenuModel 0.1
24+import Ubuntu.Components.ListItems 0.1 as ListItem
25+
26+Page {
27+ id: page
28+ anchors.fill: parent
29+
30+ property alias busType: menuModel.busType
31+ property alias busName: menuModel.busName
32+ property string actionsObjectPath
33+ property var menuObjectPaths: undefined
34+ readonly property string device: "phone"
35+
36+ property string deviceMenuObjectPath: menuObjectPaths.hasOwnProperty(device) ? menuObjectPaths[device] : ""
37+
38+ function start() {
39+ menuModel.start();
40+ }
41+
42+ QDBusMenuModel {
43+ id: menuModel
44+ objectPath: page.deviceMenuObjectPath
45+ }
46+
47+ Indicators.ModelPrinter {
48+ id: printer
49+ model: menuModel
50+ }
51+
52+ Flickable {
53+ anchors.fill: parent
54+ contentHeight: all_data.height
55+ clip:true
56+ Text {
57+ id: all_data
58+ color: "white"
59+ text: printer.text
60+ }
61+ }
62+}
Shell.qml+68−32
@@ -15,10 +15,12 @@
15 */
15 */
16
16
17import QtQuick 2.0
17import QtQuick 2.0
18+import GSettings 1.0
18import Ubuntu.Application 0.1
19import Ubuntu.Application 0.1
19import Ubuntu.Components 0.1
20import Ubuntu.Components 0.1
20import Ubuntu.Gestures 0.1
21import Ubuntu.Gestures 0.1
21import LightDM 0.1 as LightDM
22import LightDM 0.1 as LightDM
23+import Powerd 0.1
22import "Dash"
24import "Dash"
23import "Greeter"
25import "Greeter"
24import "Launcher"
26import "Launcher"
@@ -40,8 +42,8 @@ FocusScope {
40 height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
42 height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
41
43
42 property real edgeSize: units.gu(2)
44 property real edgeSize: units.gu(2)
43− property url default_background: shell.width >= units.gu(60) ? "graphics/tablet_background.jpg" : "graphics/phone_background.jpg"
45+ property url defaultBackground: shell.width >= units.gu(60) ? "graphics/tablet_background.jpg" : "graphics/phone_background.jpg"
44− property url background: default_background
46+ property url background: backgroundSettings.pictureUri
45 readonly property real panelHeight: panel.panelHeight
47 readonly property real panelHeight: panel.panelHeight
46
48
47 property bool dashShown: dash.shown
49 property bool dashShown: dash.shown
@@ -114,6 +116,11 @@ FocusScope {
114 }
116 }
115 }
117 }
116
118
119+ GSettings {
120+ id: backgroundSettings
121+ schema.id: "org.gnome.desktop.background"
122+ }
123+
117 VolumeControl {
124 VolumeControl {
118 id: volumeControl
125 id: volumeControl
119 }
126 }
@@ -121,12 +128,6 @@ FocusScope {
121 Keys.onVolumeUpPressed: volumeControl.volumeUp()
128 Keys.onVolumeUpPressed: volumeControl.volumeUp()
122 Keys.onVolumeDownPressed: volumeControl.volumeDown()
129 Keys.onVolumeDownPressed: volumeControl.volumeDown()
123
130
124− Keys.onReleased: {
125− if (event.key == Qt.Key_PowerOff) {
126− greeter.show()
127− }
128− }
129−
130 Item {
131 Item {
131 id: underlay
132 id: underlay
132 objectName: "underlay"
133 objectName: "underlay"
@@ -144,12 +145,16 @@ FocusScope {
144 // through the translucent parts of the shell surface.
145 // through the translucent parts of the shell surface.
145 visible: !fullyCovered && !applicationSurfaceShouldBeSeen
146 visible: !fullyCovered && !applicationSurfaceShouldBeSeen
146
147
147− Image {
148+ CrossFadeImage {
148 id: backgroundImage
149 id: backgroundImage
150+ objectName: "backgroundImage"
149 source: shell.background
151 source: shell.background
150− sourceSize.width: parent.width
151− sourceSize.height: parent.height
152 anchors.fill: parent
152 anchors.fill: parent
153+ onStatusChanged: {
154+ if (status == Image.Error) {
155+ backgroundSettings.pictureUri = shell.defaultBackground
156+ }
157+ }
153 }
158 }
154
159
155 Rectangle {
160 Rectangle {
@@ -194,7 +199,6 @@ FocusScope {
194 }
199 }
195 }
200 }
196
201
197−
198 Item {
202 Item {
199 id: stagesOuterContainer
203 id: stagesOuterContainer
200
204
@@ -259,7 +263,6 @@ FocusScope {
259 ignoreUnknownSignals: true
263 ignoreUnknownSignals: true
260 }
264 }
261
265
262−
263 Stage {
266 Stage {
264 id: mainStage
267 id: mainStage
265
268
@@ -420,9 +423,6 @@ FocusScope {
420
423
421 dragHandleWidth: shell.edgeSize
424 dragHandleWidth: shell.edgeSize
422
425
423− property var previousMainApp: null
424− property var previousSideApp: null
425−
426 onShownChanged: {
426 onShownChanged: {
427 if (shown) {
427 if (shown) {
428 lockscreen.reset();
428 lockscreen.reset();
@@ -432,27 +432,13 @@ FocusScope {
432 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
432 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
433 }
433 }
434 greeter.forceActiveFocus();
434 greeter.forceActiveFocus();
435− // FIXME: *FocusedApplication are not updated when unfocused, hence the need to check whether
436− // the stage was actually shown
437− if (mainStage.fullyShown) greeter.previousMainApp = applicationManager.mainStageFocusedApplication;
438− if (sideStage.fullyShown) greeter.previousSideApp = applicationManager.sideStageFocusedApplication;
439− applicationManager.unfocusCurrentApplication();
440− } else {
441− if (greeter.previousMainApp) {
442− applicationManager.focusApplication(greeter.previousMainApp);
443− greeter.previousMainApp = null;
444− }
445− if (greeter.previousSideApp) {
446− applicationManager.focusApplication(greeter.previousSideApp);
447− greeter.previousSideApp = null;
448− }
449 }
435 }
450 }
436 }
451
437
452 onUnlocked: greeter.hide()
438 onUnlocked: greeter.hide()
453 onSelected: {
439 onSelected: {
454 var bgPath = greeter.model.data(uid, LightDM.UserRoles.BackgroundPathRole)
440 var bgPath = greeter.model.data(uid, LightDM.UserRoles.BackgroundPathRole)
455− shell.background = bgPath ? bgPath : default_background
441+ shell.background = bgPath ? bgPath : defaultBackground
456 }
442 }
457
443
458 onLeftTeaserPressedChanged: {
444 onLeftTeaserPressedChanged: {
@@ -467,6 +453,42 @@ FocusScope {
467 blockInput: greeter.shown || lockscreen.shown
453 blockInput: greeter.shown || lockscreen.shown
468 }
454 }
469
455
456+ Connections {
457+ id: powerConnection
458+ target: Powerd
459+
460+ property var previousMainApp: null
461+ property var previousSideApp: null
462+
463+ function setFocused(focused) {
464+ if (!focused) {
465+ // FIXME: *FocusedApplication are not updated when unfocused, hence the need to check whether
466+ // the stage was actually shown
467+ if (mainStage.fullyShown) powerConnection.previousMainApp = applicationManager.mainStageFocusedApplication;
468+ if (sideStage.fullyShown) powerConnection.previousSideApp = applicationManager.sideStageFocusedApplication;
469+ applicationManager.unfocusCurrentApplication();
470+ } else {
471+ if (powerConnection.previousMainApp) {
472+ applicationManager.focusApplication(powerConnection.previousMainApp);
473+ powerConnection.previousMainApp = null;
474+ }
475+ if (powerConnection.previousSideApp) {
476+ applicationManager.focusApplication(powerConnection.previousSideApp);
477+ powerConnection.previousSideApp = null;
478+ }
479+ }
480+ }
481+
482+ onPowerStateChange: {
483+ if (state == 0) { // suspend
484+ powerConnection.setFocused(false);
485+ greeter.show();
486+ } else if (state == 1) { // active
487+ powerConnection.setFocused(true);
488+ }
489+ }
490+ }
491+
470 Item {
492 Item {
471 id: overlay
493 id: overlay
472
494
@@ -552,7 +574,7 @@ FocusScope {
552 anchors.bottom: parent.bottom
574 anchors.bottom: parent.bottom
553 width: parent.width
575 width: parent.width
554 dragAreaWidth: shell.edgeSize
576 dragAreaWidth: shell.edgeSize
555− available: !greeter.locked
577+ available: !greeter.shown || greeter.narrowMode
556 onDashItemSelected: {
578 onDashItemSelected: {
557 greeter.hide()
579 greeter.hide()
558 // Animate if moving between application and dash
580 // Animate if moving between application and dash
@@ -647,4 +669,18 @@ FocusScope {
647
669
648 enabled: shell.applicationManager && shell.applicationManager.keyboardVisible
670 enabled: shell.applicationManager && shell.applicationManager.keyboardVisible
649 }
671 }
672+
673+ Label {
674+ anchors.fill: parent
675+ visible: applicationManager.fake
676+ text: "EARLY ALPHA\nNOT READY FOR USE"
677+ color: "lightgrey"
678+ opacity: 0.2
679+ font.weight: Font.Black
680+ horizontalAlignment: Text.AlignHCenter
681+ verticalAlignment: Text.AlignVCenter
682+ fontSizeMode: Text.Fit
683+ font.pixelSize: height/2
684+ rotation: -45
685+ }
650}
686}
debian/changelog+48
@@ -1,3 +1,51 @@
1+unity8 (7.81.3+13.10.20130802-0ubuntu1) saucy; urgency=low
2+
3+ [ Michael Terry ]
4+ * Make hud autopilot tests more reliable by fixing how it calculates
5+ relative coordinates.
6+
7+ [ Albert Astals ]
8+ * Only update the "section" if we are not culling the item If the item
9+ is not shown we should not care about its section.
10+
11+ [ Ubuntu daily release ]
12+ * Automatic snapshot from revision 155
13+
14+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Fri, 02 Aug 2013 02:40:11 +0000
15+
16+unity8 (7.81.3+13.10.20130801.1-0ubuntu1) saucy; urgency=low
17+
18+ [ Michał Sawicz ]
19+ * Add a disclaimer for the fake applications plugin.
20+
21+ [ Nick Dedekind ]
22+ * Removed animations from fake indicator pages.
23+
24+ [ Ubuntu daily release ]
25+ * Automatic snapshot from revision 152
26+
27+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Thu, 01 Aug 2013 14:30:40 +0000
28+
29+unity8 (7.81.3+13.10.20130801ubuntu.unity.next-0ubuntu1) saucy; urgency=low
30+
31+ [ Michael Zanetti ]
32+ * implemented new Lockscreen design.
33+
34+ [ Michał Sawicz ]
35+ * Fix mock VideoPreview to use the string categoryId as well.
36+
37+ [ Nick Dedekind ]
38+ * Added a text tree representation of the qmenumodel to the
39+ indicators-client application.
40+
41+ [ Albert Astals ]
42+ * Don't need deelistmodel here.
43+
44+ [ Ubuntu daily release ]
45+ * Automatic snapshot from revision 149 (ubuntu-unity/next)
46+
47+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Thu, 01 Aug 2013 02:32:03 +0000
48+
1unity8 (7.81.3+13.10.20130730ubuntu.unity.next-0ubuntu1) saucy; urgency=low
49unity8 (7.81.3+13.10.20130730ubuntu.unity.next-0ubuntu1) saucy; urgency=low
2
50
3 [ Michał Sawicz ]
51 [ Michał Sawicz ]
debian/control+3−1
@@ -56,8 +56,10 @@ Description: Indicators client test application
56
56
57Package: unity8
57Package: unity8
58Architecture: any
58Architecture: any
59+Depends: gsettings-desktop-schemas,
59−Depends: qmenumodel-qml,
60+ qmenumodel-qml,
60 qtdeclarative5-dee-plugin,
61 qtdeclarative5-dee-plugin,
62+ qtdeclarative5-gsettings1.0,
61 qtdeclarative5-ubuntu-ui-toolkit-plugin,
63 qtdeclarative5-ubuntu-ui-toolkit-plugin,
62 qtdeclarative5-unity-notifications-plugin | unity-notifications-impl,
64 qtdeclarative5-unity-notifications-plugin | unity-notifications-impl,
63 qtdeclarative5-xmllistmodel-plugin,
65 qtdeclarative5-xmllistmodel-plugin,
debian/unity8-private.install+1
@@ -1,6 +1,7 @@
1usr/lib/*/unity8/qml/HudClient
1usr/lib/*/unity8/qml/HudClient
2usr/lib/*/unity8/qml/LightDM
2usr/lib/*/unity8/qml/LightDM
3usr/lib/*/unity8/qml/ListViewWithPageHeader
3usr/lib/*/unity8/qml/ListViewWithPageHeader
4+usr/lib/*/unity8/qml/Powerd
4usr/lib/*/unity8/qml/Ubuntu
5usr/lib/*/unity8/qml/Ubuntu
5usr/lib/*/unity8/qml/Unity
6usr/lib/*/unity8/qml/Unity
6usr/lib/*/unity8/qml/Utils
7usr/lib/*/unity8/qml/Utils
plugins/CMakeLists.txt+1
@@ -4,3 +4,4 @@ add_subdirectory(Unity)
4add_subdirectory(HudClient)
4add_subdirectory(HudClient)
5add_subdirectory(LightDM)
5add_subdirectory(LightDM)
6add_subdirectory(ListViewWithPageHeader)
6add_subdirectory(ListViewWithPageHeader)
7+add_subdirectory(Powerd)
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+26−8
@@ -280,7 +280,7 @@ void ListViewWithPageHeader::setSectionDelegate(QQmlComponent *delegate)
280
280
281 m_sectionDelegate = delegate;
281 m_sectionDelegate = delegate;
282
282
283− m_topSectionItem = getSectionItem(QString());
283+ m_topSectionItem = getSectionItem(-1, QString());
284 m_topSectionItem->setZ(3);
284 m_topSectionItem->setZ(3);
285 QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);
285 QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);
286
286
@@ -599,16 +599,17 @@ QQuickItem *ListViewWithPageHeader::getSectionItem(int modelIndex, bool alreadyI
599 }
599 }
600 }
600 }
601
601
602− return getSectionItem(section);
602+ return getSectionItem(modelIndex, section);
603}
603}
604
604
605−QQuickItem *ListViewWithPageHeader::getSectionItem(const QString &sectionText)
605+QQuickItem *ListViewWithPageHeader::getSectionItem(int modelIndex, const QString &sectionText)
606{
606{
607 QQuickItem *sectionItem = nullptr;
607 QQuickItem *sectionItem = nullptr;
608
608
609 QQmlContext *creationContext = m_sectionDelegate->creationContext();
609 QQmlContext *creationContext = m_sectionDelegate->creationContext();
610 QQmlContext *context = new QQmlContext(creationContext ? creationContext : qmlContext(this));
610 QQmlContext *context = new QQmlContext(creationContext ? creationContext : qmlContext(this));
611 context->setContextProperty(QLatin1String("section"), sectionText);
611 context->setContextProperty(QLatin1String("section"), sectionText);
612+ context->setContextProperty(QLatin1String("delegateIndex"), modelIndex);
612 QObject *nobj = m_sectionDelegate->beginCreate(context);
613 QObject *nobj = m_sectionDelegate->beginCreate(context);
613 if (nobj) {
614 if (nobj) {
614 QQml_setParent_noEvent(context, nobj);
615 QQml_setParent_noEvent(context, nobj);
@@ -932,6 +933,14 @@ void ListViewWithPageHeader::onModelUpdated(const QQmlChangeSet &changeSet, bool
932 adjustMinYExtent();
933 adjustMinYExtent();
933 }
934 }
934
935
936+ for (int i = 0; i < m_visibleItems.count(); ++i) {
937+ ListItem *item = m_visibleItems[i];
938+ if (item->m_sectionItem) {
939+ QQmlContext *context = QQmlEngine::contextForObject(item->m_sectionItem)->parentContext();
940+ context->setContextProperty(QLatin1String("delegateIndex"), m_firstVisibleIndex + i);
941+ }
942+ }
943+
935 layout();
944 layout();
936 polish();
945 polish();
937 m_contentHeightDirty = true;
946 m_contentHeightDirty = true;
@@ -1037,11 +1046,6 @@ void ListViewWithPageHeader::layout()
1037 if (!cull && firstReallyVisibleItem == -1) {
1046 if (!cull && firstReallyVisibleItem == -1) {
1038 firstReallyVisibleItem = modelIndex;
1047 firstReallyVisibleItem = modelIndex;
1039 if (m_topSectionItem) {
1048 if (m_topSectionItem) {
1040− // Update the top sticky section header
1041− const QString section = m_delegateModel->stringValue(modelIndex, m_sectionProperty);
1042− QQmlContext *context = QQmlEngine::contextForObject(m_topSectionItem)->parentContext();
1043− context->setContextProperty(QLatin1String("section"), section);
1044−
1045 // Positing the top section sticky item is a two step process
1049 // Positing the top section sticky item is a two step process
1046 // First we set it either we cull it (because it doesn't need to be sticked to the top)
1050 // First we set it either we cull it (because it doesn't need to be sticked to the top)
1047 // or stick it to the top
1051 // or stick it to the top
@@ -1058,8 +1062,22 @@ void ListViewWithPageHeader::layout()
1058 QQuickItemPrivate::get(item->m_sectionItem)->setCulled(false);
1062 QQuickItemPrivate::get(item->m_sectionItem)->setCulled(false);
1059 }
1063 }
1060 } else {
1064 } else {
1065+ // Update the top sticky section header
1066+ const QString section = m_delegateModel->stringValue(modelIndex, m_sectionProperty);
1067+ QQmlContext *context = QQmlEngine::contextForObject(m_topSectionItem)->parentContext();
1068+ context->setContextProperty(QLatin1String("section"), section);
1069+
1061 QQuickItemPrivate::get(m_topSectionItem)->setCulled(false);
1070 QQuickItemPrivate::get(m_topSectionItem)->setCulled(false);
1062 m_topSectionItem->setY(topSectionStickPos);
1071 m_topSectionItem->setY(topSectionStickPos);
1072+ int delegateIndex = modelIndex;
1073+ // Look for the first index with this section text
1074+ while (delegateIndex > 0) {
1075+ const QString prevSection = m_delegateModel->stringValue(delegateIndex - 1, m_sectionProperty);
1076+ if (prevSection != section)
1077+ break;
1078+ delegateIndex--;
1079+ }
1080+ context->setContextProperty(QLatin1String("delegateIndex"), delegateIndex);
1063 if (item->m_sectionItem) {
1081 if (item->m_sectionItem) {
1064 QQuickItemPrivate::get(item->m_sectionItem)->setCulled(true);
1082 QQuickItemPrivate::get(item->m_sectionItem)->setCulled(true);
1065 }
1083 }
plugins/ListViewWithPageHeader/listviewwithpageheader.h+1−1
@@ -152,7 +152,7 @@ private:
152 void reallyReleaseItem(ListItem *item);
152 void reallyReleaseItem(ListItem *item);
153 void updateWatchedRoles();
153 void updateWatchedRoles();
154 QQuickItem *getSectionItem(int modelIndex, bool alreadyInserted);
154 QQuickItem *getSectionItem(int modelIndex, bool alreadyInserted);
155− QQuickItem *getSectionItem(const QString &sectionText);
155+ QQuickItem *getSectionItem(int modelIndex, const QString &sectionText);
156
156
157#if (QT_VERSION < QT_VERSION_CHECK(5, 1, 0))
157#if (QT_VERSION < QT_VERSION_CHECK(5, 1, 0))
158 QQuickVisualDataModel *m_delegateModel;
158 QQuickVisualDataModel *m_delegateModel;
plugins/Powerd/CMakeLists.txtnew file+13
@@ -0,0 +1,13 @@
1+include(Plugins)
2+
3+add_definitions(-DSM_BUSNAME=systemBus)
4+
5+add_library(Powerd-qml MODULE
6+ plugin.cpp
7+ Powerd.cpp
8+ )
9+
10+qt5_use_modules(Powerd-qml DBus Qml)
11+
12+export_qmlfiles(Powerd Powerd)
13+export_qmlplugin(Powerd 0.1 Powerd TARGETS Powerd-qml)
plugins/Powerd/Powerd.cppnew file+36
@@ -0,0 +1,36 @@
1+/*
2+ * Copyright (C) 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 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 General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ *
16+ * Author: Michael Terry <michael.terry@canonical.com>
17+ */
18+
19+#include "Powerd.h"
20+
21+Powerd::Powerd(QObject* parent)
22+ : QObject(parent),
23+ powerd(NULL)
24+{
25+ powerd = new QDBusInterface("com.canonical.powerd",
26+ "/com/canonical/powerd",
27+ "com.canonical.powerd",
28+ QDBusConnection::SM_BUSNAME(), this);
29+
30+ powerd->connection().connect("com.canonical.powerd",
31+ "/com/canonical/powerd",
32+ "com.canonical.powerd",
33+ "SysPowerStateChange",
34+ this,
35+ SIGNAL(powerStateChange(int)));
36+}
plugins/Powerd/Powerd.hnew file+40
@@ -0,0 +1,40 @@
1+/*
2+ * Copyright (C) 2012,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 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 General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ *
16+ * Authors: Gerry Boland <gerry.boland@canonical.com>
17+ * Michael Terry <michael.terry@canonical.com>
18+ */
19+
20+#ifndef UNITY_POWERD_H
21+#define UNITY_POWERD_H
22+
23+#include <QtCore/QObject>
24+#include <QtDBus/QDBusInterface>
25+
26+class Powerd: public QObject
27+{
28+ Q_OBJECT
29+
30+public:
31+ explicit Powerd(QObject *parent = 0);
32+
33+Q_SIGNALS:
34+ void powerStateChange(int state);
35+
36+private:
37+ QDBusInterface *powerd;
38+};
39+
40+#endif
plugins/Powerd/plugin.cppnew file+36
@@ -0,0 +1,36 @@
1+/*
2+ * Copyright (C) 2012,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 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 General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ *
16+ * Authors: Gerry Boland <gerry.boland@canonical.com>
17+ * Michael Terry <michael.terry@canonical.com>
18+ */
19+
20+#include "plugin.h"
21+#include "Powerd.h"
22+
23+#include <QtQml/QtQml>
24+
25+static QObject *powerd_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
26+{
27+ Q_UNUSED(engine)
28+ Q_UNUSED(scriptEngine)
29+ return new Powerd();
30+}
31+
32+void PowerdPlugin::registerTypes(const char *uri)
33+{
34+ Q_ASSERT(uri == QLatin1String("Powerd"));
35+ qmlRegisterSingletonType<Powerd>(uri, 0, 1, "Powerd", powerd_provider);
36+}
plugins/Powerd/plugin.hnew file+35
@@ -0,0 +1,35 @@
1+/*
2+ * Copyright (C) 2012,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 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 General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ *
16+ * Authors: Gerry Boland <gerry.boland@canonical.com>
17+ * Michael Terry <michael.terry@canonical.com>
18+ */
19+
20+#ifndef POWER_PLUGIN_H
21+#define POWER_PLUGIN_H
22+
23+#include <QtQml/QQmlEngine>
24+#include <QtQml/QQmlExtensionPlugin>
25+
26+class PowerdPlugin : public QQmlExtensionPlugin
27+{
28+ Q_OBJECT
29+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
30+
31+public:
32+ void registerTypes(const char *uri);
33+};
34+
35+#endif
plugins/Powerd/qmldirnew file+3
@@ -0,0 +1,3 @@
1+module Powerd
2+plugin Powerd-qml
3+typeinfo plugin.qmltypes
plugins/Unity/Indicators/CMakeLists.txt+1
@@ -24,6 +24,7 @@ set(IndicatorsQML_SOURCES
24 indicatorsmanager.cpp
24 indicatorsmanager.cpp
25 indicatorsmodel.cpp
25 indicatorsmodel.cpp
26 menucontentactivator.cpp
26 menucontentactivator.cpp
27+ modelprinter.cpp
27 plugin.cpp
28 plugin.cpp
28)
29)
29add_definitions(-DUNITYINDICATORS_LIBRARY)
30add_definitions(-DUNITYINDICATORS_LIBRARY)
plugins/Unity/Indicators/modelprinter.cppnew file+114
@@ -0,0 +1,114 @@
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+// self
21+#include "modelprinter.h"
22+
23+// Qt
24+#include <QTextStream>
25+
26+ModelPrinter::ModelPrinter(QObject *parent)
27+ : QObject(parent)
28+ , m_model(NULL)
29+{
30+}
31+
32+void ModelPrinter::setSourceModel(QAbstractItemModel * sourceModel)
33+{
34+ if (m_model != NULL) {
35+ disconnect(m_model);
36+ }
37+ if (m_model != sourceModel) {
38+ m_model = sourceModel;
39+ Q_EMIT modelChanged();
40+ Q_EMIT textChanged();
41+ }
42+ if (m_model != NULL) {
43+ connect(m_model, SIGNAL(modelReset()), this, SIGNAL(textChanged()));
44+ connect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SIGNAL(textChanged()));
45+ connect(m_model, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SIGNAL(textChanged()));
46+ }
47+}
48+
49+QAbstractItemModel* ModelPrinter::sourceModel() const
50+{
51+ return m_model;
52+}
53+
54+QString ModelPrinter::text(const QModelIndex& index) const
55+{
56+ return recurseString(index, 0);
57+}
58+
59+QString tabify(int level) { QString str;
60+ for (int i = 0; i < level; i++) {
61+ str += " ";
62+ }
63+ return str;
64+}
65+
66+QString ModelPrinter::recurseString(const QModelIndex& index, int level) const
67+{
68+ if (!m_model)
69+ return "";
70+
71+ QString str;
72+ QTextStream stream(&str);
73+
74+ QHash<int, QByteArray> roleNames = m_model->roleNames();
75+ QList<int> roles = roleNames.keys();
76+ qSort(roles);
77+ Q_FOREACH(int role, roles) {
78+ QVariant vData = m_model->data(index, role);
79+ if (vData.canConvert(QMetaType::QVariantMap)) {
80+ QMapIterator<QString, QVariant> iter(vData.toMap());
81+ while (iter.hasNext()) {
82+ iter.next();
83+ stream << tabify(level)
84+ << roleNames[role]
85+ << "."
86+ << iter.key()
87+ << ": "
88+ << iter.value().toString()
89+ << endl;
90+ }
91+ }
92+ else {
93+ stream << tabify(level)
94+ << roleNames[role]
95+ << ": "
96+ << vData.toString()
97+ << endl;
98+ }
99+ }
100+
101+ int rowCount = m_model->rowCount(index);
102+ stream << tabify(level)
103+ << "child count"
104+ << ": "
105+ << rowCount
106+ << endl
107+ << endl;
108+
109+ for (int i = 0; i < rowCount; i++) {
110+ QModelIndex child = m_model->index(i, 0, index);
111+ str += recurseString(child, level+1);
112+ }
113+ return str;
114+}
plugins/Unity/Indicators/modelprinter.hnew file+50
@@ -0,0 +1,50 @@
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+#ifndef MODELPRINTER_H
21+#define MODELPRINTER_H
22+
23+#include <QSortFilterProxyModel>
24+
25+// This class acts as a namespace only, with the addition that its enums
26+// are registered to be exposed on the QML side.
27+class ModelPrinter : public QObject
28+{
29+ Q_OBJECT
30+
31+ Q_PROPERTY(QAbstractItemModel* model READ sourceModel WRITE setSourceModel NOTIFY modelChanged)
32+ Q_PROPERTY(QString text READ text NOTIFY textChanged)
33+public:
34+ ModelPrinter(QObject* parent=0);
35+
36+ void setSourceModel(QAbstractItemModel* sourceModel);
37+ QAbstractItemModel* sourceModel() const;
38+
39+ Q_INVOKABLE QString text(const QModelIndex& index = QModelIndex()) const;
40+
41+Q_SIGNALS:
42+ void modelChanged();
43+ void textChanged();
44+
45+private:
46+ QString recurseString(const QModelIndex& index, int level) const;
47+ QAbstractItemModel* m_model;
48+};
49+
50+#endif // MODELPRINTER_H
plugins/Unity/Indicators/plugin.cpp+2
@@ -28,6 +28,7 @@
28#include "indicatorsmodel.h"
28#include "indicatorsmodel.h"
29#include "indicators.h"
29#include "indicators.h"
30#include "menucontentactivator.h"
30#include "menucontentactivator.h"
31+#include "modelprinter.h"
31
32
32void IndicatorsPlugin::registerTypes(const char *uri)
33void IndicatorsPlugin::registerTypes(const char *uri)
33{
34{
@@ -36,6 +37,7 @@ void IndicatorsPlugin::registerTypes(const char *uri)
36 qmlRegisterType<IndicatorsManager>(uri, 0, 1, "IndicatorsManager");
37 qmlRegisterType<IndicatorsManager>(uri, 0, 1, "IndicatorsManager");
37 qmlRegisterType<FlatMenuProxyModel>(uri, 0, 1, "FlatMenuProxyModel");
38 qmlRegisterType<FlatMenuProxyModel>(uri, 0, 1, "FlatMenuProxyModel");
38 qmlRegisterType<IndicatorsModel>(uri, 0, 1, "IndicatorsModel");
39 qmlRegisterType<IndicatorsModel>(uri, 0, 1, "IndicatorsModel");
40+ qmlRegisterType<ModelPrinter>(uri, 0, 1, "ModelPrinter");
39 qmlRegisterType<MenuContentActivator>(uri, 0, 1, "MenuContentActivator");
41 qmlRegisterType<MenuContentActivator>(uri, 0, 1, "MenuContentActivator");
40
42
41 qmlRegisterUncreatableType<MenuContentState>(uri, 0, 1, "MenuContentState", "Can't create MenuContentState class");
43 qmlRegisterUncreatableType<MenuContentState>(uri, 0, 1, "MenuContentState", "Can't create MenuContentState class");
plugins/Unity/scope.h−3
@@ -29,9 +29,6 @@
29#include <UnityCore/Scope.h>
29#include <UnityCore/Scope.h>
30#include <UnityCore/Results.h>
30#include <UnityCore/Results.h>
31
31
32−// dee-qt
33−#include "deelistmodel.h"
34−
35#include "categories.h"
32#include "categories.h"
36
33
37class Preview;
34class Preview;
po/ar.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/az.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/bg.po+2−2
@@ -15,8 +15,8 @@ msgstr ""
15"MIME-Version: 1.0\n"
15"MIME-Version: 1.0\n"
16"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Type: text/plain; charset=UTF-8\n"
17"Content-Transfer-Encoding: 8bit\n"
17"Content-Transfer-Encoding: 8bit\n"
18−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
18+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
19−"X-Generator: Launchpad (build 16696)\n"
19+"X-Generator: Launchpad (build 16718)\n"
20
20
21#: Applications/applications.js:23
21#: Applications/applications.js:23
22msgid "Phone"
22msgid "Phone"
po/ca.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/de.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/el.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/en_AU.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/en_GB.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/eo.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/es.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/fi.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/fo.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/fr.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/gl.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/he.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/hr.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/hu.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/hy.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/id.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/it.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/ja.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/kn.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/ko.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/ky.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/lv.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/my.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/nb.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/nl.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/pl.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/pt_BR.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/ro.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/ru.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/si.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/sl.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/sr.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/sv.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/te.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/tr.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/ug.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/uk.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-22 06:19+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/zh_CN.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
po/zh_TW.po+2−2
@@ -14,8 +14,8 @@ msgstr ""
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2013-07-17 07:49+0000\n"
17+"X-Launchpad-Export-Date: 2013-07-31 06:28+0000\n"
18−"X-Generator: Launchpad (build 16696)\n"
18+"X-Generator: Launchpad (build 16718)\n"
19
19
20#: Applications/applications.js:23
20#: Applications/applications.js:23
21msgid "Phone"
21msgid "Phone"
tests/autopilot/unity8/indicators_client/tests/test_battery.py+1−1
@@ -26,7 +26,7 @@ class TestDisplayMenus(IndicatorsTestCase):
26 self.pointing_device.move_to_object(self.main_window.get_battery_menu())
26 self.pointing_device.move_to_object(self.main_window.get_battery_menu())
27 self.pointing_device.click()
27 self.pointing_device.click()
28
28
29− fn_loader = lambda: self.app.select_single("IndicatorsPage/QQuickLoader", objectName="page_loader");
29+ fn_loader = lambda: self.app.select_single("IndicatorsPage/QQuickLoader", objectName="pageLoader");
30 self.assertThat(fn_loader, Eventually(NotEquals(None)));
30 self.assertThat(fn_loader, Eventually(NotEquals(None)));
31 page_loader = fn_loader();
31 page_loader = fn_loader();
32 self.assertThat(page_loader.progress, Eventually(Equals(1.0)))
32 self.assertThat(page_loader.progress, Eventually(Equals(1.0)))
tests/autopilot/unity8/shell/emulators/greeter.py+4−1
@@ -25,7 +25,7 @@ class Greeter(UnityEmulatorBase):
25
25
26 """An emulator that understands the greeter screen."""
26 """An emulator that understands the greeter screen."""
27
27
28− def unlock(self):
28+ def swipe(self):
29 """Swipe the greeter screen away."""
29 """Swipe the greeter screen away."""
30 self.created.wait_for(True)
30 self.created.wait_for(True)
31 touch = Touch.create()
31 touch = Touch.create()
@@ -38,3 +38,6 @@ class Greeter(UnityEmulatorBase):
38 touch.drag(start_x, start_y, stop_x, stop_y)
38 touch.drag(start_x, start_y, stop_x, stop_y)
39
39
40 self.created.wait_for(False)
40 self.created.wait_for(False)
41+
42+ def get_prompt(self):
43+ return self.select_single("TextField", objectName="passwordInput")
tests/autopilot/unity8/shell/emulators/hud.py+4−7
@@ -38,13 +38,10 @@ class Hud(UnityEmulatorBase):
38 window = self.get_root_instance().select_single('QQuickView')
38 window = self.get_root_instance().select_single('QQuickView')
39 hud_show_button = window.select_single("HudButton")
39 hud_show_button = window.select_single("HudButton")
40
40
41− start_x = int(window.x + (window.width / 2))
41+ swipe_coords = self.get_button_swipe_coords(window, hud_show_button)
42− end_x = start_x
43− start_y = window.y + window.height
44− end_y = int(hud_show_button.y + (hud_show_button.height/2))
45
42
46− touch.press(start_x, start_y)
43+ touch.press(swipe_coords.start_x, swipe_coords.start_y)
47− touch._finger_move(end_x, end_y)
44+ touch._finger_move(swipe_coords.end_x, swipe_coords.end_y)
48 try:
45 try:
49 hud_show_button.opacity.wait_for(1.0)
46 hud_show_button.opacity.wait_for(1.0)
50 touch.release()
47 touch.release()
@@ -78,6 +75,6 @@ class Hud(UnityEmulatorBase):
78 start_x = int(main_view.x + (main_view.width / 2))
75 start_x = int(main_view.x + (main_view.width / 2))
79 end_x = start_x
76 end_x = start_x
80 start_y = main_view.y + (main_view.height - 3)
77 start_y = main_view.y + (main_view.height - 3)
81− end_y = int(hud_show_button.y + (hud_show_button.height/2))
78+ end_y = main_view.y + int(hud_show_button.y + (hud_show_button.height/2))
82
79
83 return SwipeCoords(start_x, end_x, start_y, end_y)
80 return SwipeCoords(start_x, end_x, start_y, end_y)
tests/autopilot/unity8/shell/emulators/main_window.py+1−1
@@ -89,4 +89,4 @@ class MainWindow(object):
89 return self.app.select_single("Lockscreen")
89 return self.app.select_single("Lockscreen")
90
90
91 def get_pinentryField(self):
91 def get_pinentryField(self):
92− return self.app.select_single("TextField", objectName="pinentryField")
92+ return self.app.select_single(objectName="pinentryField")
tests/autopilot/unity8/shell/tests/test_hud.py+5−5
@@ -37,7 +37,7 @@ class TestHud(UnityTestCase):
37
37
38 """
38 """
39 self.launch_unity()
39 self.launch_unity()
40− self.main_window.get_greeter().unlock()
40+ self.main_window.get_greeter().swipe()
41 window = self.main_window.get_qml_view()
41 window = self.main_window.get_qml_view()
42 hud_show_button = self.main_window.get_hud_show_button()
42 hud_show_button = self.main_window.get_hud_show_button()
43 hud = self.main_window.get_hud()
43 hud = self.main_window.get_hud()
@@ -58,7 +58,7 @@ class TestHud(UnityTestCase):
58
58
59 """
59 """
60 self.launch_unity()
60 self.launch_unity()
61− self.main_window.get_greeter().unlock()
61+ self.main_window.get_greeter().swipe()
62 window = self.main_window.get_qml_view()
62 window = self.main_window.get_qml_view()
63 hud_show_button = self.main_window.get_hud_show_button()
63 hud_show_button = self.main_window.get_hud_show_button()
64 hud = self.main_window.get_hud()
64 hud = self.main_window.get_hud()
@@ -81,7 +81,7 @@ class TestHud(UnityTestCase):
81 def test_hide_hud_click(self):
81 def test_hide_hud_click(self):
82 """Tapping the close button of the Hud must dismiss it."""
82 """Tapping the close button of the Hud must dismiss it."""
83 self.launch_unity()
83 self.launch_unity()
84− self.main_window.get_greeter().unlock()
84+ self.main_window.get_greeter().swipe()
85 hud = self.main_window.get_hud()
85 hud = self.main_window.get_hud()
86
86
87 self._launch_test_app_from_app_screen()
87 self._launch_test_app_from_app_screen()
@@ -97,7 +97,7 @@ class TestHud(UnityTestCase):
97
97
98 """
98 """
99 self.launch_unity()
99 self.launch_unity()
100− self.main_window.get_greeter().unlock()
100+ self.main_window.get_greeter().swipe()
101 hud = self.main_window.get_hud()
101 hud = self.main_window.get_hud()
102 window = self.main_window.get_qml_view()
102 window = self.main_window.get_qml_view()
103
103
@@ -114,7 +114,7 @@ class TestHud(UnityTestCase):
114 def test_launcher_hides_hud(self):
114 def test_launcher_hides_hud(self):
115 """Opening the Launcher while the Hud is active must close the Hud."""
115 """Opening the Launcher while the Hud is active must close the Hud."""
116 self.launch_unity()
116 self.launch_unity()
117− self.main_window.get_greeter().unlock()
117+ self.main_window.get_greeter().swipe()
118 hud = self.main_window.get_hud()
118 hud = self.main_window.get_hud()
119 launcher = self.main_window.get_launcher()
119 launcher = self.main_window.get_launcher()
120
120
tests/autopilot/unity8/shell/tests/test_lock_screen.py+58−26
@@ -40,52 +40,68 @@ class TestLockscreen(UnityTestCase):
40 """Must be able to unlock the PIN entry lock screen."""
40 """Must be able to unlock the PIN entry lock screen."""
41 self.launch_unity()
41 self.launch_unity()
42 greeter = self.main_window.get_greeter()
42 greeter = self.main_window.get_greeter()
43− greeter.unlock()
44
43
44+ if greeter.narrowMode:
45+ greeter.swipe()
45− lockscreen = self._wait_for_lockscreen()
46+ lockscreen = self._wait_for_lockscreen()
46− self._enter_pincode("1234")
47+ self._enter_pincode("1234")
47−
48+ self.assertThat(lockscreen.shown, Eventually(Equals(False)))
49+ else:
50+ self._enter_prompt_passphrase("1234")
48− self.assertThat(lockscreen.shown, Eventually(Equals(False)))
51+ self.assertThat(greeter.shown, Eventually(Equals(False)))
49
52
50 @with_lightdm_mock("single-passphrase")
53 @with_lightdm_mock("single-passphrase")
51 def test_can_unlock_passphrase_screen(self):
54 def test_can_unlock_passphrase_screen(self):
52 """Must be able to unlock the passphrase entry screen."""
55 """Must be able to unlock the passphrase entry screen."""
53 self.launch_unity()
56 self.launch_unity()
54 greeter = self.main_window.get_greeter()
57 greeter = self.main_window.get_greeter()
55− greeter.unlock()
56−
57− lockscreen = self._wait_for_lockscreen()
58− self._enter_passphrase("password")
59
58
59+ if greeter.narrowMode:
60+ greeter.swipe()
61+ lockscreen = self._wait_for_lockscreen()
62+ self._enter_pin_passphrase("password")
60− self.assertThat(lockscreen.shown, Eventually(Equals(False)))
63+ self.assertThat(lockscreen.shown, Eventually(Equals(False)))
64+ else:
65+ self._enter_prompt_passphrase("password")
66+ self.assertThat(greeter.shown, Eventually(Equals(False)))
61
67
62 @with_lightdm_mock("single-pin")
68 @with_lightdm_mock("single-pin")
63 def test_pin_screen_wrong_code(self):
69 def test_pin_screen_wrong_code(self):
64 """Entering the wrong pin code must not dismiss the lock screen."""
70 """Entering the wrong pin code must not dismiss the lock screen."""
65 self.launch_unity()
71 self.launch_unity()
66 greeter = self.main_window.get_greeter()
72 greeter = self.main_window.get_greeter()
67− greeter.unlock()
68−
69− lockscreen = self._wait_for_lockscreen()
70− self._enter_pincode("4321")
71
73
74+ if greeter.narrowMode:
75+ greeter.swipe()
76+ lockscreen = self._wait_for_lockscreen()
77+ self._enter_pincode("4321")
72− pinentryField = self.main_window.get_pinentryField()
78+ pinentryField = self.main_window.get_pinentryField()
73− self.assertThat(pinentryField.text, Eventually(Equals("")))
79+ self.assertThat(pinentryField.text, Eventually(Equals("")))
80+ self.assertThat(lockscreen.shown, Eventually(Equals(True)))
81+ else:
82+ self._enter_prompt_passphrase("4231")
83+ prompt = self.main_window.get_greeter().get_prompt()
84+ self.assertThat(prompt.text, Eventually(Equals("")))
74− self.assertThat(lockscreen.shown, Eventually(Equals(True)))
85+ self.assertThat(greeter.shown, Eventually(Equals(True)))
75
86
76 @with_lightdm_mock("single-passphrase")
87 @with_lightdm_mock("single-passphrase")
77 def test_passphrase_screen_wrong_password(self):
88 def test_passphrase_screen_wrong_password(self):
78 """Entering the wrong password must not dismiss the lock screen."""
89 """Entering the wrong password must not dismiss the lock screen."""
79 self.launch_unity()
90 self.launch_unity()
80 greeter = self.main_window.get_greeter()
91 greeter = self.main_window.get_greeter()
81− greeter.unlock()
82
92
93+ if greeter.narrowMode:
94+ greeter.swipe()
83− lockscreen = self._wait_for_lockscreen()
95+ lockscreen = self._wait_for_lockscreen()
84− self._enter_passphrase("foobar")
96+ self._enter_pin_passphrase("foobar")
85−
86− pinentryField = self.main_window.get_pinentryField()
97+ pinentryField = self.main_window.get_pinentryField()
87− self.assertThat(pinentryField.text, Eventually(Equals("")))
98+ self.assertThat(pinentryField.text, Eventually(Equals("")))
99+ self.assertThat(lockscreen.shown, Eventually(Equals(True)))
100+ else:
101+ self._enter_prompt_passphrase("foobar")
102+ prompt = self.main_window.get_greeter().get_prompt()
103+ self.assertThat(prompt.text, Eventually(Equals("")))
88− self.assertThat(lockscreen.shown, Eventually(Equals(True)))
104+ self.assertThat(greeter.shown, Eventually(Equals(True)))
89
105
90 def _wait_for_lockscreen(self):
106 def _wait_for_lockscreen(self):
91 """Wait for the lock screen to load, and return it."""
107 """Wait for the lock screen to load, and return it."""
@@ -114,9 +130,9 @@ class TestLockscreen(UnityTestCase):
114 )
130 )
115 self.touch.tap_object(self.main_window.get_pinPadButton(int(num)))
131 self.touch.tap_object(self.main_window.get_pinPadButton(int(num)))
116
132
117− def _enter_passphrase(self, passphrase):
133+ def _enter_pin_passphrase(self, passphrase):
118 """Enter the password specified in 'passphrase' into the password entry
134 """Enter the password specified in 'passphrase' into the password entry
119− field.
135+ field of the pin lock screen.
120
136
121 :param passphrase: The string you want to enter.
137 :param passphrase: The string you want to enter.
122 :raises: TypeError if passphrase is not a string.
138 :raises: TypeError if passphrase is not a string.
@@ -129,3 +145,19 @@ class TestLockscreen(UnityTestCase):
129 self.touch.tap_object(pinentryField)
145 self.touch.tap_object(pinentryField)
130 self.keyboard.type(passphrase)
146 self.keyboard.type(passphrase)
131 self.keyboard.type("\n")
147 self.keyboard.type("\n")
148+
149+ def _enter_prompt_passphrase(self, passphrase):
150+ """Enter the password specified in 'passphrase' into the password entry
151+ field of the main user list's prompt.
152+
153+ :param passphrase: The string you want to enter.
154+ :raises: TypeError if passphrase is not a string.
155+
156+ """
157+ if not isinstance(passphrase, basestring):
158+ raise TypeError("'passphrase' parameter must be a string.")
159+
160+ prompt = self.main_window.get_greeter().get_prompt()
161+ self.touch.tap_object(prompt)
162+ self.keyboard.type(passphrase)
163+ self.keyboard.type("\n")
tests/autopilot/unity8/shell/tests/test_notifications.py+10−10
@@ -120,7 +120,7 @@ class InteractiveNotificationBase(NotificationsBase):
120 """Interactive notification must react upon click on itself."""
120 """Interactive notification must react upon click on itself."""
121 self.launch_unity()
121 self.launch_unity()
122 greeter = self.main_window.get_greeter()
122 greeter = self.main_window.get_greeter()
123− greeter.unlock()
123+ greeter.swipe()
124
124
125 notify_list = self._get_notifications_list()
125 notify_list = self._get_notifications_list()
126
126
@@ -159,7 +159,7 @@ class InteractiveNotificationBase(NotificationsBase):
159 """Rejecting a call should make notification expand and offer more options."""
159 """Rejecting a call should make notification expand and offer more options."""
160 self.launch_unity()
160 self.launch_unity()
161 greeter = self.main_window.get_greeter()
161 greeter = self.main_window.get_greeter()
162− greeter.unlock()
162+ greeter.swipe()
163
163
164 notify_list = self._get_notifications_list()
164 notify_list = self._get_notifications_list()
165
165
@@ -335,7 +335,7 @@ class EphemeralNotificationsTests(NotificationsBase):
335 """Notification must display the expected summary and body text."""
335 """Notification must display the expected summary and body text."""
336 self.launch_unity()
336 self.launch_unity()
337 greeter = self.main_window.get_greeter()
337 greeter = self.main_window.get_greeter()
338− greeter.unlock()
338+ greeter.swipe()
339
339
340 notify_list = self._get_notifications_list()
340 notify_list = self._get_notifications_list()
341
341
@@ -369,7 +369,7 @@ class EphemeralNotificationsTests(NotificationsBase):
369 """Notification must display the expected summary and secondary icon."""
369 """Notification must display the expected summary and secondary icon."""
370 self.launch_unity()
370 self.launch_unity()
371 greeter = self.main_window.get_greeter()
371 greeter = self.main_window.get_greeter()
372− greeter.unlock()
372+ greeter.swipe()
373
373
374 notify_list = self._get_notifications_list()
374 notify_list = self._get_notifications_list()
375
375
@@ -407,7 +407,7 @@ class EphemeralNotificationsTests(NotificationsBase):
407 """Notifications must be displayed in order according to their urgency."""
407 """Notifications must be displayed in order according to their urgency."""
408 self.launch_unity()
408 self.launch_unity()
409 greeter = self.main_window.get_greeter()
409 greeter = self.main_window.get_greeter()
410− greeter.unlock()
410+ greeter.swipe()
411
411
412 notify_list = self._get_notifications_list()
412 notify_list = self._get_notifications_list()
413
413
@@ -498,7 +498,7 @@ class EphemeralNotificationsTests(NotificationsBase):
498 """Notification must display the expected summary- and body-text."""
498 """Notification must display the expected summary- and body-text."""
499 self.launch_unity()
499 self.launch_unity()
500 greeter = self.main_window.get_greeter()
500 greeter = self.main_window.get_greeter()
501− greeter.unlock()
501+ greeter.swipe()
502
502
503 notify_list = self._get_notifications_list()
503 notify_list = self._get_notifications_list()
504
504
@@ -524,7 +524,7 @@ class EphemeralNotificationsTests(NotificationsBase):
524 """Notification must display only the expected summary-text."""
524 """Notification must display only the expected summary-text."""
525 self.launch_unity()
525 self.launch_unity()
526 greeter = self.main_window.get_greeter()
526 greeter = self.main_window.get_greeter()
527− greeter.unlock()
527+ greeter.swipe()
528
528
529 notify_list = self._get_notifications_list()
529 notify_list = self._get_notifications_list()
530
530
@@ -543,7 +543,7 @@ class EphemeralNotificationsTests(NotificationsBase):
543 """Notification must allow updating its contents while being displayed."""
543 """Notification must allow updating its contents while being displayed."""
544 self.launch_unity()
544 self.launch_unity()
545 greeter = self.main_window.get_greeter()
545 greeter = self.main_window.get_greeter()
546− greeter.unlock()
546+ greeter.swipe()
547
547
548 notify_list = self._get_notifications_list()
548 notify_list = self._get_notifications_list()
549
549
@@ -582,7 +582,7 @@ class EphemeralNotificationsTests(NotificationsBase):
582 """Notification must allow updating its contents and layout while being displayed."""
582 """Notification must allow updating its contents and layout while being displayed."""
583 self.launch_unity()
583 self.launch_unity()
584 greeter = self.main_window.get_greeter()
584 greeter = self.main_window.get_greeter()
585− greeter.unlock()
585+ greeter.swipe()
586
586
587 notify_list = self._get_notifications_list()
587 notify_list = self._get_notifications_list()
588
588
@@ -628,7 +628,7 @@ class EphemeralNotificationsTests(NotificationsBase):
628 """Notification has to accumulate body-text using append-hint."""
628 """Notification has to accumulate body-text using append-hint."""
629 self.launch_unity()
629 self.launch_unity()
630 greeter = self.main_window.get_greeter()
630 greeter = self.main_window.get_greeter()
631− greeter.unlock()
631+ greeter.swipe()
632
632
633 notify_list = self._get_notifications_list()
633 notify_list = self._get_notifications_list()
634
634
tests/data/unity/backgrounds/blue.pngnew file

Binary file not shown.

tests/data/unity/backgrounds/red.pngnew file

Binary file not shown.

tests/mocks/CMakeLists.txt+1
@@ -1,3 +1,4 @@
1+add_subdirectory(GSettings)
1add_subdirectory(libusermetrics)
2add_subdirectory(libusermetrics)
2add_subdirectory(LightDM)
3add_subdirectory(LightDM)
3add_subdirectory(QMenuModel)
4add_subdirectory(QMenuModel)
tests/mocks/GSettings/CMakeLists.txtnew file+31
@@ -0,0 +1,31 @@
1+set(CMAKE_AUTOMOC ON)
2+
3+include(FindPkgConfig)
4+find_package(Qt5Core REQUIRED)
5+find_package(Qt5Quick REQUIRED)
6+
7+include_directories(
8+ ${CMAKE_CURRENT_BINARY_DIR}
9+ ${Qt5Core_INCLUDE_DIRS}
10+ ${Qt5Quick_INCLUDE_DIRS}
11+)
12+
13+add_definitions(-DQT_NO_KEYWORDS)
14+
15+set(GSettingsQML_SOURCES
16+ fake_gsettings.cpp
17+ plugin.cpp
18+)
19+
20+add_library(FakeGSettingsQml MODULE ${GSettingsQML_SOURCES})
21+target_link_libraries(FakeGSettingsQml
22+ ${Qt5Core_LIBRARIES}
23+ ${Qt5Quick_LIBRARIES}
24+)
25+
26+qt5_use_modules(FakeGSettingsQml Qml)
27+
28+# copy qmldir file into build directory for shadow builds
29+file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
30+ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
31+ )
tests/mocks/GSettings/fake_gsettings.cppnew file+102
@@ -0,0 +1,102 @@
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+
17+#include "fake_gsettings.h"
18+
19+#include <QList>
20+
21+GSettingsControllerQml* GSettingsControllerQml::s_controllerInstance = 0;
22+
23+GSettingsControllerQml::GSettingsControllerQml() {
24+}
25+
26+GSettingsControllerQml::~GSettingsControllerQml() {
27+ s_controllerInstance = 0;
28+}
29+
30+GSettingsControllerQml* GSettingsControllerQml::instance() {
31+ if(!s_controllerInstance) {
32+ s_controllerInstance = new GSettingsControllerQml();
33+ }
34+ return s_controllerInstance;
35+}
36+
37+void GSettingsControllerQml::registerSettingsObject(GSettingsQml *obj) {
38+ m_registeredGSettings.append(obj);
39+}
40+
41+void GSettingsControllerQml::unRegisterSettingsObject(GSettingsQml *obj) {
42+ m_registeredGSettings.removeOne(obj);
43+}
44+
45+void GSettingsControllerQml::setPictureUri(const QString &str) {
46+ Q_FOREACH (GSettingsQml *obj, m_registeredGSettings) {
47+ obj->setPictureUri(str);
48+ }
49+}
50+
51+GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) {
52+}
53+
54+QByteArray GSettingsSchemaQml::id() const {
55+ return m_id;
56+}
57+
58+void GSettingsSchemaQml::setId(const QByteArray &id) {
59+ if (m_id.isEmpty()) {
60+ qWarning("GSettings.schema.id may only be set on construction");
61+ return;
62+ }
63+
64+ m_id = id;
65+}
66+
67+QByteArray GSettingsSchemaQml::path() const {
68+ return m_path;
69+}
70+
71+void GSettingsSchemaQml::setPath(const QByteArray &path) {
72+ if (m_path.isEmpty()) {
73+ qWarning("GSettings.schema.path may only be set on construction");
74+ return;
75+ }
76+
77+ m_path = path;
78+}
79+
80+GSettingsQml::GSettingsQml(QObject *parent): QObject(parent) {
81+ m_schema = new GSettingsSchemaQml(this);
82+ GSettingsControllerQml::instance()->registerSettingsObject(this);
83+}
84+
85+GSettingsQml::~GSettingsQml() {
86+ GSettingsControllerQml::instance()->unRegisterSettingsObject(this);
87+}
88+
89+GSettingsSchemaQml * GSettingsQml::schema() const {
90+ return m_schema;
91+}
92+
93+QString GSettingsQml::pictureUri() const {
94+ return m_pictureUri;
95+}
96+
97+void GSettingsQml::setPictureUri(const QString &str) {
98+ if (str != m_pictureUri) {
99+ m_pictureUri = str;
100+ Q_EMIT pictureUriChanged(m_pictureUri);
101+ }
102+}
tests/mocks/GSettings/fake_gsettings.hnew file+90
@@ -0,0 +1,90 @@
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+
17+#ifndef FAKE_GSETTINGS_H
18+#define FAKE_GSETTINGS_H
19+
20+#include <QList>
21+#include <QtQml>
22+
23+class GSettingsSchemaQml: public QObject
24+{
25+ Q_OBJECT
26+
27+ Q_PROPERTY(QByteArray id READ id WRITE setId)
28+
29+public:
30+ GSettingsSchemaQml(QObject *parent = NULL);
31+
32+ QByteArray id() const;
33+ void setId(const QByteArray &id);
34+
35+ QByteArray path() const;
36+ void setPath(const QByteArray &path);
37+
38+private:
39+ QByteArray m_id;
40+ QByteArray m_path;
41+};
42+
43+class GSettingsQml: public QObject
44+{
45+ Q_OBJECT
46+
47+ Q_PROPERTY(GSettingsSchemaQml* schema READ schema NOTIFY schemaChanged)
48+ Q_PROPERTY(QString pictureUri READ pictureUri WRITE setPictureUri NOTIFY pictureUriChanged)
49+
50+public:
51+ GSettingsQml(QObject *parent = NULL);
52+ ~GSettingsQml();
53+
54+ GSettingsSchemaQml * schema() const;
55+ QString pictureUri() const;
56+
57+ void setPictureUri(const QString &str);
58+
59+Q_SIGNALS:
60+ void schemaChanged();
61+ void pictureUriChanged(const QString&);
62+
63+private:
64+ GSettingsSchemaQml* m_schema;
65+
66+ QString m_pictureUri;
67+
68+ friend class GSettingsSchemaQml;
69+};
70+
71+class GSettingsControllerQml: public QObject
72+{
73+ Q_OBJECT
74+
75+public:
76+ static GSettingsControllerQml* instance();
77+ ~GSettingsControllerQml();
78+
79+ void registerSettingsObject(GSettingsQml *obj);
80+ void unRegisterSettingsObject(GSettingsQml *obj);
81+ Q_INVOKABLE void setPictureUri(const QString &str);
82+
83+private:
84+ GSettingsControllerQml();
85+
86+ static GSettingsControllerQml* s_controllerInstance;
87+ QList<GSettingsQml *> m_registeredGSettings;
88+};
89+
90+#endif // FAKE_GSETTINGS_H
tests/mocks/GSettings/plugin.cppnew file+33
@@ -0,0 +1,33 @@
1+/*
2+ * Copyright (C) 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 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 General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include "plugin.h"
18+#include "fake_gsettings.h"
19+
20+#include <QtQml>
21+
22+static QObject* controllerProvider(QQmlEngine* /* engine */, QJSEngine* /* scriptEngine */)
23+{
24+ return GSettingsControllerQml::instance();
25+}
26+
27+void FakeGSettingsQmlPlugin::registerTypes(const char *uri)
28+{
29+ qmlRegisterSingletonType<GSettingsControllerQml>(uri, 1, 0, "GSettingsController", controllerProvider);
30+ qmlRegisterType<GSettingsQml>(uri, 1, 0, "GSettings");
31+ qmlRegisterUncreatableType<GSettingsSchemaQml>(uri, 1, 0, "GSettingsSchema",
32+ "GSettingsSchema can only be used inside of a GSettings component");
33+}
tests/mocks/GSettings/plugin.hnew file+31
@@ -0,0 +1,31 @@
1+/*
2+ * Copyright (C) 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 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 General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#ifndef PLUGIN_H
18+#define PLUGIN_H
19+
20+#include <QtQml/QQmlExtensionPlugin>
21+
22+class FakeGSettingsQmlPlugin : public QQmlExtensionPlugin
23+{
24+ Q_OBJECT
25+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26+
27+public:
28+ void registerTypes(const char *uri);
29+};
30+
31+#endif // PLUGIN_H
tests/mocks/GSettings/qmldirnew file+2
@@ -0,0 +1,2 @@
1+module GSettings
2+plugin FakeGSettingsQml
tests/mocks/LightDM/single/GreeterPrivate.cpp+2−4
@@ -34,10 +34,8 @@ void GreeterPrivate::handleAuthenticate()
34{
34{
35 Q_Q(Greeter);
35 Q_Q(Greeter);
36
36
37− if (authenticationUser == "one") {
38− authenticated = true;
37+ authenticated = true;
39− Q_EMIT q->authenticationComplete();
38+ Q_EMIT q->authenticationComplete();
40− }
41}
39}
42
40
43void GreeterPrivate::handleRespond(QString const &response)
41void GreeterPrivate::handleRespond(QString const &response)
tests/mocks/Ubuntu/Application/ApplicationManager.h+4
@@ -46,6 +46,8 @@ class ApplicationManager : public QObject {
46 Q_PROPERTY(ApplicationInfo* sideStageFocusedApplication READ sideStageFocusedApplication
46 Q_PROPERTY(ApplicationInfo* sideStageFocusedApplication READ sideStageFocusedApplication
47 NOTIFY sideStageFocusedApplicationChanged)
47 NOTIFY sideStageFocusedApplicationChanged)
48
48
49+ Q_PROPERTY(bool fake READ fake CONSTANT)
50+
49 public:
51 public:
50 ApplicationManager(QObject *parent = NULL);
52 ApplicationManager(QObject *parent = NULL);
51 virtual ~ApplicationManager();
53 virtual ~ApplicationManager();
@@ -80,6 +82,8 @@ class ApplicationManager : public QObject {
80 ApplicationInfo* mainStageFocusedApplication() const;
82 ApplicationInfo* mainStageFocusedApplication() const;
81 ApplicationInfo* sideStageFocusedApplication() const;
83 ApplicationInfo* sideStageFocusedApplication() const;
82
84
85+ bool fake() { return true; }
86+
83 Q_INVOKABLE void focusApplication(int handle);
87 Q_INVOKABLE void focusApplication(int handle);
84 Q_INVOKABLE void unfocusCurrentApplication(StageHint stageHint);
88 Q_INVOKABLE void unfocusCurrentApplication(StageHint stageHint);
85 Q_INVOKABLE ApplicationInfo* startProcess(QString desktopFile,
89 Q_INVOKABLE ApplicationInfo* startProcess(QString desktopFile,
tests/mocks/Unity/Indicators/qml/fake_menu_page1.qml−8
@@ -32,13 +32,5 @@ Indicators.FakeMenuPage {
32 horizontalCenter: parent.horizontalCenter
32 horizontalCenter: parent.horizontalCenter
33 verticalCenter: parent.verticalCenter
33 verticalCenter: parent.verticalCenter
34 }
34 }
35−
36− NumberAnimation on rotation {
37− id: rotation_animation
38− from: 0
39− to: 360
40− duration: 5000
41− loops: Animation.Infinite
42− }
43 }
35 }
44}
36}
tests/mocks/Unity/Indicators/qml/fake_menu_page2.qml−8
@@ -32,13 +32,5 @@ Indicators.FakeMenuPage {
32 horizontalCenter: parent.horizontalCenter
32 horizontalCenter: parent.horizontalCenter
33 verticalCenter: parent.verticalCenter
33 verticalCenter: parent.verticalCenter
34 }
34 }
35−
36− NumberAnimation on rotation {
37− id: rotation_animation
38− from: 0
39− to: 360
40− duration: 5000
41− loops: Animation.Infinite
42− }
43 }
35 }
44}
36}
tests/mocks/Unity/Indicators/qml/fake_menu_page3.qml−8
@@ -32,13 +32,5 @@ Indicators.FakeMenuPage {
32 horizontalCenter: parent.horizontalCenter
32 horizontalCenter: parent.horizontalCenter
33 verticalCenter: parent.verticalCenter
33 verticalCenter: parent.verticalCenter
34 }
34 }
35−
36− NumberAnimation on rotation {
37− id: rotation_animation
38− from: 0
39− to: 360
40− duration: 5000
41− loops: Animation.Infinite
42− }
43 }
35 }
44}
36}
tests/mocks/Unity/Indicators/qml/fake_menu_page4.qml−8
@@ -32,13 +32,5 @@ Indicators.FakeMenuPage {
32 horizontalCenter: parent.horizontalCenter
32 horizontalCenter: parent.horizontalCenter
33 verticalCenter: parent.verticalCenter
33 verticalCenter: parent.verticalCenter
34 }
34 }
35−
36− NumberAnimation on rotation {
37− id: rotation_animation
38− from: 0
39− to: 360
40− duration: 5000
41− loops: Animation.Infinite
42− }
43 }
35 }
44}
36}
tests/mocks/Unity/Indicators/qml/fake_menu_page5.qml−8
@@ -32,13 +32,5 @@ Indicators.FakeMenuPage {
32 horizontalCenter: parent.horizontalCenter
32 horizontalCenter: parent.horizontalCenter
33 verticalCenter: parent.verticalCenter
33 verticalCenter: parent.verticalCenter
34 }
34 }
35−
36− NumberAnimation on rotation {
37− id: rotation_animation
38− from: 0
39− to: 360
40− duration: 5000
41− loops: Animation.Infinite
42− }
43 }
35 }
44}
36}
tests/plugins/ListViewWithPageHeader/listviewwithpageheadertestsection.cpp+51−2
@@ -45,6 +45,7 @@ private:
45 QCOMPARE(section(lvwph->m_visibleItems[visibleIndex]->m_sectionItem), sectionHeader);
45 QCOMPARE(section(lvwph->m_visibleItems[visibleIndex]->m_sectionItem), sectionHeader);
46 if (!sectionHeader.isNull()) {
46 if (!sectionHeader.isNull()) {
47 QCOMPARE(QQuickItemPrivate::get(lvwph->m_visibleItems[visibleIndex]->m_sectionItem)->culled, sectionHeaderCulled);
47 QCOMPARE(QQuickItemPrivate::get(lvwph->m_visibleItems[visibleIndex]->m_sectionItem)->culled, sectionHeaderCulled);
48+ QCOMPARE(sectionDelegateIndex(lvwph->m_visibleItems[visibleIndex]->m_sectionItem), lvwph->m_firstVisibleIndex + visibleIndex);
48 }
49 }
49 }
50 }
50
51
@@ -116,6 +117,11 @@ private:
116 return item ? QQmlEngine::contextForObject(item)->parentContext()->contextProperty(QLatin1String("section")).toString() : QString();
117 return item ? QQmlEngine::contextForObject(item)->parentContext()->contextProperty(QLatin1String("section")).toString() : QString();
117 }
118 }
118
119
120+ int sectionDelegateIndex(QQuickItem *item)
121+ {
122+ return item ? QQmlEngine::contextForObject(item)->parentContext()->contextProperty(QLatin1String("delegateIndex")).toInt() : -1;
123+ }
124+
119private Q_SLOTS:
125private Q_SLOTS:
120
126
121 void initTestCase()
127 void initTestCase()
@@ -220,6 +226,7 @@ private Q_SLOTS:
220 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
226 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
221 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
227 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
222 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
228 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
229+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 1);
223 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
230 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
224 }
231 }
225
232
@@ -241,6 +248,7 @@ private Q_SLOTS:
241 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
248 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
242 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
249 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
243 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
250 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
251+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
244 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
252 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
245 }
253 }
246
254
@@ -262,6 +270,7 @@ private Q_SLOTS:
262 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
270 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
263 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
271 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
264 QCOMPARE(section(lvwph->m_topSectionItem), QString("Agressive"));
272 QCOMPARE(section(lvwph->m_topSectionItem), QString("Agressive"));
273+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 0);
265 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
274 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
266
275
267 changeContentY(-30);
276 changeContentY(-30);
@@ -280,6 +289,7 @@ private Q_SLOTS:
280 QCOMPARE(lvwph->m_headerItemShownHeight, 30.);
289 QCOMPARE(lvwph->m_headerItemShownHeight, 30.);
281 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
290 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
282 QCOMPARE(section(lvwph->m_topSectionItem), QString("Agressive"));
291 QCOMPARE(section(lvwph->m_topSectionItem), QString("Agressive"));
292+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 0);
283 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
293 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
284 }
294 }
285
295
@@ -335,6 +345,7 @@ private Q_SLOTS:
335 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
345 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
336 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
346 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
337 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
347 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
348+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 1);
338 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
349 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
339
350
340 lvwph->positionAtBeginning();
351 lvwph->positionAtBeginning();
@@ -360,6 +371,7 @@ private Q_SLOTS:
360 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
371 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
361 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
372 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
362 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
373 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
374+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
363 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
375 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
364
376
365 lvwph->positionAtBeginning();
377 lvwph->positionAtBeginning();
@@ -404,6 +416,7 @@ private Q_SLOTS:
404 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
416 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
405 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
417 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
406 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
418 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
419+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 1);
407 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
420 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
408
421
409 model->setProperty(0, "size", 400);
422 model->setProperty(0, "size", 400);
@@ -423,6 +436,7 @@ private Q_SLOTS:
423 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
436 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
424 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
437 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
425 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
438 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
439+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 1);
426 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
440 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
427
441
428 scrollToTop();
442 scrollToTop();
@@ -476,6 +490,7 @@ private Q_SLOTS:
476 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
490 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
477 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
491 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
478 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
492 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
493+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
479 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
494 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
480
495
481 model->setProperty(0, "size", 400);
496 model->setProperty(0, "size", 400);
@@ -495,6 +510,7 @@ private Q_SLOTS:
495 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
510 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
496 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
511 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
497 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
512 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
513+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
498 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
514 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
499
515
500 scrollToTop();
516 scrollToTop();
@@ -531,6 +547,7 @@ private Q_SLOTS:
531 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
547 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
532 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
548 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
533 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
549 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
550+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 3);
534 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
551 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
535
552
536 changeContentY(-30);
553 changeContentY(-30);
@@ -548,6 +565,7 @@ private Q_SLOTS:
548 QCOMPARE(lvwph->m_headerItemShownHeight, 30.);
565 QCOMPARE(lvwph->m_headerItemShownHeight, 30.);
549 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
566 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
550 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
567 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
568+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 3);
551 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
569 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
552
570
553 changeContentY(30);
571 changeContentY(30);
@@ -565,6 +583,7 @@ private Q_SLOTS:
565 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
583 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
566 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
584 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
567 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
585 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
586+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 3);
568 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
587 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
569
588
570 changeContentY(-30);
589 changeContentY(-30);
@@ -582,6 +601,7 @@ private Q_SLOTS:
582 QCOMPARE(lvwph->m_headerItemShownHeight, 30.);
601 QCOMPARE(lvwph->m_headerItemShownHeight, 30.);
583 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
602 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
584 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
603 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
604+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 3);
585 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
605 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
586 }
606 }
587
607
@@ -602,6 +622,7 @@ private Q_SLOTS:
602 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
622 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
603 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
623 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
604 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
624 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
625+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 3);
605 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
626 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
606
627
607 lvwph->setDelegate(otherDelegate);
628 lvwph->setDelegate(otherDelegate);
@@ -660,6 +681,7 @@ private Q_SLOTS:
660 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
681 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
661 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
682 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
662 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
683 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
684+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 3);
663 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
685 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
664
686
665 scrollToTop();
687 scrollToTop();
@@ -698,6 +720,7 @@ private Q_SLOTS:
698 QTRY_VERIFY(lvwph->isAtYEnd());
720 QTRY_VERIFY(lvwph->isAtYEnd());
699 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
721 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
700 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
722 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
723+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 3);
701 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
724 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
702
725
703 scrollToTop();
726 scrollToTop();
@@ -734,6 +757,7 @@ private Q_SLOTS:
734 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
757 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
735 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
758 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
736 QCOMPARE(section(lvwph->m_topSectionItem), QString("Agressive"));
759 QCOMPARE(section(lvwph->m_topSectionItem), QString("Agressive"));
760+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 0);
737 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
761 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
738 }
762 }
739
763
@@ -818,6 +842,7 @@ private Q_SLOTS:
818 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
842 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
819 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
843 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
820 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
844 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
845+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
821 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
846 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
822
847
823 QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 1), Q_ARG(QVariant, 100), Q_ARG(QVariant, "Agressive"));
848 QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 1), Q_ARG(QVariant, 100), Q_ARG(QVariant, "Agressive"));
@@ -838,6 +863,7 @@ private Q_SLOTS:
838 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
863 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
839 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
864 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
840 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
865 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
866+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 4);
841 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
867 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
842
868
843 scrollToTop();
869 scrollToTop();
@@ -878,6 +904,7 @@ private Q_SLOTS:
878 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
904 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
879 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
905 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
880 QCOMPARE(section(lvwph->m_topSectionItem), QString("Agressive"));
906 QCOMPARE(section(lvwph->m_topSectionItem), QString("Agressive"));
907+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 0);
881 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
908 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
882
909
883 QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 3), Q_ARG(QVariant, 100), Q_ARG(QVariant, "Agressive"));
910 QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 3), Q_ARG(QVariant, 100), Q_ARG(QVariant, "Agressive"));
@@ -898,6 +925,7 @@ private Q_SLOTS:
898 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
925 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
899 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
926 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
900 QCOMPARE(section(lvwph->m_topSectionItem), QString("Agressive"));
927 QCOMPARE(section(lvwph->m_topSectionItem), QString("Agressive"));
928+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 0);
901 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
929 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
902 }
930 }
903
931
@@ -920,6 +948,7 @@ private Q_SLOTS:
920 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
948 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
921 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
949 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
922 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
950 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
951+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
923 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
952 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
924
953
925 QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 1), Q_ARG(QVariant, 100), Q_ARG(QVariant, "Agressive"));
954 QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 1), Q_ARG(QVariant, 100), Q_ARG(QVariant, "Agressive"));
@@ -940,6 +969,7 @@ private Q_SLOTS:
940 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
969 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
941 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
970 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
942 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
971 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
972+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 4);
943 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
973 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
944 }
974 }
945
975
@@ -962,6 +992,7 @@ private Q_SLOTS:
962 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
992 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
963 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
993 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
964 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
994 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
995+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 1);
965 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
996 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
966
997
967 QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 1), Q_ARG(QVariant, 100), Q_ARG(QVariant, "Agressive"));
998 QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 1), Q_ARG(QVariant, 100), Q_ARG(QVariant, "Agressive"));
@@ -982,6 +1013,7 @@ private Q_SLOTS:
982 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1013 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
983 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1014 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
984 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
1015 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
1016+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 3);
985 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1017 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
986
1018
987 scrollToTop();
1019 scrollToTop();
@@ -1029,6 +1061,7 @@ private Q_SLOTS:
1029 QVERIFY(!lvwph->isAtYEnd());
1061 QVERIFY(!lvwph->isAtYEnd());
1030 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1062 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1031 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
1063 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
1064+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 3);
1032 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1065 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1033
1066
1034 scrollToBottom();
1067 scrollToBottom();
@@ -1049,6 +1082,7 @@ private Q_SLOTS:
1049 QVERIFY(lvwph->isAtYEnd());
1082 QVERIFY(lvwph->isAtYEnd());
1050 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1083 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1051 QCOMPARE(section(lvwph->m_topSectionItem), QString("Lazy"));
1084 QCOMPARE(section(lvwph->m_topSectionItem), QString("Lazy"));
1085+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 5);
1052 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1086 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1053 }
1087 }
1054
1088
@@ -1102,6 +1136,7 @@ private Q_SLOTS:
1102 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1136 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1103 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1137 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1104 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
1138 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
1139+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 13);
1105 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1140 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1106
1141
1107 changeContentY(-1700);
1142 changeContentY(-1700);
@@ -1126,6 +1161,7 @@ private Q_SLOTS:
1126 QCOMPARE(lvwph->m_headerItemShownHeight, 50.);
1161 QCOMPARE(lvwph->m_headerItemShownHeight, 50.);
1127 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1162 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1128 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
1163 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
1164+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 4);
1129 QCOMPARE(lvwph->m_topSectionItem->y(), -23.);
1165 QCOMPARE(lvwph->m_topSectionItem->y(), -23.);
1130 }
1166 }
1131
1167
@@ -1187,6 +1223,7 @@ private Q_SLOTS:
1187 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1223 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1188 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1224 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1189 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
1225 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
1226+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 1);
1190 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1227 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1191 }
1228 }
1192
1229
@@ -1210,6 +1247,7 @@ private Q_SLOTS:
1210 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1247 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1211 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1248 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1212 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
1249 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
1250+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
1213 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1251 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1214 }
1252 }
1215
1253
@@ -1232,6 +1270,7 @@ private Q_SLOTS:
1232 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1270 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1233 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1271 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1234 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
1272 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
1273+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
1235 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1274 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1236
1275
1237 QMetaObject::invokeMethod(model, "removeItems", Q_ARG(QVariant, 1), Q_ARG(QVariant, 1));
1276 QMetaObject::invokeMethod(model, "removeItems", Q_ARG(QVariant, 1), Q_ARG(QVariant, 1));
@@ -1251,6 +1290,7 @@ private Q_SLOTS:
1251 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1290 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1252 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1291 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1253 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
1292 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
1293+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 1);
1254 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1294 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1255 }
1295 }
1256
1296
@@ -1273,6 +1313,7 @@ private Q_SLOTS:
1273 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1313 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1274 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1314 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1275 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
1315 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
1316+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
1276 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1317 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1277
1318
1278 QMetaObject::invokeMethod(model, "removeItems", Q_ARG(QVariant, 3), Q_ARG(QVariant, 1));
1319 QMetaObject::invokeMethod(model, "removeItems", Q_ARG(QVariant, 3), Q_ARG(QVariant, 1));
@@ -1292,6 +1333,7 @@ private Q_SLOTS:
1292 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1333 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1293 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1334 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1294 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
1335 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
1336+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
1295 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1337 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1296 }
1338 }
1297
1339
@@ -1371,6 +1413,7 @@ private Q_SLOTS:
1371 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1413 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1372 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1414 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1373 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
1415 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
1416+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 3);
1374 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1417 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1375
1418
1376 QMetaObject::invokeMethod(model, "moveItems", Q_ARG(QVariant, 0), Q_ARG(QVariant, 5), Q_ARG(QVariant, 1));
1419 QMetaObject::invokeMethod(model, "moveItems", Q_ARG(QVariant, 0), Q_ARG(QVariant, 5), Q_ARG(QVariant, 1));
@@ -1391,6 +1434,7 @@ private Q_SLOTS:
1391 QVERIFY(!lvwph->isAtYEnd());
1434 QVERIFY(!lvwph->isAtYEnd());
1392 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1435 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1393 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
1436 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
1437+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
1394 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1438 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1395 }
1439 }
1396
1440
@@ -1414,6 +1458,7 @@ private Q_SLOTS:
1414 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1458 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1415 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1459 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1416 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
1460 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
1461+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
1417 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1462 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1418
1463
1419 model->setProperty(1, "size", 100);
1464 model->setProperty(1, "size", 100);
@@ -1434,6 +1479,7 @@ private Q_SLOTS:
1434 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1479 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1435 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1480 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1436 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
1481 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
1482+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
1437 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1483 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1438 }
1484 }
1439
1485
@@ -1455,7 +1501,7 @@ private Q_SLOTS:
1455 QCOMPARE(lvwph->m_headerItem->y(), 0.);
1501 QCOMPARE(lvwph->m_headerItem->y(), 0.);
1456 QCOMPARE(lvwph->m_headerItem->height(), 50.);
1502 QCOMPARE(lvwph->m_headerItem->height(), 50.);
1457 QCOMPARE(lvwph->contentY(), 20.);
1503 QCOMPARE(lvwph->contentY(), 20.);
1458− QCOMPARE(lvwph->m_headerItemShownHeight, 0.);;
1504+ QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1459 QVERIFY(QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1505 QVERIFY(QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1460
1506
1461 lvwph->showHeader();
1507 lvwph->showHeader();
@@ -1475,6 +1521,7 @@ private Q_SLOTS:
1475 QCOMPARE(lvwph->m_headerItemShownHeight, 50.);
1521 QCOMPARE(lvwph->m_headerItemShownHeight, 50.);
1476 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1522 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1477 QCOMPARE(section(lvwph->m_topSectionItem), QString("Agressive"));
1523 QCOMPARE(section(lvwph->m_topSectionItem), QString("Agressive"));
1524+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 0);
1478 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1525 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1479
1526
1480 scrollToTop();
1527 scrollToTop();
@@ -1510,9 +1557,10 @@ private Q_SLOTS:
1510 QCOMPARE(lvwph->m_headerItem->y(), 0.);
1557 QCOMPARE(lvwph->m_headerItem->y(), 0.);
1511 QCOMPARE(lvwph->m_headerItem->height(), 50.);
1558 QCOMPARE(lvwph->m_headerItem->height(), 50.);
1512 QCOMPARE(lvwph->contentY(), 375.);
1559 QCOMPARE(lvwph->contentY(), 375.);
1513− QCOMPARE(lvwph->m_headerItemShownHeight, 0.);;
1560+ QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
1514 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1561 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1515 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
1562 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
1563+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 1);
1516 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1564 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1517
1565
1518 lvwph->showHeader();
1566 lvwph->showHeader();
@@ -1533,6 +1581,7 @@ private Q_SLOTS:
1533 QCOMPARE(lvwph->m_headerItemShownHeight, 50.);
1581 QCOMPARE(lvwph->m_headerItemShownHeight, 50.);
1534 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1582 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
1535 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
1583 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
1584+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 1);
1536 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1585 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
1537
1586
1538 scrollToTop();
1587 scrollToTop();
tests/qmltests/CMakeLists.txt+1−1
@@ -26,7 +26,7 @@ set(qmltest_DEFAULT_TARGETS qmluitests)
26set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
26set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
27set(qmltest_DEFAULT_PROPERTIES "")
27set(qmltest_DEFAULT_PROPERTIES "")
28
28
29−add_qml_test(. Shell IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}
29+add_qml_test(. Shell IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks
30 ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/LightDM/single")
30 ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/LightDM/single")
31add_manual_qml_test(Components DragHandle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
31add_manual_qml_test(Components DragHandle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
32add_qml_test(Components DraggingArea)
32add_qml_test(Components DraggingArea)
tests/qmltests/Dash/tst_FilterGrids.qml+1−1
@@ -118,7 +118,7 @@ Rectangle {
118 gridLoader.source = "../../../Dash/" + data.component;
118 gridLoader.source = "../../../Dash/" + data.component;
119
119
120 // Wait until the FilterGrid is loaded by the loader
120 // Wait until the FilterGrid is loaded by the loader
121− tryCompare(gridLoader, "status", Loader.Ready, "Loader couldn't load " + data.component);
121+ tryCompare(gridLoader, "status", Loader.Ready);
122
122
123 // Wait until the GridView inside the model has finished rendering
123 // Wait until the GridView inside the model has finished rendering
124 var gridView = findChild(gridLoader, "responsiveGridViewGrid");
124 var gridView = findChild(gridLoader, "responsiveGridViewGrid");
tests/qmltests/Greeter/tst_Lockscreen.qml+1
@@ -186,6 +186,7 @@ Rectangle {
186 function test_unlock(data) {
186 function test_unlock(data) {
187 unlockedCheckBox.checked = false
187 unlockedCheckBox.checked = false
188 LightDM.Greeter.authenticate(data.username)
188 LightDM.Greeter.authenticate(data.username)
189+ waitForRendering(lockscreen)
189
190
190 var inputField = findChild(lockscreen, "pinentryField")
191 var inputField = findChild(lockscreen, "pinentryField")
191 if (data.alphanumeric) {
192 if (data.alphanumeric) {
tests/qmltests/tst_Shell.qml+14
@@ -19,6 +19,7 @@
19
19
20import QtQuick 2.0
20import QtQuick 2.0
21import QtTest 1.0
21import QtTest 1.0
22+import GSettings 1.0
22import Ubuntu.Application 0.1
23import Ubuntu.Application 0.1
23import Unity.Test 0.1 as UT
24import Unity.Test 0.1 as UT
24
25
@@ -277,5 +278,18 @@ Item {
277 }
278 }
278 } while (!isStill);
279 } while (!isStill);
279 }
280 }
281+
282+ function test_wallpaper_data() {
283+ return [
284+ {tag: "red", url: "tests/data/unity/backgrounds/red.png"},
285+ {tag: "blue", url: "tests/data/unity/backgrounds/blue.png"}
286+ ]
287+ }
288+
289+ function test_wallpaper(data) {
290+ var backgroundImage = findChild(shell, "backgroundImage")
291+ GSettingsController.setPictureUri(data.url)
292+ tryCompareFunction(function() { return backgroundImage.source.toString().indexOf(data.url) !== -1; }, true)
293+ }
280 }
294 }
281}
295}
tests/utils/modules/Unity/Test/UnityTestCase.qml+10−5
@@ -72,11 +72,16 @@ TestCase {
72 // Find an object with the given name recursively, starting
72 // Find an object with the given name recursively, starting
73 // at the given object "obj"
73 // at the given object "obj"
74 function findChild(obj,objectName) {
74 function findChild(obj,objectName) {
75+ var childs = new Array(0);
76+ childs.push(obj)
77+ while (childs.length > 0) {
78+ if (childs[0].objectName == objectName) {
79+ return childs[0]
80+ }
75− for (var i in obj.children) {
81+ for (var i in childs[0].data) {
76− var child = obj.children[i];
82+ childs.push(childs[0].data[i])
77− if (child.objectName === objectName) return child;
83+ }
78− var subChild = findChild(child,objectName);
84+ childs.splice(0, 1);
79− if (subChild !== undefined) return subChild;
80 }
85 }
81 return undefined;
86 return undefined;
82 }
87 }