on xenial help sign in
Begin large refactor
88f3046Josh Arenson
qml/Greeter/LoginList.qml+2−2
@@ -35,8 +35,8 @@ StyledItem {
35 readonly property int highlightedHeight: units.gu(15)
35 readonly property int highlightedHeight: units.gu(15)
36 readonly property int moveDuration: 200
36 readonly property int moveDuration: 200
37 property string selectedSession
37 property string selectedSession
38− property string currentSession: selectedSession ?
38+ property string currentSession//: selectedSession ?
39− selectedSession : userList.currentItem.userSession
39+ //selectedSession : userList.currentItem.userSession
40 readonly property string currentUser: userList.currentItem.username
40 readonly property string currentUser: userList.currentItem.username
41 property bool wasPrompted: false
41 property bool wasPrompted: false
42
42
qml/Greeter/WideView.qml+117−31
@@ -27,12 +27,12 @@ FocusScope {
27 property alias dragHandleLeftMargin: coverPage.dragHandleLeftMargin
27 property alias dragHandleLeftMargin: coverPage.dragHandleLeftMargin
28 property alias infographicModel: coverPage.infographicModel
28 property alias infographicModel: coverPage.infographicModel
29 property alias launcherOffset: coverPage.launcherOffset
29 property alias launcherOffset: coverPage.launcherOffset
30− property alias loginListShown: loginAreaLoader.loginListShown
30+ property alias loginListShown: loginList.loginListShown
31− property int currentIndex // Set from outside
31+ property alias currentIndex: loginList.currentIndex
32 property int delayMinutes // TODO
32 property int delayMinutes // TODO
33− property bool alphanumeric: true
33+ property alias alphanumeric: loginList.alphanumeric
34− property bool locked
34+ property alias locked: loginList.locked
35− property alias sessionToStart: loginAreaLoader.currentSession
35+ property alias sessionToStart: loginList.currentSession
36 property var userModel // Set from outside
36 property var userModel // Set from outside
37
37
38 readonly property bool animating: coverPage.showAnimation.running || coverPage.hideAnimation.running
38 readonly property bool animating: coverPage.showAnimation.running || coverPage.hideAnimation.running
@@ -57,29 +57,29 @@ FocusScope {
57
57
58 readonly property var notifyAuthenticationFailed: ifLoginlistShownThen(doNotifyAuthenticationFailed);
58 readonly property var notifyAuthenticationFailed: ifLoginlistShownThen(doNotifyAuthenticationFailed);
59 function doNotifyAuthenticationFailed() {
59 function doNotifyAuthenticationFailed() {
60− loginAreaLoader.item.showError();
60+ loginListm.showError();
61 }
61 }
62
62
63 readonly property var reset: ifLoginlistShownThen(doReset);
63 readonly property var reset: ifLoginlistShownThen(doReset);
64 function doReset() {
64 function doReset() {
65− loginAreaLoader.item.reset();
65+ loginList.reset();
66 }
66 }
67
67
68 readonly property var showMessage: ifLoginlistShownThen(doShowMessage);
68 readonly property var showMessage: ifLoginlistShownThen(doShowMessage);
69 function doShowMessage(html) {
69 function doShowMessage(html) {
70− loginAreaLoader.item.showMessage(html);
70+ loginList.showMessage(html);
71 }
71 }
72
72
73 readonly property var showPrompt: ifLoginlistShownThen(doShowPrompt);
73 readonly property var showPrompt: ifLoginlistShownThen(doShowPrompt);
74 function doShowPrompt(text, isSecret, isDefaultPrompt) {
74 function doShowPrompt(text, isSecret, isDefaultPrompt) {
75− loginAreaLoader.item.showPrompt(text, isSecret, isDefaultPrompt);
75+ loginList.showPrompt(text, isSecret, isDefaultPrompt);
76 }
76 }
77
77
78 readonly property var tryToUnlock: ifLoginlistShownThen(doTryToUnlock);
78 readonly property var tryToUnlock: ifLoginlistShownThen(doTryToUnlock);
79 function doTryToUnlock(toTheRight) {
79 function doTryToUnlock(toTheRight) {
80 if (root.locked) {
80 if (root.locked) {
81 coverPage.show();
81 coverPage.show();
82− loginAreaLoader.item.tryToUnlock();
82+ loginList.tryToUnlock();
83 return false;
83 return false;
84 } else {
84 } else {
85 var coverChanged = coverPage.shown;
85 var coverChanged = coverPage.shown;
@@ -117,10 +117,11 @@ FocusScope {
117 height: parent.height
117 height: parent.height
118 width: parent.width
118 width: parent.width
119 draggable: !root.locked && !root.waiting
119 draggable: !root.locked && !root.waiting
120+ state: "LoginList"
120
121
121 infographics {
122 infographics {
122 height: 0.75 * parent.height
123 height: 0.75 * parent.height
123− anchors.leftMargin: loginAreaLoader.x + loginAreaLoader.width
124+ anchors.leftMargin: loginList.x + loginList.width
124 }
125 }
125
126
126 onTease: root.tease()
127 onTease: root.tease()
@@ -131,9 +132,94 @@ FocusScope {
131 }
132 }
132 }
133 }
133
134
135+ LoginList {
136+ id: loginList
137+
138+ property bool loginListShown: true
139+ property bool sessionUpdated: false
140+
141+ height: inputMethod && inputMethod.visible ?
142+ parent.height - inputMethod.keyboardRectangle.height : parent.height
143+ width: units.gu(40)
144+ anchors {
145+ left: parent.left
146+ leftMargin: Math.min(parent.width * 0.16, units.gu(20))
147+ top: parent.top
148+ }
149+
150+ model: root.userModel
151+
152+ currentSession: LightDMService.greeter.defaultSession
153+ onResponded: root.responded(response)
154+ onSelected: root.selected(index)
155+ onSessionChooserButtonClicked: parent.state = "SessionsList"
156+ }
157+
134 Loader {
158 Loader {
135− id: loginAreaLoader
159+ id: sessionChooserLoader
160+
161+ height: loginList.height
162+ width: loginList.width
163+ anchors {
164+ left: parent.left
165+ leftMargin: Math.min(parent.width * 0.16, units.gu(20))
166+ top: parent.top
167+ }
168+
169+ active: false
170+
171+ Binding {
172+ target: sessionChooserLoader.item
173+ property: "initiallySelectedSession"
174+ value: loginList.currentSession
175+ }
176+
177+ Connections {
178+ target: sessionChooserLoader.item
179+ onShowLoginList: coverPage.state = "LoginList"
180+ onSessionSelected: {
181+ loginList.sessionUpdated = true
182+ loginList.currentSession = sessionKey
183+ }
184+ ignoreUnknownSignals: true
185+ }
186+ }
187+
188+ states: [
189+ State {
190+ name: "SessionsList"
191+ PropertyChanges { target: loginList; opacity: 0 }
192+ PropertyChanges { target: sessionChooserLoader;
193+ active: true;
194+ opacity: 1
195+ source: "SessionsList.qml"
196+ }
197+ },
198+
199+ State {
200+ name: "LoginList"
201+ PropertyChanges { target: loginList; opacity: 1 }
202+ PropertyChanges { target: sessionChooserLoader;
203+ active: false;
204+ opacity: 0
205+ source: "";
206+ }
207+ }
208+ ]
209+
210+ transitions: [
211+ Transition {
212+ from: "*"
213+ to: "*"
214+ UbuntuNumberAnimation {
215+ property: "opacity";
216+ }
217+ }
218+ ]
219+
220+ /*Loader {
221+ id: loginList
136− objectName: "loginAreaLoader"
222+ objectName: "loginList"
137
223
138 // True when LoginList is shown, false when SessionList is shown
224 // True when LoginList is shown, false when SessionList is shown
139 property bool loginListShown: true
225 property bool loginListShown: true
@@ -155,7 +241,7 @@ FocusScope {
155
241
156 UbuntuNumberAnimation {
242 UbuntuNumberAnimation {
157 id: loadingAnimation
243 id: loadingAnimation
158− target: loginAreaLoader.item
244+ target: loginList.item
159 property: "opacity"
245 property: "opacity"
160 from: 0
246 from: 0
161 to: 1
247 to: 1
@@ -163,25 +249,25 @@ FocusScope {
163 }
249 }
164
250
165 Binding {
251 Binding {
166− target: loginAreaLoader.item
252+ target: loginList.item
167 property: "alphanumeric"
253 property: "alphanumeric"
168 value: loginListShown ? root.alphanumeric : null
254 value: loginListShown ? root.alphanumeric : null
169 }
255 }
170
256
171 Binding {
257 Binding {
172− target: loginAreaLoader.item
258+ target: loginList.item
173 property: "currentIndex"
259 property: "currentIndex"
174 value: loginListShown ? root.currentIndex : null
260 value: loginListShown ? root.currentIndex : null
175 }
261 }
176
262
177 Binding {
263 Binding {
178− target: loginAreaLoader.item
264+ target: loginList.item
179 property: "locked"
265 property: "locked"
180 value: root.locked
266 value: root.locked
181 }
267 }
182
268
183 Binding {
269 Binding {
184− target: loginAreaLoader.item
270+ target: loginList.item
185 property: "model"
271 property: "model"
186 value: loginListShown ? root.userModel : null
272 value: loginListShown ? root.userModel : null
187 }
273 }
@@ -189,27 +275,27 @@ FocusScope {
189 // Only inform LoginList if the session isn't the user's default session
275 // Only inform LoginList if the session isn't the user's default session
190 // because LoginList gets the default session on its own
276 // because LoginList gets the default session on its own
191 Binding {
277 Binding {
192− target: loginAreaLoader.item
278+ target: loginList.item
193 property: "selectedSession"
279 property: "selectedSession"
194− value: loginListShown && loginAreaLoader.sessionUpdated ?
280+ value: loginListShown && loginList.sessionUpdated ?
195− loginAreaLoader.currentSession : null
281+ loginList.currentSession : null
196 }
282 }
197
283
198 Binding {
284 Binding {
199− target: loginAreaLoader.item
285+ target: loginList.item
200 property: "initiallySelectedSession"
286 property: "initiallySelectedSession"
201− value: !loginListShown ? loginAreaLoader.currentSession : null
287+ value: !loginListShown ? loginList.currentSession : null
202 }
288 }
203
289
204 Connections {
290 Connections {
205− target: loginListShown ? loginAreaLoader.item : null
291+ target: loginListShown ? loginList.item : null
206 onSelected: root.selected(index)
292 onSelected: root.selected(index)
207 onResponded: root.responded(response)
293 onResponded: root.responded(response)
208 // The initially selected session lags behind the component completion
294 // The initially selected session lags behind the component completion
209 // so this provides the initial session name when available
295 // so this provides the initial session name when available
210 onLoginListSessionChanged: {
296 onLoginListSessionChanged: {
211− if (loginListShown && !loginAreaLoader.sessionUpdated) {
297+ if (loginListShown && !loginList.sessionUpdated) {
212− loginAreaLoader.currentSession = loginAreaLoader.item.currentSession
298+ loginList.currentSession = loginList.item.currentSession
213 }
299 }
214 }
300 }
215
301
@@ -218,15 +304,15 @@ FocusScope {
218 }
304 }
219
305
220 Connections {
306 Connections {
221− target: !loginListShown ? loginAreaLoader.item : null
307+ target: !loginListShown ? loginList.item : null
222 onSessionSelected: {
308 onSessionSelected: {
223− loginAreaLoader.sessionUpdated = true
309+ loginList.sessionUpdated = true
224− loginAreaLoader.currentSession = sessionKey
310+ loginList.currentSession = sessionKey
225 }
311 }
226
312
227− onShowLoginList: loginAreaLoader.loginListShown = true
313+ onShowLoginList: loginList.loginListShown = true
228 ignoreUnknownSignals: true
314 ignoreUnknownSignals: true
229 }
315 }
230− }
316+ }*/
231 }
317 }
232}
318}