From 4a08127caceff75d9e0ad4b20e6195c30a809447 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 3 Jul 2018 08:44:57 +0200 Subject: Keep login with an empty password from succeeding --- accounts/gmail/qml/Login.qml | 1 + accounts/imap/qml/Login.qml | 1 + accounts/kolabnow/qml/Login.qml | 1 + framework/qml/LoginAccount.qml | 7 ++++++- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/accounts/gmail/qml/Login.qml b/accounts/gmail/qml/Login.qml index 597e3ee3..bcab19be 100644 --- a/accounts/gmail/qml/Login.qml +++ b/accounts/gmail/qml/Login.qml @@ -26,6 +26,7 @@ Item { property alias accountId: settings.accountIdentifier property string heading: qsTr("Login") property string subheadline: settings.accountName + property bool valid: pwField.acceptableInput GmailAccount.GmailSettings { id: settings diff --git a/accounts/imap/qml/Login.qml b/accounts/imap/qml/Login.qml index c9304b0e..d013f6ca 100644 --- a/accounts/imap/qml/Login.qml +++ b/accounts/imap/qml/Login.qml @@ -26,6 +26,7 @@ Item { property alias accountId: settings.accountIdentifier property string heading: qsTr("Login") property string subheadline: settings.accountName + property bool valid: pwField.acceptableInput ImapAccount.ImapSettings { id: settings diff --git a/accounts/kolabnow/qml/Login.qml b/accounts/kolabnow/qml/Login.qml index 856f8ba4..877dd6a9 100644 --- a/accounts/kolabnow/qml/Login.qml +++ b/accounts/kolabnow/qml/Login.qml @@ -26,6 +26,7 @@ Item { property alias accountId: settings.accountIdentifier property string heading: qsTr("Login") property string subheadline: settings.accountName + property bool valid: pwField.acceptableInput KolabnowAccount.KolabnowSettings { id: settings diff --git a/framework/qml/LoginAccount.qml b/framework/qml/LoginAccount.qml index f1289dc4..65f162a8 100644 --- a/framework/qml/LoginAccount.qml +++ b/framework/qml/LoginAccount.qml @@ -97,7 +97,11 @@ Item { } } } - Keys.onReturnPressed: login() + Keys.onReturnPressed: { + if (loader.item.valid) { + login() + } + } Item { id: footer @@ -112,6 +116,7 @@ Item { anchors.right: parent.right text: qsTr("Login") onClicked: login() + enabled: loader.item.valid } } } -- cgit v1.2.3