Commit c15683a5 authored by Gus Grubba's avatar Gus Grubba

Make option to show/hide vehicle related functions

Create new, specific button for clearing mission from vehicle
Adjust sizing of DropPanel
parent cb74d310
......@@ -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()
}
}
}
}
}
......
......@@ -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
......
......@@ -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;}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment