@@ -35,44 +35,39 @@ LocalComponents.Page {
3535 id: passwdPage
3636 objectName: "passwdPage"
3737
38− title: i18n.tr("Lock security")
38+ title: i18n.tr("Lock Security")
3939 forwardButtonSourceComponent: forwardButton
40− skip: false
4140
4241 function indexToMethod(index) {
43− if (index === 0)
42+ if (index === 1)
4443 return UbuntuSecurityPrivacyPanel.Passcode
45− else if (index === 1)
44+ else if (index === 0)
4645 return UbuntuSecurityPrivacyPanel.Passphrase
47− else
48− return UbuntuSecurityPrivacyPanel.Swipe
4946 }
5047
5148 function methodToIndex(method) {
52− if (method === UbuntuSecurityPrivacyPanel.Swipe)
53− return 2
54− else if (method === UbuntuSecurityPrivacyPanel.Passcode)
55− return 0
56− else
49+ if (method === UbuntuSecurityPrivacyPanel.Passcode)
5750 return 1
51+ else if (method === UbuntuSecurityPrivacyPanel.Passphrase)
52+ return 0
5853 }
5954
6055 Component.onCompleted: {
6156 selector.currentIndex = methodToIndex(root.passwordMethod)
6257 }
6358
64− Column {
59+ Item {
6560 id: column
6661 anchors.fill: content
67− spacing: units.gu(4)
6862 anchors.topMargin: units.gu(4)
6963
7064 Label {
65+ id: infoLabel
7166 anchors.left: parent.left
7267 anchors.right: parent.right
7368 wrapMode: Text.Wrap
7469 text: i18n.tr("Choose how to secure your device to protect your personal information.")
75− color: "black"
70+ color: "#525252"
7671 fontSize: "small"
7772 font.weight: Font.Light
7873 }
@@ -81,13 +76,15 @@ LocalComponents.Page {
8176 id: selector
8277 anchors.left: parent.left
8378 anchors.right: parent.right
79+ anchors.top: infoLabel.bottom
80+ anchors.topMargin: units.gu(3)
8481
8582 boundsBehavior: Flickable.StopAtBounds;
8683 clip: true;
87− height: column.height
84+ height: childrenRect.height
8885
8986 // this is the order we want to display it; cf indexToMethod()
90− model: [UbuntuSecurityPrivacyPanel.Passcode, UbuntuSecurityPrivacyPanel.Passphrase, UbuntuSecurityPrivacyPanel.Swipe]
87+ model: [UbuntuSecurityPrivacyPanel.Passphrase, UbuntuSecurityPrivacyPanel.Passcode]
9188
9289 delegate: ListItem {
9390 id: itemDelegate
@@ -97,7 +94,7 @@ LocalComponents.Page {
9794 objectName: "passwdDelegate" + index
9895 anchors.verticalCenter: parent.verticalCenter;
9996 fontSize: "medium"
100− color: "black"
97+ color: "#525252"
10198 font.weight: itemDelegate.isCurrent ? Font.Normal : Font.Light
10299 text: {
103100 var method = modelData
@@ -134,6 +131,74 @@ LocalComponents.Page {
134131 }
135132 }
136133 }
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+ }
137202 }
138203
139204 Component {
@@ -141,8 +206,12 @@ LocalComponents.Page {
141206 LocalComponents.StackButton {
142207 text: i18n.tr("Next")
143208 onClicked: {
144− print("Clicked next")
145− root.passwordMethod = indexToMethod(selector.currentIndex)
209+ if (!requiredSwitch.checked) { // == swipe method
210+ root.passwordMethod = UbuntuSecurityPrivacyPanel.Swipe
211+ } else {
212+ root.passwordMethod = indexToMethod(selector.currentIndex)
213+ }
214+
146215 print("Current method: " + root.passwordMethod)
147216 pageStack.load(Qt.resolvedUrl("passwd-set.qml"))
148217 }