summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/mail/contents/ui/main.qml21
-rw-r--r--components/package/contents/ui/NewAccountDialog.qml10
-rw-r--r--components/package/contents/ui/Settings.qml151
-rw-r--r--components/qmldir1
4 files changed, 11 insertions, 172 deletions
diff --git a/components/mail/contents/ui/main.qml b/components/mail/contents/ui/main.qml
index 827dab39..fdae00dc 100644
--- a/components/mail/contents/ui/main.qml
+++ b/components/mail/contents/ui/main.qml
@@ -263,29 +263,14 @@ ApplicationWindow {
263 TextField { 263 TextField {
264 id: searchBar 264 id: searchBar
265 265
266 Layout.minimumWidth: Kirigami.Units.gridUnit * 10 266 Layout.minimumWidth: Kirigami.Units.gridUnit * 15
267 height: toolbar.height 267 height: toolbar.height
268 268
269 placeholderText: "Search..." 269 placeholderText: "Search..."
270 } 270 }
271 271
272 ToolButton { 272 Item {
273 id: settingsButton 273 width: Kirigami.Units.smallSpacing
274
275 iconName: "application-menu"
276 text: "Settings"
277
278 onClicked: {
279 settingsComponent.createObject(app)
280 }
281
282 Component {
283 id: settingsComponent
284 KubeComponents.Settings {
285 id: settings
286 anchors.fill: parent
287 }
288 }
289 } 274 }
290 } 275 }
291 //END MailView section 276 //END MailView section
diff --git a/components/package/contents/ui/NewAccountDialog.qml b/components/package/contents/ui/NewAccountDialog.qml
index 3be72a78..d46728a5 100644
--- a/components/package/contents/ui/NewAccountDialog.qml
+++ b/components/package/contents/ui/NewAccountDialog.qml
@@ -28,6 +28,10 @@ import org.kube.components 1.0 as KubeComponents
28KubeComponents.OverlayDialog { 28KubeComponents.OverlayDialog {
29 id: root 29 id: root
30 30
31 KubeFramework.AccountsController {
32 id: accountsController
33 }
34
31 Item { 35 Item {
32 id: dialog 36 id: dialog
33 37
@@ -103,7 +107,8 @@ KubeComponents.OverlayDialog {
103 text: "imap" 107 text: "imap"
104 108
105 onClicked: { 109 onClicked: {
106 stack.push(imap) 110 accountsController.createAccount("imap");
111 //stack.push(imap)
107 } 112 }
108 } 113 }
109 114
@@ -114,7 +119,8 @@ KubeComponents.OverlayDialog {
114 text: "maildir" 119 text: "maildir"
115 120
116 onClicked: { 121 onClicked: {
117 stack.push(maildir) 122 accountsController.createAccount("maildir");
123 //stack.push(maildir)
118 } 124 }
119 } 125 }
120 } 126 }
diff --git a/components/package/contents/ui/Settings.qml b/components/package/contents/ui/Settings.qml
deleted file mode 100644
index d37863f8..00000000
--- a/components/package/contents/ui/Settings.qml
+++ /dev/null
@@ -1,151 +0,0 @@
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.kirigami 1.0 as Kirigami
23
24import org.kube.framework.settings 1.0 as KubeSettings
25import org.kube.framework.domain 1.0 as KubeFramework
26import org.kube.framework.theme 1.0
27
28Rectangle {
29 id: root
30
31 color: ColorPalette.border
32
33 opacity: 0.9
34
35 MouseArea {
36 anchors.fill: parent
37 onClicked: {
38 root.destroy()
39 }
40 }
41
42 Rectangle {
43 anchors.centerIn: parent
44
45 height: root.height * 0.8
46 width: root.width * 0.8
47
48 color: ColorPalette.background
49
50 MouseArea {
51 anchors.fill: parent
52 }
53
54 KubeSettings.Settings {
55 id: contextSettings
56 identifier: "applicationcontext"
57 property string currentAccountId: "current"
58 }
59
60 KubeFramework.AccountsController {
61 id: accountsController
62 }
63 KubeFramework.AccountsModel {
64 id: accountsModel
65 }
66
67 SplitView {
68 anchors.fill: parent
69
70 ColumnLayout {
71 ScrollView {
72 id: accountsList
73
74 width: Unit.size * 55
75 Layout.maximumWidth: Unit.size * 150
76 Layout.minimumWidth: Unit.size * 30
77
78 ListView {
79 id: listView
80
81 model: accountsModel
82
83 currentIndex: -1
84
85 onCountChanged: {
86 listView.currentIndex = count - 1
87 }
88
89 delegate: Kirigami.AbstractListItem {
90 enabled: true
91 supportsMouseEvents: true
92 checked: listView.currentIndex == index
93
94 onCheckedChanged: {
95 if (checked) {
96 console.warn("Current index changed ", accountFactory.accountId);
97 accountDetails.source = accountFactory.uiPath
98 accountDetails.item.accountId = accountFactory.accountId
99 accountDetails.item.icon = accountFactory.icon
100 accountDetails.item.accountName = accountFactory.name
101 }
102 }
103
104 onClicked: {
105 listView.currentIndex = model.index
106 }
107
108 contentItem: RowLayout {
109
110 KubeFramework.AccountFactory {
111 id: accountFactory
112 accountId: model.accountId
113 onAccountLoaded: {
114 if (listView.currentIndex == model.index) {
115 accountDetails.source = accountFactory.uiPath
116 accountDetails.item.accountId = accountFactory.accountId
117 accountDetails.item.icon = accountFactory.icon
118 accountDetails.item.accountName = accountFactory.name
119 }
120 }
121 }
122
123 Kirigami.Icon {
124 source: accountFactory.icon
125 }
126
127 Label {
128 text: model.name === "" ? accountFactory.name : model.name
129 }
130 }
131 }
132 }
133
134 }
135 Button {
136 id: button
137 text: "Create New"
138 onClicked: {
139 accountsController.createAccount("maildir");
140 }
141 }
142 }
143
144 Loader {
145 id: accountDetails
146
147 Layout.fillWidth: true
148 }
149 }
150 }
151}
diff --git a/components/qmldir b/components/qmldir
index a294cbd3..984c325c 100644
--- a/components/qmldir
+++ b/components/qmldir
@@ -4,7 +4,6 @@ FocusComposer 1.0 FocusComposer.qml
4SingleMailView 1.0 SingleMailView.qml 4SingleMailView 1.0 SingleMailView.qml
5FolderListView 1.0 FolderListView.qml 5FolderListView 1.0 FolderListView.qml
6MailListView 1.0 MailListView.qml 6MailListView 1.0 MailListView.qml
7Settings 1.0 Settings.qml
8AccountSwitcher 1.0 AccountSwitcher.qml 7AccountSwitcher 1.0 AccountSwitcher.qml
9NewAccountDialog 1.0 NewAccountDialog.qml 8NewAccountDialog 1.0 NewAccountDialog.qml
10EditAccountDialog 1.0 EditAccountDialog.qml 9EditAccountDialog 1.0 EditAccountDialog.qml