summaryrefslogtreecommitdiffstats
path: root/accounts/gmail/qml
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gmail/qml')
-rw-r--r--accounts/gmail/qml/AccountSettings.qml122
1 files changed, 122 insertions, 0 deletions
diff --git a/accounts/gmail/qml/AccountSettings.qml b/accounts/gmail/qml/AccountSettings.qml
new file mode 100644
index 00000000..16f7dbf3
--- /dev/null
+++ b/accounts/gmail/qml/AccountSettings.qml
@@ -0,0 +1,122 @@
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.Controls 1.4 as Controls
22import QtQuick.Layouts 1.1
23import org.kube.framework 1.0 as Kube
24import org.kube.accounts.gmail 1.0 as GmailAccount
25
26Item {
27
28 property string accountId
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.")
31 property bool valid: true
32 implicitHeight: grid.implicitHeight
33
34 GmailAccount.GmailSettings {
35 id: gmailSettings
36 accountIdentifier: accountId
37 accountType: "gmail"
38 }
39
40 function save(){
41 gmailSettings.save()
42 }
43
44 function remove(){
45 gmailSettings.remove()
46 }
47
48 GridLayout {
49 id: grid
50 anchors.fill: parent
51 columns: 2
52 columnSpacing: Kube.Units.largeSpacing
53 rowSpacing: Kube.Units.largeSpacing
54
55 Kube.Label {
56 text: "Please note that GMail requires you to configure your account to allow IMAP connections from Kube:
57<ol type=''>
58<li> See <a href='https://support.google.com/mail/answer/7126229'>https://support.google.com/mail/answer/7126229</a> to configure your account to allow IMAP connections.
59<li> Visit <a href='https://myaccount.google.com/lesssecureapps'>https://myaccount.google.com/lesssecureapps</a> and enable the setting to allow Kube to connect to your account."
60 Layout.alignment: Qt.AlignCenter
61 Layout.columnSpan: 2
62 textFormat: Text.StyledText
63 }
64
65 Kube.Label {
66 text: qsTr("Title of Account")
67 Layout.alignment: Qt.AlignRight
68 }
69 Kube.TextField {
70 Layout.fillWidth: true
71 placeholderText: qsTr("E.g. \"Work\", \"Home\" that will be displayed in Kube as name")
72 text: gmailSettings.accountName
73 onTextChanged: {
74 gmailSettings.accountName = text
75 }
76 }
77
78 Kube.Label {
79 text: qsTr("Name")
80 Layout.alignment: Qt.AlignRight
81 }
82 Kube.TextField {
83 Layout.fillWidth: true
84 placeholderText: qsTr("Your name")
85 text: gmailSettings.userName
86 onTextChanged: {
87 gmailSettings.userName = text
88 }
89 }
90
91 Kube.Label {
92 text: qsTr("Email address")
93 Layout.alignment: Qt.AlignRight
94 }
95 Kube.TextField {
96 Layout.fillWidth: true
97
98 text: gmailSettings.emailAddress
99 onTextChanged: {
100 gmailSettings.emailAddress = text
101 }
102 placeholderText: qsTr("Your email address")
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 }
122}