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
=== modified file 'plugins/security-privacy/LockSecurity.qml'
--- plugins/security-privacy/LockSecurity.qml 2015-01-27 16:35:08 +0000
+++ plugins/security-privacy/LockSecurity.qml 2015-01-28 14:36:58 +0000
@@ -353,7 +353,23 @@
353 else353 else
354 return i18n.tr("Set")354 return i18n.tr("Set")
355 }355 }
356 enabled: newInput.acceptableInput356 /* see https://wiki.ubuntu.com/SecurityAndPrivacySettings#Phone for details */
357 enabled: /* Validate the old method, it's either swipe or a secret which needs
358 to be valid, 4 digits for the passcode or > 0 for a passphrase */
359 (changeSecurityDialog.oldMethod === UbuntuSecurityPrivacyPanel.Swipe ||
360 ((changeSecurityDialog.oldMethod === UbuntuSecurityPrivacyPanel.Passcode &&
361 currentInput.text.length === 4) ||
362 (changeSecurityDialog.oldMethod === UbuntuSecurityPrivacyPanel.Passphrase &&
363 currentInput.text.length > 0))) &&
364 /* Validate the new auth method, either it's a passcode and the code needs to be 4 digits */
365 ((changeSecurityDialog.newMethod === UbuntuSecurityPrivacyPanel.Passcode &&
366 newInput.text.length === 4 && confirmInput.text.length === 4) ||
367 /* or a passphrase and then > 0 */
368 (changeSecurityDialog.newMethod === UbuntuSecurityPrivacyPanel.Passphrase &&
369 newInput.text.length > 0 && confirmInput.text.length > 0) ||
370 /* or to be swipe */
371 changeSecurityDialog.newMethod === UbuntuSecurityPrivacyPanel.Swipe)
372
357 onClicked: {373 onClicked: {
358 changeSecurityDialog.enabled = false374 changeSecurityDialog.enabled = false
359 incorrect.text = ""375 incorrect.text = ""

Subscribers

People subscribed via source and target branches