on xenial help sign in
Finish refactor
commit2bf597239cce68abcd18de725c3ef8e29b2e9d4e authorJosh Arenson <joshua.arenson@canonical.com> dateMon 25 Jul 2016, 17:27 (10 years ago) parent88f3046
1 file changed+6−125
qml/Greeter/WideView.qml+6−125
qml/Greeter/WideView.qml+6−125
@@ -27,7 +27,6 @@ FocusScope {
2727 property alias dragHandleLeftMargin: coverPage.dragHandleLeftMargin
2828 property alias infographicModel: coverPage.infographicModel
2929 property alias launcherOffset: coverPage.launcherOffset
30− property alias loginListShown: loginList.loginListShown
3130 property alias currentIndex: loginList.currentIndex
3231 property int delayMinutes // TODO
3332 property alias alphanumeric: loginList.alphanumeric
@@ -47,36 +46,23 @@ FocusScope {
4746 signal tease()
4847 signal emergencyCall() // unused
4948
50− /***** Functions that depend on LoginList being loaded *****/
51− // A decorator to only call LoginList functions when its shown
52− function ifLoginlistShownThen(f) {
53− return function() {
54− if (loginListShown) f.apply(this, arguments);
55− }
56− }
57−
58− readonly property var notifyAuthenticationFailed: ifLoginlistShownThen(doNotifyAuthenticationFailed);
59− function doNotifyAuthenticationFailed() {
49+ function notifyAuthenticationFailed() {
6050 loginListm.showError();
6151 }
6252
63− readonly property var reset: ifLoginlistShownThen(doReset);
64− function doReset() {
53+ function reset() {
6554 loginList.reset();
6655 }
6756
68− readonly property var showMessage: ifLoginlistShownThen(doShowMessage);
69− function doShowMessage(html) {
57+ function showMessage(html) {
7058 loginList.showMessage(html);
7159 }
7260
73− readonly property var showPrompt: ifLoginlistShownThen(doShowPrompt);
74− function doShowPrompt(text, isSecret, isDefaultPrompt) {
61+ function showPrompt(text, isSecret, isDefaultPrompt) {
7562 loginList.showPrompt(text, isSecret, isDefaultPrompt);
7663 }
7764
78− readonly property var tryToUnlock: ifLoginlistShownThen(doTryToUnlock);
79− function doTryToUnlock(toTheRight) {
65+ function tryToUnlock(toTheRight) {
8066 if (root.locked) {
8167 coverPage.show();
8268 loginList.tryToUnlock();
@@ -92,7 +78,6 @@ FocusScope {
9278 }
9379 }
9480
95− /***** Functions that are agnostic of what object is loaded *****/
9681 function hide() {
9782 coverPage.hide();
9883 }
@@ -135,9 +120,6 @@ FocusScope {
135120 LoginList {
136121 id: loginList
137122
138− property bool loginListShown: true
139− property bool sessionUpdated: false
140−
141123 height: inputMethod && inputMethod.visible ?
142124 parent.height - inputMethod.keyboardRectangle.height : parent.height
143125 width: units.gu(40)
@@ -176,11 +158,8 @@ FocusScope {
176158
177159 Connections {
178160 target: sessionChooserLoader.item
161+ onSessionSelected: loginList.currentSession = sessionKey
179162 onShowLoginList: coverPage.state = "LoginList"
180− onSessionSelected: {
181− loginList.sessionUpdated = true
182− loginList.currentSession = sessionKey
183− }
184163 ignoreUnknownSignals: true
185164 }
186165 }
@@ -216,103 +195,5 @@ FocusScope {
216195 }
217196 }
218197 ]
219−
220− /*Loader {
221− id: loginList
222− objectName: "loginList"
223−
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
228−
229− source: loginListShown ? "LoginList.qml" : "SessionsList.qml"
230− onSourceChanged: loadingAnimation.running = true
231−
232− anchors {
233− left: parent.left
234− leftMargin: Math.min(parent.width * 0.16, units.gu(20))
235− top: parent.top
236− }
237−
238− width: units.gu(40)
239− height: inputMethod && inputMethod.visible ?
240− parent.height - inputMethod.keyboardRectangle.height : parent.height
241−
242− UbuntuNumberAnimation {
243− id: loadingAnimation
244− target: loginList.item
245− property: "opacity"
246− from: 0
247− to: 1
248− running: false
249− }
250−
251− Binding {
252− target: loginList.item
253− property: "alphanumeric"
254− value: loginListShown ? root.alphanumeric : null
255− }
256−
257− Binding {
258− target: loginList.item
259− property: "currentIndex"
260− value: loginListShown ? root.currentIndex : null
261− }
262−
263− Binding {
264− target: loginList.item
265− property: "locked"
266− value: root.locked
267− }
268−
269− Binding {
270− target: loginList.item
271− property: "model"
272− value: loginListShown ? root.userModel : null
273− }
274−
275− // Only inform LoginList if the session isn't the user's default session
276− // because LoginList gets the default session on its own
277− Binding {
278− target: loginList.item
279− property: "selectedSession"
280− value: loginListShown && loginList.sessionUpdated ?
281− loginList.currentSession : null
282− }
283−
284− Binding {
285− target: loginList.item
286− property: "initiallySelectedSession"
287− value: !loginListShown ? loginList.currentSession : null
288− }
289−
290− Connections {
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
299− }
300− }
301−
302− onSessionChooserButtonClicked: loginListShown = false;
303− ignoreUnknownSignals: true
304− }
305−
306− Connections {
307− target: !loginListShown ? loginList.item : null
308− onSessionSelected: {
309− loginList.sessionUpdated = true
310− loginList.currentSession = sessionKey
311− }
312−
313− onShowLoginList: loginList.loginListShown = true
314− ignoreUnknownSignals: true
315− }
316− }*/
317198 }
318199}