Warning, /plasma/kscreenlocker/tests/kcheckpass_test.qml is written in an unsupported language. File is not indexed.

0001 /*
0002 SPDX-FileCopyrightText: 2017 Martin Gräßlin <mgraesslin@kde.org>
0003 
0004 SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 import QtQuick 2.1
0007 import QtQuick.Controls 2.4
0008 import QtQuick.Layouts 1.3
0009 
0010 ApplicationWindow {
0011     visible: true
0012     ColumnLayout {
0013         anchors.fill: parent
0014         Label {
0015             id: message
0016             Connections {
0017                 target: authenticator
0018                 function onPromptForSecretChanged() {
0019                     authenticator.respond(password.text)
0020                 }
0021                 function onSucceeded() {
0022                     message.text = "Authentication succeeded";
0023                 }
0024                 function onFailed() {
0025                     message.text = "Failed"
0026                 }
0027             }
0028         }
0029         TextField {
0030             id: password
0031             enabled: true
0032             echoMode: TextInput.Password
0033         }
0034         Button {
0035             text: "Authenticate"
0036             onClicked: {
0037                 console.log("unlock")
0038                 authenticator.tryUnlock()
0039             }
0040         }
0041         Item {
0042             Layout.fillHeight: true
0043         }
0044     }
0045 }