5import QGroundControl.Controls
7/// Scrollable list of NTRIP caster mountpoints. Highlights the active selection
8/// and emits mountpointSelected() when the user picks one. The model rows must
9/// expose: index, mountpoint, format, navSystem, country, bitrate, distanceKm.
13 /// Mountpoint of the active selection (rendered as highlighted / "Selected").
14 property string selectedMountpoint
16 signal mountpointSelected(string mountpoint)
18 Layout.fillWidth: true
19 Layout.preferredHeight: Math.min(root.contentHeight, ScreenTools.defaultFontPixelHeight * 20)
20 spacing: ScreenTools.defaultFontPixelHeight * 0.25
22 QGCPalette { id: qgcPal }
27 required property int index
28 required property string mountpoint
29 required property string format
30 required property string navSystem
31 required property string country
32 required property int bitrate
33 required property real distanceKm
35 width: ListView.view.width
36 height: mountRow.height + ScreenTools.defaultFontPixelHeight * 0.5
37 radius: ScreenTools.defaultFontPixelHeight * 0.25
39 if (entry.mountpoint === root.selectedMountpoint)
40 return qgcPal.buttonHighlight
41 return entry.index % 2 === 0 ? qgcPal.windowShade : qgcPal.window
46 anchors.left: parent.left
47 anchors.right: parent.right
48 anchors.verticalCenter: parent.verticalCenter
49 anchors.margins: ScreenTools.defaultFontPixelWidth
52 Layout.fillWidth: true
56 spacing: ScreenTools.defaultFontPixelWidth
59 text: entry.mountpoint
61 color: entry.mountpoint === root.selectedMountpoint
62 ? qgcPal.buttonHighlightText : qgcPal.text
65 visible: entry.mountpoint === root.selectedMountpoint
66 text: qsTr("(selected)")
67 font.pointSize: ScreenTools.smallFontPointSize
68 color: qgcPal.buttonHighlightText
75 if (entry.format) parts.push(entry.format)
76 if (entry.navSystem) parts.push(entry.navSystem)
77 if (entry.country) parts.push(entry.country)
78 if (entry.bitrate > 0) parts.push(entry.bitrate + " bps")
79 if (entry.distanceKm >= 0) parts.push(entry.distanceKm.toFixed(1) + " km")
80 return parts.join(" ยท ")
82 font.pointSize: ScreenTools.smallFontPointSize
83 color: entry.mountpoint === root.selectedMountpoint
84 ? qgcPal.buttonHighlightText : qgcPal.colorGrey
89 text: entry.mountpoint === root.selectedMountpoint
90 ? qsTr("Selected") : qsTr("Select")
91 enabled: entry.mountpoint !== root.selectedMountpoint
92 onClicked: root.mountpointSelected(entry.mountpoint)