diff options
Diffstat (limited to 'accounts/imap/package')
-rw-r--r-- | accounts/imap/package/contents/ui/ImapAccountSettings.qml | 137 |
1 files changed, 39 insertions, 98 deletions
diff --git a/accounts/imap/package/contents/ui/ImapAccountSettings.qml b/accounts/imap/package/contents/ui/ImapAccountSettings.qml index a9ac9317..e7834368 100644 --- a/accounts/imap/package/contents/ui/ImapAccountSettings.qml +++ b/accounts/imap/package/contents/ui/ImapAccountSettings.qml | |||
@@ -1,5 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net> | 2 | Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net> |
3 | Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsys.com> | ||
3 | 4 | ||
4 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
5 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
@@ -17,7 +18,7 @@ | |||
17 | */ | 18 | */ |
18 | 19 | ||
19 | import QtQuick 2.4 | 20 | import QtQuick 2.4 |
20 | import QtQuick.Controls 1.4 | 21 | import QtQuick.Controls 1.4 as Controls |
21 | import QtQuick.Layouts 1.1 | 22 | import QtQuick.Layouts 1.1 |
22 | 23 | ||
23 | import org.kde.kirigami 1.0 as Kirigami | 24 | import org.kde.kirigami 1.0 as Kirigami |
@@ -25,132 +26,101 @@ import org.kde.kirigami 1.0 as Kirigami | |||
25 | import org.kube.framework.settings 1.0 as KubeSettings | 26 | import org.kube.framework.settings 1.0 as KubeSettings |
26 | import org.kube.accounts.imap 1.0 as ImapAccount | 27 | import org.kube.accounts.imap 1.0 as ImapAccount |
27 | 28 | ||
28 | |||
29 | Item { | 29 | Item { |
30 | 30 | ||
31 | property string accountId | 31 | property string accountId |
32 | property string heading: "Connect your IMAP 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. For information about which SMTP, IMAP address, which authentification and port to be used, please contact your email provider." | ||
32 | 34 | ||
33 | ImapAccount.ImapSettings { | 35 | ImapAccount.ImapSettings { |
34 | id: imapSettings | 36 | id: imapSettings |
35 | accountIdentifier: accountId | 37 | accountIdentifier: accountId |
38 | accountType: "imap" | ||
39 | } | ||
40 | |||
41 | function save(){ | ||
42 | imapSettings.save() | ||
36 | } | 43 | } |
37 | 44 | ||
38 | anchors.fill: parent | 45 | function remove(){ |
46 | imapSettings.remove() | ||
47 | } | ||
39 | 48 | ||
40 | Item { | 49 | Item { |
41 | anchors { | 50 | anchors { |
42 | fill: parent | 51 | fill: parent |
43 | margins: Kirigami.Units.largeSpacing * 2 | ||
44 | } | ||
45 | |||
46 | Kirigami.Heading { | ||
47 | id: heading | ||
48 | text: "Connect your IMAP account" | ||
49 | |||
50 | color: Kirigami.Theme.highlightColor | ||
51 | } | 52 | } |
52 | 53 | ||
53 | Label { | ||
54 | id: subHeadline | ||
55 | |||
56 | anchors { | ||
57 | left: heading.left | ||
58 | top: heading.bottom | ||
59 | } | ||
60 | |||
61 | width: parent.width | ||
62 | |||
63 | text: "To let Kube access your account, fill in email address, username, password and give the account a title that will be displayed inside Kube. For information about which SMTP, IMAP address, which authentification and port to be used, please contact your email provider" | ||
64 | |||
65 | color: Kirigami.Theme.disabledTextColor | ||
66 | |||
67 | wrapMode: Text.Wrap | ||
68 | } | ||
69 | |||
70 | |||
71 | GridLayout { | 54 | GridLayout { |
72 | anchors { | 55 | anchors { |
73 | top:subHeadline.bottom | 56 | fill: parent |
74 | bottom: parent.bottom | ||
75 | left: parent.left | ||
76 | right: parent.right | ||
77 | topMargin: Kirigami.Units.largeSpacing | ||
78 | bottomMargin: Kirigami.Units.largeSpacing * 2 | ||
79 | } | 57 | } |
80 | |||
81 | columns: 2 | 58 | columns: 2 |
82 | columnSpacing: Kirigami.Units.largeSpacing | 59 | columnSpacing: Kirigami.Units.largeSpacing |
83 | rowSpacing: Kirigami.Units.largeSpacing | 60 | rowSpacing: Kirigami.Units.largeSpacing |
84 | 61 | ||
85 | Kirigami.Label { | 62 | Controls.Label { |
86 | text: "Title of Acocunt" | 63 | text: "Title of Account" |
87 | Layout.alignment: Qt.AlignRight | 64 | Layout.alignment: Qt.AlignRight |
88 | } | 65 | } |
89 | TextField { | 66 | Controls.TextField { |
90 | Layout.fillWidth: true | 67 | Layout.fillWidth: true |
91 | |||
92 | placeholderText: "E.g. \"Work\", \"Home\" that will be displayed in Kube as name" | 68 | placeholderText: "E.g. \"Work\", \"Home\" that will be displayed in Kube as name" |
93 | |||
94 | text: imapSettings.accountName | 69 | text: imapSettings.accountName |
95 | onTextChanged: { | 70 | onTextChanged: { |
96 | imapSettings.accountName = text | 71 | imapSettings.accountName = text |
97 | } | 72 | } |
98 | } | 73 | } |
99 | 74 | ||
100 | Kirigami.Label { | 75 | Controls.Label { |
101 | text: "Email address" | 76 | text: "Name" |
102 | Layout.alignment: Qt.AlignRight | 77 | Layout.alignment: Qt.AlignRight |
103 | } | 78 | } |
104 | 79 | Controls.TextField { | |
105 | TextField { | ||
106 | Layout.fillWidth: true | 80 | Layout.fillWidth: true |
107 | 81 | placeholderText: "Your name" | |
108 | placeholderText: "Your email address" | 82 | text: imapSettings.userName |
109 | |||
110 | text: imapSettings.emailAddress | ||
111 | onTextChanged: { | 83 | onTextChanged: { |
112 | imapSettings.emailAddress = text | 84 | imapSettings.userName = text |
113 | } | 85 | } |
114 | } | 86 | } |
115 | 87 | ||
116 | Kirigami.Label { | 88 | Controls.Label { |
117 | text: "Username" | 89 | text: "Email address" |
118 | Layout.alignment: Qt.AlignRight | 90 | Layout.alignment: Qt.AlignRight |
119 | } | 91 | } |
120 | TextField { | 92 | Controls.TextField { |
121 | Layout.fillWidth: true | 93 | Layout.fillWidth: true |
122 | 94 | ||
123 | placeholderText: "The name used to log into your email account" | 95 | text: imapSettings.emailAddress |
124 | |||
125 | text: imapSettings.imapUsername | ||
126 | onTextChanged: { | 96 | onTextChanged: { |
127 | imapSettings.imapUsername = text | 97 | imapSettings.emailAddress = text |
128 | imapSettings.smtpUsername = text | ||
129 | } | 98 | } |
99 | placeholderText: "Your email address" | ||
130 | } | 100 | } |
131 | 101 | ||
132 | Kirigami.Label { | 102 | Controls.Label { |
133 | text: "Password" | 103 | text: "Password" |
134 | Layout.alignment: Qt.AlignRight | 104 | Layout.alignment: Qt.AlignRight |
135 | } | 105 | } |
136 | |||
137 | RowLayout { | 106 | RowLayout { |
138 | Layout.fillWidth: true | 107 | Layout.fillWidth: true |
139 | 108 | ||
140 | TextField { | 109 | Controls.TextField { |
141 | id: pwField | 110 | id: pwField |
142 | Layout.fillWidth: true | 111 | Layout.fillWidth: true |
143 | 112 | ||
144 | text: imapSettings.imapPassword | ||
145 | placeholderText: "Password of your email account" | 113 | placeholderText: "Password of your email account" |
146 | echoMode: TextInput.Password | 114 | text: imapSettings.imapPassword |
147 | onTextChanged: { | 115 | onTextChanged: { |
148 | imapSettings.imapPassword = text | 116 | imapSettings.imapPassword = text |
149 | imapSettings.smtpPassword = text | 117 | imapSettings.smtpPassword = text |
150 | } | 118 | } |
119 | |||
120 | echoMode: TextInput.Password | ||
151 | } | 121 | } |
152 | 122 | ||
153 | CheckBox { | 123 | Controls.CheckBox { |
154 | text: "Show Password" | 124 | text: "Show Password" |
155 | onClicked: { | 125 | onClicked: { |
156 | if(pwField.echoMode == TextInput.Password) { | 126 | if(pwField.echoMode == TextInput.Password) { |
@@ -160,14 +130,13 @@ Item { | |||
160 | } | 130 | } |
161 | } | 131 | } |
162 | } | 132 | } |
163 | |||
164 | } | 133 | } |
165 | 134 | ||
166 | Kirigami.Label { | 135 | Controls.Label { |
167 | text: "IMAP address" | 136 | text: "IMAP server address" |
168 | Layout.alignment: Qt.AlignRight | 137 | Layout.alignment: Qt.AlignRight |
169 | } | 138 | } |
170 | TextField { | 139 | Controls.TextField { |
171 | id: imapServer | 140 | id: imapServer |
172 | 141 | ||
173 | Layout.fillWidth: true | 142 | Layout.fillWidth: true |
@@ -187,11 +156,11 @@ Item { | |||
187 | } | 156 | } |
188 | } | 157 | } |
189 | 158 | ||
190 | Kirigami.Label { | 159 | Controls.Label { |
191 | text: "Smtp address" | 160 | text: "Smtp address" |
192 | Layout.alignment: Qt.AlignRight | 161 | Layout.alignment: Qt.AlignRight |
193 | } | 162 | } |
194 | TextField { | 163 | Controls.TextField { |
195 | id: smtpServer | 164 | id: smtpServer |
196 | Layout.fillWidth: true | 165 | Layout.fillWidth: true |
197 | 166 | ||
@@ -209,34 +178,6 @@ Item { | |||
209 | visible: smtpServer.acceptableInput | 178 | visible: smtpServer.acceptableInput |
210 | } | 179 | } |
211 | } | 180 | } |
212 | |||
213 | Label { | ||
214 | text: "" | ||
215 | } | ||
216 | Item { | ||
217 | Layout.fillWidth: true | ||
218 | |||
219 | Button { | ||
220 | text: "Delete" | ||
221 | |||
222 | onClicked: { | ||
223 | imapSettings.remove() | ||
224 | root.closeDialog() | ||
225 | } | ||
226 | } | ||
227 | |||
228 | Button { | ||
229 | anchors.right: parent.right | ||
230 | |||
231 | text: "Save" | ||
232 | |||
233 | onClicked: { | ||
234 | focus: true | ||
235 | imapSettings.save() | ||
236 | root.closeDialog() | ||
237 | } | ||
238 | } | ||
239 | } | ||
240 | } | 181 | } |
241 | } | 182 | } |
242 | } | 183 | } |