2 * Copyright (C) 2013 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18import Ubuntu.Components 0.1
23 anchors.centerIn: parent
24 spacing: units.gu(2.5)
26 property alias placeholderText: pinentryField.placeholderText
27 property int padWidth: units.gu(32)
28 property int pinLength: 4
30 signal entered(string passphrase)
33 function clear(playAnimation) {
34 pinentryField.text = "";
36 wrongPasswordAnimation.start();
42 objectName: "pinentryField"
43 anchors.horizontalCenter: parent.horizontalCenter
46 echoMode: TextInput.Password
47 font.pixelSize: units.dp(44)
51 horizontalAlignment: Text.AlignHCenter
54 if (pinentryField.text.length === root.pinLength) {
55 root.entered(pinentryField.text);
59 // Using a MouseArea to eat clicks. We don't want to disable the TextField for styling reasons
69 margins: (parent.width - root.padWidth) / 2
79 objectName: "pinPadButton" + (index + 1)
83 pinentryField.text = pinentryField.text + text
89 objectName: "pinPadButtonBack"
91 onClicked: root.cancel();
95 objectName: "pinPadButton0"
97 onClicked: pinentryField.text = pinentryField.text + text
101 objectName: "pinPadButtonErase"
103 onClicked: pinentryField.text = pinentryField.text.substring(0, pinentryField.text.length-1)
107 WrongPasswordAnimation {
108 id: wrongPasswordAnimation
109 target: pinentryField
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list