diff options
Diffstat (limited to 'components/accounts/contents/ui/CreateKolabNow.qml')
-rw-r--r-- | components/accounts/contents/ui/CreateKolabNow.qml | 208 |
1 files changed, 208 insertions, 0 deletions
diff --git a/components/accounts/contents/ui/CreateKolabNow.qml b/components/accounts/contents/ui/CreateKolabNow.qml new file mode 100644 index 00000000..e6022cbb --- /dev/null +++ b/components/accounts/contents/ui/CreateKolabNow.qml | |||
@@ -0,0 +1,208 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | import QtQuick 2.7 | ||
20 | import QtQuick.Layouts 1.1 | ||
21 | import QtQuick.Controls 1.4 as Controls | ||
22 | import QtQuick.Controls 2.0 as Controls2 | ||
23 | import org.kde.kirigami 1.0 as Kirigami | ||
24 | |||
25 | import org.kube.framework.accounts 1.0 as KubeAccounts | ||
26 | |||
27 | Item { | ||
28 | |||
29 | KubeAccounts.KolabNowController { | ||
30 | id: account | ||
31 | } | ||
32 | |||
33 | Controls.ToolButton { | ||
34 | iconName: "go-previous" | ||
35 | |||
36 | tooltip: "go back" | ||
37 | |||
38 | onClicked: { | ||
39 | stack.pop() | ||
40 | } | ||
41 | } | ||
42 | |||
43 | //Item to avoid anchors conflict with stack | ||
44 | Item { | ||
45 | |||
46 | anchors { | ||
47 | fill: parent | ||
48 | margins: Kirigami.Units.largeSpacing * 2 | ||
49 | } | ||
50 | |||
51 | Kirigami.Heading { | ||
52 | id: heading | ||
53 | text: "Connect your Kolab Now account" | ||
54 | |||
55 | color: Kirigami.Theme.highlightColor | ||
56 | } | ||
57 | |||
58 | Kirigami.Label { | ||
59 | id: subHeadline | ||
60 | |||
61 | anchors { | ||
62 | left: heading.left | ||
63 | top: heading.bottom | ||
64 | } | ||
65 | |||
66 | width: parent.width | ||
67 | |||
68 | text: "To let Kube access your account, fill in email address, username, password and give the account a title that will be displayed inside Kube." | ||
69 | |||
70 | color: Kirigami.Theme.disabledTextColor | ||
71 | |||
72 | wrapMode: Text.Wrap | ||
73 | } | ||
74 | |||
75 | GridLayout { | ||
76 | anchors { | ||
77 | top:subHeadline.bottom | ||
78 | bottom: parent.bottom | ||
79 | left: parent.left | ||
80 | right: parent.right | ||
81 | topMargin: Kirigami.Units.largeSpacing * 2 | ||
82 | } | ||
83 | |||
84 | columns: 2 | ||
85 | columnSpacing: Kirigami.Units.largeSpacing | ||
86 | rowSpacing: Kirigami.Units.largeSpacing | ||
87 | |||
88 | Controls.Label { | ||
89 | text: "Title of Account" | ||
90 | Layout.alignment: Qt.AlignRight | ||
91 | } | ||
92 | Controls.TextField { | ||
93 | Layout.fillWidth: true | ||
94 | |||
95 | placeholderText: "E.g. \"Work\", \"Home\" that will be displayed in Kube as name" | ||
96 | |||
97 | text: account.name | ||
98 | |||
99 | onTextChanged: { | ||
100 | account.name = text | ||
101 | } | ||
102 | } | ||
103 | |||
104 | Controls.Label { | ||
105 | text: "Name" | ||
106 | Layout.alignment: Qt.AlignRight | ||
107 | } | ||
108 | Controls.TextField { | ||
109 | Layout.fillWidth: true | ||
110 | |||
111 | placeholderText: "Your name" | ||
112 | |||
113 | text: account.identityName | ||
114 | |||
115 | onTextChanged: { | ||
116 | account.identityName = text | ||
117 | } | ||
118 | } | ||
119 | |||
120 | Controls.Label { | ||
121 | text: "Email address" | ||
122 | Layout.alignment: Qt.AlignRight | ||
123 | } | ||
124 | |||
125 | Controls.TextField { | ||
126 | Layout.fillWidth: true | ||
127 | |||
128 | text: account.emailAddress | ||
129 | |||
130 | onTextChanged: { | ||
131 | account.emailAddress = text | ||
132 | } | ||
133 | |||
134 | placeholderText: "Your email address" | ||
135 | } | ||
136 | |||
137 | Kirigami.Label { | ||
138 | text: "Password" | ||
139 | Layout.alignment: Qt.AlignRight | ||
140 | } | ||
141 | |||
142 | RowLayout { | ||
143 | Layout.fillWidth: true | ||
144 | |||
145 | Controls.TextField { | ||
146 | id: pwField | ||
147 | Layout.fillWidth: true | ||
148 | |||
149 | placeholderText: "Password of your email account" | ||
150 | |||
151 | text: account.password | ||
152 | |||
153 | onTextChanged: { | ||
154 | account.password = text | ||
155 | } | ||
156 | |||
157 | echoMode: TextInput.Password | ||
158 | } | ||
159 | |||
160 | Controls.CheckBox { | ||
161 | text: "Show Password" | ||
162 | onClicked: { | ||
163 | if(pwField.echoMode == TextInput.Password) { | ||
164 | pwField.echoMode = TextInput.Normal; | ||
165 | } else { | ||
166 | pwField.echoMode = TextInput.Password; | ||
167 | } | ||
168 | } | ||
169 | } | ||
170 | } | ||
171 | |||
172 | Item { | ||
173 | Layout.fillHeight: true | ||
174 | } | ||
175 | |||
176 | Kirigami.Label { | ||
177 | text: "" | ||
178 | } | ||
179 | |||
180 | Kirigami.Label { | ||
181 | text: "" | ||
182 | } | ||
183 | |||
184 | Item { | ||
185 | Layout.fillWidth: true | ||
186 | |||
187 | Controls.Button { | ||
188 | text: "Discard" | ||
189 | |||
190 | onClicked: { | ||
191 | popup.close() | ||
192 | } | ||
193 | } | ||
194 | |||
195 | Controls.Button { | ||
196 | anchors.right: parent.right | ||
197 | |||
198 | text: "Save" | ||
199 | |||
200 | onClicked: { | ||
201 | account.createAction.execute() | ||
202 | popup.close() | ||
203 | } | ||
204 | } | ||
205 | } | ||
206 | } | ||
207 | } | ||
208 | } | ||