on xenial help sign in
Make it easier to use the Lockscreen component from the welcome wizard.
5367c4fMichael Terry
qml/Components/Lockscreen.qml+14−9
@@ -24,6 +24,12 @@ Showable {
24 // Determine if a numeric or alphanumeric pad is used.
24 // Determine if a numeric or alphanumeric pad is used.
25 property bool alphaNumeric: false
25 property bool alphaNumeric: false
26
26
27+ // Whether to show an emergency call button
28+ property bool showEmergencyCallButton: true
29+
30+ // Whether to show a cancel button (not all lockscreen types normally do anyway)
31+ property bool showCancelButton: true
32+
27 // Informational text. (e.g. some text to tell which domain this is pin is entered for)
33 // Informational text. (e.g. some text to tell which domain this is pin is entered for)
28 property string infoText: ""
34 property string infoText: ""
29
35
@@ -76,10 +82,11 @@ Showable {
76 }
82 }
77
83
78 Rectangle {
84 Rectangle {
79− // In case background fails to load or is undefined
85+ // In case background fails to load
80 id: backgroundBackup
86 id: backgroundBackup
81 anchors.fill: parent
87 anchors.fill: parent
82 color: "black"
88 color: "black"
89+ visible: root.background.toString() !== ""
83 }
90 }
84
91
85 Image {
92 Image {
@@ -184,19 +191,17 @@ Showable {
184 value: root.delayMinutes
191 value: root.delayMinutes
185 }
192 }
186 }
193 }
194+ Binding {
195+ target: pinPadLoader.item
196+ property: "showCancelButton"
197+ value: root.showCancelButton
198+ }
187 }
199 }
188
200
189 Item {
201 Item {
190 id: emergencyCallRow
202 id: emergencyCallRow
191
203
192− // FIXME: We *should* show emergency dialer if there is a SIM present,
204+ visible: showEmergencyCallButton
193− // regardless of whether the side stage is enabled. But right now,
194− // the assumption is that narrow screens are phones which have SIMs
195− // and wider screens are tablets which don't. When we do allow this
196− // on devices with a side stage and a SIM, work should be done to
197− // ensure that the main stage is disabled while the dialer is present
198− // in the side stage.
199− visible: !shell.sideStageEnabled
200
205
201 anchors {
206 anchors {
202 bottom: parent.bottom
207 bottom: parent.bottom
qml/Components/PinLockscreen.qml+3
@@ -33,6 +33,7 @@ Column {
33 property int padHeight: units.gu(28)
33 property int padHeight: units.gu(28)
34 property int minPinLength: -1
34 property int minPinLength: -1
35 property int maxPinLength: -1
35 property int maxPinLength: -1
36+ property bool showCancelButton: true
36
37
37 signal entered(string passphrase)
38 signal entered(string passphrase)
38 signal cancel()
39 signal cancel()
@@ -110,6 +111,7 @@ Column {
110 fontSize: "x-large"
111 fontSize: "x-large"
111 color: "#f3f3e7"
112 color: "#f3f3e7"
112 anchors.horizontalCenter: parent.horizontalCenter
113 anchors.horizontalCenter: parent.horizontalCenter
114+ horizontalAlignment: Text.AlignHCenter
113 text: root.errorText
115 text: root.errorText
114 visible: pinentryField.incorrectOverride
116 visible: pinentryField.incorrectOverride
115 }
117 }
@@ -199,6 +201,7 @@ Column {
199 width: numbersGrid.buttonWidth
201 width: numbersGrid.buttonWidth
200
202
201 onClicked: root.cancel()
203 onClicked: root.cancel()
204+ visible: root.showCancelButton
202 }
205 }
203 Item {
206 Item {
204 height: units.gu(5)
207 height: units.gu(5)
qml/Shell.qml+14−1
@@ -292,6 +292,15 @@ Item {
292 minPinLength: 4
292 minPinLength: 4
293 maxPinLength: 4
293 maxPinLength: 4
294
294
295+ // FIXME: We *should* show emergency dialer if there is a SIM present,
296+ // regardless of whether the side stage is enabled. But right now,
297+ // the assumption is that narrow screens are phones which have SIMs
298+ // and wider screens are tablets which don't. When we do allow this
299+ // on devices with a side stage and a SIM, work should be done to
300+ // ensure that the main stage is disabled while the dialer is present
301+ // in the side stage.
302+ showEmergencyCallButton: !shell.sideStageEnabled
303+
295 onEntered: LightDM.Greeter.respond(passphrase);
304 onEntered: LightDM.Greeter.respond(passphrase);
296 onCancel: greeter.show()
305 onCancel: greeter.show()
297 onEmergencyCall: shell.activateApplication("dialer-app") // will automatically enter fake-active mode
306 onEmergencyCall: shell.activateApplication("dialer-app") // will automatically enter fake-active mode
@@ -588,7 +597,11 @@ Item {
588 available: edgeDemo.launcherEnabled && (!shell.locked || AccountsService.enableLauncherWhileLocked) && greeter.fakeActiveForApp === ""
597 available: edgeDemo.launcherEnabled && (!shell.locked || AccountsService.enableLauncherWhileLocked) && greeter.fakeActiveForApp === ""
589
598
590 onShowDashHome: showHome()
599 onShowDashHome: showHome()
600+ onDash: {
601+ if (ApplicationManager.focusedApplicationId != "unity8-dash") {
591− onDash: showDash()
602+ showDash()
603+ }
604+ }
592 onDashSwipeChanged: {
605 onDashSwipeChanged: {
593 if (dashSwipe) {
606 if (dashSwipe) {
594 dash.setCurrentScope("clickscope", false, true)
607 dash.setCurrentScope("clickscope", false, true)