Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
Alberto Mardegan
Lomiri VNC
Commits
4b82958a
Commit
4b82958a
authored
Dec 08, 2020
by
Alberto Mardegan
Browse files
QML: switch to ViewerPage on connection established
parent
34a73567
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
src/desktop/qml/MainPage.qml
src/desktop/qml/MainPage.qml
+3
-7
src/desktop/qml/main.qml
src/desktop/qml/main.qml
+16
-1
No files found.
src/desktop/qml/MainPage.qml
View file @
4b82958a
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
()
{
vncClien
t
.
connect
ToServer
(
text
)
;
roo
t
.
connect
ionRequested
(
text
)
}
}
...
...
@@ -36,9 +37,4 @@ Page {
onClicked
:
urlField
.
activate
()
}
}
VncClient
{
id
:
vncClient
onConnectedChanged
:
console
.
log
(
"
Connected:
"
+
connected
)
}
}
src/desktop/qml/main.qml
View file @
4b82958a
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
})
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment