diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-03 10:28:31 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-03 10:28:31 +0100 |
commit | db60d347d06e82ad05ff8ffcf5af6e7c5aa23b07 (patch) | |
tree | 1b9ea70151dbc10172e42136678623a65ed287f5 | |
parent | 2068a8e1bbca09730a0b69ee08b18f76b1adb3ff (diff) | |
download | kube-db60d347d06e82ad05ff8ffcf5af6e7c5aa23b07.tar.gz kube-db60d347d06e82ad05ff8ffcf5af6e7c5aa23b07.zip |
A maildir settings page.
Not how it should be at all (it should all become part of a nice
account plugin), but it's a start.
-rw-r--r-- | applications/kube-mail/package/contents/ui/MaildirAccountSettings.qml | 100 | ||||
-rw-r--r-- | applications/kube-mail/package/contents/ui/Settings.qml | 79 |
2 files changed, 114 insertions, 65 deletions
diff --git a/applications/kube-mail/package/contents/ui/MaildirAccountSettings.qml b/applications/kube-mail/package/contents/ui/MaildirAccountSettings.qml new file mode 100644 index 00000000..5ba9f0c1 --- /dev/null +++ b/applications/kube-mail/package/contents/ui/MaildirAccountSettings.qml | |||
@@ -0,0 +1,100 @@ | |||
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 | |||
22 | import org.kde.kube.settings 1.0 as KubeSettings | ||
23 | // import org.kde.kube.accounts.maildir 1.0 as MaildirAccount | ||
24 | |||
25 | Rectangle { | ||
26 | id: root | ||
27 | property string accountId | ||
28 | property string accountName | ||
29 | |||
30 | color: colorPalette.background | ||
31 | |||
32 | GridLayout { | ||
33 | id: gridLayout | ||
34 | columns: 2 | ||
35 | Layout.fillWidth: true | ||
36 | |||
37 | Text { | ||
38 | Layout.columnSpan: 2 | ||
39 | Layout.fillWidth: true | ||
40 | text: "Account: " + accountName | ||
41 | } | ||
42 | |||
43 | Label { text: "Username" } | ||
44 | TextField { | ||
45 | id: username | ||
46 | text: "username" | ||
47 | Layout.fillWidth: true | ||
48 | } | ||
49 | |||
50 | Label { text: "Password" } | ||
51 | TextField { | ||
52 | id: password | ||
53 | text: "password" | ||
54 | Layout.fillWidth: true | ||
55 | } | ||
56 | |||
57 | Label { text: "Server" } | ||
58 | TextField { | ||
59 | id: server | ||
60 | text: "server" | ||
61 | Layout.fillWidth: true | ||
62 | } | ||
63 | |||
64 | //If we had a settings controller | ||
65 | // MaildirAccount.SmtpSettings { | ||
66 | // id: smtpSettings | ||
67 | // identifier: accountId | ||
68 | // property alias username: username.text | ||
69 | // property alias password: password.text | ||
70 | // property alias server: server.text | ||
71 | // } | ||
72 | |||
73 | KubeSettings.Settings { | ||
74 | id: accountSettings | ||
75 | identifier: "account." + modelData | ||
76 | property string primaryIdentity: "current" | ||
77 | } | ||
78 | KubeSettings.Settings { | ||
79 | id: identitySettings | ||
80 | identifier: "identity.current" | ||
81 | property string transport: "current" | ||
82 | } | ||
83 | KubeSettings.Settings { | ||
84 | id: transportSettings | ||
85 | identifier: "transport.current" | ||
86 | property alias username: username.text | ||
87 | property alias password: password.text | ||
88 | property alias server: server.text | ||
89 | } | ||
90 | |||
91 | Button { | ||
92 | id: button | ||
93 | text: "Save" | ||
94 | onClicked: { | ||
95 | smtpSettings.save(); | ||
96 | root.visible = false; | ||
97 | } | ||
98 | } | ||
99 | } | ||
100 | } | ||
diff --git a/applications/kube-mail/package/contents/ui/Settings.qml b/applications/kube-mail/package/contents/ui/Settings.qml index 71fcf359..34755df0 100644 --- a/applications/kube-mail/package/contents/ui/Settings.qml +++ b/applications/kube-mail/package/contents/ui/Settings.qml | |||
@@ -50,74 +50,23 @@ Rectangle { | |||
50 | anchors.fill: parent | 50 | anchors.fill: parent |
51 | } | 51 | } |
52 | 52 | ||
53 | GridLayout { | 53 | KubeSettings.Settings { |
54 | columns: 2 | 54 | id: contextSettings |
55 | anchors.fill: parent | 55 | identifier: "applicationcontext" |
56 | anchors.margins: 10 | 56 | property string currentAccountId: "current" |
57 | rowSpacing: 10 | 57 | } |
58 | columnSpacing: 10 | ||
59 | |||
60 | Label { text: "Username" } | ||
61 | TextField { | ||
62 | id: username | ||
63 | text: "username" | ||
64 | Layout.fillWidth: true | ||
65 | } | ||
66 | |||
67 | Label { text: "Password" } | ||
68 | TextField { | ||
69 | id: password | ||
70 | text: "password" | ||
71 | Layout.fillWidth: true | ||
72 | } | ||
73 | |||
74 | Label { text: "Server" } | ||
75 | TextField { | ||
76 | id: server | ||
77 | text: "server" | ||
78 | Layout.fillWidth: true | ||
79 | } | ||
80 | |||
81 | KubeSettings.Settings { | ||
82 | id: contextSettings | ||
83 | identifier: "applicationcontext" | ||
84 | property string currentAccountId: "current" | ||
85 | } | ||
86 | KubeSettings.Settings { | ||
87 | id: accountSettings | ||
88 | identifier: "account.current" | ||
89 | property string primaryIdentity: "current" | ||
90 | } | ||
91 | KubeSettings.Settings { | ||
92 | id: identitySettings | ||
93 | identifier: "identity.current" | ||
94 | property string transport: "current" | ||
95 | } | ||
96 | KubeSettings.Settings { | ||
97 | id: transportSettings | ||
98 | identifier: "transport.current" | ||
99 | property alias username: username.text | ||
100 | property alias password: password.text | ||
101 | property alias server: server.text | ||
102 | } | ||
103 | 58 | ||
104 | Item { | 59 | Column { |
105 | Layout.columnSpan: 2 | 60 | spacing: 5 |
106 | Layout.fillWidth: true | 61 | Repeater { |
107 | Button { | 62 | model: ["current"] //Get from context settings |
108 | id: button | 63 | delegate: MaildirAccountSettings { //This should be retrieved from the accounts plugin: KubeAccounts { identifier: modelData }.settingsUi |
109 | anchors.centerIn: parent | 64 | accountId: modelData |
110 | text: "Save" | 65 | accountName: "Maildir" |
111 | onClicked: { | ||
112 | contextSettings.save(); | ||
113 | accountSettings.save(); | ||
114 | identitySettings.save(); | ||
115 | transportSettings.save(); | ||
116 | root.visible = false; | ||
117 | } | ||
118 | } | 66 | } |
119 | } | 67 | } |
120 | |||
121 | } | 68 | } |
69 | |||
70 | //Add possibility to add more accounts | ||
122 | } | 71 | } |
123 | } | 72 | } |