Merge lp:~seb128/ubuntu-system-settings/security-confirmation-enabled into lp:ubuntu-system-settings

Proposed by Sebastien Bacher
Status: Merged
Approved by: Ken VanDine
Approved revision: 1280
Merged at revision: 1284
Proposed branch: lp:~seb128/ubuntu-system-settings/security-confirmation-enabled
Merge into: lp:ubuntu-system-settings
Diff against target: 28 lines (+17/-1)
1 file modified
plugins/security-privacy/LockSecurity.qml (+17/-1)
To merge this branch: bzr merge lp:~seb128/ubuntu-system-settings/security-confirmation-enabled
Reviewer Review Type Date Requested Status
Ken VanDine Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+247839@code.launchpad.net

Commit message

[security-privacy] enable the confirmation button only in the cases
described by the specification

Description of the change

[security-privacy] enable the confirmation button only in the cases
described by the specification

To post a comment you must log in.
1280. By Sebastien Bacher

[security-privacy] enable the confirmation button only in the cases
described by the specification

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Thanks, that had to be painful to put together that enabled check. Looks good and I tested all the scenarios.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/security-privacy/LockSecurity.qml'
2--- plugins/security-privacy/LockSecurity.qml 2015-01-27 16:35:08 +0000
3+++ plugins/security-privacy/LockSecurity.qml 2015-01-28 14:36:58 +0000
4@@ -353,7 +353,23 @@
5 else
6 return i18n.tr("Set")
7 }
8- enabled: newInput.acceptableInput
9+ /* see https://wiki.ubuntu.com/SecurityAndPrivacySettings#Phone for details */
10+ enabled: /* Validate the old method, it's either swipe or a secret which needs
11+ to be valid, 4 digits for the passcode or > 0 for a passphrase */
12+ (changeSecurityDialog.oldMethod === UbuntuSecurityPrivacyPanel.Swipe ||
13+ ((changeSecurityDialog.oldMethod === UbuntuSecurityPrivacyPanel.Passcode &&
14+ currentInput.text.length === 4) ||
15+ (changeSecurityDialog.oldMethod === UbuntuSecurityPrivacyPanel.Passphrase &&
16+ currentInput.text.length > 0))) &&
17+ /* Validate the new auth method, either it's a passcode and the code needs to be 4 digits */
18+ ((changeSecurityDialog.newMethod === UbuntuSecurityPrivacyPanel.Passcode &&
19+ newInput.text.length === 4 && confirmInput.text.length === 4) ||
20+ /* or a passphrase and then > 0 */
21+ (changeSecurityDialog.newMethod === UbuntuSecurityPrivacyPanel.Passphrase &&
22+ newInput.text.length > 0 && confirmInput.text.length > 0) ||
23+ /* or to be swipe */
24+ changeSecurityDialog.newMethod === UbuntuSecurityPrivacyPanel.Swipe)
25+
26 onClicked: {
27 changeSecurityDialog.enabled = false
28 incorrect.text = ""

Subscribers

People subscribed via source and target branches