This repository has been archived on 2026-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
powersync-app/guh-control/ui/customviews/NotificationsView.qml
2017-11-06 21:55:35 +01:00

38 lines
1.1 KiB
QML

import QtQuick 2.5
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.1
import "../components"
import Guh 1.0
CustomViewBase {
id: root
height: grid.implicitHeight + app.margins * 2
ColumnLayout {
id: grid
anchors { left: parent.left; top: parent.top; right: parent.right }
Label {
Layout.fillWidth: true
text: "Send a notification now:"
}
TextArea {
id: textArea
Layout.fillWidth: true
}
Button {
Layout.fillWidth: true
text: "Send"
onClicked: {
var params = []
var param1 = {}
var paramTypeId = root.deviceClass.actionTypes.findByName("notify").paramTypes.getParamType("title").id
param1.paramTypeId = paramTypeId
param1.value = textArea.text
params.push(param1)
Engine.deviceManager.executeAction(root.device.id, root.deviceClass.actionTypes.findByName("notify").id, params)
}
}
}
}