2019-10-27 17:08:51 +00:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2019 Nicolas Fella <nicolas.fella@gmx.de>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
|
|
|
*/
|
|
|
|
|
2023-12-23 16:48:04 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Layouts
|
|
|
|
import org.kde.kirigami as Kirigami
|
|
|
|
import org.kde.kdeconnect
|
2019-10-27 17:08:51 +00:00
|
|
|
|
2022-12-13 20:49:21 +00:00
|
|
|
Kirigami.ScrollablePage {
|
2019-10-27 17:08:51 +00:00
|
|
|
id: root
|
|
|
|
title: i18n("Plugin Settings")
|
|
|
|
property string device
|
|
|
|
|
|
|
|
ListView {
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
model: PluginModel {
|
|
|
|
deviceId: device
|
|
|
|
}
|
|
|
|
|
|
|
|
delegate: Kirigami.SwipeListItem {
|
|
|
|
|
2023-11-08 21:06:14 +00:00
|
|
|
contentItem: RowLayout {
|
2020-11-15 23:39:23 +00:00
|
|
|
CheckBox {
|
|
|
|
id: serviceCheck
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
|
|
|
checked: model.isChecked
|
|
|
|
onToggled: model.isChecked = checked
|
|
|
|
}
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
spacing: 0
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
|
|
|
|
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: model.name
|
|
|
|
elide: Text.ElideRight
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: model.description
|
|
|
|
elide: Text.ElideRight
|
|
|
|
font: Kirigami.Theme.smallFont
|
|
|
|
opacity: 0.7
|
|
|
|
}
|
2019-10-27 17:08:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
actions: [
|
|
|
|
Kirigami.Action {
|
|
|
|
icon.name: "settings-configure"
|
|
|
|
visible: configSource != ""
|
|
|
|
onTriggered: {
|
|
|
|
if (pageStack.lastItem.toString().startsWith("PluginInfoPage")) {
|
2022-12-13 20:49:21 +00:00
|
|
|
pageStack.lastItem.configFile = configSource;
|
|
|
|
pageStack.lastItem.title = name;
|
|
|
|
pageStack.goForward();
|
2019-10-27 17:08:51 +00:00
|
|
|
} else {
|
|
|
|
pageStack.push(Qt.resolvedUrl("PluginInfoPage.qml"), {
|
|
|
|
title: name,
|
|
|
|
configFile: configSource,
|
2022-12-13 20:49:21 +00:00
|
|
|
device: root.device,
|
|
|
|
});
|
2019-10-27 17:08:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|