aboutsummaryrefslogtreecommitdiffstats
path: root/demo
diff options
context:
space:
mode:
Diffstat (limited to 'demo')
-rw-r--r--demo/Main.qml29
1 files changed, 16 insertions, 13 deletions
diff --git a/demo/Main.qml b/demo/Main.qml
index 9b9223f..6aca201 100644
--- a/demo/Main.qml
+++ b/demo/Main.qml
@@ -31,8 +31,9 @@ ApplicationWindow {
Connections {
function onConnectedChanged() {
- debugConsole.appendLog(Xpl2Client.connected ? "Connected" :
- "Disconnected");
+ debugConsole.appendLog(Xpl2Client.connected
+ ? "Controller connected" :
+ "Controller disconnected");
}
function onErrorOccurred(error: string) {
@@ -43,6 +44,12 @@ ApplicationWindow {
statusPage.lastJcStatus = status;
}
+ function onListeningChanged() {
+ debugConsole.appendLog(Xpl2Client.listening
+ ? "Listening on ports 9110/9111/9112" :
+ "Stopped listening");
+ }
+
function onPhStatusReceived(status) {
statusPage.lastPhStatus = status;
}
@@ -95,26 +102,22 @@ ApplicationWindow {
anchors.fill: parent
Label {
- text: "Host:"
+ text: Xpl2Client.connected ? "Controller connected" :
+ "Waiting for controller…"
}
- TextField {
- id: hostField
-
+ Item {
Layout.fillWidth: true
- text: Xpl2Client.host
-
- onEditingFinished: Xpl2Client.host = text
}
Button {
- text: Xpl2Client.connected ? "Disconnect" : "Connect"
+ text: Xpl2Client.listening ? "Stop" : "Listen"
onClicked: {
- if (Xpl2Client.connected)
- Xpl2Client.disconnectFromServer();
+ if (Xpl2Client.listening)
+ Xpl2Client.stopListening();
else
- Xpl2Client.connectToServer();
+ Xpl2Client.startListening();
}
}
}