18 import Ubuntu.Components 1.0
19 import Ubuntu.Components.Popups 1.0
25 property bool alphaNumeric:
false
28 property string placeholderText:
""
30 property string wrongPlaceholderText:
""
32 property string retryText:
""
35 property string infoText:
""
38 property string username:
""
48 property int minPinLength: -1
49 property int maxPinLength: -1
51 property url background:
""
53 signal entered(
string passphrase)
55 signal emergencyCall()
56 signal infoPopupConfirmed()
59 if (required && pinPadLoader.item) {
60 pinPadLoader.item.clear(
false);
66 pinPadLoader.resetting =
true;
67 pinPadLoader.resetting =
false;
70 function clear(showAnimation) {
71 pinPadLoader.item.clear(showAnimation);
74 function showInfoPopup(title, text) {
75 PopupUtils.open(infoPopupComponent, root, {title: title, text: text})
87 objectName:
"lockscreenBackground"
91 source: root.required ? root.background :
""
92 fillMode: Image.PreserveAspectCrop
104 bottom: pinPadLoader.top
105 bottomMargin: units.gu(2)
108 objectName:
"retryCountLabel"
114 horizontalAlignment: Text.AlignHCenter
117 visible: root.retryText.length > 0
121 objectName:
"infoTextLabel"
127 horizontalAlignment: Text.AlignHCenter
130 visible: root.infoText.length > 0
138 objectName:
"pinPadLoader"
142 verticalCenter: parent.verticalCenter
143 verticalCenterOffset: root.alphaNumeric ? -units.gu(10) : -units.gu(4)
145 property bool resetting:
false
147 source: (!resetting && root.required) ? (root.alphaNumeric ?
"PassphraseLockscreen.qml" :
"PinLockscreen.qml") :
""
150 target: pinPadLoader.item
153 root.entered(passphrase);
162 target: pinPadLoader.item
163 property:
"minPinLength"
164 value: root.minPinLength
167 target: pinPadLoader.item
168 property:
"maxPinLength"
169 value: root.maxPinLength
172 target: pinPadLoader.item
173 property:
"placeholderText"
174 value: root.placeholderText
177 target: pinPadLoader.item
178 property:
"wrongPlaceholderText"
179 value: root.wrongPlaceholderText
182 target: pinPadLoader.item
191 bottom: parent.bottom
192 bottomMargin: units.gu(4)
195 height: childrenRect.height
199 objectName:
"emergencyCallIcon"
202 anchors.horizontalCenter: parent.horizontalCenter
203 name:
"phone-app-call-symbolic"
209 onClicked: root.emergencyCall()
214 text: i18n.tr(
"Emergency Call")
218 anchors.horizontalCenter: parent.horizontalCenter
223 id: infoPopupComponent
226 objectName:
"infoPopup"
230 objectName:
"infoPopupOkButton"
233 PopupUtils.close(dialog)
234 root.infoPopupConfirmed();