diff --git a/src/PlanView/PlanView.qml b/src/PlanView/PlanView.qml index 0487904aedca9e88f2ebdce4601d72518af4e49b..dbeef74f350f8912b1ac04588fbe222ac6445d5f 100644 --- a/src/PlanView/PlanView.qml +++ b/src/PlanView/PlanView.qml @@ -877,32 +877,6 @@ QGCView { rowSpacing: _margin columnSpacing: ScreenTools.defaultFontPixelWidth - QGCButton { - text: qsTr("Upload") - Layout.fillWidth: true - enabled: !masterController.offline && !masterController.syncInProgress - visible: _activeVehicle - onClicked: { - dropPanel.hide() - masterController.upload() - } - } - - QGCButton { - text: qsTr("Download") - Layout.fillWidth: true - enabled: !masterController.offline && !masterController.syncInProgress - visible: _activeVehicle - onClicked: { - dropPanel.hide() - if (masterController.dirty) { - _qgcView.showDialog(syncLoadFromVehicleOverwrite, columnHolder._overwriteText, _qgcView.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) - } else { - masterController.loadFromVehicle() - } - } - } - QGCButton { text: qsTr("New...") Layout.fillWidth: true @@ -977,6 +951,54 @@ QGCView { } } + Rectangle { + width: parent.width * 0.8 + height: 1 + color: qgcPal.text + opacity: 0.5 + visible: !QGroundControl.corePlugin.options.disableVehicleConnection + Layout.fillWidth: true + Layout.columnSpan: 2 + } + + QGCButton { + text: qsTr("Upload") + Layout.fillWidth: true + enabled: !masterController.offline && !masterController.syncInProgress && _visualItems.count > 1 + visible: !QGroundControl.corePlugin.options.disableVehicleConnection + onClicked: { + dropPanel.hide() + masterController.upload() + } + } + + QGCButton { + text: qsTr("Download") + Layout.fillWidth: true + enabled: !masterController.offline && !masterController.syncInProgress + visible: !QGroundControl.corePlugin.options.disableVehicleConnection + onClicked: { + dropPanel.hide() + if (masterController.dirty) { + _qgcView.showDialog(syncLoadFromVehicleOverwrite, columnHolder._overwriteText, _qgcView.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) + } else { + masterController.loadFromVehicle() + } + } + } + + QGCButton { + text: qsTr("Clear Vehicle Mission") + Layout.fillWidth: true + Layout.columnSpan: 2 + enabled: !masterController.offline && !masterController.syncInProgress + visible: !QGroundControl.corePlugin.options.disableVehicleConnection + onClicked: { + dropPanel.hide() + masterController.removeAllFromVehicle() + } + } + } } } diff --git a/src/QmlControls/DropPanel.qml b/src/QmlControls/DropPanel.qml index b3dd2f71f98c2819b62aa6b5b84439fcce181355..8caecc58d970603214ce3ba496770e1f73dad42c 100644 --- a/src/QmlControls/DropPanel.qml +++ b/src/QmlControls/DropPanel.qml @@ -71,11 +71,11 @@ Item { } function _calcPositions() { - var panelComponentWidth = panelLoader.item.width + var panelComponentWidth = panelLoader.item.width var panelComponentHeight = panelLoader.item.height - dropDownItem.width = panelComponentWidth + _dropMarginX2 + _arrowPointWidth - dropDownItem.height = panelComponentHeight + _dropMarginX2 + dropDownItem.width = panelComponentWidth + (_dropMarginX2 * 2) + _arrowPointWidth + dropDownItem.height = panelComponentHeight + (_dropMarginX2 * 2) dropDownItem.x = _dropEdgeTopPoint.x + _dropMargin dropDownItem.y = _dropEdgeTopPoint.y -(dropDownItem.height / 2) + radius diff --git a/src/api/QGCOptions.h b/src/api/QGCOptions.h index 56f0546829022dee0c3cb4319bc08f046eea03d1..213512981e5d39436055ee3c4824cc76ad3fdf12 100644 --- a/src/api/QGCOptions.h +++ b/src/api/QGCOptions.h @@ -49,6 +49,7 @@ public: Q_PROPERTY(bool guidedActionsRequireRCRSSI READ guidedActionsRequireRCRSSI CONSTANT) Q_PROPERTY(bool showMissionAbsoluteAltitude READ showMissionAbsoluteAltitude NOTIFY showMissionAbsoluteAltitudeChanged) Q_PROPERTY(bool showSimpleMissionStart READ showSimpleMissionStart NOTIFY showSimpleMissionStartChanged) + Q_PROPERTY(bool disableVehicleConnection READ disableVehicleConnection 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. @@ -90,6 +91,7 @@ public: virtual bool showOfflineMapImport () const { return true; } virtual bool showMissionAbsoluteAltitude () const { return true; } virtual bool showSimpleMissionStart () const { return false; } + virtual bool disableVehicleConnection () const { return false; } ///< true: vehicle connection is disabled #if defined(__mobile__) virtual bool useMobileFileDialog () const { return true;}