@@ -27,7 +27,6 @@ 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: loginList.loginListShown
31 property alias currentIndex: loginList.currentIndex
30 property alias currentIndex: loginList.currentIndex
32 property int delayMinutes // TODO
31 property int delayMinutes // TODO
33 property alias alphanumeric: loginList.alphanumeric
32 property alias alphanumeric: loginList.alphanumeric
@@ -47,36 +46,23 @@ FocusScope {
47 signal tease()
46 signal tease()
48 signal emergencyCall() // unused
47 signal emergencyCall() // unused
50− /***** Functions that depend on LoginList being loaded *****/
51− // A decorator to only call LoginList functions when its shown
52− function ifLoginlistShownThen(f) {
54− if (loginListShown) f.apply(this, arguments);
58− readonly property var notifyAuthenticationFailed: ifLoginlistShownThen(doNotifyAuthenticationFailed);
49+ function notifyAuthenticationFailed() {
59− function doNotifyAuthenticationFailed() {
60 loginListm.showError();
50 loginListm.showError();
63− readonly property var reset: ifLoginlistShownThen(doReset);
53+ function reset() {
65 loginList.reset();
54 loginList.reset();
68− readonly property var showMessage: ifLoginlistShownThen(doShowMessage);
57+ function showMessage(html) {
69− function doShowMessage(html) {
70 loginList.showMessage(html);
58 loginList.showMessage(html);
73− readonly property var showPrompt: ifLoginlistShownThen(doShowPrompt);
74− function doShowPrompt(text, isSecret, isDefaultPrompt) {
61+ function showPrompt(text, isSecret, isDefaultPrompt) {
75 loginList.showPrompt(text, isSecret, isDefaultPrompt);
62 loginList.showPrompt(text, isSecret, isDefaultPrompt);
78− readonly property var tryToUnlock: ifLoginlistShownThen(doTryToUnlock);
65+ function tryToUnlock(toTheRight) {
79− function doTryToUnlock(toTheRight) {
80 if (root.locked) {
66 if (root.locked) {
81 coverPage.show();
67 coverPage.show();
82 loginList.tryToUnlock();
68 loginList.tryToUnlock();
@@ -92,7 +78,6 @@ FocusScope {
95− /***** Functions that are agnostic of what object is loaded *****/
96 function hide() {
81 function hide() {
97 coverPage.hide();
82 coverPage.hide();
@@ -135,9 +120,6 @@ FocusScope {
135 LoginList {
120 LoginList {
136 id: loginList
121 id: loginList
138− property bool loginListShown: true
139− property bool sessionUpdated: false
141 height: inputMethod && inputMethod.visible ?
123 height: inputMethod && inputMethod.visible ?
142 parent.height - inputMethod.keyboardRectangle.height : parent.height
124 parent.height - inputMethod.keyboardRectangle.height : parent.height
143 width: units.gu(40)
125 width: units.gu(40)
@@ -176,11 +158,8 @@ FocusScope {
177 Connections {
159 Connections {
178 target: sessionChooserLoader.item
160 target: sessionChooserLoader.item
161+ onSessionSelected: loginList.currentSession = sessionKey
179 onShowLoginList: coverPage.state = "LoginList"
162 onShowLoginList: coverPage.state = "LoginList"
180− onSessionSelected: {
181− loginList.sessionUpdated = true
182− loginList.currentSession = sessionKey
184 ignoreUnknownSignals: true
163 ignoreUnknownSignals: true
@@ -216,103 +195,5 @@ FocusScope {
222− objectName: "loginList"
224− // True when LoginList is shown, false when SessionList is shown
225− property bool loginListShown: true
226− property bool sessionUpdated: false
227− property string currentSession: LightDMService.sessions.defaultSession // Set as soon as LoginList is loaded
229− source: loginListShown ? "LoginList.qml" : "SessionsList.qml"
230− onSourceChanged: loadingAnimation.running = true
234− leftMargin: Math.min(parent.width * 0.16, units.gu(20))
239− height: inputMethod && inputMethod.visible ?
240− parent.height - inputMethod.keyboardRectangle.height : parent.height
242− UbuntuNumberAnimation {
243− id: loadingAnimation
244− target: loginList.item
252− target: loginList.item
253− property: "alphanumeric"
254− value: loginListShown ? root.alphanumeric : null
258− target: loginList.item
259− property: "currentIndex"
260− value: loginListShown ? root.currentIndex : null
264− target: loginList.item
270− target: loginList.item
272− value: loginListShown ? root.userModel : null
275− // Only inform LoginList if the session isn't the user's default session
276− // because LoginList gets the default session on its own
278− target: loginList.item
279− property: "selectedSession"
280− value: loginListShown && loginList.sessionUpdated ?
281− loginList.currentSession : null
285− target: loginList.item
286− property: "initiallySelectedSession"
287− value: !loginListShown ? loginList.currentSession : null
291− target: loginListShown ? loginList.item : null
292− onSelected: root.selected(index)
293− onResponded: root.responded(response)
294− // The initially selected session lags behind the component completion
295− // so this provides the initial session name when available
296− onLoginListSessionChanged: {
297− if (loginListShown && !loginList.sessionUpdated) {
298− loginList.currentSession = loginList.item.currentSession
302− onSessionChooserButtonClicked: loginListShown = false;
303− ignoreUnknownSignals: true
307− target: !loginListShown ? loginList.item : null
308− onSessionSelected: {
309− loginList.sessionUpdated = true
310− loginList.currentSession = sessionKey
313− onShowLoginList: loginList.loginListShown = true
314− ignoreUnknownSignals: true