summaryrefslogtreecommitdiffstats
path: root/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml')
-rw-r--r--accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml153
1 files changed, 153 insertions, 0 deletions
diff --git a/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml b/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml
new file mode 100644
index 00000000..274b9207
--- /dev/null
+++ b/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml
@@ -0,0 +1,153 @@
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 3 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
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18import QtQuick 2.4
19import QtQuick.Controls 1.4
20import QtQuick.Layouts 1.1
21
22import org.kde.kirigami 1.0 as Kirigami
23
24import org.kube.framework.settings 1.0 as KubeSettings
25import org.kube.accounts.kolabnow 1.0 as KolabnowAccount
26
27
28Item {
29
30 property string accountId
31
32 KolabnowAccount.KolabnowSettings {
33 id: kolabnowSettings
34 accountIdentifier: accountId
35 }
36
37 anchors.fill: parent
38
39 Item {
40 anchors {
41 fill: parent
42 margins: Kirigami.Units.largeSpacing * 2
43 }
44
45 Kirigami.Heading {
46 id: heading
47 text: "Connect your KOLABNOW account"
48
49 color: Kirigami.Theme.highlightColor
50 }
51
52 Label {
53 id: subHeadline
54
55 anchors {
56 left: heading.left
57 top: heading.bottom
58 }
59
60 width: parent.width
61
62 text: "To let Kube access your KOLABNOW account, fill in email address and password and give the account a title that will be displayed inside Kube."
63 //TODO wait for kirgami theme disabled text color
64 opacity: 0.5
65 wrapMode: Text.Wrap
66 }
67
68
69 GridLayout {
70 anchors {
71 top:subHeadline.bottom
72 bottom: parent.bottom
73 left: parent.left
74 right: parent.right
75 topMargin: Kirigami.Units.largeSpacing
76 bottomMargin: Kirigami.Units.largeSpacing * 2
77 }
78
79 columns: 2
80 columnSpacing: Kirigami.Units.largeSpacing
81 rowSpacing: Kirigami.Units.largeSpacing
82
83 Kirigami.Label {
84 text: "Title of Account"
85 Layout.alignment: Qt.AlignRight
86 }
87 TextField {
88 Layout.fillWidth: true
89
90 text: kolabnowSettings.accountName
91 placeholderText: "KOLABNOW"
92 onTextChanged: {
93 kolabnowSettings.accountName = text
94 }
95 }
96
97 Kirigami.Label {
98 text: "Email address"
99 Layout.alignment: Qt.AlignRight
100 }
101 TextField {
102 Layout.fillWidth: true
103
104 text: kolabnowSettings.emailAddress
105 onTextChanged: {
106 kolabnowSettings.emailAddress = text
107 }
108 }
109
110 Kirigami.Label {
111 text: "Password"
112 Layout.alignment: Qt.AlignRight
113 }
114 TextField {
115 Layout.fillWidth: true
116
117 text: kolabnowSettings.imapPassword
118 onTextChanged: {
119 kolabnowSettings.imapPassword = text
120 kolabnowSettings.smtpPassword = text
121 }
122 }
123
124 Label {
125 text: ""
126 }
127 Item {
128 Layout.fillWidth: true
129
130 Button {
131 text: "Delete"
132
133 onClicked: {
134 kolabnowSettings.remove()
135 root.closeDialog()
136 }
137 }
138
139 Button {
140 anchors.right: parent.right
141
142 text: "Save"
143
144 onClicked: {
145 focus: true
146 kolabnowSettings.save()
147 root.closeDialog()
148 }
149 }
150 }
151 }
152 }
153}