diff options
Diffstat (limited to 'accounts/imap/package')
-rw-r--r-- | accounts/imap/package/contents/ui/ImapAccountSettings.qml | 164 | ||||
-rw-r--r-- | accounts/imap/package/metadata.desktop | 8 |
2 files changed, 172 insertions, 0 deletions
diff --git a/accounts/imap/package/contents/ui/ImapAccountSettings.qml b/accounts/imap/package/contents/ui/ImapAccountSettings.qml new file mode 100644 index 00000000..4dfa3ba4 --- /dev/null +++ b/accounts/imap/package/contents/ui/ImapAccountSettings.qml | |||
@@ -0,0 +1,164 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2016 Michael Bohlender <michael.bohlender@kdemail.net> | ||
3 | * | ||
4 | * 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 | * the Free Software Foundation; either version 3 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | import QtQuick 2.4 | ||
19 | import QtQuick.Controls 1.4 | ||
20 | import QtQuick.Layouts 1.1 | ||
21 | import QtQuick.Dialogs 1.0 | ||
22 | |||
23 | import org.kube.framework.settings 1.0 as KubeSettings | ||
24 | import org.kube.framework.theme 1.0 | ||
25 | import org.kube.accounts.imap 1.0 as ImapAccount | ||
26 | |||
27 | |||
28 | Rectangle { | ||
29 | id: root | ||
30 | property string accountId | ||
31 | property string accountName | ||
32 | property string icon | ||
33 | |||
34 | color: ColorPalette.background | ||
35 | |||
36 | GridLayout { | ||
37 | id: gridLayout | ||
38 | columns: 2 | ||
39 | Layout.fillWidth: true | ||
40 | |||
41 | Text { | ||
42 | Layout.columnSpan: 2 | ||
43 | Layout.fillWidth: true | ||
44 | text: "General:" | ||
45 | } | ||
46 | |||
47 | Label { text: "Account Name" } | ||
48 | TextField { | ||
49 | id: name | ||
50 | placeholderText: accountName | ||
51 | Layout.fillWidth: true | ||
52 | text: imapSettings.accountName | ||
53 | onTextChanged: { imapSettings.accountName = text; root.accountName = text; } | ||
54 | } | ||
55 | |||
56 | Label { text: "User Name" } | ||
57 | TextField { | ||
58 | placeholderText: "Your Name" | ||
59 | Layout.fillWidth: true | ||
60 | text: imapSettings.userName | ||
61 | onTextChanged: { imapSettings.userName = text; } | ||
62 | } | ||
63 | |||
64 | Label { text: "Email Address" } | ||
65 | TextField { | ||
66 | placeholderText: "Your EMail Address" | ||
67 | Layout.fillWidth: true | ||
68 | text: imapSettings.emailAddress | ||
69 | onTextChanged: { imapSettings.emailAddress = text; } | ||
70 | } | ||
71 | |||
72 | Text { | ||
73 | Layout.columnSpan: 2 | ||
74 | Layout.fillWidth: true | ||
75 | text: "Imap:" | ||
76 | } | ||
77 | |||
78 | Label { text: "Username" } | ||
79 | TextField { | ||
80 | placeholderText: "Username" | ||
81 | Layout.fillWidth: true | ||
82 | text: imapSettings.imapUsername | ||
83 | onTextChanged: { imapSettings.imapUsername = text; } | ||
84 | } | ||
85 | |||
86 | Label { text: "Password" } | ||
87 | TextField { | ||
88 | placeholderText: "Password" | ||
89 | Layout.fillWidth: true | ||
90 | text: imapSettings.imapPassword | ||
91 | onTextChanged: { imapSettings.imapPassword = text; } | ||
92 | } | ||
93 | |||
94 | Label { text: "Server" } | ||
95 | TextField { | ||
96 | id: server | ||
97 | placeholderText: "imaps://mainserver.example.net:993" | ||
98 | Layout.fillWidth: true | ||
99 | text: imapSettings.imapServer | ||
100 | onTextChanged: { imapSettings.imapServer = text; } | ||
101 | validator: imapSettings.imapServerValidator | ||
102 | Rectangle { | ||
103 | anchors.fill: parent | ||
104 | opacity: 0.2 | ||
105 | color: server.acceptableInput ? "green" : "yellow" | ||
106 | } | ||
107 | } | ||
108 | |||
109 | Text { | ||
110 | Layout.columnSpan: 2 | ||
111 | Layout.fillWidth: true | ||
112 | text: "Smtp:" | ||
113 | } | ||
114 | |||
115 | Label { text: "Username" } | ||
116 | TextField { | ||
117 | placeholderText: "Username" | ||
118 | Layout.fillWidth: true | ||
119 | text: imapSettings.smtpUsername | ||
120 | onTextChanged: { imapSettings.smtpUsername = text; } | ||
121 | } | ||
122 | |||
123 | Label { text: "Password" } | ||
124 | TextField { | ||
125 | placeholderText: "Password" | ||
126 | Layout.fillWidth: true | ||
127 | text: imapSettings.smtpPassword | ||
128 | onTextChanged: { imapSettings.smtpPassword = text; } | ||
129 | } | ||
130 | |||
131 | Label { text: "Server" } | ||
132 | TextField { | ||
133 | id: server | ||
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 | } | ||
144 | } | ||
145 | |||
146 | ImapAccount.ImapSettings { | ||
147 | id: imapSettings | ||
148 | accountIdentifier: accountId | ||
149 | } | ||
150 | |||
151 | Button { | ||
152 | text: "Save" | ||
153 | onClicked: { | ||
154 | imapSettings.save(); | ||
155 | } | ||
156 | } | ||
157 | Button { | ||
158 | text: "Remove" | ||
159 | onClicked: { | ||
160 | imapSettings.remove(); | ||
161 | } | ||
162 | } | ||
163 | } | ||
164 | } | ||
diff --git a/accounts/imap/package/metadata.desktop b/accounts/imap/package/metadata.desktop new file mode 100644 index 00000000..7c4320c3 --- /dev/null +++ b/accounts/imap/package/metadata.desktop | |||
@@ -0,0 +1,8 @@ | |||
1 | [Desktop Entry] | ||
2 | Name=Kube Imap Accounts Plugin | ||
3 | X-KDE-PluginInfo-Name=org.kube.accounts.imap | ||
4 | Exec=kpackagelauncherqml -a org.kube.accounts.imap | ||
5 | X-Plasma-MainScript=ui/ImapAccountSettings.qml | ||
6 | X-KDE-ServiceTypes=KPackage/GenericQML | ||
7 | Icon=folder | ||
8 | Type=Service | ||