summaryrefslogtreecommitdiffstats
path: root/components/package/contents/ui/EditAccount.qml
diff options
context:
space:
mode:
Diffstat (limited to 'components/package/contents/ui/EditAccount.qml')
-rw-r--r--components/package/contents/ui/EditAccount.qml138
1 files changed, 138 insertions, 0 deletions
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}