diff options
Diffstat (limited to 'accounts/google/qml/Login.qml')
-rw-r--r-- | accounts/google/qml/Login.qml | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/accounts/google/qml/Login.qml b/accounts/google/qml/Login.qml new file mode 100644 index 00000000..0a44aa8c --- /dev/null +++ b/accounts/google/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.google 1.0 as GoogleAccount | ||
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 | GoogleAccount.GoogleSettings { | ||
32 | id: settings | ||
33 | accountType: "google" | ||
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 IMAP account") | ||
58 | } | ||
59 | } | ||
60 | } | ||