summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--accounts/gmail/qml/AccountSettings.qml19
-rw-r--r--accounts/gmail/qml/Login.qml59
2 files changed, 60 insertions, 18 deletions
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 {
27 27
28 property string accountId 28 property string accountId
29 property string heading: qsTr("Connect your GMail account") 29 property string heading: qsTr("Connect your GMail account")
30 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.") 30 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.")
31 property bool valid: true 31 property bool valid: true
32 implicitHeight: grid.implicitHeight 32 implicitHeight: grid.implicitHeight
33 33
@@ -101,22 +101,5 @@ Item {
101 } 101 }
102 placeholderText: qsTr("Your email address") 102 placeholderText: qsTr("Your email address")
103 } 103 }
104
105 Kube.Label {
106 text: qsTr("Password")
107 Layout.alignment: Qt.AlignRight
108 }
109
110 Kube.PasswordField {
111 id: pwField
112 Layout.fillWidth: true
113
114 placeholderText: qsTr("Password of your email account")
115 text: gmailSettings.imapPassword
116 onTextChanged: {
117 gmailSettings.imapPassword = text
118 gmailSettings.smtpPassword = text
119 }
120 }
121 } 104 }
122} 105}
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 @@
1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsys.com>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18*/
19
20import QtQuick 2.4
21import QtQuick.Layouts 1.1
22import org.kube.framework 1.0 as Kube
23import org.kube.accounts.gmail 1.0 as GmailAccount
24
25Item {
26 property alias accountId: settings.accountIdentifier
27 property string heading: qsTr("Login")
28 property string subheadline: settings.accountName
29
30 GmailAccount.GmailSettings {
31 id: settings
32 accountType: "gmail"
33 }
34
35 function login(){
36 settings.login({accountSecret: pwField.text})
37 }
38
39 GridLayout {
40 anchors {
41 fill: parent
42 }
43 columns: 2
44 columnSpacing: Kube.Units.largeSpacing
45 rowSpacing: Kube.Units.largeSpacing
46
47 Kube.Label {
48 text: qsTr("Password")
49 Layout.alignment: Qt.AlignRight
50 }
51
52 Kube.PasswordField {
53 id: pwField
54 Layout.fillWidth: true
55 focus: true
56 placeholderText: qsTr("Password of your IMAP account")
57 }
58 }
59}