on xenial help sign in
minor cleanup
b1e092aMichael Terry
qml/Components/EdgeDemo.qml+1−1
@@ -145,7 +145,7 @@ Item {
145 }
145 }
146 }
146 }
147
147
148− onUnlocked: hide()
148+ onSessionStarted: hide()
149 onShownChanged: if (!greeter.shown) hide()
149 onShownChanged: if (!greeter.shown) hide()
150 }
150 }
151
151
qml/Greeter/Greeter.qml+29−37
@@ -19,7 +19,6 @@ import AccountsService 0.1
19import LightDM 0.1 as LightDM
19import LightDM 0.1 as LightDM
20import Ubuntu.Components 1.1
20import Ubuntu.Components 1.1
21import Ubuntu.SystemImage 0.1
21import Ubuntu.SystemImage 0.1
22−import Ubuntu.Telephony 0.1 as Telephony
23import Unity.Launcher 0.1
22import Unity.Launcher 0.1
24import "../Components"
23import "../Components"
25
24
@@ -42,10 +41,8 @@ Showable {
42 property string lockedApp: ""
41 property string lockedApp: ""
43 property bool hasLockedApp: lockedApp !== ""
42 property bool hasLockedApp: lockedApp !== ""
44
43
45− showAnimation: StandardAnimation { property: "dragOffset"; to: 0; duration: UbuntuAnimation.FastDuration }
44+ showAnimation: d.showAnimation
46− hideAnimation: __leftHideAnimation
45+ hideAnimation: d.leftHideAnimation
47−
48− property alias lockscreen: lockscreen
49
46
50 readonly property bool locked: LightDM.Greeter.active && !LightDM.Greeter.authenticated && !forcedUnlock
47 readonly property bool locked: LightDM.Greeter.active && !LightDM.Greeter.authenticated && !forcedUnlock
51 property bool forcedUnlock
48 property bool forcedUnlock
@@ -57,9 +54,6 @@ Showable {
57
54
58 readonly property int currentIndex: greeterContentLoader.currentIndex
55 readonly property int currentIndex: greeterContentLoader.currentIndex
59
56
60− property var __leftHideAnimation: StandardAnimation { property: "dragOffset"; to: -width }
61− property var __rightHideAnimation: StandardAnimation { property: "dragOffset"; to: width }
62−
63 property real dragOffset
57 property real dragOffset
64
58
65 // We define a proxy and "is valid" property for launcherOffset because of
59 // We define a proxy and "is valid" property for launcherOffset because of
@@ -84,35 +78,13 @@ Showable {
84
78
85 function hideRight() {
79 function hideRight() {
86 if (shown) {
80 if (shown) {
87− hideAnimation = __rightHideAnimation
81+ hideAnimation = d.rightHideAnimation;
88 hide()
82 hide()
89 }
83 }
90 }
84 }
91
85
92− function reset() {
93− if (greeterContentLoader.item) {
94− greeterContentLoader.item.reset()
95− }
96− }
97−
98− function login() {
99− enabled = false;
100− if (LightDM.Greeter.startSessionSync()) {
101− sessionStarted();
102− hide();
103− lockscreen.hide();
104− }
105− enabled = true;
106− }
107−
108 function notifyAppFocused(appId) {
86 function notifyAppFocused(appId) {
109 if (narrowMode) {
87 if (narrowMode) {
110− if (appId === "dialer-app" && callManager.hasCalls && locked) {
111− // If we are in the middle of a call, make dialer lockedApp and show it.
112− // This can happen if user backs out of dialer back to greeter, then
113− // launches dialer again.
114− lockedApp = appId;
115− }
116 if (hasLockedApp) {
88 if (hasLockedApp) {
117 if (appId === lockedApp) {
89 if (appId === lockedApp) {
118 lockscreen.hide(); // show locked app
90 lockscreen.hide(); // show locked app
@@ -168,7 +140,7 @@ Showable {
168 // Reset hide animation to default once we're finished with it
140 // Reset hide animation to default once we're finished with it
169 if (required) {
141 if (required) {
170 // Reset hide animation so that a hide() call is reliably left
142 // Reset hide animation so that a hide() call is reliably left
171− hideAnimation = __leftHideAnimation
143+ hideAnimation = d.leftHideAnimation;
172 }
144 }
173 }
145 }
174
146
@@ -179,7 +151,7 @@ Showable {
179 if (narrowMode) {
151 if (narrowMode) {
180 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
152 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
181 } else {
153 } else {
182− reset();
154+ d.reset();
183 }
155 }
184 lockedApp = "";
156 lockedApp = "";
185 forceActiveFocus();
157 forceActiveFocus();
@@ -197,7 +169,7 @@ Showable {
197 onShowProgressChanged: {
169 onShowProgressChanged: {
198 if (showProgress === 0) {
170 if (showProgress === 0) {
199 if ((LightDM.Greeter.promptless && LightDM.Greeter.authenticated) || forcedUnlock) {
171 if ((LightDM.Greeter.promptless && LightDM.Greeter.authenticated) || forcedUnlock) {
200− greeter.login();
172+ d.login();
201 } else if (narrowMode) {
173 } else if (narrowMode) {
202 lockscreen.clear(false); // to reset focus if necessary
174 lockscreen.clear(false); // to reset focus if necessary
203 }
175 }
@@ -207,12 +179,32 @@ Showable {
207 QtObject {
179 QtObject {
208 id: d
180 id: d
209
181
182+ property var showAnimation: StandardAnimation { property: "dragOffset"; to: 0; duration: UbuntuAnimation.FastDuration }
183+ property var leftHideAnimation: StandardAnimation { property: "dragOffset"; to: -width }
184+ property var rightHideAnimation: StandardAnimation { property: "dragOffset"; to: width }
185+
210 function selectUser(uid) {
186 function selectUser(uid) {
211 // Update launcher items for new user
187 // Update launcher items for new user
212 var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
188 var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
213 AccountsService.user = user;
189 AccountsService.user = user;
214 LauncherModel.setUser(user);
190 LauncherModel.setUser(user);
215 }
191 }
192+
193+ function reset() {
194+ if (greeterContentLoader.item) {
195+ greeterContentLoader.item.reset()
196+ }
197+ }
198+
199+ function login() {
200+ enabled = false;
201+ if (LightDM.Greeter.startSessionSync()) {
202+ sessionStarted();
203+ hide();
204+ lockscreen.hide();
205+ }
206+ enabled = true;
207+ }
216 }
208 }
217
209
218 Lockscreen {
210 Lockscreen {
@@ -321,7 +313,7 @@ Showable {
321 target: LightDM.Greeter
313 target: LightDM.Greeter
322
314
323 onShowGreeter: greeter.show()
315 onShowGreeter: greeter.show()
324− onHideGreeter: greeter.login()
316+ onHideGreeter: d.login()
325
317
326 onShowPrompt: {
318 onShowPrompt: {
327 waiting = false;
319 waiting = false;
@@ -364,7 +356,7 @@ Showable {
364 }
356 }
365
357
366 if (LightDM.Greeter.authenticated) {
358 if (LightDM.Greeter.authenticated) {
367− greeter.login();
359+ d.login();
368 } else {
360 } else {
369 AccountsService.failedLogins++
361 AccountsService.failedLogins++
370 if (maxFailedLogins >= 2) { // require at least a warning
362 if (maxFailedLogins >= 2) { // require at least a warning
@@ -397,6 +389,6 @@ Showable {
397 Binding {
389 Binding {
398 target: LightDM.Greeter
390 target: LightDM.Greeter
399 property: "active"
391 property: "active"
400− value: greeter.shown || lockscreen.shown || greeter.hasLockedApp
392+ value: greeter.fullyShown || greeter.hasLockedApp
401 }
393 }
402}
394}
qml/Shell.qml+10−1
@@ -200,7 +200,16 @@ Item {
200 Connections {
200 Connections {
201 target: ApplicationManager
201 target: ApplicationManager
202
202
203+ onFocusRequested: {
204+ if (appId === "dialer-app" && callManager.hasCalls && greeter.locked) {
205+ // If we are in the middle of a call, make dialer lockedApp and show it.
206+ // This can happen if user backs out of dialer back to greeter, then
207+ // launches dialer again.
208+ lockedApp = appId;
209+ }
210+
203− onFocusRequested: greeter.notifyAppFocused(appId)
211+ greeter.notifyAppFocused(appId);
212+ }
204
213
205 onFocusedApplicationIdChanged: {
214 onFocusedApplicationIdChanged: {
206 greeter.notifyFocusChanged(ApplicationManager.focusedApplicationId);
215 greeter.notifyFocusChanged(ApplicationManager.focusedApplicationId);