2
* Copyright 2016 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by Jonas G. Drange <jonas.drange@canonical.com>
21
import QtQuick.Layouts 1.1
22
import Ubuntu.Components 1.3
23
import Ubuntu.Settings.Fingerprint 0.1
28
objectName: "fingerprintSetupPage"
33
function enrollmentFailed(error) {
34
root.state = "failed";
37
function enrollmentCompleted() {
41
function enrollmentProgressed(progress, hints) {
42
root.state = "reading";
43
imageDefault.masks = hints[FingerprintReader.masks];
44
progressLabel.progress = 100 * progress;
45
directionContainer.direction = hints[FingerprintReader.suggestedNextDirection] || FingerprintReader.NotAvailable;
52
script: statusLabel.setText(statusLabel.initialText)
58
script: statusLabel.setText(
59
i18n.dtr("ubuntu-settings-components",
60
"Swipe your finger repeatedly over the reader.")
75
script: statusLabel.setText(
76
i18n.dtr("ubuntu-settings-components",
77
"Keep your finger on the reader for longer.")
93
text: i18n.dtr("ubuntu-settings-components", "Back");
100
script: statusLabel.setText(
101
i18n.dtr("ubuntu-settings-components",
102
"Sorry, the reader doesn’t seem to be working."),
107
script: imageFailed.start()
110
target: directionContainer
129
script: statusLabel.setText(
130
i18n.dtr("ubuntu-settings-components", "All done!"),
137
text: i18n.dtr("ubuntu-settings-components", "OK")
140
script: imageDone.start()
143
target: directionContainer
158
anchors.centerIn: parent
164
anchors.centerIn: parent
165
width: imageDefault.implicitWidth
166
height: imageDefault.implicitHeight
171
objectName: "fingerprintDefaultVisual"
172
anchors.centerIn: parent
174
Behavior on opacity { UbuntuNumberAnimation {
175
duration: UbuntuAnimation.SlowDuration
176
easing: UbuntuAnimation.StandardEasing
183
objectName: "fingerprintFailedVisual"
186
width: directionContainer.width - units.dp(3)
188
anchors.centerIn: parent
191
failAngstopAnim.start();
192
failThichAnim.start();
195
NumberAnimation on angleStop {
200
duration: UbuntuAnimation.SlowDuration
201
easing: UbuntuAnimation.StandardEasing
204
NumberAnimation on thickness {
209
duration: UbuntuAnimation.SlowDuration
210
easing: UbuntuAnimation.StandardEasing
217
anchors.centerIn: parent
220
Behavior on opacity { UbuntuNumberAnimation {
221
duration: UbuntuAnimation.SlowDuration
222
easing: UbuntuAnimation.StandardEasing
229
objectName: "fingerprintDoneVisual"
231
width: directionContainer.width - units.dp(3)
233
anchors.centerIn: parent
240
NumberAnimation on angleStop {
245
duration: UbuntuAnimation.SlowDuration
246
easing: UbuntuAnimation.StandardEasing
249
NumberAnimation on thickness {
254
duration: UbuntuAnimation.SlowDuration
255
easing: UbuntuAnimation.StandardEasing
262
anchors.centerIn: parent
265
Behavior on opacity { UbuntuNumberAnimation {
266
duration: UbuntuAnimation.SlowDuration
267
easing: UbuntuAnimation.StandardEasing
272
id: directionContainer
273
objectName: "fingerprintDirectionVisual"
274
anchors.centerIn: parent
277
imageContainer.width*imageContainer.width
278
+ imageContainer.height*imageContainer.height
289
leftMargin: units.gu(2.9)
291
rightMargin: units.gu(2.9)
293
topMargin: units.gu(5)
295
initialText: i18n.dtr("ubuntu-settings-components",
296
"Swipe your finger over the reader.")
297
objectName: "fingerprintStatusLabel"
303
objectName: "fingerprintProgressLabel"
304
property int progress: 0
306
top: fingerprintBox.bottom
307
topMargin: units.gu(1.5)
308
horizontalCenter: parent.horizontalCenter
310
text: i18n.dtr("ubuntu-settings-components", "%1%").arg((progress).toFixed());
312
horizontalAlignment: Text.AlignHCenter
314
color: theme.palette.normal.backgroundTertiaryText
316
Behavior on opacity { UbuntuNumberAnimation {} }
317
Behavior on progress {
319
duration: UbuntuAnimation.SlowDuration
320
easing: UbuntuAnimation.StandardEasing
331
bottom: parent.bottom
334
// Color and height values are copied from the Wizard.
340
property alias text: cancelButtonText.text
341
objectName: "fingerprintSetupCancelButton"
344
leftMargin: units.gu(3)
345
verticalCenter: parent.verticalCenter
347
height: parent.height
356
anchors.verticalCenter: parent.verticalCenter
357
text: i18n.dtr("ubuntu-settings-components", "Cancel")
363
property alias text: doneButtonText.text
364
objectName: "fingerprintSetupDoneButton"
367
rightMargin: units.gu(3)
368
verticalCenter: parent.verticalCenter
371
height: parent.height
373
onClicked: pageStack.pop()
378
verticalCenter: parent.verticalCenter
381
font.bold: parent.enabled
382
text: i18n.dtr("ubuntu-settings-components", "Next")