summaryrefslogtreecommitdiffstats
path: root/accounts/generic/qml/AccountSettings.qml
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-08-18 10:55:08 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-08-18 10:55:08 +0200
commite2f86e32a295cddacc6053936933150d1e7c665b (patch)
tree35467b1419afa2253d354f3e564f5eca82b16aee /accounts/generic/qml/AccountSettings.qml
parent108913be58ecb014ab575247f3adc9776feafa59 (diff)
downloadkube-e2f86e32a295cddacc6053936933150d1e7c665b.tar.gz
kube-e2f86e32a295cddacc6053936933150d1e7c665b.zip
A generic account.
This is intended to eventually replace the protocol specific accounts. The account is used to group together several protocols to one logical service, and thus it makes sense to set it up as one.
Diffstat (limited to 'accounts/generic/qml/AccountSettings.qml')
-rw-r--r--accounts/generic/qml/AccountSettings.qml157
1 files changed, 157 insertions, 0 deletions
diff --git a/accounts/generic/qml/AccountSettings.qml b/accounts/generic/qml/AccountSettings.qml
new file mode 100644
index 00000000..c75a526c
--- /dev/null
+++ b/accounts/generic/qml/AccountSettings.qml
@@ -0,0 +1,157 @@
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.generic 1.0 as GenericAccount
24
25Item {
26
27 property string accountId
28 property string heading: qsTr("Connect your account")
29 property string subheadline: qsTr("To let Kube access your account, fill in email address, username and the relevant server addresses. For information about the server details, please contact your email provider.")
30 property bool valid: true
31 implicitHeight: grid.implicitHeight
32
33 GenericAccount.Settings {
34 id: settings
35 accountIdentifier: accountId
36 accountType: "generic"
37 }
38
39 function save(){
40 settings.save()
41 }
42
43 function remove(){
44 settings.remove()
45 }
46 GridLayout {
47 id: grid
48 anchors.fill: parent
49 columns: 2
50 columnSpacing: Kube.Units.largeSpacing
51 rowSpacing: Kube.Units.largeSpacing
52
53 Kube.Label {
54 text: qsTr("Name")
55 Layout.alignment: Qt.AlignRight
56 }
57 Kube.RequiredTextField {
58 Layout.fillWidth: true
59 placeholderText: qsTr("Your name")
60 text: settings.userName
61 onTextChanged: {
62 settings.userName = text
63 }
64 }
65
66 Kube.Label {
67 text: qsTr("Email address")
68 Layout.alignment: Qt.AlignRight
69 }
70 Kube.RequiredTextField {
71 Layout.fillWidth: true
72
73 text: settings.emailAddress
74 onTextChanged: {
75 settings.emailAddress = text
76 settings.accountName = text
77 }
78 placeholderText: qsTr("Your email address")
79 }
80 Kube.Label {
81 text: qsTr("Username")
82 Layout.alignment: Qt.AlignRight
83 }
84 Kube.RequiredTextField {
85 Layout.fillWidth: true
86
87 text: settings.imapUsername
88 onTextChanged: {
89 settings.imapUsername = text
90 settings.smtpUsername = text
91 settings.carddavUsername = text
92 settings.caldavUsername = text
93 }
94 placeholderText: qsTr("Your username for server access.")
95 }
96
97 Kube.Label {
98 text: qsTr("IMAP address")
99 Layout.alignment: Qt.AlignRight
100 }
101 Kube.RequiredTextField {
102 id: imapServer
103
104 Layout.fillWidth: true
105
106 placeholderText: "imaps://mainserver.example.net:993"
107 text: settings.imapServer
108 onTextChanged: {
109 settings.imapServer = text
110 }
111 validator: settings.imapServerValidator
112 }
113
114 Kube.Label {
115 text: qsTr("SMTP address")
116 Layout.alignment: Qt.AlignRight
117 }
118 Kube.RequiredTextField {
119 Layout.fillWidth: true
120
121 placeholderText: "smtps://mainserver.example.net:587"
122 text: settings.smtpServer
123 onTextChanged: {
124 settings.smtpServer = text
125 }
126 validator: settings.smtpServerValidator
127 }
128
129 Kube.Label {
130 text: qsTr("CardDAV address")
131 Layout.alignment: Qt.AlignRight
132 }
133 Kube.RequiredTextField {
134 Layout.fillWidth: true
135
136 placeholderText: "https://mainserver.example.net"
137 text: settings.carddavServer
138 onTextChanged: {
139 settings.carddavServer = text
140 }
141 }
142
143 Kube.Label {
144 text: qsTr("CalDAV address")
145 Layout.alignment: Qt.AlignRight
146 }
147 Kube.RequiredTextField {
148 Layout.fillWidth: true
149
150 placeholderText: "https://mainserver.example.net"
151 text: settings.caldavServer
152 onTextChanged: {
153 settings.caldavServer = text
154 }
155 }
156 }
157}