diff --git a/src/kcm/package/contents/ui/Accounts.qml b/src/kcm/package/contents/ui/Accounts.qml index 4c73dd5..ad2f7bc 100644 --- a/src/kcm/package/contents/ui/Accounts.qml +++ b/src/kcm/package/contents/ui/Accounts.qml @@ -1,75 +1,75 @@ /* * Copyright 2015 Martin Klapetek * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 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 Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.7 import QtQuick.Layouts 1.11 import QtQuick.Controls 2.0 as Controls import org.kde.kirigami 2.4 as Kirigami import org.kde.kaccounts 1.0 import org.kde.kcm 1.2 import Ubuntu.OnlineAccounts 0.1 as OA ScrollViewKCM { id: kaccountsRoot // Existing accounts - ListView { + view: ListView { model: OA.AccountServiceModel { id: accountsModel service: "global" includeDisabled: true } delegate: Kirigami.SwipeListItem { width: ListView.view.width contentItem: Controls.Label { - text: i18n("%1 (%2)", model.displayName, providerName) + text: i18n("%1 (%2)", model.displayName, model.providerName) OA.Account { id: account objectHandle: model.accountHandle } } actions: [ Kirigami.Action { iconName: "bookmark-remove" onTriggered: { account.remove() } } ] onClicked: kcm.push("AvailableServices.qml", {accountId: model.accountId}) } } footer: RowLayout { Controls.Button { Layout.alignment: Qt.AlignRight text: i18n("Add new Account") icon.name: "contact-new" onClicked: kcm.push("AvailableAccounts.qml") } } } diff --git a/src/kcm/package/contents/ui/AvailableAccounts.qml b/src/kcm/package/contents/ui/AvailableAccounts.qml index d300956..7b1c5d0 100644 --- a/src/kcm/package/contents/ui/AvailableAccounts.qml +++ b/src/kcm/package/contents/ui/AvailableAccounts.qml @@ -1,55 +1,53 @@ /* * Copyright 2019 Nicolas Fella * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 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 Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.7 import QtQuick.Layouts 1.11 import QtQuick.Controls 2.0 as Controls import org.kde.kirigami 2.4 as Kirigami import org.kde.kaccounts 1.0 import org.kde.kcm 1.2 import Ubuntu.OnlineAccounts 0.1 as OA ScrollViewKCM { id: root title: i18n("Add new Account") - ListView { - anchors.fill: parent - + view: ListView { model: OA.ProviderModel {} delegate: Kirigami.BasicListItem { icon: model.iconName label: model.displayName width: parent.width onClicked: { var job = jobComponent.createObject(root, { "providerName": providerId }) job.start() } } } Component { id: jobComponent CreateAccount { onFinished: kcm.pop() } } } diff --git a/src/kcm/package/contents/ui/AvailableServices.qml b/src/kcm/package/contents/ui/AvailableServices.qml index 37521f6..0ece090 100644 --- a/src/kcm/package/contents/ui/AvailableServices.qml +++ b/src/kcm/package/contents/ui/AvailableServices.qml @@ -1,47 +1,46 @@ /* * Copyright 2019 Nicolas Fella * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 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 Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.7 import QtQuick.Layouts 1.11 import QtQuick.Controls 2.0 as Controls import org.kde.kirigami 2.4 as Kirigami import org.kde.kaccounts 1.0 import org.kde.kcm 1.2 import Ubuntu.OnlineAccounts 0.1 as OA ScrollViewKCM { title: i18n("Available Services") property alias accountId: servicesModel.accountId - ListView { - anchors.fill: parent + view: ListView { model: OA.AccountServiceModel { id: servicesModel } delegate: Kirigami.AbstractListItem { width: parent.width Controls.CheckBox { text: model.serviceName checked: model.enabled } } } }