summaryrefslogtreecommitdiffstats
path: root/components/accounts/contents/ui/AccountWizardPage.qml
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-02-22 14:19:43 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-02-22 15:57:44 +0100
commitcb2b1a35e14031f15155243aee12fc862cb65ebf (patch)
treecc6a28ef675953d41b9eeb98b21325d9a7b030b4 /components/accounts/contents/ui/AccountWizardPage.qml
parentb08e78c52a0b6a3c725ce58e0c3fb0bfcdf2bc55 (diff)
downloadkube-cb2b1a35e14031f15155243aee12fc862cb65ebf.tar.gz
kube-cb2b1a35e14031f15155243aee12fc862cb65ebf.zip
Fixed kolabnow account setup page.
The account plugin supplies the configuration UI, the application supplies the scaffolding. That way we ensure the application doens't contain any account specific code and account configurations are free to offer specialized UI's that work best for them. We're not currently using a standardized controller, but if we did those controllers would have to live with the plugin, not the framework or the components.
Diffstat (limited to 'components/accounts/contents/ui/AccountWizardPage.qml')
-rw-r--r--components/accounts/contents/ui/AccountWizardPage.qml144
1 files changed, 144 insertions, 0 deletions
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}