~josharenson/unity8/fix-greeter-password-focus

« back to all changes in this revision

Viewing changes to qml/Wizard/Pages/passcode-confirm.qml

  • Committer: Josh Arenson
  • Date: 2016-03-25 19:54:02 UTC
  • mfrom: (1979.1.9 session-chooser-gui)
  • Revision ID: joshua.arenson@canonical.com-20160325195402-867v3w2zvmjj0kq3
merge prereq

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2014 Canonical, Ltd.
 
2
 * Copyright (C) 2014-2016 Canonical, Ltd.
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
5
5
 * it under the terms of the GNU General Public License as published by
26
26
 */
27
27
 
28
28
LocalComponents.Page {
29
 
    id: passwdConfirmPage
30
 
    objectName: "passwdConfirmPage"
31
 
    forwardButtonSourceComponent: forwardButton
32
 
 
33
 
    skip: root.passwordMethod === UbuntuSecurityPrivacyPanel.Swipe
 
29
    id: passcodeConfirmPage
 
30
    objectName: "passcodeConfirmPage"
 
31
    customTitle: true
 
32
    backButtonText: i18n.tr("Cancel")
34
33
 
35
34
    // If we are entering this page, clear any saved password and get focus
36
35
    onEnabledChanged: if (enabled) lockscreen.clear(false)
38
37
    UnityComponents.Lockscreen {
39
38
        id: lockscreen
40
39
        anchors {
41
 
            fill: parent
42
 
            topMargin: topMargin
43
 
            leftMargin: leftMargin
44
 
            rightMargin: rightMargin
45
 
            bottomMargin: buttonMargin
 
40
            fill: content
46
41
        }
47
42
 
48
 
        infoText: root.passwordMethod === UbuntuSecurityPrivacyPanel.Passphrase ?
49
 
                  i18n.tr("Confirm passphrase") :
50
 
                  i18n.tr("Confirm passcode")
51
 
 
52
 
        errorText: root.passwordMethod === UbuntuSecurityPrivacyPanel.Passphrase ?
53
 
                  i18n.tr("Sorry, incorrect passphrase.") + "\n" + i18n.tr("Please try again.") :
54
 
                  i18n.tr("Sorry, incorrect passcode.") + "\n" + i18n.tr("Please try again.")
 
43
        infoText: i18n.tr("Confirm passcode")
 
44
 
 
45
        errorText: i18n.tr("Incorrect passcode.") + "\n" + i18n.ctr("Enter the passcode again", "Please re-enter.")
 
46
 
 
47
        foregroundColor: textColor
55
48
 
56
49
        showEmergencyCallButton: false
57
50
        showCancelButton: false
58
 
        alphaNumeric: root.passwordMethod === UbuntuSecurityPrivacyPanel.Passphrase
 
51
        alphaNumeric: false
59
52
        minPinLength: 4
60
53
        maxPinLength: 4
61
54
 
62
55
        onEntered: {
63
56
            if (passphrase === root.password) {
64
 
                confirmTimer.start()
 
57
                confirmTimer.start();
65
58
            } else {
66
 
                clear(true)
 
59
                clear(true);
67
60
            }
68
61
        }
69
62
 
73
66
            onTriggered: pageStack.next()
74
67
        }
75
68
    }
76
 
 
77
 
    Component {
78
 
        id: forwardButton
79
 
        LocalComponents.StackButton {
80
 
            visible: root.passwordMethod === UbuntuSecurityPrivacyPanel.Passphrase
81
 
            enabled: root.password === lockscreen.passphrase
82
 
            text: i18n.tr("Continue")
83
 
            onClicked: pageStack.next()
84
 
        }
85
 
    }
86
69
}