From 6804f8ddb30ae7a0a404207d1752934b24cd893e Mon Sep 17 00:00:00 2001 From: bosism Date: Sun, 30 Aug 2026 14:18:52 +0300 Subject: [PATCH 1/2] fix(Video): show receiver settings for discovered streams Keep local receiver-policy controls visible when MAVLink provides the stream endpoint, while continuing to lock source selection and connection fields and to hide the aspect-ratio override. Add UI regression coverage for the discovered-stream state. --- src/AppSettings/pages/Video.SettingsUI.json | 8 ++-- test/QmlUITests/TopLevelViewsTest.cc | 46 +++++++++++++++++++++ test/QmlUITests/TopLevelViewsTest.h | 1 + 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/src/AppSettings/pages/Video.SettingsUI.json b/src/AppSettings/pages/Video.SettingsUI.json index 5a44c56b549..d7793b9fe52 100644 --- a/src/AppSettings/pages/Video.SettingsUI.json +++ b/src/AppSettings/pages/Video.SettingsUI.json @@ -51,19 +51,19 @@ }, { "setting": "videoSettings.disableWhenDisarmed", - "showWhen": "!autoStreamConfig && isStreamSource" + "showWhen": "isStreamSource" }, { "setting": "videoSettings.lowLatencyMode", - "showWhen": "!autoStreamConfig && isStreamSource && QGroundControl.settingsManager.videoSettings.lowLatencyMode.userVisible" + "showWhen": "isStreamSource && QGroundControl.settingsManager.videoSettings.lowLatencyMode.userVisible" }, { "setting": "videoSettings.rtpJitterLatencyMs", - "showWhen": "!autoStreamConfig && isStreamSource && rtpLatencyVisible && QGroundControl.settingsManager.videoSettings.rtpJitterLatencyMs.userVisible" + "showWhen": "isStreamSource && rtpLatencyVisible && QGroundControl.settingsManager.videoSettings.rtpJitterLatencyMs.userVisible" }, { "setting": "videoSettings.rtspAutoReconnect", - "showWhen": "!autoStreamConfig && isStreamSource" + "showWhen": "isStreamSource" }, { "setting": "videoSettings.forceCpuVideoPath", diff --git a/test/QmlUITests/TopLevelViewsTest.cc b/test/QmlUITests/TopLevelViewsTest.cc index f6c130cd1bd..5df708357b7 100644 --- a/test/QmlUITests/TopLevelViewsTest.cc +++ b/test/QmlUITests/TopLevelViewsTest.cc @@ -289,3 +289,49 @@ void TopLevelViewsTest::_testSettingsSearchExcludesHiddenSections() searchField->setProperty("text", QString()); QTRY_VERIFY(findVisibleItem(_rootItem, QStringLiteral("settingsButton_Video"), 0)); } + +void TopLevelViewsTest::_testDiscoveredCameraReceiverSettingsVisible() +{ +#ifndef QGC_GST_STREAMING + QSKIP("GStreamer receiver settings are unavailable in this build"); +#else + const auto restoreVideoSource = setVideoSourceWithRestore(VideoSettings::videoSourceRTSP); + + Fact* const lowLatencyMode = SettingsManager::instance()->videoSettings()->lowLatencyMode(); + const QVariant savedLowLatencyMode = lowLatencyMode->rawValue(); + const auto restoreLowLatencyMode = + qScopeGuard([lowLatencyMode, savedLowLatencyMode] { lowLatencyMode->setRawValue(savedLowLatencyMode); }); + lowLatencyMode->setRawValue(false); + + startUI(); + if (QTest::currentTestFailed()) + return; + + QVERIFY(clickToolSelectDropdownButton(QStringLiteral("toolbar_viewSettings"))); + if (!_clickSettingsButton(QStringLiteral("Video"))) { + return; + } + + QQuickItem* const videoPage = findVisibleItem(_rootItem, QStringLiteral("settingsPage_Video")); + QVERIFY(videoPage); + QVERIFY(videoPage->property("isStreamSource").toBool()); + + // autoStreamConfig mirrors the read-only VideoManager property. Override the + // page binding to isolate these UI visibility rules from camera transport. + QVERIFY(videoPage->setProperty("autoStreamConfig", true)); + QTRY_VERIFY(videoPage->property("autoStreamConfig").toBool()); + + QQuickItem* const sourceGroup = findVisibleItem(_rootItem, QStringLiteral("settingsGroup_VideoSource")); + QVERIFY(sourceGroup); + QTRY_VERIFY(!sourceGroup->isEnabled()); + QTRY_VERIFY(!findVisibleItem(_rootItem, QStringLiteral("settingsGroup_Connection"), 0)); + QTRY_VERIFY(!findVisibleItem(_rootItem, QStringLiteral("settingsTextField_aspectRatio"), 0)); + + QTRY_VERIFY(findVisibleItem(_rootItem, QStringLiteral("settingsCheckBox_disableWhenDisarmed"), 0)); + QTRY_VERIFY(findVisibleItem(_rootItem, QStringLiteral("settingsCheckBox_lowLatencyMode"), 0)); + QTRY_VERIFY(findVisibleItem(_rootItem, QStringLiteral("settingsTextField_rtpJitterLatencyMs"), 0)); + QTRY_VERIFY(findVisibleItem(_rootItem, QStringLiteral("settingsCheckBox_rtspAutoReconnect"), 0)); + + stopUI(); +#endif +} diff --git a/test/QmlUITests/TopLevelViewsTest.h b/test/QmlUITests/TopLevelViewsTest.h index 25f56a4c1bb..9015e7063a6 100644 --- a/test/QmlUITests/TopLevelViewsTest.h +++ b/test/QmlUITests/TopLevelViewsTest.h @@ -21,6 +21,7 @@ private slots: void _testSettingsSectionCollapseToSingle(); void _testSettingsPageUnavailableFallback(); void _testSettingsSearchExcludesHiddenSections(); + void _testDiscoveredCameraReceiverSettingsVisible(); private: QQuickItem* _clickSettingsButton(const QString& pageName); From ac0a7f796dd41c0e1c9a0482ff9176eababffafc Mon Sep 17 00:00:00 2001 From: bosism Date: Tue, 1 Sep 2026 15:02:49 +0300 Subject: [PATCH 2/2] fix(Video): simplify discovered stream visibility Rely on the settings generator to append Fact userVisible conditions, and remove the redundant asynchronous check after synchronously overriding autoStreamConfig in the UI regression test. --- src/AppSettings/pages/Video.SettingsUI.json | 4 ++-- test/QmlUITests/TopLevelViewsTest.cc | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/AppSettings/pages/Video.SettingsUI.json b/src/AppSettings/pages/Video.SettingsUI.json index d7793b9fe52..0c18474fb78 100644 --- a/src/AppSettings/pages/Video.SettingsUI.json +++ b/src/AppSettings/pages/Video.SettingsUI.json @@ -55,11 +55,11 @@ }, { "setting": "videoSettings.lowLatencyMode", - "showWhen": "isStreamSource && QGroundControl.settingsManager.videoSettings.lowLatencyMode.userVisible" + "showWhen": "isStreamSource" }, { "setting": "videoSettings.rtpJitterLatencyMs", - "showWhen": "isStreamSource && rtpLatencyVisible && QGroundControl.settingsManager.videoSettings.rtpJitterLatencyMs.userVisible" + "showWhen": "isStreamSource && rtpLatencyVisible" }, { "setting": "videoSettings.rtspAutoReconnect", diff --git a/test/QmlUITests/TopLevelViewsTest.cc b/test/QmlUITests/TopLevelViewsTest.cc index 5df708357b7..51c67dafd10 100644 --- a/test/QmlUITests/TopLevelViewsTest.cc +++ b/test/QmlUITests/TopLevelViewsTest.cc @@ -319,7 +319,6 @@ void TopLevelViewsTest::_testDiscoveredCameraReceiverSettingsVisible() // autoStreamConfig mirrors the read-only VideoManager property. Override the // page binding to isolate these UI visibility rules from camera transport. QVERIFY(videoPage->setProperty("autoStreamConfig", true)); - QTRY_VERIFY(videoPage->property("autoStreamConfig").toBool()); QQuickItem* const sourceGroup = findVisibleItem(_rootItem, QStringLiteral("settingsGroup_VideoSource")); QVERIFY(sourceGroup);