@@ -25,7 +25,7 @@ import ".." as LocalComponents
2525 * answer. We don't run as root, so if we did set the password immediately,
2626 * we'd need to prompt for their previous password when they came back and
2727 * 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).
2929 * Setting the password shouldn't fail, since Ubuntu Touch has loose password
3030 * requirements, but we'll check what we can here. Ideally we'd be able to ask
3131 * the system if a password is legal without actually setting that password.
@@ -35,7 +35,7 @@ LocalComponents.Page {
3535 id: passwdPage
3636 objectName: "passwdPage"
3737
38− title: i18n.tr("Lock Security")
38+ title: i18n.tr("Lock Screen")
3939 forwardButtonSourceComponent: forwardButton
4040
4141 function indexToMethod(index) {
@@ -43,6 +43,8 @@ LocalComponents.Page {
4343 return UbuntuSecurityPrivacyPanel.Passcode
4444 else if (index === 0)
4545 return UbuntuSecurityPrivacyPanel.Passphrase
46+ else
47+ return UbuntuSecurityPrivacyPanel.Swipe
4648 }
4749
4850 function methodToIndex(method) {
@@ -50,6 +52,8 @@ LocalComponents.Page {
5052 return 1
5153 else if (method === UbuntuSecurityPrivacyPanel.Passphrase)
5254 return 0
55+ else
56+ return 2
5357 }
5458
5559 Component.onCompleted: {
@@ -66,7 +70,7 @@ LocalComponents.Page {
6670 anchors.left: parent.left
6771 anchors.right: parent.right
6872 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")
7074 color: "#525252"
7175 fontSize: "small"
7276 font.weight: Font.Light
@@ -84,7 +88,7 @@ LocalComponents.Page {
8488 height: childrenRect.height
8589
8690 // 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]
8892
8993 delegate: ListItem {
9094 id: itemDelegate
@@ -131,74 +135,6 @@ LocalComponents.Page {
131135 }
132136 }
133137 }
134−
135− Switch {
136− id: requiredSwitch
137− anchors.left: parent.left
138− anchors.top: selector.bottom
139− anchors.topMargin: units.gu(1)
140− checked: true
141− }
142−
143− Label {
144− id: requiredLabel
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)
150− wrapMode: Text.Wrap
151− text: i18n.tr("Require my password or passcode to access my device")
152− color: "#525252"
153− opacity: requiredSwitch.checked ? 1 : 0.5
154− fontSize: "small"
155− font.weight: Font.Light
156− MouseArea {
157− anchors.fill: parent
158− onClicked: requiredSwitch.trigger()
159− }
160− }
161−
162− Label {
163− id: requiredInfo
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)
169− wrapMode: Text.Wrap
170− text: i18n.tr("You will still be required to enter password or passcode to gain admin privileges")
171− color: "#888888"
172− opacity: requiredSwitch.checked ? 1 : 0.5
173− fontSize: "x-small"
174− font.weight: Font.Light
175− }
176−
177− CheckBox {
178− id: encryptCheck
179− anchors.left: requiredLabel.left
180− anchors.top: requiredInfo.bottom
181− anchors.topMargin: units.gu(1)
182− visible: requiredSwitch.checked
183− }
184−
185− Label {
186− id: encryptLabel
187− anchors.left: encryptCheck.right
188− anchors.right: parent.right
189− anchors.verticalCenter: encryptCheck.verticalCenter
190− anchors.leftMargin: units.gu(.5)
191− wrapMode: Text.Wrap
192− text: i18n.tr("Encrypt my content")
193− color: "#525252"
194− font.weight: Font.Light
195− fontSize: "small"
196− visible: requiredSwitch.checked
197− MouseArea {
198− anchors.fill: parent
199− onClicked: encryptCheck.trigger()
200− }
201− }
202138 }
203139
204140 Component {
@@ -207,19 +143,15 @@ LocalComponents.Page {
207143 text: i18n.tr("Next")
208144 onClicked: {
209145 var method = indexToMethod(selector.currentIndex)
210−
211− if (!requiredSwitch.checked) {
212− root.passwordMethod = UbuntuSecurityPrivacyPanel.Swipe
213− } else {
214− root.passwordMethod = method
215− }
216−
146+ root.passwordMethod = method
217147 print("Current method: " + root.passwordMethod)
218148
219149 if (method === UbuntuSecurityPrivacyPanel.Passphrase) {
220150 pageStack.load(Qt.resolvedUrl("password-set.qml"))
221151 } else if (method === UbuntuSecurityPrivacyPanel.Passcode) {
222152 pageStack.load(Qt.resolvedUrl("passcode-set.qml"))
153+ } else {
154+ pageStack.next()
223155 }
224156 }
225157 }