From f6df80e970063f4fce3c5f4eb0af157239ae1f8e Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 24 Jan 2018 11:33:19 +0100 Subject: Fixed gmail login --- accounts/gmail/qml/AccountSettings.qml | 19 +---------- accounts/gmail/qml/Login.qml | 59 ++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 18 deletions(-) create mode 100644 accounts/gmail/qml/Login.qml (limited to 'accounts/gmail/qml') diff --git a/accounts/gmail/qml/AccountSettings.qml b/accounts/gmail/qml/AccountSettings.qml index 16f7dbf3..0ebce1d3 100644 --- a/accounts/gmail/qml/AccountSettings.qml +++ b/accounts/gmail/qml/AccountSettings.qml @@ -27,7 +27,7 @@ Item { property string accountId property string heading: qsTr("Connect your GMail 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 string subheadline: qsTr("To let Kube access your account, fill in email address, username and give the account a title that will be displayed inside Kube.") property bool valid: true implicitHeight: grid.implicitHeight @@ -101,22 +101,5 @@ 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: gmailSettings.imapPassword - onTextChanged: { - gmailSettings.imapPassword = text - gmailSettings.smtpPassword = text - } - } } } diff --git a/accounts/gmail/qml/Login.qml b/accounts/gmail/qml/Login.qml new file mode 100644 index 00000000..597e3ee3 --- /dev/null +++ b/accounts/gmail/qml/Login.qml @@ -0,0 +1,59 @@ +/* + 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.gmail 1.0 as GmailAccount + +Item { + property alias accountId: settings.accountIdentifier + property string heading: qsTr("Login") + property string subheadline: settings.accountName + + GmailAccount.GmailSettings { + id: settings + accountType: "gmail" + } + + function login(){ + settings.login({accountSecret: pwField.text}) + } + + 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") + } + } +} -- cgit v1.2.3