Commit 3422348c authored by Aleksei Nikiforov's avatar Aleksei Nikiforov Committed by David Edmundson
Browse files

Adapt to kscreenlocker interface v3

Interface v3 provides improved PAM support.
This has to be reflected in GUI.
parent 96cc8e2a
Pipeline #172215 passed with stage
in 11 minutes and 31 seconds
......@@ -32,18 +32,37 @@ PlasmaCore.ColorScope {
root.notification += "\n"
}
root.notification += i18nd("plasma_lookandfeel_org.kde.lookandfeel","Unlocking failed");
graceLockTimer.restart();
notificationRemoveTimer.restart();
}
function onGraceLockedChanged() {
if (!authenticator.graceLocked) {
root.notification = "";
root.clearPassword();
function onSucceeded() {
}
function onInfoMessage(msg) {
if (root.notification) {
root.notification += "\n"
}
root.notification += msg;
}
function onMessage(msg) {
function onErrorMessage(msg) {
if (root.notification) {
root.notification += "\n"
}
root.notification += msg;
}
function onError(err) {
root.notification += err;
function onPrompt(msg) {
root.notification = msg;
mainBlock.echoMode = TextInput.Normal
mainBlock.mainPasswordBox.text = "";
mainBlock.mainPasswordBox.forceActiveFocus();
}
function onPromptForSecret(msg) {
mainBlock.echoMode = TextInput.Password
mainBlock.mainPasswordBox.text = "";
mainBlock.mainPasswordBox.forceActiveFocus();
}
}
......@@ -79,6 +98,7 @@ PlasmaCore.ColorScope {
MouseArea {
id: lockScreenRoot
property bool calledUnlock: false
property bool uiVisible: false
property bool blockUI: mainStack.depth > 1 || mainBlock.mainPasswordBox.text.length > 0 || inputPanel.keyboardActive
......@@ -89,13 +109,16 @@ PlasmaCore.ColorScope {
hoverEnabled: true
drag.filterChildren: true
onPressed: uiVisible = true;
onPositionChanged: uiVisible = true;
onUiVisibleChanged: {
if (blockUI) {
fadeoutTimer.running = false;
} else if (uiVisible) {
fadeoutTimer.restart();
}
if (!calledUnlock) {
calledUnlock = true
authenticator.tryUnlock();
}
}
onBlockUIChanged: {
if (blockUI) {
......@@ -127,6 +150,16 @@ PlasmaCore.ColorScope {
}
}
}
Timer {
id: notificationRemoveTimer
interval: 3000
onTriggered: root.notification = ""
}
Timer {
id: graceLockTimer
interval: 3000
onTriggered: authenticator.tryUnlock();
}
Component.onCompleted: PropertyAnimation { id: launchAnimation; target: lockScreenRoot; property: "opacity"; from: 0; to: 1; duration: PlasmaCore.Units.veryLongDuration * 2 }
......@@ -229,11 +262,14 @@ PlasmaCore.ColorScope {
showUserList: userList.y + mainStack.y > 0
enabled: !graceLockTimer.running
Stack.onStatusChanged: {
// prepare for presenting again to the user
if (Stack.status === Stack.Activating) {
mainPasswordBox.remove(0, mainPasswordBox.length)
mainPasswordBox.focus = true
root.notification = ""
}
}
userListModel: users
......@@ -250,9 +286,8 @@ PlasmaCore.ColorScope {
return parts.join("");
}
onLoginRequest: {
root.notification = ""
authenticator.tryUnlock(password)
onPasswordResult: {
authenticator.respond(password)
}
actionItems: [
......@@ -554,12 +589,4 @@ PlasmaCore.ColorScope {
Battery {}
}
}
Component.onCompleted: {
// version support checks
if (root.interfaceVersion < 1) {
// ksmserver of 5.4, with greeter of 5.5
root.viewVisible = true;
}
}
}
......@@ -18,6 +18,7 @@ SessionManagementScreen {
property Item mainPasswordBox: passwordBox
property bool lockScreenUiVisible: false
property alias echoMode: passwordBox.echoMode
//the y position that should be ensured visible when the on screen keyboard is visible
property int visibleBoundary: mapFromItem(loginButton, 0, 0).y
......@@ -26,7 +27,7 @@ SessionManagementScreen {
* Login has been requested with the following username and password
* If username field is visible, it will be taken from that, otherwise from the "name" property of the currentIndex
*/
signal loginRequest(string password)
signal passwordResult(string password)
function startLogin() {
const password = passwordBox.text
......@@ -37,7 +38,7 @@ SessionManagementScreen {
//
// See https://bugreports.qt.io/browse/QTBUG-55460
loginButton.forceActiveFocus();
loginRequest(password);
passwordResult(password);
}
RowLayout {
......
......@@ -136,6 +136,7 @@
"Version": "2.0",
"Website": "https://www.kde.org"
},
"X-Plasma-APIVersion": "2",
"Keywords": "Desktop;Workspace;Appearance;Look and Feel;Logout;Lock;Suspend;Shutdown;Hibernate;",
"Keywords[ar]": "سطح المكتب;مساحة العمل;المظهر;المظهر والإحساس;اخرج;Lock;علق;أطفئ;أسبت;",
"Keywords[ast]": "Escritoriu;Estaya de trabayu;Aspeutu;Estilu;Aspeutu y Estilu;Zarrar sesión;Zarru de sesión;Bloquiar;Bloquéu;Suspender;Suspensión;Apagar;Apagáu;Ivernar;Ivernación;Hibernar;Hibernación;",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment