From bcf9f4d0c3965b0edcff58d17bf7e7dd8c3a3b9d Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 8 Nov 2017 12:04:37 +0100 Subject: Login page for generic imap account --- accounts/imap/imapsettings.cpp | 1 + .../package/contents/ui/ImapAccountSettings.qml | 17 ------ accounts/imap/package/contents/ui/Login.qml | 62 ++++++++++++++++++++++ 3 files changed, 63 insertions(+), 17 deletions(-) create mode 100644 accounts/imap/package/contents/ui/Login.qml diff --git a/accounts/imap/imapsettings.cpp b/accounts/imap/imapsettings.cpp index 1f338e83..a9749878 100644 --- a/accounts/imap/imapsettings.cpp +++ b/accounts/imap/imapsettings.cpp @@ -33,6 +33,7 @@ void ImapSettings::load() void ImapSettings::save() { + mSmtpPassword = mImapPassword; saveAccount(); saveImapResource(); saveMailtransportResource(); diff --git a/accounts/imap/package/contents/ui/ImapAccountSettings.qml b/accounts/imap/package/contents/ui/ImapAccountSettings.qml index fec070f2..d81f9c54 100644 --- a/accounts/imap/package/contents/ui/ImapAccountSettings.qml +++ b/accounts/imap/package/contents/ui/ImapAccountSettings.qml @@ -93,23 +93,6 @@ Item { placeholderText: qsTr("Your email address") } - Kube.Label { - text: qsTr("Password") - Layout.alignment: Qt.AlignRight - } - - Kube.PasswordField { - id: pwField - Layout.fillWidth: true - - placeholderText: qsTr("Password of your email account") - text: imapSettings.imapPassword - onTextChanged: { - imapSettings.imapPassword = text - imapSettings.smtpPassword = text - } - } - Kube.Label { text: qsTr("IMAP server address") Layout.alignment: Qt.AlignRight diff --git a/accounts/imap/package/contents/ui/Login.qml b/accounts/imap/package/contents/ui/Login.qml new file mode 100644 index 00000000..14e13e89 --- /dev/null +++ b/accounts/imap/package/contents/ui/Login.qml @@ -0,0 +1,62 @@ +/* + Copyright (C) 2016 Michael Bohlender, + Copyright (C) 2017 Christian Mollekopf, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +import QtQuick 2.4 +import QtQuick.Layouts 1.1 +import org.kube.framework 1.0 as Kube +import org.kube.accounts.imap 1.0 as ImapAccount + +Item { + property alias accountId: settings.accountIdentifier + property string heading: qsTr("Login") + property string subheadline: settings.accountName + + ImapAccount.ImapSettings { + id: settings + accountType: "imap" + } + + function login(){ + settings.save() + } + + GridLayout { + anchors { + fill: parent + } + columns: 2 + columnSpacing: Kube.Units.largeSpacing + rowSpacing: Kube.Units.largeSpacing + + Kube.Label { + text: qsTr("Password") + Layout.alignment: Qt.AlignRight + } + + Kube.PasswordField { + id: pwField + Layout.fillWidth: true + focus: true + + placeholderText: qsTr("Password of your IMAP account") + text: settings.imapPassword + onTextChanged: settings.imapPassword = text + } + } +} -- cgit v1.2.3