summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rw-r--r--components/accounts/contents/ui/AccountWizard.qml76
-rw-r--r--components/accounts/contents/ui/AccountWizardPage.qml144
-rw-r--r--components/package/contents/ui/AccountSwitcher.qml20
-rw-r--r--components/package/contents/ui/EditAccount.qml138
-rw-r--r--components/package/contents/ui/EditAccountDialog.qml20
5 files changed, 299 insertions, 99 deletions
diff --git a/components/accounts/contents/ui/AccountWizard.qml b/components/accounts/contents/ui/AccountWizard.qml
index 8cc90acb..ffc3f5da 100644
--- a/components/accounts/contents/ui/AccountWizard.qml
+++ b/components/accounts/contents/ui/AccountWizard.qml
@@ -51,47 +51,15 @@ Controls2.Popup {
51 51
52 spacing: Kirigami.Units.largeSpacing 52 spacing: Kirigami.Units.largeSpacing
53 53
54 Controls2.Button { 54 Repeater {
55 55 //TODO replace by model of available accounts
56 Layout.fillWidth: true 56 model: ["kolabnow", "imap", "maildir"]
57 57 delegate: Controls2.Button {
58 text: "kolabnow account" 58 Layout.fillWidth: true
59 59 text: modelData +" account"
60 onClicked: { 60 onClicked: {
61 stack.push(kolabnow) 61 stack.push(wizardPage.createObject(app, {accountType:modelData}))
62 } 62 }
63 }
64
65 Controls2.Button {
66
67 Layout.fillWidth: true
68
69 text: "gmail account"
70
71 onClicked: {
72 stack.push(gmail)
73 }
74 }
75
76 Controls2.Button {
77
78 Layout.fillWidth: true
79
80 text: "imap account"
81
82 onClicked: {
83 stack.push(imap)
84 }
85 }
86
87 Controls2.Button {
88
89 Layout.fillWidth: true
90
91 text: "maildir archive"
92
93 onClicked: {
94 stack.push(maildir)
95 } 63 }
96 } 64 }
97 } 65 }
@@ -99,30 +67,8 @@ Controls2.Popup {
99 } 67 }
100 68
101 Component { 69 Component {
102 id: kolabnow 70 id: wizardPage
103 71 AccountWizardPage {
104 CreateKolabNow {
105 }
106 }
107
108 Component {
109 id: gmail
110
111 CreateGmail {
112 }
113 }
114
115 Component {
116 id: imap
117
118 CreateImap {
119 }
120 }
121
122 Component {
123 id: maildir
124
125 CreateMaildir {
126 } 72 }
127 } 73 }
128} 74}
diff --git a/components/accounts/contents/ui/AccountWizardPage.qml b/components/accounts/contents/ui/AccountWizardPage.qml
new file mode 100644
index 00000000..967bd4ab
--- /dev/null
+++ b/components/accounts/contents/ui/AccountWizardPage.qml
@@ -0,0 +1,144 @@
1/*
2 * Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsys.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20import QtQuick 2.7
21import QtQuick.Layouts 1.1
22import QtQuick.Controls 1.4 as Controls
23import QtQuick.Controls 2.0 as Controls2
24import org.kde.kirigami 1.0 as Kirigami
25
26import org.kube.framework.accounts 1.0 as KubeAccounts
27
28Item {
29 id: root
30 property string accountType
31
32 KubeAccounts.AccountFactory {
33 id: accountFactory
34 accountType: root.accountType
35 }
36
37 Controls.ToolButton {
38 iconName: "go-previous"
39 tooltip: "go back"
40 onClicked: {
41 stack.pop()
42 }
43 }
44
45 //Item to avoid anchors conflict with stack
46 Item {
47
48 anchors {
49 fill: parent
50 margins: Kirigami.Units.largeSpacing * 2
51 }
52
53 Kirigami.Heading {
54 id: heading
55 text: loader.item.heading
56 color: Kirigami.Theme.highlightColor
57 }
58
59 Kirigami.Label {
60 id: subHeadline
61
62 anchors {
63 left: heading.left
64 top: heading.bottom
65 }
66
67 width: parent.width
68 text: loader.item.subheadline
69 color: Kirigami.Theme.disabledTextColor
70 wrapMode: Text.Wrap
71 }
72
73 Item {
74 id: accountEdit
75 anchors {
76 top:subHeadline.bottom
77 left: parent.left
78 right: parent.right
79 topMargin: Kirigami.Units.largeSpacing * 2
80 }
81
82 Loader {
83 id: loader
84 anchors.fill: parent
85 source: accountFactory.uiPath
86 }
87 }
88
89 Item {
90 id: spacer
91 Layout.fillHeight: true
92 anchors {
93 top:accountEdit.bottom
94 bottom: footer.top
95 left: parent.left
96 right: parent.right
97 }
98 }
99
100 //This is where we should place the account wizard ui
101 GridLayout {
102 id: footer
103 anchors {
104 bottom: parent.bottom
105 left: parent.left
106 right: parent.right
107 topMargin: Kirigami.Units.largeSpacing * 2
108 }
109
110 columns: 2
111 columnSpacing: Kirigami.Units.largeSpacing
112 rowSpacing: Kirigami.Units.largeSpacing
113
114 Item {
115 Layout.fillHeight: true
116 }
117
118 Kirigami.Label {
119 text: ""
120 }
121
122 Item {
123 Layout.fillWidth: true
124
125 Controls.Button {
126 text: "Discard"
127
128 onClicked: {
129 popup.close()
130 }
131 }
132
133 Controls.Button {
134 anchors.right: parent.right
135 text: "Save"
136 onClicked: {
137 loader.item.save()
138 popup.close()
139 }
140 }
141 }
142 }
143 }
144}
diff --git a/components/package/contents/ui/AccountSwitcher.qml b/components/package/contents/ui/AccountSwitcher.qml
index eb5702e0..48bb2c1b 100644
--- a/components/package/contents/ui/AccountSwitcher.qml
+++ b/components/package/contents/ui/AccountSwitcher.qml
@@ -72,14 +72,11 @@ Controls.ToolButton {
72 width: parent.width 72 width: parent.width
73 73
74 Controls2.Button { 74 Controls2.Button {
75
76
77 anchors { 75 anchors {
78 left: parent.left 76 left: parent.left
79 bottom: parent.bottom 77 bottom: parent.bottom
80 } 78 }
81 79
82
83 //iconName: "view-refresh" 80 //iconName: "view-refresh"
84 text: "Sync" 81 text: "Sync"
85 enabled: folderController.synchronizeAction.enabled 82 enabled: folderController.synchronizeAction.enabled
@@ -160,15 +157,6 @@ Controls.ToolButton {
160 157
161 Layout.fillHeight: true 158 Layout.fillHeight: true
162 159
163 KubeAccounts.AccountFactory {
164 id: accountFactory
165 accountId: model.accountId
166 }
167
168 // Kirigami.Icon {
169 // source: model.icon
170 // }
171
172 Controls2.Label { 160 Controls2.Label {
173 text: model.name 161 text: model.name
174 } 162 }
@@ -191,20 +179,14 @@ Controls.ToolButton {
191 text: "edit" 179 text: "edit"
192 180
193 onClicked: { 181 onClicked: {
194 editAccountComponent.createObject(app) 182 editAccountComponent.createObject(app, {accountId:model.accountId})
195 popup.close() 183 popup.close()
196 } 184 }
197 185
198 Component { 186 Component {
199 id: editAccountComponent 187 id: editAccountComponent
200
201 KubeComponents.EditAccountDialog { 188 KubeComponents.EditAccountDialog {
202 id: editAccount
203
204 anchors.fill: parent 189 anchors.fill: parent
205
206 accountId: accountFactory.accountId
207 uiSource: accountFactory.uiPath
208 } 190 }
209 } 191 }
210 } 192 }
diff --git a/components/package/contents/ui/EditAccount.qml b/components/package/contents/ui/EditAccount.qml
new file mode 100644
index 00000000..e3e049fa
--- /dev/null
+++ b/components/package/contents/ui/EditAccount.qml
@@ -0,0 +1,138 @@
1/*
2 * Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsys.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20import QtQuick 2.7
21import QtQuick.Layouts 1.1
22import QtQuick.Controls 1.4 as Controls
23import QtQuick.Controls 2.0 as Controls2
24import org.kde.kirigami 1.0 as Kirigami
25
26import org.kube.framework.accounts 1.0 as KubeAccounts
27
28Item {
29 id: root
30 property string accountId
31
32 KubeAccounts.AccountFactory {
33 id: accountFactory
34 accountId: root.accountId
35 }
36
37 Item {
38
39 anchors {
40 fill: parent
41 margins: Kirigami.Units.largeSpacing * 2
42 }
43
44 Kirigami.Heading {
45 id: heading
46 text: loader.item.heading
47 color: Kirigami.Theme.highlightColor
48 }
49
50 Kirigami.Label {
51 id: subHeadline
52
53 anchors {
54 left: heading.left
55 top: heading.bottom
56 }
57
58 width: parent.width
59 text: loader.item.subheadline
60 color: Kirigami.Theme.disabledTextColor
61 wrapMode: Text.Wrap
62 }
63
64 Item {
65 id: accountEdit
66 anchors {
67 top:subHeadline.bottom
68 bottom: spacer.top
69 left: parent.left
70 right: parent.right
71 topMargin: Kirigami.Units.largeSpacing * 2
72 }
73
74 Loader {
75 id: loader
76 anchors.fill: parent
77 source: accountFactory.uiPath
78 onLoaded: item.accountId = root.accountId
79 }
80 }
81
82 Item {
83 id: spacer
84 Layout.fillHeight: true
85 anchors {
86 top:accountEdit.bottom
87 bottom: footer.top
88 left: parent.left
89 right: parent.right
90 }
91 }
92
93 //This is where we should place the account wizard ui
94 GridLayout {
95 id: footer
96 anchors {
97 top:spacer.bottom
98 bottom: parent.bottom
99 left: parent.left
100 right: parent.right
101 topMargin: Kirigami.Units.largeSpacing * 2
102 }
103
104 columns: 2
105 columnSpacing: Kirigami.Units.largeSpacing
106 rowSpacing: Kirigami.Units.largeSpacing
107
108 Item {
109 Layout.fillHeight: true
110 }
111
112 Kirigami.Label {
113 text: ""
114 }
115
116 Item {
117 Layout.fillWidth: true
118
119 Controls.Button {
120 text: "Discard"
121
122 onClicked: {
123 dialog.closeDialog()
124 }
125 }
126
127 Controls.Button {
128 anchors.right: parent.right
129 text: "Save"
130 onClicked: {
131 loader.item.save()
132 dialog.closeDialog()
133 }
134 }
135 }
136 }
137 }
138}
diff --git a/components/package/contents/ui/EditAccountDialog.qml b/components/package/contents/ui/EditAccountDialog.qml
index 19349f38..a7461640 100644
--- a/components/package/contents/ui/EditAccountDialog.qml
+++ b/components/package/contents/ui/EditAccountDialog.qml
@@ -21,28 +21,18 @@ import QtQuick.Layouts 1.1
21 21
22import org.kde.kirigami 1.0 as Kirigami 22import org.kde.kirigami 1.0 as Kirigami
23 23
24import org.kube.framework.settings 1.0 as KubeSettings
25import org.kube.framework.domain 1.0 as KubeFramework
26import org.kube.components 1.0 as KubeComponents 24import org.kube.components 1.0 as KubeComponents
27 25
28KubeComponents.OverlayDialog { 26KubeComponents.OverlayDialog {
29 id: root 27 id: dialog
30 28
31 property variant uiSource
32 property variant accountId 29 property variant accountId
30 EditAccount {
31 accountId: dialog.accountId
33 32
34 Item {
35 id: dialog
36 anchors.centerIn: parent 33 anchors.centerIn: parent
37 34
38 height: root.height * 0.8 35 height: dialog.height * 0.8
39 width: root.width * 0.8 36 width: dialog.width * 0.8
40
41 Loader {
42 anchors.fill: parent
43
44 source: root.uiSource
45 onLoaded: item.accountId = root.accountId
46 }
47 } 37 }
48} 38}