diff options
Diffstat (limited to 'accounts/kolabnow/qml')
-rw-r--r-- | accounts/kolabnow/qml/AccountSettings.qml | 84 | ||||
-rw-r--r-- | accounts/kolabnow/qml/Login.qml | 62 |
2 files changed, 146 insertions, 0 deletions
diff --git a/accounts/kolabnow/qml/AccountSettings.qml b/accounts/kolabnow/qml/AccountSettings.qml new file mode 100644 index 00000000..4161bc49 --- /dev/null +++ b/accounts/kolabnow/qml/AccountSettings.qml | |||
@@ -0,0 +1,84 @@ | |||
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.kolabnow 1.0 as KolabnowAccount | ||
24 | |||
25 | Item { | ||
26 | property string accountId | ||
27 | property string heading: qsTr("Connect your Kolab Now account") | ||
28 | property string subheadline: qsTr("Please fill in your name and email address. No account yet? <a href='https://kolabnow.com/kube-campaign/'>Sign up now!</a>") | ||
29 | property bool valid: nameField.acceptableInput && emailField.acceptableInput | ||
30 | implicitHeight: grid.implicitHeight | ||
31 | |||
32 | KolabnowAccount.KolabnowSettings { | ||
33 | id: kolabnowSettings | ||
34 | accountIdentifier: accountId | ||
35 | accountType: "kolabnow" | ||
36 | } | ||
37 | |||
38 | function save(){ | ||
39 | kolabnowSettings.save() | ||
40 | } | ||
41 | |||
42 | function remove(){ | ||
43 | kolabnowSettings.remove() | ||
44 | } | ||
45 | |||
46 | GridLayout { | ||
47 | id: grid | ||
48 | anchors.fill: parent | ||
49 | columns: 2 | ||
50 | columnSpacing: Kube.Units.largeSpacing | ||
51 | rowSpacing: Kube.Units.largeSpacing | ||
52 | |||
53 | Kube.Label { | ||
54 | text: qsTr("Name") | ||
55 | Layout.alignment: Qt.AlignRight | ||
56 | } | ||
57 | Kube.RequiredTextField { | ||
58 | id: nameField | ||
59 | focus: true | ||
60 | Layout.fillWidth: true | ||
61 | placeholderText: qsTr("Your name") | ||
62 | text: kolabnowSettings.userName | ||
63 | onTextChanged: { | ||
64 | kolabnowSettings.userName = text | ||
65 | } | ||
66 | } | ||
67 | |||
68 | Kube.Label { | ||
69 | text: qsTr("Email address") | ||
70 | Layout.alignment: Qt.AlignRight | ||
71 | } | ||
72 | Kube.RequiredTextField { | ||
73 | id: emailField | ||
74 | Layout.fillWidth: true | ||
75 | |||
76 | text: kolabnowSettings.emailAddress | ||
77 | onTextChanged: { | ||
78 | kolabnowSettings.emailAddress = text | ||
79 | kolabnowSettings.accountName = text | ||
80 | } | ||
81 | placeholderText: qsTr("Your email address") | ||
82 | } | ||
83 | } | ||
84 | } | ||
diff --git a/accounts/kolabnow/qml/Login.qml b/accounts/kolabnow/qml/Login.qml new file mode 100644 index 00000000..e416b089 --- /dev/null +++ b/accounts/kolabnow/qml/Login.qml | |||
@@ -0,0 +1,62 @@ | |||
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.kolabnow 1.0 as KolabnowAccount | ||
24 | |||
25 | Item { | ||
26 | property alias accountId: settings.accountIdentifier | ||
27 | property string heading: qsTr("Login") | ||
28 | property string subheadline: settings.accountName | ||
29 | |||
30 | KolabnowAccount.KolabnowSettings { | ||
31 | id: settings | ||
32 | accountType: "kolabnow" | ||
33 | } | ||
34 | |||
35 | function login(){ | ||
36 | settings.save() | ||
37 | } | ||
38 | |||
39 | GridLayout { | ||
40 | anchors { | ||
41 | fill: parent | ||
42 | } | ||
43 | columns: 2 | ||
44 | columnSpacing: Kube.Units.largeSpacing | ||
45 | rowSpacing: Kube.Units.largeSpacing | ||
46 | |||
47 | Kube.Label { | ||
48 | text: qsTr("Password") | ||
49 | Layout.alignment: Qt.AlignRight | ||
50 | } | ||
51 | |||
52 | Kube.PasswordField { | ||
53 | id: pwField | ||
54 | Layout.fillWidth: true | ||
55 | focus: true | ||
56 | |||
57 | placeholderText: qsTr("Password of your Kolab Now account") | ||
58 | text: settings.imapPassword | ||
59 | onTextChanged: settings.imapPassword = text | ||
60 | } | ||
61 | } | ||
62 | } | ||