From 6c7e79f7270500d00c526692c32cfc106a2feb07 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 8 Sep 2017 11:54:45 +0200 Subject: Some basic input field validation. --- accounts/gmail/package/contents/ui/GmailSettings.qml | 1 + accounts/imap/package/contents/ui/ImapAccountSettings.qml | 1 + .../kolabnow/package/contents/ui/KolabnowAccountSettings.qml | 9 +++++++-- accounts/maildir/package/contents/ui/MaildirAccountSettings.qml | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) (limited to 'accounts') diff --git a/accounts/gmail/package/contents/ui/GmailSettings.qml b/accounts/gmail/package/contents/ui/GmailSettings.qml index 0ee18bed..7f0c737b 100644 --- a/accounts/gmail/package/contents/ui/GmailSettings.qml +++ b/accounts/gmail/package/contents/ui/GmailSettings.qml @@ -28,6 +28,7 @@ Item { property string accountId property string heading: "Connect your GMail account" property string subheadline: "To let Kube access your account, fill in email address, username, password and give the account a title that will be displayed inside Kube." + property bool valid: true GmailAccount.GmailSettings { id: gmailSettings diff --git a/accounts/imap/package/contents/ui/ImapAccountSettings.qml b/accounts/imap/package/contents/ui/ImapAccountSettings.qml index 26a41541..a0469719 100644 --- a/accounts/imap/package/contents/ui/ImapAccountSettings.qml +++ b/accounts/imap/package/contents/ui/ImapAccountSettings.qml @@ -28,6 +28,7 @@ Item { property string accountId property string heading: "Connect your IMAP account" property string subheadline: "To let Kube access your account, fill in email address, username, password and give the account a title that will be displayed inside Kube. For information about which SMTP, IMAP address, which authentification and port to be used, please contact your email provider." + property bool valid: true ImapAccount.ImapSettings { id: imapSettings diff --git a/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml b/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml index 017bf40a..be509641 100644 --- a/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml +++ b/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml @@ -27,6 +27,7 @@ Item { property string accountId property string heading: qsTr("Connect your KolabNOW account") property string subheadline: qsTr("To let Kube access your account, fill in email address, username, password and give the account a title that will be displayed inside Kube.") + property bool valid: accountField.acceptableInput && nameField.acceptableInput && emailField.acceptableInput && pwField.acceptableInput KolabnowAccount.KolabnowSettings { id: kolabnowSettings @@ -60,19 +61,22 @@ Item { Layout.alignment: Qt.AlignRight } Kube.TextField { + id: accountField Layout.fillWidth: true placeholderText: qsTr("E.g. \"Work\", \"Home\" that will be displayed in Kube as name") text: kolabnowSettings.accountName onTextChanged: { kolabnowSettings.accountName = text } + validator: RegExpValidator { regExp: /.*\S.*/ } } Kube.Label { text: qsTr("Name") Layout.alignment: Qt.AlignRight } - Kube.TextField { + Kube.RequiredTextField { + id: nameField Layout.fillWidth: true placeholderText: qsTr("Your name") text: kolabnowSettings.userName @@ -85,7 +89,8 @@ Item { text: qsTr("Email address") Layout.alignment: Qt.AlignRight } - Kube.TextField { + Kube.RequiredTextField { + id: emailField Layout.fillWidth: true text: kolabnowSettings.emailAddress diff --git a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml index 83f6d381..ba5bd766 100644 --- a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml +++ b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml @@ -28,6 +28,7 @@ Item { property string accountId property string heading: "Add your Maildir archive" property string subheadline: "To let Kube access your maildir archive, add the path to your archive and give the account a title that will be displayed inside Kube." + property bool valid: true MaildirAccount.MaildirSettings { id: maildirSettings -- cgit v1.2.3