diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-02-25 16:40:54 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-02-25 16:40:54 +0100 |
commit | fed67ae13d4b9c109449f6077cea328913a8548e (patch) | |
tree | 057d19f9412b2120df749259d393b18c1d5cfb24 /applications | |
parent | 0aba0c3fc68712383774263d0906f8e996e1e9c0 (diff) | |
download | kube-fed67ae13d4b9c109449f6077cea328913a8548e.tar.gz kube-fed67ae13d4b9c109449f6077cea328913a8548e.zip |
An overly basic settings framework.
and a settings view to mess around.
Diffstat (limited to 'applications')
-rw-r--r-- | applications/kube-mail/package/contents/ui/Settings.qml | 123 | ||||
-rw-r--r-- | applications/kube-mail/package/contents/ui/main.qml | 15 |
2 files changed, 138 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 | |||
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 | |||
24 | Rectangle { | ||
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 | } | ||
diff --git a/applications/kube-mail/package/contents/ui/main.qml b/applications/kube-mail/package/contents/ui/main.qml index 7682a334..191a7434 100644 --- a/applications/kube-mail/package/contents/ui/main.qml +++ b/applications/kube-mail/package/contents/ui/main.qml | |||
@@ -21,6 +21,7 @@ import QtQuick.Layouts 1.1 | |||
21 | import org.kde.plasma.components 2.0 as PlasmaComponents | 21 | import org.kde.plasma.components 2.0 as PlasmaComponents |
22 | 22 | ||
23 | import org.kde.kube.actions 1.0 as KubeAction | 23 | import org.kde.kube.actions 1.0 as KubeAction |
24 | import org.kde.kube.settings 1.0 as KubeSettings | ||
24 | 25 | ||
25 | ApplicationWindow { | 26 | ApplicationWindow { |
26 | id: app | 27 | id: app |
@@ -69,6 +70,14 @@ ApplicationWindow { | |||
69 | 70 | ||
70 | PlasmaComponents.ToolButton { | 71 | PlasmaComponents.ToolButton { |
71 | height: parent.height | 72 | height: parent.height |
73 | text: "Settings" | ||
74 | onClicked: { | ||
75 | settings.visible = true | ||
76 | } | ||
77 | } | ||
78 | |||
79 | PlasmaComponents.ToolButton { | ||
80 | height: parent.height | ||
72 | iconName: "mail-message-new" | 81 | iconName: "mail-message-new" |
73 | text: "Compose" | 82 | text: "Compose" |
74 | onClicked: { | 83 | onClicked: { |
@@ -165,6 +174,12 @@ ApplicationWindow { | |||
165 | 174 | ||
166 | } | 175 | } |
167 | 176 | ||
177 | Settings { | ||
178 | id: settings | ||
179 | |||
180 | anchors.fill: parent | ||
181 | } | ||
182 | |||
168 | FocusComposer { | 183 | FocusComposer { |
169 | id: composer | 184 | id: composer |
170 | 185 | ||