From a08427a3d2bbfc9936c06d7a3571aa096a53f432 Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Wed, 24 Apr 2019 17:21:49 -0300 Subject: [PATCH] Allow plugins to enable/disable multiple vehicles selector --- src/FlightDisplay/FlightDisplayView.qml | 4 ++-- src/api/QGCOptions.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/FlightDisplay/FlightDisplayView.qml b/src/FlightDisplay/FlightDisplayView.qml index 768b7a21a..3a0b8aed3 100644 --- a/src/FlightDisplay/FlightDisplayView.qml +++ b/src/FlightDisplay/FlightDisplayView.qml @@ -486,7 +486,7 @@ Item { anchors.top: parent.top spacing: ScreenTools.defaultFontPixelWidth z: _mapAndVideo.z + 4 - visible: QGroundControl.multiVehicleManager.vehicles.count > 1 + visible: QGroundControl.multiVehicleManager.vehicles.count > 1 && QGroundControl.corePlugin.options.enableMultiVehicleList ExclusiveGroup { id: multiVehicleSelectorGroup } @@ -535,7 +535,7 @@ Item { anchors.right: parent.right anchors.bottom: parent.bottom width: ScreenTools.defaultFontPixelWidth * 30 - visible: !singleVehicleView.checked && !QGroundControl.videoManager.fullScreen + visible: !singleVehicleView.checked && !QGroundControl.videoManager.fullScreen && QGroundControl.corePlugin.options.enableMultiVehicleList z: _mapAndVideo.z + 4 guidedActionsController: _guidedController } diff --git a/src/api/QGCOptions.h b/src/api/QGCOptions.h index ee73c27dd..d00fa7c7e 100644 --- a/src/api/QGCOptions.h +++ b/src/api/QGCOptions.h @@ -62,6 +62,7 @@ public: Q_PROPERTY(float devicePixelDensity READ devicePixelDensity NOTIFY devicePixelDensityChanged) Q_PROPERTY(bool checkFirmwareVersion READ checkFirmwareVersion CONSTANT) Q_PROPERTY(bool showMavlinkLogOptions READ showMavlinkLogOptions CONSTANT) + Q_PROPERTY(bool enableMultiVehicleList READ enableMultiVehicleList CONSTANT) /// Should QGC hide its settings menu and colapse it into one single menu (Settings and Vehicle Setup)? /// @return true if QGC should consolidate both menus into one. @@ -113,6 +114,7 @@ public: virtual bool disableVehicleConnection () const { return false; } ///< true: vehicle connection is disabled virtual bool checkFirmwareVersion () const { return true; } virtual bool showMavlinkLogOptions () const { return true; } + virtual bool enableMultiVehicleList () const { return true; } #if defined(__mobile__) virtual bool useMobileFileDialog () const { return true;} -- 2.22.0