diff options
Diffstat (limited to 'components/accounts/contents/ui/AccountWizardPage.qml')
-rw-r--r-- | components/accounts/contents/ui/AccountWizardPage.qml | 144 |
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 | |||
20 | import QtQuick 2.7 | ||
21 | import QtQuick.Layouts 1.1 | ||
22 | import QtQuick.Controls 1.4 as Controls | ||
23 | import QtQuick.Controls 2.0 as Controls2 | ||
24 | import org.kde.kirigami 1.0 as Kirigami | ||
25 | |||
26 | import org.kube.framework.accounts 1.0 as KubeAccounts | ||
27 | |||
28 | Item { | ||
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 | } | ||