1
0
Fork 0
mirror of https://github.com/kbumsik/VirtScreen.git synced 2025-02-13 03:41:50 +00:00
VirtScreen/virtscreen/assets/VncPage.qml

118 lines
3.6 KiB
QML
Raw Normal View History

2018-05-14 20:42:36 +00:00
import QtQuick 2.10
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import VirtScreen.Backend 1.0
import VirtScreen.Network 1.0
2018-05-14 20:42:36 +00:00
ColumnLayout {
// virtscreen.py Network interfaces backend.
Network {
id: network
}
2018-05-14 20:42:36 +00:00
GroupBox {
title: "VNC Server"
Layout.fillWidth: true
enabled: backend.vncState == Backend.OFF ? true : false
ColumnLayout {
anchors.left: parent.left
anchors.right: parent.right
RowLayout {
Label { text: "Port"; Layout.fillWidth: true }
SpinBox {
value: settings.vnc.port
from: 1
to: 65535
stepSize: 1
editable: true
onValueModified: {
settings.vnc.port = value;
}
textFromValue: function(value, locale) { return value; }
}
}
RowLayout {
Label { text: "Password"; Layout.fillWidth: true }
Button {
text: "Delete"
font.capitalization: Font.MixedCase
highlighted: false
enabled: backend.vncUsePassword
onClicked: backend.deleteVNCPassword()
}
Button {
text: "New"
font.capitalization: Font.MixedCase
highlighted: true
enabled: !backend.vncUsePassword
onClicked: passwordDialog.open()
}
}
2018-05-31 06:48:07 +00:00
RowLayout {
Layout.alignment: Qt.AlignRight
Button {
text: "Advanced"
font.capitalization: Font.MixedCase
onClicked: vncOptionsLoader.active = true;
background.opacity : 0
onHoveredChanged: hovered ? background.opacity = 0.4
:background.opacity = 0;
}
}
2018-05-14 20:42:36 +00:00
}
}
RowLayout {
Layout.fillWidth: true
Layout.margins: margin / 2
Button {
id: vncButton
Layout.fillWidth: true
text: vncAction.text
highlighted: true
enabled: vncAction.enabled
onClicked: vncAction.onTriggered()
}
CheckBox {
checked: autostart
onToggled: {
autostart = checked;
if ((checked == true) && (backend.vncState == Backend.OFF) &&
backend.virtScreenCreated) {
2018-05-31 06:48:07 +00:00
startVNC();
2018-05-14 20:42:36 +00:00
}
}
}
Label { text: "Auto"; }
}
GroupBox {
title: "Available IP addresses"
Layout.fillWidth: true
2018-06-25 08:06:53 +00:00
Layout.fillHeight: true
implicitHeight: 145
2018-06-25 08:06:53 +00:00
ListView {
id: ipListView
2018-05-14 20:42:36 +00:00
anchors.fill: parent
2018-06-25 08:06:53 +00:00
clip: true
ScrollBar.vertical: ScrollBar {
parent: ipListView.parent
anchors.top: ipListView.top
anchors.right: ipListView.right
anchors.bottom: ipListView.bottom
policy: ScrollBar.AlwaysOn
}
model: network.ipAddresses
delegate: TextEdit {
text: modelData
readOnly: true
selectByMouse: true
anchors.horizontalCenter: parent.horizontalCenter
font.pixelSize: 14
2018-05-14 20:42:36 +00:00
}
}
}
RowLayout {
// Empty layout
Layout.fillHeight: true
}
}