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
19import Ubuntu.Components.ListItems 0.1
24 anchors.centerIn: parent
25 spacing: units.gu(3.5)
27 property alias placeholderText: pinentryField.placeholderText
28 property int padWidth: units.gu(34)
29 property int padHeight: units.gu(28)
30 property int pinLength: 4
32 signal entered(string passphrase)
35 property bool entryEnabled: true
37 function clear(playAnimation) {
38 pinentryField.text = "";
40 wrongPasswordAnimation.start();
47 objectName: "pinentryField"
48 anchors.horizontalCenter: parent.horizontalCenter
53 property string text: ""
54 property string placeholderText: ""
56 pinentryFieldLabel.text = "";
57 for (var i = 0; i < text.length; ++i) {
58 pinentryFieldLabel.text += "•";
60 if (text.length === root.pinLength) {
66 id: pinentryFieldLabel
67 anchors.centerIn: parent
68 font.pixelSize: units.dp(44)
73 id: pinentryFieldPlaceHolder
74 anchors.centerIn: parent
76 text: parent.placeholderText
77 visible: pinentryFieldLabel.text.length == 0
85 margins: (parent.width - root.padWidth) / 2
87 height: root.padHeight
96 topMargin: root.padHeight / 4
103 verticalCenter: parent.verticalCenter
110 bottom: parent.bottom
111 bottomMargin: root.padHeight / 4
116 anchors.centerIn: parent
117 anchors.horizontalCenterOffset: -root.padWidth / 6
118 width: root.padHeight
122 anchors.centerIn: parent
123 anchors.horizontalCenterOffset: root.padWidth / 6
124 width: root.padHeight
132 margins: (parent.width - root.padWidth) / 2
141 objectName: "pinPadButton" + (index + 1)
142 width: root.padWidth / 3
143 height: root.padHeight / 4
145 enabled: entryEnabled
148 pinentryField.text = pinentryField.text + text;
154 objectName: "pinPadButtonBack"
155 width: root.padWidth / 3
156 height: root.padHeight / 4
158 onClicked: root.cancel();
162 objectName: "pinPadButton0"
163 width: root.padWidth / 3
164 height: root.padHeight / 4
166 onClicked: pinentryField.text = pinentryField.text + text
167 enabled: entryEnabled
171 objectName: "pinPadButtonErase"
172 width: root.padWidth / 3
173 height: root.padHeight / 4
175 onClicked: pinentryField.text = pinentryField.text.substring(0, pinentryField.text.length-1)
176 enabled: entryEnabled
181 WrongPasswordAnimation {
182 id: wrongPasswordAnimation
183 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