Warning, /network/kdeconnect-kde/app/qml/runcommand.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 * SPDX-FileCopyrightText: 2018 Nicolas Fella <nicolas.fella@gmx.de>
0003 *
0004 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006
0007 import QtQuick
0008 import QtQuick.Controls
0009 import QtQuick.Layouts
0010 import org.kde.kirigami as Kirigami
0011 import org.kde.kdeconnect
0012
0013 Kirigami.ScrollablePage
0014 {
0015 id: root
0016 title: i18nd("kdeconnect-app", "Run command")
0017 property QtObject pluginInterface
0018
0019 actions: [
0020 Kirigami.Action {
0021 icon.name: "document-edit"
0022 text: i18nd("kdeconnect-app", "Edit commands")
0023 onTriggered: {
0024 pluginInterface.editCommands();
0025 showPassiveNotification(i18nd("kdeconnect-app", "You can edit commands on the connected device"));
0026 }
0027 }
0028 ]
0029
0030 ListView {
0031 id: commandsList
0032 model: RemoteCommandsModel {
0033 deviceId: pluginInterface.deviceId
0034 }
0035 delegate: ItemDelegate {
0036 id: delegate
0037 width: ListView.view.width
0038 text: name
0039
0040 contentItem: Kirigami.TitleSubtitle {
0041 title: delegate.text
0042 subtitle: command
0043 }
0044
0045 onClicked: pluginInterface.triggerCommand(key)
0046 }
0047
0048 Kirigami.PlaceholderMessage {
0049 visible: commandsList.count === 0
0050 text: i18nd("kdeconnect-app", "No commands defined")
0051 anchors.centerIn: parent
0052 }
0053 }
0054 }
0055