diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-04-04 19:19:41 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-04-04 19:19:41 +0200 |
commit | d9295fc8f19e4005f8454e7f193f80316550ac0c (patch) | |
tree | f27c370d54bced09212b9c4a12b827d1cebb6110 /framework/qml/EditAccount.qml | |
parent | d002eae7f8b443dd1bad914444c296088c2b6e85 (diff) | |
download | kube-d9295fc8f19e4005f8454e7f193f80316550ac0c.tar.gz kube-d9295fc8f19e4005f8454e7f193f80316550ac0c.zip |
One framework plugin to rule them all
Diffstat (limited to 'framework/qml/EditAccount.qml')
-rw-r--r-- | framework/qml/EditAccount.qml | 138 |
1 files changed, 138 insertions, 0 deletions
diff --git a/framework/qml/EditAccount.qml b/framework/qml/EditAccount.qml new file mode 100644 index 00000000..8618ec91 --- /dev/null +++ b/framework/qml/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 | |||
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 | import org.kube.components.theme 1.0 as KubeTheme | ||
28 | |||
29 | Item { | ||
30 | id: root | ||
31 | property string accountId | ||
32 | |||
33 | KubeAccounts.AccountFactory { | ||
34 | id: accountFactory | ||
35 | accountId: root.accountId | ||
36 | } | ||
37 | |||
38 | Item { | ||
39 | |||
40 | anchors { | ||
41 | fill: parent | ||
42 | margins: Kirigami.Units.largeSpacing * 2 | ||
43 | } | ||
44 | |||
45 | Kirigami.Heading { | ||
46 | id: heading | ||
47 | text: loader.item.heading | ||
48 | color: KubeTheme.Colors.highlightColor | ||
49 | } | ||
50 | |||
51 | Kirigami.Label { | ||
52 | id: subHeadline | ||
53 | |||
54 | anchors { | ||
55 | left: heading.left | ||
56 | top: heading.bottom | ||
57 | } | ||
58 | |||
59 | width: parent.width | ||
60 | text: loader.item.subheadline | ||
61 | color: KubeTheme.Colors.disabledTextColor | ||
62 | wrapMode: Text.Wrap | ||
63 | } | ||
64 | |||
65 | Item { | ||
66 | id: accountEdit | ||
67 | anchors { | ||
68 | top:subHeadline.bottom | ||
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 | left: parent.left | ||
88 | right: parent.right | ||
89 | } | ||
90 | } | ||
91 | |||
92 | //This is where we should place the account wizard ui | ||
93 | GridLayout { | ||
94 | id: footer | ||
95 | anchors { | ||
96 | top:spacer.bottom | ||
97 | bottom: parent.bottom | ||
98 | left: parent.left | ||
99 | right: parent.right | ||
100 | topMargin: Kirigami.Units.largeSpacing * 2 | ||
101 | } | ||
102 | |||
103 | columns: 2 | ||
104 | columnSpacing: Kirigami.Units.largeSpacing | ||
105 | rowSpacing: Kirigami.Units.largeSpacing | ||
106 | |||
107 | Item { | ||
108 | Layout.fillHeight: true | ||
109 | } | ||
110 | |||
111 | Kirigami.Label { | ||
112 | text: "" | ||
113 | } | ||
114 | |||
115 | Item { | ||
116 | Layout.fillWidth: true | ||
117 | |||
118 | Controls.Button { | ||
119 | text: "Discard" | ||
120 | |||
121 | onClicked: { | ||
122 | loader.item.remove() | ||
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 | } | ||