on xenial help sign in
custom PIN entry page for desktop mode
commitd1c4cf6ae7a88ea16c36968a09ea8f2f5c0b9574 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateFri 18 Dec 2015, 16:09 (11 years ago) parente8703fd
3 files changed+105−2
qml/Wizard/Pages/50-timezone.qml+1−1 qml/Wizard/Pages/70-passwd-type.qml+5−1 qml/Wizard/Pages/passcode-desktop.qml+99
qml/Wizard/Pages/50-timezone.qml+1−1
@@ -165,7 +165,7 @@ LocalComponents.Page {
165165 top: divider.bottom
166166 }
167167
168− height: column.height - searchField.height - customMargin - topMargin - divider.height
168+ height: column.height - searchField.height - column.anchors.topMargin - divider.height
169169 model: tzFilterModel
170170 delegate: tzComponent
171171 }
qml/Wizard/Pages/70-passwd-type.qml+5−1
@@ -147,7 +147,11 @@ LocalComponents.Page {
147147 else
148148 pageStack.next(); // got the password already, go next page
149149 } else if (method === UbuntuSecurityPrivacyPanel.Passcode) { // passcode
150− pageStack.load(Qt.resolvedUrl("passcode-set.qml"));
150+ if (desktopLook) {
151+ pageStack.load(Qt.resolvedUrl("passcode-desktop.qml"));
152+ } else {
153+ pageStack.load(Qt.resolvedUrl("passcode-set.qml"));
154+ }
151155 } else { //swipe
152156 pageStack.next();
153157 }
qml/Wizard/Pages/passcode-desktop.qmlnew file+99
@@ -0,0 +1,99 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
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.
7+ *
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.
12+ *
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/>.
15+ */
16+
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import ".." as LocalComponents
20+
21+/**
22+ * See the main passwd-type page for an explanation of why we don't actually
23+ * directly set the password here.
24+ */
25+
26+LocalComponents.Page {
27+ id: passwdSetPage
28+ objectName: "passcodeDesktopPage"
29+ title: i18n.tr("Lock Screen Passcode")
30+ forwardButtonSourceComponent: forwardButton
31+
32+ property alias password: passwordField.text
33+
34+ Column {
35+ id: column
36+ anchors.fill: content
37+ anchors.leftMargin: leftMargin
38+ anchors.rightMargin: rightMargin
39+ anchors.topMargin: customMargin
40+ spacing: units.gu(3)
41+
42+ Label {
43+ id: infoLabel
44+ objectName: "infoLabel"
45+ anchors {
46+ left: parent.left
47+ right: parent.right
48+ }
49+ wrapMode: Text.Wrap
50+ font.weight: Font.Light
51+ color: textColor
52+ text: i18n.tr("Enter 4 numbers to setup your passcode")
53+ }
54+
55+ Grid {
56+ columns: 2
57+ spacing: units.gu(2)
58+ verticalItemAlignment: Grid.AlignVCenter
59+
60+ Label {
61+ text: i18n.tr("Choose passcode")
62+ color: textColor
63+ }
64+ LocalComponents.WizardTextField {
65+ id: passwordField
66+ objectName: "passwordField"
67+ echoMode: TextInput.Password
68+ inputMethodHints: Qt.ImhDigitsOnly
69+ validator: RegExpValidator { regExp: /^\d{4}$/ }
70+ maximumLength: 4
71+ }
72+
73+ Label {
74+ text: i18n.tr("Confirm passcode")
75+ color: textColor
76+ }
77+ LocalComponents.WizardTextField {
78+ id: password2Field
79+ objectName: "password2Field"
80+ echoMode: TextInput.Password
81+ inputMethodHints: Qt.ImhDigitsOnly
82+ validator: RegExpValidator { regExp: /^\d{4}$/ }
83+ maximumLength: 4
84+ }
85+ }
86+ }
87+
88+ Component {
89+ id: forwardButton
90+ LocalComponents.StackButton {
91+ text: i18n.tr("Next")
92+ enabled: password != "" && password == password2Field.text
93+ onClicked: {
94+ root.password = password;
95+ pageStack.next();
96+ }
97+ }
98+ }
99+}