on xenial help sign in
Merge
4aa36b8Albert Astals
qml/Dash/PreviewListView.qml+25−29
@@ -151,43 +151,39 @@ Item {
151 }
151 }
152 }
152 }
153
153
154− delegate: Previews.Preview {
154+ delegate: Item {
155− id: preview
156− objectName: "preview" + index
157 height: previewListView.height
155 height: previewListView.height
158 width: previewListView.width
156 width: previewListView.width
159
157
158+ Previews.Preview {
159+ id: preview
160+ objectName: "preview" + index
161+ anchors.fill: parent
162+
160− isCurrent: ListView.isCurrentItem
163+ isCurrent: parent.ListView.isCurrentItem
161−
164+
162− onPreviewModelChanged: preview.opacity = 0;
163− onReadyChanged: if (ready) fadeIn.start()
164− previewModel: {
165+ previewModel: {
165− // TODO
166− // We need the isCurrent because the scope fails to
167− // deliver the preview if we ask for one after other very quickly
168− // If we remove the isCurrent, we will have to think another way of
169− // doing the fadeIn or just don't do it at all or just decide
170− // this code is good enough and remove the TODO
171− if (isCurrent) {
172 var previewStack = root.scope.preview(result);
166 var previewStack = root.scope.preview(result);
173 return previewStack.get(0);
167 return previewStack.get(0);
174− } else {
175− ready = false;
176− return null;
177 }
168 }
169+
170+ // onClose: {
171+ // previewListView.open = false
172+ // }
173+
178 }
174 }
179
175
180−// onClose: {
176+ MouseArea {
181−// previewListView.open = false
177+ id: processingMouseArea
178+ objectName: "processingMouseArea"
179+ anchors.fill: parent
180+ enabled: !preview.previewModel.loaded || preview.previewModel.processingAction
181+
182+ ActivityIndicator {
183+ anchors.centerIn: parent
184+ visible: parent.enabled
185+ running: visible
182−// }
186+ }
183−
184− PropertyAnimation {
185− id: fadeIn
186− target: preview
187− property: "opacity"
188− from: 0.0
189− to: 1.0
190− duration: UbuntuAnimation.BriskDuration
191 }
187 }
192 }
188 }
193 }
189 }
qml/Dash/Previews/Preview.qml−13
@@ -36,9 +36,6 @@ Item {
36 //! \brief Should be set to true if this preview is currently displayed.
36 //! \brief Should be set to true if this preview is currently displayed.
37 property bool isCurrent: false
37 property bool isCurrent: false
38
38
39− //! \brief Will be changed to true when the initial preview widgets are in.
40− property bool ready: false
41−
42 clip: true
39 clip: true
43
40
44 Connections {
41 Connections {
@@ -52,8 +49,6 @@ Item {
52 }
49 }
53 }
50 }
54
51
55− onPreviewModelChanged: processingMouseArea.enabled = false
56−
57 Binding {
52 Binding {
58 target: previewModel
53 target: previewModel
59 property: "widgetColumnCount"
54 property: "widgetColumnCount"
@@ -84,7 +79,6 @@ Item {
84 bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
79 bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
85
80
86 model: columnModel
81 model: columnModel
87− onCountChanged: if (count > 0) root.ready = true
88 cacheBuffer: height
82 cacheBuffer: height
89
83
90 Behavior on contentY { UbuntuNumberAnimation { } }
84 Behavior on contentY { UbuntuNumberAnimation { } }
@@ -113,11 +107,4 @@ Item {
113 }
107 }
114 }
108 }
115 }
109 }
116−
117− MouseArea {
118− id: processingMouseArea
119− objectName: "processingMouseArea"
120− anchors.fill: parent
121− enabled: false
122− }
123}
110}
qml/Greeter/Greeter.qml+4
@@ -67,6 +67,10 @@ Showable {
67
67
68 source: required ? "GreeterContent.qml" : ""
68 source: required ? "GreeterContent.qml" : ""
69
69
70+ onLoaded: {
71+ selected(currentIndex);
72+ }
73+
70 Connections {
74 Connections {
71 target: greeterContentLoader.item
75 target: greeterContentLoader.item
72
76
qml/Greeter/GreeterContent.qml−1
@@ -96,7 +96,6 @@ MouseArea {
96
96
97 onLoaded: {
97 onLoaded: {
98 item.currentIndex = greeterContentLoader.currentIndex;
98 item.currentIndex = greeterContentLoader.currentIndex;
99− selected(item.currentIndex);
100 item.resetAuthentication();
99 item.resetAuthentication();
101 }
100 }
102
101
qml/Shell.qml+2−4
@@ -463,7 +463,6 @@ FocusScope {
463 Component.onCompleted: {
463 Component.onCompleted: {
464 if (LightDM.Users.count == 1) {
464 if (LightDM.Users.count == 1) {
465 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
465 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
466− greeter.selected(0)
467 }
466 }
468 }
467 }
469 }
468 }
@@ -504,7 +503,7 @@ FocusScope {
504 hides: [launcher, panel.indicators, hud]
503 hides: [launcher, panel.indicators, hud]
505 shown: true
504 shown: true
506
505
507− defaultBackground: shell.background
506+ defaultBackground: shell.defaultBackground
508
507
509 y: panel.panelHeight
508 y: panel.panelHeight
510 width: parent.width
509 width: parent.width
@@ -541,7 +540,6 @@ FocusScope {
541 // If there are more users, the Greeter will handle that
540 // If there are more users, the Greeter will handle that
542 if (LightDM.Users.count == 1) {
541 if (LightDM.Users.count == 1) {
543 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
542 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
544− greeter.selected(0);
545 }
543 }
546 greeter.forceActiveFocus();
544 greeter.forceActiveFocus();
547 removeApplicationFocus();
545 removeApplicationFocus();
@@ -720,7 +718,7 @@ FocusScope {
720 anchors.bottom: parent.bottom
718 anchors.bottom: parent.bottom
721 width: parent.width
719 width: parent.width
722 dragAreaWidth: shell.edgeSize
720 dragAreaWidth: shell.edgeSize
723− available: (!greeter.shown || greeter.narrowMode) && edgeDemo.launcherEnabled
721+ available: !greeter.locked && edgeDemo.launcherEnabled
724
722
725 onShowDashHome: {
723 onShowDashHome: {
726 if (edgeDemo.running)
724 if (edgeDemo.running)
tests/mocks/AccountsService/AccountsService.cpp+1−1
@@ -20,7 +20,7 @@
20
20
21AccountsService::AccountsService(QObject* parent)
21AccountsService::AccountsService(QObject* parent)
22 : QObject(parent),
22 : QObject(parent),
23− m_backgroundFile(TOP_SRCDIR "/graphics/phone_background.jpg"),
23+ m_backgroundFile(TOP_SRCDIR "/qml/graphics/phone_background.jpg"),
24 m_statsWelcomeScreen(true)
24 m_statsWelcomeScreen(true)
25{
25{
26}
26}
tests/qmltests/Greeter/tst_Phone.qml+19
@@ -44,6 +44,17 @@ Item {
44 }
44 }
45 }
45 }
46
46
47+ Component {
48+ id: greeterComponent
49+ Greeter {
50+ SignalSpy {
51+ objectName: "selectedSpy"
52+ target: parent
53+ signalName: "selected"
54+ }
55+ }
56+ }
57+
47 SignalSpy {
58 SignalSpy {
48 id: unlockSpy
59 id: unlockSpy
49 target: greeter
60 target: greeter
@@ -148,5 +159,13 @@ Item {
148 tryCompareFunction(function() { return background.source.toString().indexOf(data.expected) !== -1; }, true)
159 tryCompareFunction(function() { return background.source.toString().indexOf(data.expected) !== -1; }, true)
149 tryCompare(background, "status", Image.Ready)
160 tryCompare(background, "status", Image.Ready)
150 }
161 }
162+
163+ function test_initial_selected_signal() {
164+ var greeterObj = greeterComponent.createObject(this)
165+ var spy = findChild(greeterObj, "selectedSpy")
166+ spy.wait()
167+ tryCompare(spy, "count", 1)
168+ greeterObj.destroy()
169+ }
151 }
170 }
152}
171}
tests/qmltests/Greeter/tst_Tablet.qml+19
@@ -31,6 +31,17 @@ Item {
31 anchors.fill: parent
31 anchors.fill: parent
32 }
32 }
33
33
34+ Component {
35+ id: greeterComponent
36+ Greeter {
37+ SignalSpy {
38+ objectName: "selectedSpy"
39+ target: parent
40+ signalName: "selected"
41+ }
42+ }
43+ }
44+
34 SignalSpy {
45 SignalSpy {
35 id: unlockSpy
46 id: unlockSpy
36 target: greeter
47 target: greeter
@@ -335,5 +346,13 @@ Item {
335 var userlist = findChild(greeter, "userList")
346 var userlist = findChild(greeter, "userList")
336 compare(greeter.model.data(userlist.currentIndex, LightDM.UserRoles.NameRole), "has-password")
347 compare(greeter.model.data(userlist.currentIndex, LightDM.UserRoles.NameRole), "has-password")
337 }
348 }
349+
350+ function test_initial_selected_signal() {
351+ var greeterObj = greeterComponent.createObject(this)
352+ var spy = findChild(greeterObj, "selectedSpy")
353+ spy.wait()
354+ tryCompare(spy, "count", 1)
355+ greeterObj.destroy()
356+ }
338 }
357 }
339}
358}