feat(Modules/LockScreen): divert PAM messages to user (eg: to notify the user about fingerprint reader)

This commit is contained in:
Matej Cotman 2025-09-10 19:48:39 +03:00
parent 4265290a0f
commit b9ae772987
No known key found for this signature in database
GPG key ID: 66FDC7A2EEA1F8A6
2 changed files with 6 additions and 2 deletions

View file

@ -12,6 +12,7 @@ Scope {
property bool unlockInProgress: false property bool unlockInProgress: false
property bool showFailure: false property bool showFailure: false
property string errorMessage: "" property string errorMessage: ""
property string infoMessage: ""
property bool pamAvailable: typeof PamContext !== "undefined" property bool pamAvailable: typeof PamContext !== "undefined"
onCurrentTextChanged: { onCurrentTextChanged: {
@ -47,6 +48,8 @@ Scope {
if (messageIsError) { if (messageIsError) {
errorMessage = message errorMessage = message
} else {
infoMessage = message
} }
if (responseRequired) { if (responseRequired) {

View file

@ -515,6 +515,7 @@ Loader {
width: 0 width: 0
height: 0 height: 0
visible: false visible: false
enabled: !lockContext.unlockInProgress
font.family: Settings.data.ui.fontFixed font.family: Settings.data.ui.fontFixed
font.pointSize: Style.fontSizeL * scaling font.pointSize: Style.fontSizeL * scaling
color: Color.mOnSurface color: Color.mOnSurface
@ -544,7 +545,7 @@ Loader {
color: Color.mOnSurface color: Color.mOnSurface
font.family: Settings.data.ui.fontFixed font.family: Settings.data.ui.fontFixed
font.pointSize: Style.fontSizeL * scaling font.pointSize: Style.fontSizeL * scaling
visible: passwordInput.activeFocus visible: passwordInput.activeFocus && !lockContext.unlockInProgress
SequentialAnimation { SequentialAnimation {
id: typingEffect id: typingEffect
@ -588,7 +589,7 @@ Loader {
NText { NText {
text: { text: {
if (lockContext.unlockInProgress) if (lockContext.unlockInProgress)
return "Authenticating..." return lockContext.infoMessage || "Authenticating..."
if (lockContext.showFailure && lockContext.errorMessage) if (lockContext.showFailure && lockContext.errorMessage)
return lockContext.errorMessage return lockContext.errorMessage
if (lockContext.showFailure) if (lockContext.showFailure)