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 function clear(playAnimation) {
36 pinentryField.text = "";
38 wrongPasswordAnimation.start();
45 objectName: "pinentryField"
46 anchors.horizontalCenter: parent.horizontalCenter
51 property string text: ""
52 property string placeholderText: ""
54 pinentryFieldLabel.text = "";
55 for (var i = 0; i < text.length; ++i) {
56 pinentryFieldLabel.text += "•";
58 if (text.length === root.pinLength) {
64 id: pinentryFieldLabel
65 anchors.centerIn: parent
66 font.pixelSize: units.dp(44)
71 id: pinentryFieldPlaceHolder
72 anchors.centerIn: parent
74 text: parent.placeholderText
75 visible: pinentryFieldLabel.text.length == 0
83 margins: (parent.width - root.padWidth) / 2
85 height: root.padHeight
94 topMargin: root.padHeight / 4
101 verticalCenter: parent.verticalCenter
108 bottom: parent.bottom
109 bottomMargin: root.padHeight / 4
114 anchors.centerIn: parent
115 anchors.horizontalCenterOffset: -root.padWidth / 6
116 width: root.padHeight
120 anchors.centerIn: parent
121 anchors.horizontalCenterOffset: root.padWidth / 6
122 width: root.padHeight
130 margins: (parent.width - root.padWidth) / 2
139 objectName: "pinPadButton" + (index + 1)
140 width: root.padWidth / 3
141 height: root.padHeight / 4
145 pinentryField.text = pinentryField.text + text;
151 objectName: "pinPadButtonBack"
152 width: root.padWidth / 3
153 height: root.padHeight / 4
155 onClicked: root.cancel();
159 objectName: "pinPadButton0"
160 width: root.padWidth / 3
161 height: root.padHeight / 4
163 onClicked: pinentryField.text = pinentryField.text + text
167 objectName: "pinPadButtonErase"
168 width: root.padWidth / 3
169 height: root.padHeight / 4
171 onClicked: pinentryField.text = pinentryField.text.substring(0, pinentryField.text.length-1)
176 WrongPasswordAnimation {
177 id: wrongPasswordAnimation
178 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