summaryrefslogtreecommitdiffstats
path: root/components/accounts/contents/ui/AccountWizardPage.qml
diff options
context:
space:
mode:
Diffstat (limited to 'components/accounts/contents/ui/AccountWizardPage.qml')
-rw-r--r--components/accounts/contents/ui/AccountWizardPage.qml154
1 files changed, 0 insertions, 154 deletions
diff --git a/components/accounts/contents/ui/AccountWizardPage.qml b/components/accounts/contents/ui/AccountWizardPage.qml
deleted file mode 100644
index 18001419..00000000
--- a/components/accounts/contents/ui/AccountWizardPage.qml
+++ /dev/null
@@ -1,154 +0,0 @@
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.kube.framework 1.0 as Kube
25
26
27FocusScope {
28 id: root
29 property string accountType
30 signal done()
31
32 property bool isFirstView: root.Controls2.StackView.index == 0
33 property bool requireSetup: false
34
35 function save() {
36 if (loader.item.valid) {
37 loader.item.save()
38 Kube.Fabric.postMessage(Kube.Messages.synchronize, {"accountId": loader.item.accountIdentifier});
39 root.done()
40 } else {
41 console.warn("Invalid settings.");
42 }
43 }
44
45 Kube.AccountFactory {
46 id: accountFactory
47 accountType: root.accountType
48 }
49
50 Controls.ToolButton {
51 id: backButton
52 iconName: Kube.Icons.goBack
53 tooltip: "go back"
54 visible: !root.isFirstView
55 onClicked: {
56 stack.pop()
57 }
58 }
59
60 Keys.onReturnPressed: save()
61
62 //Item to avoid anchors conflict with stack
63 Item {
64 anchors{
65 top: backButton.bottom
66 left: parent.left
67 right: parent.right
68 bottom: parent.bottom
69 }
70
71 Kube.Heading {
72 id: heading
73 text: loader.item.heading
74 color: Kube.Colors.highlightColor
75 }
76
77 Kube.Label {
78 id: subHeadline
79
80 anchors {
81 left: heading.left
82 top: heading.bottom
83 }
84
85 width: parent.width
86 text: loader.item.subheadline
87 color: Kube.Colors.disabledTextColor
88 wrapMode: Text.Wrap
89 }
90
91 Item {
92 id: accountEdit
93 anchors {
94 top:subHeadline.bottom
95 left: parent.left
96 right: parent.right
97 topMargin: Kube.Units.largeSpacing * 2
98 }
99
100 Loader {
101 id: loader
102 anchors.fill: parent
103 focus: true
104 source: accountFactory.uiPath
105 }
106 }
107
108 Item {
109 id: spacer
110 Layout.fillHeight: true
111 anchors {
112 top:accountEdit.bottom
113 bottom: footer.top
114 left: parent.left
115 right: parent.right
116 }
117 }
118
119 //This is where we should place the account wizard ui
120 Item {
121 id: footer
122
123 anchors {
124 bottom: parent.bottom
125 left: parent.left
126 right: parent.right
127 topMargin: Kube.Units.largeSpacing * 2
128 }
129
130 Kube.Button {
131 anchors {
132 left: parent.left
133 bottom: parent.bottom
134 }
135 visible: !root.requireSetup
136
137 text: qsTr("Discard")
138 onClicked: {
139 root.done()
140 }
141 }
142
143 Kube.PositiveButton {
144 anchors {
145 right: parent.right
146 bottom: parent.bottom
147 }
148
149 text: qsTr("Save")
150 onClicked: save()
151 }
152 }
153 }
154}