Commit 4b82958a authored by Alberto Mardegan's avatar Alberto Mardegan
Browse files

QML: switch to ViewerPage on connection established

parent 34a73567
import LomiriVNC 1.0
import QtQuick 2.7
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
......@@ -6,6 +5,8 @@ import QtQuick.Layouts 1.3
Page {
id: root
signal connectionRequested(string host)
title: qsTr("VNC Client")
ColumnLayout {
......@@ -25,7 +26,7 @@ Page {
onAccepted: activate()
function activate() {
vncClient.connectToServer(text);
root.connectionRequested(text)
}
}
......@@ -36,9 +37,4 @@ Page {
onClicked: urlField.activate()
}
}
VncClient {
id: vncClient
onConnectedChanged: console.log("Connected: " + connected)
}
}
import LomiriVNC 1.0
import QtQml 2.2
import QtQuick 2.7
import QtQuick.Controls 2.2
......@@ -19,6 +20,20 @@ ApplicationWindow {
Component {
id: mainPageComponent
MainPage {}
MainPage {
onConnectionRequested: {
vncClient.connectToServer(host);
}
}
}
VncClient {
id: vncClient
onConnectedChanged: if (connected) {
pageStack.push(Qt.resolvedUrl("ViewerPage.qml"), {
"vncClient": vncClient
})
}
}
}
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