2 * Copyright (C) 2014 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU 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 General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 import Ubuntu.Components 1.3
19 import Ubuntu.SystemSettings.SecurityPrivacy 1.0
20 import ".." as LocalComponents
21 import "../../Components" as UnityComponents
24 * See the main passwd-type page for an explanation of why we don't actually
25 * directly set the password here.
28 LocalComponents.Page {
30 objectName: "passwdConfirmPage"
31 forwardButtonSourceComponent: forwardButton
33 skip: root.passwordMethod === UbuntuSecurityPrivacyPanel.Swipe
35 // If we are entering this page, clear any saved password and get focus
36 onEnabledChanged: if (enabled) lockscreen.clear(false)
38 UnityComponents.Lockscreen {
43 leftMargin: leftMargin
44 rightMargin: rightMargin
45 bottomMargin: buttonMargin
48 infoText: root.passwordMethod === UbuntuSecurityPrivacyPanel.Passphrase ?
49 i18n.tr("Confirm passphrase") :
50 i18n.tr("Confirm passcode")
52 errorText: root.passwordMethod === UbuntuSecurityPrivacyPanel.Passphrase ?
53 i18n.tr("Sorry, incorrect passphrase.") + "\n" + i18n.tr("Please try again.") :
54 i18n.tr("Sorry, incorrect passcode.") + "\n" + i18n.tr("Please try again.")
56 showEmergencyCallButton: false
57 showCancelButton: false
58 alphaNumeric: root.passwordMethod === UbuntuSecurityPrivacyPanel.Passphrase
63 if (passphrase === root.password) {
72 interval: UbuntuAnimation.SnapDuration
73 onTriggered: pageStack.next()
79 LocalComponents.StackButton {
80 visible: root.passwordMethod === UbuntuSecurityPrivacyPanel.Passphrase
81 enabled: root.password === lockscreen.passphrase
82 text: i18n.tr("Continue")
83 onClicked: pageStack.next()