From 57429a6ec932978dbefd1c520ca98077c1c733a7 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sat, 16 Jul 2016 10:40:18 +0200 Subject: Kolabnow account configuration --- .../contents/ui/KolabnowAccountSettings.qml | 153 +++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml (limited to 'accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml') 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 @@ +/* + * Copyright (C) 2016 Michael Bohlender + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +import QtQuick 2.4 +import QtQuick.Controls 1.4 +import QtQuick.Layouts 1.1 + +import org.kde.kirigami 1.0 as Kirigami + +import org.kube.framework.settings 1.0 as KubeSettings +import org.kube.accounts.kolabnow 1.0 as KolabnowAccount + + +Item { + + property string accountId + + KolabnowAccount.KolabnowSettings { + id: kolabnowSettings + accountIdentifier: accountId + } + + anchors.fill: parent + + Item { + anchors { + fill: parent + margins: Kirigami.Units.largeSpacing * 2 + } + + Kirigami.Heading { + id: heading + text: "Connect your KOLABNOW account" + + color: Kirigami.Theme.highlightColor + } + + Label { + id: subHeadline + + anchors { + left: heading.left + top: heading.bottom + } + + width: parent.width + + 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." + //TODO wait for kirgami theme disabled text color + opacity: 0.5 + wrapMode: Text.Wrap + } + + + GridLayout { + anchors { + top:subHeadline.bottom + bottom: parent.bottom + left: parent.left + right: parent.right + topMargin: Kirigami.Units.largeSpacing + bottomMargin: Kirigami.Units.largeSpacing * 2 + } + + columns: 2 + columnSpacing: Kirigami.Units.largeSpacing + rowSpacing: Kirigami.Units.largeSpacing + + Kirigami.Label { + text: "Title of Account" + Layout.alignment: Qt.AlignRight + } + TextField { + Layout.fillWidth: true + + text: kolabnowSettings.accountName + placeholderText: "KOLABNOW" + onTextChanged: { + kolabnowSettings.accountName = text + } + } + + Kirigami.Label { + text: "Email address" + Layout.alignment: Qt.AlignRight + } + TextField { + Layout.fillWidth: true + + text: kolabnowSettings.emailAddress + onTextChanged: { + kolabnowSettings.emailAddress = text + } + } + + Kirigami.Label { + text: "Password" + Layout.alignment: Qt.AlignRight + } + TextField { + Layout.fillWidth: true + + text: kolabnowSettings.imapPassword + onTextChanged: { + kolabnowSettings.imapPassword = text + kolabnowSettings.smtpPassword = text + } + } + + Label { + text: "" + } + Item { + Layout.fillWidth: true + + Button { + text: "Delete" + + onClicked: { + kolabnowSettings.remove() + root.closeDialog() + } + } + + Button { + anchors.right: parent.right + + text: "Save" + + onClicked: { + focus: true + kolabnowSettings.save() + root.closeDialog() + } + } + } + } + } +} -- cgit v1.2.3