diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-12-18 20:32:57 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-12-18 20:37:06 +0100 |
commit | 1f62cf29d038e1dfd9bd56505ecaae10ca14b60b (patch) | |
tree | 724b2d4f979c06b5033ca86e3271b3a345a1cc30 /accounts/imap/package/contents/ui/AccountSettings.qml | |
parent | 321488dfe88fc3d60b35f3b5b8075adbabf93d29 (diff) | |
download | kube-1f62cf29d038e1dfd9bd56505ecaae10ca14b60b.tar.gz kube-1f62cf29d038e1dfd9bd56505ecaae10ca14b60b.zip |
Accounts without kpackage
Diffstat (limited to 'accounts/imap/package/contents/ui/AccountSettings.qml')
-rw-r--r-- | accounts/imap/package/contents/ui/AccountSettings.qml | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/accounts/imap/package/contents/ui/AccountSettings.qml b/accounts/imap/package/contents/ui/AccountSettings.qml new file mode 100644 index 00000000..d81f9c54 --- /dev/null +++ b/accounts/imap/package/contents/ui/AccountSettings.qml | |||
@@ -0,0 +1,129 @@ | |||
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 | |||
20 | import QtQuick 2.4 | ||
21 | import QtQuick.Controls 1.4 as Controls | ||
22 | import QtQuick.Layouts 1.1 | ||
23 | import org.kube.framework 1.0 as Kube | ||
24 | import org.kube.accounts.imap 1.0 as ImapAccount | ||
25 | |||
26 | Item { | ||
27 | |||
28 | property string accountId | ||
29 | property string heading: qsTr("Connect your IMAP 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. For information about which SMTP, IMAP address, which authentification and port to be used, please contact your email provider.") | ||
31 | property bool valid: true | ||
32 | implicitHeight: grid.implicitHeight | ||
33 | |||
34 | ImapAccount.ImapSettings { | ||
35 | id: imapSettings | ||
36 | accountIdentifier: accountId | ||
37 | accountType: "imap" | ||
38 | } | ||
39 | |||
40 | function save(){ | ||
41 | imapSettings.save() | ||
42 | } | ||
43 | |||
44 | function remove(){ | ||
45 | imapSettings.remove() | ||
46 | } | ||
47 | GridLayout { | ||
48 | id: grid | ||
49 | anchors.fill: parent | ||
50 | columns: 2 | ||
51 | columnSpacing: Kube.Units.largeSpacing | ||
52 | rowSpacing: Kube.Units.largeSpacing | ||
53 | |||
54 | Kube.Label { | ||
55 | text: qsTr("Title of Account") | ||
56 | Layout.alignment: Qt.AlignRight | ||
57 | } | ||
58 | Kube.RequiredTextField { | ||
59 | Layout.fillWidth: true | ||
60 | placeholderText: qsTr("E.g. \"Work\", \"Home\" that will be displayed in Kube as name") | ||
61 | text: imapSettings.accountName | ||
62 | onTextChanged: { | ||
63 | imapSettings.accountName = text | ||
64 | } | ||
65 | } | ||
66 | |||
67 | Kube.Label { | ||
68 | text: qsTr("Name") | ||
69 | Layout.alignment: Qt.AlignRight | ||
70 | } | ||
71 | Kube.RequiredTextField { | ||
72 | Layout.fillWidth: true | ||
73 | placeholderText: qsTr("Your name") | ||
74 | text: imapSettings.userName | ||
75 | onTextChanged: { | ||
76 | imapSettings.userName = text | ||
77 | } | ||
78 | } | ||
79 | |||
80 | Kube.Label { | ||
81 | text: qsTr("Email address") | ||
82 | Layout.alignment: Qt.AlignRight | ||
83 | } | ||
84 | Kube.RequiredTextField { | ||
85 | Layout.fillWidth: true | ||
86 | |||
87 | text: imapSettings.emailAddress | ||
88 | onTextChanged: { | ||
89 | imapSettings.emailAddress = text | ||
90 | imapSettings.imapUsername = text | ||
91 | imapSettings.smtpUsername = text | ||
92 | } | ||
93 | placeholderText: qsTr("Your email address") | ||
94 | } | ||
95 | |||
96 | Kube.Label { | ||
97 | text: qsTr("IMAP server address") | ||
98 | Layout.alignment: Qt.AlignRight | ||
99 | } | ||
100 | Kube.RequiredTextField { | ||
101 | id: imapServer | ||
102 | |||
103 | Layout.fillWidth: true | ||
104 | |||
105 | placeholderText: "imaps://mainserver.example.net:993" | ||
106 | text: imapSettings.imapServer | ||
107 | onTextChanged: { | ||
108 | imapSettings.imapServer = text | ||
109 | } | ||
110 | validator: imapSettings.imapServerValidator | ||
111 | } | ||
112 | |||
113 | Kube.Label { | ||
114 | text: qsTr("Smtp address") | ||
115 | Layout.alignment: Qt.AlignRight | ||
116 | } | ||
117 | Kube.RequiredTextField { | ||
118 | id: smtpServer | ||
119 | Layout.fillWidth: true | ||
120 | |||
121 | placeholderText: "smtps://mainserver.example.net:993" | ||
122 | text: imapSettings.smtpServer | ||
123 | onTextChanged: { | ||
124 | imapSettings.smtpServer = text | ||
125 | } | ||
126 | validator: imapSettings.smtpServerValidator | ||
127 | } | ||
128 | } | ||
129 | } | ||