summaryrefslogtreecommitdiffstats
path: root/accounts/imap
diff options
context:
space:
mode:
authorMichael Bohlender <michael.bohlender@kdemail.net>2016-06-22 00:36:49 +0200
committerMichael Bohlender <michael.bohlender@kdemail.net>2016-06-22 00:36:49 +0200
commitff59585a9b243183da0c30665f9de63b882d2b1f (patch)
tree488b61d670fdc81885388d2208b5789721ec0b18 /accounts/imap
parentc69d45b16f5ace1a6ac22326611919956fc7ec90 (diff)
downloadkube-ff59585a9b243183da0c30665f9de63b882d2b1f.tar.gz
kube-ff59585a9b243183da0c30665f9de63b882d2b1f.zip
almost pixel perfect imap settings
Diffstat (limited to 'accounts/imap')
-rw-r--r--accounts/imap/package/contents/ui/ImapAccountSettings.qml281
1 files changed, 169 insertions, 112 deletions
diff --git a/accounts/imap/package/contents/ui/ImapAccountSettings.qml b/accounts/imap/package/contents/ui/ImapAccountSettings.qml
index 4dfa3ba4..ca220f3e 100644
--- a/accounts/imap/package/contents/ui/ImapAccountSettings.qml
+++ b/accounts/imap/package/contents/ui/ImapAccountSettings.qml
@@ -18,146 +18,203 @@
18import QtQuick 2.4 18import QtQuick 2.4
19import QtQuick.Controls 1.4 19import QtQuick.Controls 1.4
20import QtQuick.Layouts 1.1 20import QtQuick.Layouts 1.1
21import QtQuick.Dialogs 1.0 21
22import org.kde.kirigami 1.0 as Kirigami
22 23
23import org.kube.framework.settings 1.0 as KubeSettings 24import org.kube.framework.settings 1.0 as KubeSettings
24import org.kube.framework.theme 1.0
25import org.kube.accounts.imap 1.0 as ImapAccount 25import org.kube.accounts.imap 1.0 as ImapAccount
26 26
27 27
28Rectangle { 28Item {
29 id: root 29
30 property string accountId 30 property string accountId
31 property string accountName
32 property string icon
33 31
34 color: ColorPalette.background 32 ImapAccount.ImapSettings {
33 id: imapSettings
34 accountIdentifier: accountId
35 }
35 36
36 GridLayout { 37 anchors.fill: parent
37 id: gridLayout
38 columns: 2
39 Layout.fillWidth: true
40 38
41 Text { 39 Item {
42 Layout.columnSpan: 2 40 anchors {
43 Layout.fillWidth: true 41 fill: parent
44 text: "General:" 42 margins: Kirigami.Units.largeSpacing * 2
45 } 43 }
46 44
47 Label { text: "Account Name" } 45 Kirigami.Heading {
48 TextField { 46 id: heading
49 id: name 47 text: "Connect your IMAP account"
50 placeholderText: accountName
51 Layout.fillWidth: true
52 text: imapSettings.accountName
53 onTextChanged: { imapSettings.accountName = text; root.accountName = text; }
54 }
55 48
56 Label { text: "User Name" } 49 color: Kirigami.Theme.highlightColor
57 TextField {
58 placeholderText: "Your Name"
59 Layout.fillWidth: true
60 text: imapSettings.userName
61 onTextChanged: { imapSettings.userName = text; }
62 } 50 }
63 51
64 Label { text: "Email Address" } 52 Label {
65 TextField { 53 id: subHeadline
66 placeholderText: "Your EMail Address"
67 Layout.fillWidth: true
68 text: imapSettings.emailAddress
69 onTextChanged: { imapSettings.emailAddress = text; }
70 }
71 54
72 Text { 55 anchors {
73 Layout.columnSpan: 2 56 left: heading.left
74 Layout.fillWidth: true 57 top: heading.bottom
75 text: "Imap:" 58 }
76 }
77 59
78 Label { text: "Username" } 60 width: parent.width
79 TextField {
80 placeholderText: "Username"
81 Layout.fillWidth: true
82 text: imapSettings.imapUsername
83 onTextChanged: { imapSettings.imapUsername = text; }
84 }
85 61
86 Label { text: "Password" } 62 text: "To let Kube access your account, fill in email adress, username, password and give the account a title that will be displayed inside Kube. For information about which SMTP, IMAP server, which authentification and port to be used, please contact your email provider"
87 TextField { 63 //TODO wait for kirgami theme disabled text color
88 placeholderText: "Password" 64 opacity: 0.5
89 Layout.fillWidth: true 65 wrapMode: Text.Wrap
90 text: imapSettings.imapPassword
91 onTextChanged: { imapSettings.imapPassword = text; }
92 } 66 }
93 67
94 Label { text: "Server" } 68
95 TextField { 69 GridLayout {
96 id: server 70 anchors {
97 placeholderText: "imaps://mainserver.example.net:993" 71 top:subHeadline.bottom
98 Layout.fillWidth: true 72 bottom: parent.bottom
99 text: imapSettings.imapServer 73 left: parent.left
100 onTextChanged: { imapSettings.imapServer = text; } 74 right: parent.right
101 validator: imapSettings.imapServerValidator 75 topMargin: Kirigami.Units.largeSpacing
102 Rectangle { 76 bottomMargin: Kirigami.Units.largeSpacing * 2
103 anchors.fill: parent
104 opacity: 0.2
105 color: server.acceptableInput ? "green" : "yellow"
106 } 77 }
107 }
108 78
109 Text { 79 columns: 2
110 Layout.columnSpan: 2 80 columnSpacing: Kirigami.Units.largeSpacing
111 Layout.fillWidth: true 81 rowSpacing: Kirigami.Units.largeSpacing
112 text: "Smtp:"
113 }
114 82
115 Label { text: "Username" } 83 Kirigami.Label {
116 TextField { 84 text: "Title of Acocunt"
117 placeholderText: "Username" 85 Layout.alignment: Qt.AlignRight
118 Layout.fillWidth: true 86 }
119 text: imapSettings.smtpUsername 87 TextField {
120 onTextChanged: { imapSettings.smtpUsername = text; } 88 Layout.fillWidth: true
121 }
122 89
123 Label { text: "Password" } 90 text: imapSettings.accountName
124 TextField { 91 onTextChanged: {
125 placeholderText: "Password" 92 imapSettings.accountName = text
126 Layout.fillWidth: true 93 }
127 text: imapSettings.smtpPassword 94 }
128 onTextChanged: { imapSettings.smtpPassword = text; }
129 }
130 95
131 Label { text: "Server" } 96 Kirigami.Label {
132 TextField { 97 text: "Email adress"
133 id: server 98 Layout.alignment: Qt.AlignRight
134 placeholderText: "smtps://mainserver.example.net:465"
135 Layout.fillWidth: true
136 text: imapSettings.smtpServer
137 onTextChanged: { imapSettings.smtpServer = text; }
138 validator: imapSettings.smtpServerValidator
139 Rectangle {
140 anchors.fill: parent
141 opacity: 0.2
142 color: server.acceptableInput ? "green" : "yellow"
143 } 99 }
144 } 100 TextField {
101 Layout.fillWidth: true
145 102
146 ImapAccount.ImapSettings { 103 text: imapSettings.emailAddress
147 id: imapSettings 104 onTextChanged: {
148 accountIdentifier: accountId 105 imapSettings.emailAddress = text
149 } 106 }
107 }
150 108
151 Button { 109 Kirigami.Label {
152 text: "Save" 110 text: "Username"
153 onClicked: { 111 Layout.alignment: Qt.AlignRight
154 imapSettings.save();
155 } 112 }
156 } 113 TextField {
157 Button { 114 Layout.fillWidth: true
158 text: "Remove" 115
159 onClicked: { 116 text: imapSettings.imapUsername
160 imapSettings.remove(); 117 onTextChanged: {
118 imapSettings.imapUsername = text
119 imapSettings.smtpUsername = text
120 }
121 }
122
123 Kirigami.Label {
124 text: "Password"
125 Layout.alignment: Qt.AlignRight
126 }
127 TextField {
128 Layout.fillWidth: true
129
130 text: imapSettings.imapPassword
131 onTextChanged: {
132 imapSettings.imapPassword = text
133 imapSettings.smtpPassword = text
134 }
135 }
136
137 Kirigami.Label {
138 text: "IMAP adress"
139 Layout.alignment: Qt.AlignRight
140 }
141 TextField {
142 id: imapServer
143
144 Layout.fillWidth: true
145
146 placeholderText: "imaps://mainserver.example.net:993"
147 text: imapSettings.imapServer
148 onTextChanged: {
149 imapSettings.imapServer = text
150 }
151 validator: imapSettings.imapServerValidator
152
153 Rectangle {
154 anchors.fill: parent
155 opacity: 0.2
156 color: "yellow"
157 visible: imapServer.acceptableInput
158 }
159 }
160
161 Kirigami.Label {
162 text: "Smtp adress"
163 Layout.alignment: Qt.AlignRight
164 }
165 TextField {
166 id: smtpServer
167 Layout.fillWidth: true
168
169 placeholderText: "smtps://mainserver.example.net:993"
170 text: imapSettings.smtpServer
171 onTextChanged: {
172 imapSettings.smtpServer = text
173 }
174 validator: imapSettings.smtpServerValidator
175
176 Rectangle {
177 anchors.fill: parent
178 opacity: 0.2
179 color: "yellow"
180 visible: smtpServer.acceptableInput
181 }
182 }
183
184 Label {
185 text: ""
186 Layout.fillHeight: ture
187 }
188 Label {
189 text: ""
190 }
191
192 Label {
193 text: ""
194 }
195 Item {
196 Layout.fillWidth: true
197
198 Button {
199 text: "Delete"
200
201 onClicked: {
202 imapSettings.remove()
203 root.closeDialog()
204 }
205 }
206
207 Button {
208 anchors.right: parent.right
209
210 text: "Save"
211
212 onClicked: {
213 focus: true
214 imapSettings.save()
215 root.closeDialog()
216 }
217 }
161 } 218 }
162 } 219 }
163 } 220 }