@@ -25,7 +25,7 @@ import ".." as LocalComponents
25 * answer. We don't run as root, so if we did set the password immediately,
25 * answer. We don't run as root, so if we did set the password immediately,
26 * we'd need to prompt for their previous password when they came back and
26 * we'd need to prompt for their previous password when they came back and
27 * changed their answer. Which is silly UX. So instead, we just keep track
27 * changed their answer. Which is silly UX. So instead, we just keep track
28− * of their choice and set the password at the end (see main.qml).
28+ * of their choice and set the password at the end (see Pages.qml).
29 * Setting the password shouldn't fail, since Ubuntu Touch has loose password
29 * Setting the password shouldn't fail, since Ubuntu Touch has loose password
30 * requirements, but we'll check what we can here. Ideally we'd be able to ask
30 * requirements, but we'll check what we can here. Ideally we'd be able to ask
31 * the system if a password is legal without actually setting that password.
31 * the system if a password is legal without actually setting that password.
@@ -35,7 +35,7 @@ LocalComponents.Page {
35 id: passwdPage
35 id: passwdPage
36 objectName: "passwdPage"
36 objectName: "passwdPage"
38− title: i18n.tr("Lock Security")
38+ title: i18n.tr("Lock Screen")
39 forwardButtonSourceComponent: forwardButton
39 forwardButtonSourceComponent: forwardButton
41 function indexToMethod(index) {
41 function indexToMethod(index) {
@@ -43,6 +43,8 @@ LocalComponents.Page {
43 return UbuntuSecurityPrivacyPanel.Passcode
43 return UbuntuSecurityPrivacyPanel.Passcode
44 else if (index === 0)
44 else if (index === 0)
45 return UbuntuSecurityPrivacyPanel.Passphrase
45 return UbuntuSecurityPrivacyPanel.Passphrase
47+ return UbuntuSecurityPrivacyPanel.Swipe
48 function methodToIndex(method) {
50 function methodToIndex(method) {
@@ -50,6 +52,8 @@ LocalComponents.Page {
51 else if (method === UbuntuSecurityPrivacyPanel.Passphrase)
53 else if (method === UbuntuSecurityPrivacyPanel.Passphrase)
55 Component.onCompleted: {
59 Component.onCompleted: {
@@ -66,7 +70,7 @@ LocalComponents.Page {
66 anchors.left: parent.left
70 anchors.left: parent.left
67 anchors.right: parent.right
71 anchors.right: parent.right
68 wrapMode: Text.Wrap
72 wrapMode: Text.Wrap
69− text: i18n.tr("Choose how to secure your device to protect your personal information.")
73+ text: i18n.tr("Choose lock screen security")
70 color: "#525252"
74 color: "#525252"
71 fontSize: "small"
75 fontSize: "small"
72 font.weight: Font.Light
76 font.weight: Font.Light
@@ -84,7 +88,7 @@ LocalComponents.Page {
84 height: childrenRect.height
88 height: childrenRect.height
86 // this is the order we want to display it; cf indexToMethod()
90 // this is the order we want to display it; cf indexToMethod()
87− model: [UbuntuSecurityPrivacyPanel.Passphrase, UbuntuSecurityPrivacyPanel.Passcode]
91+ model: [UbuntuSecurityPrivacyPanel.Passphrase, UbuntuSecurityPrivacyPanel.Passcode, UbuntuSecurityPrivacyPanel.Swipe]
89 delegate: ListItem {
93 delegate: ListItem {
90 id: itemDelegate
94 id: itemDelegate
@@ -131,74 +135,6 @@ LocalComponents.Page {
137− anchors.left: parent.left
138− anchors.top: selector.bottom
139− anchors.topMargin: units.gu(1)
145− anchors.left: requiredSwitch.right
146− anchors.right: parent.right
147− anchors.top: selector.bottom
148− anchors.topMargin: units.gu(1)
149− anchors.leftMargin: units.gu(1)
151− text: i18n.tr("Require my password or passcode to access my device")
153− opacity: requiredSwitch.checked ? 1 : 0.5
155− font.weight: Font.Light
157− anchors.fill: parent
158− onClicked: requiredSwitch.trigger()
164− anchors.left: requiredSwitch.right
165− anchors.right: parent.right
166− anchors.top: requiredLabel.bottom
167− anchors.topMargin: units.gu(1)
168− anchors.leftMargin: units.gu(1)
170− text: i18n.tr("You will still be required to enter password or passcode to gain admin privileges")
172− opacity: requiredSwitch.checked ? 1 : 0.5
174− font.weight: Font.Light
179− anchors.left: requiredLabel.left
180− anchors.top: requiredInfo.bottom
181− anchors.topMargin: units.gu(1)
182− visible: requiredSwitch.checked
187− anchors.left: encryptCheck.right
188− anchors.right: parent.right
189− anchors.verticalCenter: encryptCheck.verticalCenter
190− anchors.leftMargin: units.gu(.5)
192− text: i18n.tr("Encrypt my content")
194− font.weight: Font.Light
196− visible: requiredSwitch.checked
198− anchors.fill: parent
199− onClicked: encryptCheck.trigger()
204 Component {
140 Component {
@@ -207,19 +143,15 @@ LocalComponents.Page {
207 text: i18n.tr("Next")
143 text: i18n.tr("Next")
208 onClicked: {
144 onClicked: {
209 var method = indexToMethod(selector.currentIndex)
145 var method = indexToMethod(selector.currentIndex)
211− if (!requiredSwitch.checked) {
212− root.passwordMethod = UbuntuSecurityPrivacyPanel.Swipe
214− root.passwordMethod = method
146+ root.passwordMethod = method
217 print("Current method: " + root.passwordMethod)
147 print("Current method: " + root.passwordMethod)
219 if (method === UbuntuSecurityPrivacyPanel.Passphrase) {
149 if (method === UbuntuSecurityPrivacyPanel.Passphrase) {
220 pageStack.load(Qt.resolvedUrl("password-set.qml"))
150 pageStack.load(Qt.resolvedUrl("password-set.qml"))
221 } else if (method === UbuntuSecurityPrivacyPanel.Passcode) {
151 } else if (method === UbuntuSecurityPrivacyPanel.Passcode) {
222 pageStack.load(Qt.resolvedUrl("passcode-set.qml"))
152 pageStack.load(Qt.resolvedUrl("passcode-set.qml"))