2 * Copyright (C) 2014-2016 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/>.
18import Lomiri.Components 1.3
19import Lomiri.SystemSettings.SecurityPrivacy 1.0
20import ".." as LocalComponents
21import "../../Components"
24 * See the main passwd-type page for an explanation of why we don't actually
25 * directly set the password here.
30 objectName: "passcodeSetPage"
32 backButtonText: i18n.tr("Cancel")
34 // If we are entering this page, clear any saved password and get focus
35 onEnabledChanged: if (enabled) lockscreen.clear(false)
38 root.password = lockscreen.passphrase;
44 interval: LomiriAnimation.SnapDuration
45 onTriggered: pageStack.load(Qt.resolvedUrl("passcode-confirm.qml"));
54 infoText: i18n.tr("Choose passcode")
55 foregroundColor: textColor
57 // Note that the number four comes from PAM settings,
58 // which we don't have a good way to interrogate. We
59 // only do this matching instead of PAM because we want
60 // to set the password via PAM in a different place
61 // than this page. See comments at top of passwd-type file.
62 errorText: i18n.tr("Passcode must be at least 4 characters long")
64 showEmergencyCallButton: false
65 showCancelButton: false
71 if (passphrase.length >= 4) {
72 passcodeSetPage.confirm();
74 lockscreen.clear(true);