@@ -35,44 +35,39 @@ 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 Security")
39 forwardButtonSourceComponent: forwardButton
39 forwardButtonSourceComponent: forwardButton
42 function indexToMethod(index) {
41 function indexToMethod(index) {
43− if (index === 0)
42+ if (index === 1)
44 return UbuntuSecurityPrivacyPanel.Passcode
43 return UbuntuSecurityPrivacyPanel.Passcode
45− else if (index === 1)
44+ else if (index === 0)
46 return UbuntuSecurityPrivacyPanel.Passphrase
45 return UbuntuSecurityPrivacyPanel.Passphrase
48− return UbuntuSecurityPrivacyPanel.Swipe
51 function methodToIndex(method) {
48 function methodToIndex(method) {
52− if (method === UbuntuSecurityPrivacyPanel.Swipe)
49+ if (method === UbuntuSecurityPrivacyPanel.Passcode)
54− else if (method === UbuntuSecurityPrivacyPanel.Passcode)
51+ else if (method === UbuntuSecurityPrivacyPanel.Passphrase)
60 Component.onCompleted: {
55 Component.onCompleted: {
61 selector.currentIndex = methodToIndex(root.passwordMethod)
56 selector.currentIndex = methodToIndex(root.passwordMethod)
65 id: column
60 id: column
66 anchors.fill: content
61 anchors.fill: content
68 anchors.topMargin: units.gu(4)
62 anchors.topMargin: units.gu(4)
71 anchors.left: parent.left
66 anchors.left: parent.left
72 anchors.right: parent.right
67 anchors.right: parent.right
73 wrapMode: Text.Wrap
68 wrapMode: Text.Wrap
74 text: i18n.tr("Choose how to secure your device to protect your personal information.")
69 text: i18n.tr("Choose how to secure your device to protect your personal information.")
75− color: "black"
70+ color: "#525252"
76 fontSize: "small"
71 fontSize: "small"
77 font.weight: Font.Light
72 font.weight: Font.Light
@@ -81,13 +76,15 @@ LocalComponents.Page {
81 id: selector
76 id: selector
82 anchors.left: parent.left
77 anchors.left: parent.left
83 anchors.right: parent.right
78 anchors.right: parent.right
79+ anchors.top: infoLabel.bottom
80+ anchors.topMargin: units.gu(3)
85 boundsBehavior: Flickable.StopAtBounds;
82 boundsBehavior: Flickable.StopAtBounds;
86 clip: true;
83 clip: true;
87− height: column.height
84+ height: childrenRect.height
89 // this is the order we want to display it; cf indexToMethod()
86 // 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]
92 delegate: ListItem {
89 delegate: ListItem {
93 id: itemDelegate
90 id: itemDelegate
@@ -97,7 +94,7 @@ LocalComponents.Page {
97 objectName: "passwdDelegate" + index
94 objectName: "passwdDelegate" + index
98 anchors.verticalCenter: parent.verticalCenter;
95 anchors.verticalCenter: parent.verticalCenter;
99 fontSize: "medium"
96 fontSize: "medium"
100− color: "black"
97+ color: "#525252"
101 font.weight: itemDelegate.isCurrent ? Font.Normal : Font.Light
98 font.weight: itemDelegate.isCurrent ? Font.Normal : Font.Light
103 var method = modelData
100 var method = modelData
@@ -134,6 +131,74 @@ 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()
139 Component {
204 Component {
@@ -141,8 +206,12 @@ LocalComponents.Page {
141 LocalComponents.StackButton {
206 LocalComponents.StackButton {
142 text: i18n.tr("Next")
207 text: i18n.tr("Next")
143 onClicked: {
208 onClicked: {
144− print("Clicked next")
209+ if (!requiredSwitch.checked) { // == swipe method
210+ root.passwordMethod = UbuntuSecurityPrivacyPanel.Swipe
145− root.passwordMethod = indexToMethod(selector.currentIndex)
212+ root.passwordMethod = indexToMethod(selector.currentIndex)
146 print("Current method: " + root.passwordMethod)
215 print("Current method: " + root.passwordMethod)
147 pageStack.load(Qt.resolvedUrl("passwd-set.qml"))
216 pageStack.load(Qt.resolvedUrl("passwd-set.qml"))