From ec72a93d303c10d798f40f0d6c6a1ef78f725268 Mon Sep 17 00:00:00 2001 From: reionwong Date: Wed, 15 Sep 2021 15:53:26 +0800 Subject: [PATCH] Update interface name --- screenlocker/authenticator.cpp | 2 +- screenlocker/main.cpp | 2 +- screenlocker/qml/LockScreen.qml | 17 ++++++++++------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/screenlocker/authenticator.cpp b/screenlocker/authenticator.cpp index 01a8fd7..26f7476 100644 --- a/screenlocker/authenticator.cpp +++ b/screenlocker/authenticator.cpp @@ -44,7 +44,7 @@ Authenticator::Authenticator(AuthenticationMode mode, QObject *parent) , m_checkPass(nullptr) { m_graceLockTimer->setSingleShot(true); - m_graceLockTimer->setInterval(3000); + m_graceLockTimer->setInterval(1500); connect(m_graceLockTimer, &QTimer::timeout, this, &Authenticator::graceLockedChanged); if (mode == AuthenticationMode::Delayed) { diff --git a/screenlocker/main.cpp b/screenlocker/main.cpp index e818340..57499bb 100644 --- a/screenlocker/main.cpp +++ b/screenlocker/main.cpp @@ -26,7 +26,7 @@ int main(int argc, char *argv[]) { Application app(argc, argv); - if (!QDBusConnection::sessionBus().registerService("org.cutefish.ScreenLocker")) { + if (!QDBusConnection::sessionBus().registerService("com.cutefish.ScreenLocker")) { return -1; } diff --git a/screenlocker/qml/LockScreen.qml b/screenlocker/qml/LockScreen.qml index f0107d4..14a605d 100644 --- a/screenlocker/qml/LockScreen.qml +++ b/screenlocker/qml/LockScreen.qml @@ -218,6 +218,7 @@ Item { placeholderText: qsTr("Password") leftPadding: FishUI.Units.largeSpacing rightPadding: FishUI.Units.largeSpacing + enabled: !authenticator.graceLocked focus: true echoMode: TextInput.Password @@ -242,6 +243,7 @@ Item { Layout.preferredWidth: 260 text: qsTr("Unlock") onClicked: root.tryUnlock() + enabled: !authenticator.graceLocked scale: unlockBtn.pressed ? 0.95 : 1.0 @@ -319,18 +321,19 @@ Item { Connections { target: authenticator + function onFailed() { notificationResetTimer.start() root.notification = qsTr("Unlocking failed") } -// function onGraceLockedChanged() { -// if (!authenticator.graceLocked) { -// root.notification = "" -// password.selectAll() -// password.focus = true -// } -// } + function onGraceLockedChanged() { + if (!authenticator.graceLocked) { + root.notification = "" + password.selectAll() + password.focus = true + } + } function onMessage(text) { notificationResetTimer.start()