2018-06-18 20:01:29 +01:00
|
|
|
/*
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-FileCopyrightText: 2018 Nicolas Fella <nicolas.fella@gmx.de>
|
2018-06-18 20:01:29 +01:00
|
|
|
*
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
2018-06-18 20:01:29 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
import QtQuick 2.2
|
|
|
|
import QtQuick.Controls 2.2
|
|
|
|
import QtQuick.Layouts 1.1
|
2020-05-01 23:18:22 +01:00
|
|
|
import org.kde.kirigami 2.12 as Kirigami
|
2018-06-18 20:01:29 +01:00
|
|
|
import org.kde.kdeconnect 1.0
|
|
|
|
|
2020-07-12 01:25:38 +01:00
|
|
|
Kirigami.ScrollablePage
|
2018-06-18 20:01:29 +01:00
|
|
|
{
|
|
|
|
id: root
|
2019-12-21 07:59:36 +00:00
|
|
|
title: i18nd("kdeconnect-app", "Run command")
|
2018-06-18 20:01:29 +01:00
|
|
|
property QtObject pluginInterface
|
|
|
|
|
|
|
|
actions.main: Kirigami.Action {
|
|
|
|
icon.name: "document-edit"
|
2019-12-21 07:59:36 +00:00
|
|
|
text: i18nd("kdeconnect-app", "Edit commands")
|
2018-10-31 15:56:02 +00:00
|
|
|
onTriggered: {
|
|
|
|
pluginInterface.editCommands();
|
2019-12-21 07:59:36 +00:00
|
|
|
showPassiveNotification(i18nd("kdeconnect-app", "You can edit commands on the connected device"));
|
2018-10-31 15:56:02 +00:00
|
|
|
}
|
2018-06-18 20:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ListView {
|
2018-09-24 20:49:18 +01:00
|
|
|
id: commandsList
|
2018-06-18 20:01:29 +01:00
|
|
|
model: RemoteCommandsModel {
|
|
|
|
deviceId: pluginInterface.deviceId
|
|
|
|
}
|
|
|
|
delegate: Kirigami.BasicListItem {
|
|
|
|
width: ListView.view.width
|
2020-07-12 01:25:38 +01:00
|
|
|
label: name
|
|
|
|
subtitle: command
|
2018-06-18 20:01:29 +01:00
|
|
|
onClicked: pluginInterface.triggerCommand(key)
|
|
|
|
reserveSpaceForIcon: false
|
|
|
|
}
|
|
|
|
|
2020-07-12 01:25:38 +01:00
|
|
|
Kirigami.PlaceholderMessage {
|
|
|
|
visible: commandsList.count === 0
|
|
|
|
text: i18nd("kdeconnect-app", "No commands defined")
|
|
|
|
anchors.centerIn: parent
|
|
|
|
}
|
2018-09-24 20:49:18 +01:00
|
|
|
}
|
2018-06-18 20:01:29 +01:00
|
|
|
}
|
|
|
|
|