QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
NtripServerSettings.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3import QtQuick.Layouts
4
5import QGroundControl
6import QGroundControl.Controls
7import QGroundControl.FactControls
8
9SettingsGroupLayout {
10 Layout.fillWidth: true
11 heading: qsTr("Server")
12 visible: _ntrip.ntripServerHostAddress.userVisible || _ntrip.ntripServerPort.userVisible ||
13 _ntrip.ntripUsername.userVisible || _ntrip.ntripPassword.userVisible
14
15 property var _ntrip: QGroundControl.settingsManager.ntripSettings
16 property bool _isActive: _ntrip.ntripServerConnectEnabled.rawValue
17 property real _textFieldWidth: ScreenTools.defaultFontPixelWidth * 30
18
19 LabelledFactTextField {
20 objectName: "ntripHostField"
21 Layout.fillWidth: true
22 textFieldPreferredWidth: _textFieldWidth
23 fact: _ntrip.ntripServerHostAddress
24 visible: fact.userVisible
25 enabled: !_isActive
26 }
27
28 LabelledFactTextField {
29 Layout.fillWidth: true
30 textFieldPreferredWidth: _textFieldWidth
31 fact: _ntrip.ntripServerPort
32 visible: fact.userVisible
33 enabled: !_isActive
34 }
35
36 LabelledFactTextField {
37 Layout.fillWidth: true
38 textFieldPreferredWidth: _textFieldWidth
39 label: fact.shortDescription
40 fact: _ntrip.ntripUsername
41 visible: fact.userVisible
42 enabled: !_isActive
43 }
44
45 RowLayout {
46 Layout.fillWidth: true
47 visible: _ntrip.ntripPassword.userVisible
48 spacing: ScreenTools.defaultFontPixelWidth * 0.5
49
50 LabelledFactTextField {
51 id: passwordField
52 Layout.fillWidth: true
53 textFieldPreferredWidth: _textFieldWidth
54 label: fact.shortDescription
55 fact: _ntrip.ntripPassword
56 textField.echoMode: _showPassword ? TextInput.Normal : TextInput.Password
57 enabled: !_isActive
58
59 property bool _showPassword: false
60 }
61
62 QGCButton {
63 text: passwordField._showPassword ? qsTr("Hide") : qsTr("Show")
64 onClicked: passwordField._showPassword = !passwordField._showPassword
65 Layout.alignment: Qt.AlignBottom
66 }
67 }
68
69 FactCheckBoxSlider {
70 objectName: "ntripUseTlsSwitch"
71 Layout.fillWidth: true
72 text: fact.shortDescription
73 fact: _ntrip.ntripUseTls
74 visible: fact.userVisible
75 enabled: !_isActive
76 }
77
78 FactCheckBoxSlider {
79 objectName: "ntripAcceptSelfSignedSwitch"
80 Layout.fillWidth: true
81 text: fact.shortDescription
82 fact: _ntrip.ntripAllowSelfSignedCerts
83 visible: fact.userVisible
84 enabled: !_isActive && _ntrip.ntripUseTls.rawValue
85 }
86}