diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-08-18 10:55:08 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-08-18 10:55:08 +0200 |
commit | e2f86e32a295cddacc6053936933150d1e7c665b (patch) | |
tree | 35467b1419afa2253d354f3e564f5eca82b16aee /accounts/generic/qml/Login.qml | |
parent | 108913be58ecb014ab575247f3adc9776feafa59 (diff) | |
download | kube-e2f86e32a295cddacc6053936933150d1e7c665b.tar.gz kube-e2f86e32a295cddacc6053936933150d1e7c665b.zip |
A generic account.
This is intended to eventually replace the protocol specific accounts.
The account is used to group together several protocols to one logical
service, and thus it makes sense to set it up as one.
Diffstat (limited to 'accounts/generic/qml/Login.qml')
-rw-r--r-- | accounts/generic/qml/Login.qml | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/accounts/generic/qml/Login.qml b/accounts/generic/qml/Login.qml new file mode 100644 index 00000000..7b5b4221 --- /dev/null +++ b/accounts/generic/qml/Login.qml | |||
@@ -0,0 +1,60 @@ | |||
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.4 | ||
21 | import QtQuick.Layouts 1.1 | ||
22 | import org.kube.framework 1.0 as Kube | ||
23 | import org.kube.accounts.generic 1.0 as GenericAccount | ||
24 | |||
25 | Item { | ||
26 | property alias accountId: settings.accountIdentifier | ||
27 | property string heading: qsTr("Login") | ||
28 | property string subheadline: settings.accountName | ||
29 | property bool valid: pwField.acceptableInput | ||
30 | |||
31 | GenericAccount.Settings { | ||
32 | id: settings | ||
33 | accountType: "generic" | ||
34 | } | ||
35 | |||
36 | function login(){ | ||
37 | settings.login({accountSecret: pwField.text}) | ||
38 | } | ||
39 | |||
40 | GridLayout { | ||
41 | anchors { | ||
42 | fill: parent | ||
43 | } | ||
44 | columns: 2 | ||
45 | columnSpacing: Kube.Units.largeSpacing | ||
46 | rowSpacing: Kube.Units.largeSpacing | ||
47 | |||
48 | Kube.Label { | ||
49 | text: qsTr("Password") | ||
50 | Layout.alignment: Qt.AlignRight | ||
51 | } | ||
52 | |||
53 | Kube.PasswordField { | ||
54 | id: pwField | ||
55 | Layout.fillWidth: true | ||
56 | focus: true | ||
57 | placeholderText: qsTr("Password of your account") | ||
58 | } | ||
59 | } | ||
60 | } | ||