Commit 76c4dd64 authored by Aditya Mehra's avatar Aditya Mehra
Browse files

add implementation to receive STT from KDE Connect and forward it to mycroft

parent d6dd0d29
...@@ -19,13 +19,23 @@ AbstractIndicator { ...@@ -19,13 +19,23 @@ AbstractIndicator {
model: allDevicesModel model: allDevicesModel
delegate: Item { delegate: Item {
property bool pairingRequest: device.hasPairingRequests property bool pairingRequest: device.hasPairingRequests
property var bigscreenIface: KDEConnect.BigscreenDbusInterfaceFactory.create(device.id())
Connections {
target: bigscreenIface
onMessageReceived: message => {
if (mycroftLoader.item) {
mycroftLoader.item.sendText(message);
}
}
}
onPairingRequestChanged: { onPairingRequestChanged: {
if(pairingRequest) { if (pairingRequest) {
var component = Qt.createComponent("PairWindow.qml"); var component = Qt.createComponent("PairWindow.qml");
if(component.status != Component.Ready) if (component.status != Component.Ready)
{ {
if(component.status == Component.Error) { if (component.status == Component.Error) {
console.debug("Error: "+ component.errorString()); console.debug("Error: "+ component.errorString());
} }
return; return;
...@@ -39,9 +49,16 @@ AbstractIndicator { ...@@ -39,9 +49,16 @@ AbstractIndicator {
window.close() window.close()
} }
} }
} }
} }
Loader {
id: mycroftLoader
source: Qt.resolvedUrl("MycroftConnect.qml") ? Qt.resolvedUrl("MycroftConnect.qml") : null
}
onClicked: { onClicked: {
feedbackWindow.open(i18n("KDE Connect"), "kdeconnect"); feedbackWindow.open(i18n("KDE Connect"), "kdeconnect");
plasmoid.nativeInterface.executeCommand("plasma-settings -s -m kcm_mediacenter_kdeconnect") plasmoid.nativeInterface.executeCommand("plasma-settings -s -m kcm_mediacenter_kdeconnect")
......
import QtQuick 2.9
import Mycroft 1.0 as Mycroft
Item {
function sendText(utterance) {
Mycroft.MycroftController.sendText(utterance)
}
Component.onCompleted: Mycroft.MycroftController.start()
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment