summaryrefslogtreecommitdiffstats
path: root/accounts/gmail/package/contents/ui/GmailSettings.qml
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gmail/package/contents/ui/GmailSettings.qml')
-rw-r--r--accounts/gmail/package/contents/ui/GmailSettings.qml136
1 files changed, 136 insertions, 0 deletions
diff --git a/accounts/gmail/package/contents/ui/GmailSettings.qml b/accounts/gmail/package/contents/ui/GmailSettings.qml
new file mode 100644
index 00000000..33dafe8d
--- /dev/null
+++ b/accounts/gmail/package/contents/ui/GmailSettings.qml
@@ -0,0 +1,136 @@
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
23
24import org.kde.kirigami 1.0 as Kirigami
25
26import org.kube.framework.settings 1.0 as KubeSettings
27import org.kube.accounts.gmail 1.0 as GmailAccount
28
29Item {
30
31 property string accountId
32 property string heading: "Connect your GMail account"
33 property string subheadline: "To let Kube access your account, fill in email address, username, password and give the account a title that will be displayed inside Kube."
34
35 GmailAccount.GmailSettings {
36 id: gmailSettings
37 accountIdentifier: accountId
38 accountType: "gmail"
39 }
40
41 function save(){
42 gmailSettings.save()
43 }
44
45 function remove(){
46 gmailSettings.remove()
47 }
48
49 Item {
50 anchors {
51 fill: parent
52 }
53
54 GridLayout {
55 anchors {
56 fill: parent
57 }
58 columns: 2
59 columnSpacing: Kirigami.Units.largeSpacing
60 rowSpacing: Kirigami.Units.largeSpacing
61
62 Controls.Label {
63 text: "Title of Account"
64 Layout.alignment: Qt.AlignRight
65 }
66 Controls.TextField {
67 Layout.fillWidth: true
68 placeholderText: "E.g. \"Work\", \"Home\" that will be displayed in Kube as name"
69 text: gmailSettings.accountName
70 onTextChanged: {
71 gmailSettings.accountName = text
72 }
73 }
74
75 Controls.Label {
76 text: "Name"
77 Layout.alignment: Qt.AlignRight
78 }
79 Controls.TextField {
80 Layout.fillWidth: true
81 placeholderText: "Your name"
82 text: gmailSettings.userName
83 onTextChanged: {
84 gmailSettings.userName = text
85 }
86 }
87
88 Controls.Label {
89 text: "Email address"
90 Layout.alignment: Qt.AlignRight
91 }
92 Controls.TextField {
93 Layout.fillWidth: true
94
95 text: gmailSettings.emailAddress
96 onTextChanged: {
97 gmailSettings.emailAddress = text
98 }
99 placeholderText: "Your email address"
100 }
101
102 Controls.Label {
103 text: "Password"
104 Layout.alignment: Qt.AlignRight
105 }
106 RowLayout {
107 Layout.fillWidth: true
108
109 Controls.TextField {
110 id: pwField
111 Layout.fillWidth: true
112
113 placeholderText: "Password of your email account"
114 text: gmailSettings.imapPassword
115 onTextChanged: {
116 gmailSettings.imapPassword = text
117 gmailSettings.smtpPassword = text
118 }
119
120 echoMode: TextInput.Password
121 }
122
123 Controls.CheckBox {
124 text: "Show Password"
125 onClicked: {
126 if(pwField.echoMode == TextInput.Password) {
127 pwField.echoMode = TextInput.Normal;
128 } else {
129 pwField.echoMode = TextInput.Password;
130 }
131 }
132 }
133 }
134 }
135 }
136}