summaryrefslogtreecommitdiffstats
path: root/applications/kube-mail/package/contents/ui/Settings.qml
diff options
context:
space:
mode:
Diffstat (limited to 'applications/kube-mail/package/contents/ui/Settings.qml')
-rw-r--r--applications/kube-mail/package/contents/ui/Settings.qml123
1 files changed, 123 insertions, 0 deletions
diff --git a/applications/kube-mail/package/contents/ui/Settings.qml b/applications/kube-mail/package/contents/ui/Settings.qml
new file mode 100644
index 00000000..71fcf359
--- /dev/null
+++ b/applications/kube-mail/package/contents/ui/Settings.qml
@@ -0,0 +1,123 @@
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
18import QtQuick 2.4
19import QtQuick.Controls 1.4
20import QtQuick.Layouts 1.1
21
22import org.kde.kube.settings 1.0 as KubeSettings
23
24Rectangle {
25 id: root
26
27 visible: false
28
29 color: colorPalette.border
30
31 opacity: 0.9
32
33 MouseArea {
34 anchors.fill: parent
35
36 onClicked: {
37 root.visible = false
38 }
39 }
40
41 Rectangle {
42 anchors.centerIn: parent
43
44 height: root.height * 0.8
45 width: root.width * 0.8
46
47 color: colorPalette.background
48
49 MouseArea {
50 anchors.fill: parent
51 }
52
53 GridLayout {
54 columns: 2
55 anchors.fill: parent
56 anchors.margins: 10
57 rowSpacing: 10
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
104 Item {
105 Layout.columnSpan: 2
106 Layout.fillWidth: true
107 Button {
108 id: button
109 anchors.centerIn: parent
110 text: "Save"
111 onClicked: {
112 contextSettings.save();
113 accountSettings.save();
114 identitySettings.save();
115 transportSettings.save();
116 root.visible = false;
117 }
118 }
119 }
120
121 }
122 }
123}