From ed90f285745279e91743851ae49eeccf1d95710f Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Mon, 31 Jul 2017 18:58:39 +0200 Subject: dedicated Kube.PasswordField --- .../gmail/package/contents/ui/GmailSettings.qml | 32 ++++++---------------- .../package/contents/ui/ImapAccountSettings.qml | 32 ++++++---------------- .../contents/ui/KolabnowAccountSettings.qml | 16 +---------- 3 files changed, 17 insertions(+), 63 deletions(-) (limited to 'accounts') diff --git a/accounts/gmail/package/contents/ui/GmailSettings.qml b/accounts/gmail/package/contents/ui/GmailSettings.qml index 40a6e1e7..0ee18bed 100644 --- a/accounts/gmail/package/contents/ui/GmailSettings.qml +++ b/accounts/gmail/package/contents/ui/GmailSettings.qml @@ -116,32 +116,16 @@ Item { text: qsTr("Password") Layout.alignment: Qt.AlignRight } - RowLayout { - Layout.fillWidth: true - - Kube.TextField { - id: pwField - Layout.fillWidth: true - - placeholderText: qsTr("Password of your email account") - text: gmailSettings.imapPassword - onTextChanged: { - gmailSettings.imapPassword = text - gmailSettings.smtpPassword = text - } - echoMode: TextInput.Password - } + Kube.PasswordField { + id: pwField + Layout.fillWidth: true - Controls.CheckBox { - text: qsTr("Show Password") - onClicked: { - if(pwField.echoMode == TextInput.Password) { - pwField.echoMode = TextInput.Normal; - } else { - pwField.echoMode = TextInput.Password; - } - } + placeholderText: qsTr("Password of your email account") + text: gmailSettings.imapPassword + onTextChanged: { + gmailSettings.imapPassword = text + gmailSettings.smtpPassword = text } } } diff --git a/accounts/imap/package/contents/ui/ImapAccountSettings.qml b/accounts/imap/package/contents/ui/ImapAccountSettings.qml index 332b2bbe..26a41541 100644 --- a/accounts/imap/package/contents/ui/ImapAccountSettings.qml +++ b/accounts/imap/package/contents/ui/ImapAccountSettings.qml @@ -102,32 +102,16 @@ Item { text: qsTr("Password") Layout.alignment: Qt.AlignRight } - RowLayout { - Layout.fillWidth: true - - Kube.TextField { - id: pwField - Layout.fillWidth: true - - placeholderText: qsTr("Password of your email account") - text: imapSettings.imapPassword - onTextChanged: { - imapSettings.imapPassword = text - imapSettings.smtpPassword = text - } - echoMode: TextInput.Password - } + Kube.PasswordField { + id: pwField + Layout.fillWidth: true - Controls.CheckBox { - text: qsTr("Show Password") - onClicked: { - if(pwField.echoMode == TextInput.Password) { - pwField.echoMode = TextInput.Normal; - } else { - pwField.echoMode = TextInput.Password; - } - } + placeholderText: qsTr("Password of your email account") + text: imapSettings.imapPassword + onTextChanged: { + imapSettings.imapPassword = text + imapSettings.smtpPassword = text } } diff --git a/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml b/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml index c691c44a..b2048827 100644 --- a/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml +++ b/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml @@ -100,7 +100,7 @@ Item { Layout.alignment: Qt.AlignRight } - Kube.TextField { + Kube.PasswordField { id: pwField Layout.fillWidth: true @@ -110,20 +110,6 @@ Item { kolabnowSettings.imapPassword = text kolabnowSettings.smtpPassword = text } - - echoMode: pwCheck.checked ? TextInput.Normal : TextInput.Password - } - - Kube.Label { - text: "" - } - RowLayout { - Kube.CheckBox { - id: pwCheck - } - Kube.Label { - text: qsTr("Show Password") - } } } } -- cgit v1.2.3