Commit ccd91f7a authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #4981 from DonLakeFlyer/UploadWhileMission

New user model for upload while actively flying a mission
parents f57e0f3d 4d868b9f
......@@ -115,6 +115,40 @@ QGCView {
}
}
Component {
id: activeMissionUploadDialogComponent
QGCViewDialog {
Column {
anchors.fill: parent
spacing: ScreenTools.defaultFontPixelHeight
QGCLabel {
width: parent.width
wrapMode: Text.WordWrap
text: qsTr("Your vehicle is currently flying a mission. In order to upload a new or modified mission the current mission will be paused.")
}
QGCLabel {
width: parent.width
wrapMode: Text.WordWrap
text: qsTr("After the mission is uploaded you can adjust the current waypoint and start the mission.")
}
QGCButton {
text: qsTr("Pause and Upload")
onClicked: {
_activeVehicle.flightMode = _activeVehicle.pauseFlightMode
missionController.sendToVehicle()
toolbar.showFlyView()
hideDialog()
}
}
}
}
}
MissionController {
id: missionController
......@@ -127,7 +161,7 @@ QGCView {
function _denyUpload() {
if (_activeVehicle && _activeVehicle.armed && _activeVehicle.flightMode === _activeVehicle.missionFlightMode) {
_qgcView.showMessage(qsTr("Mission Upload"), qsTr("Your vehicle is currently flying a mission. Upload is not allowed."), StandardButton.Ok)
_qgcView.showDialog(activeMissionUploadDialogComponent, qsTr("Mission Upload"), _qgcView.showDialogDefaultWidth, StandardButton.Cancel)
return true
} else {
return false
......@@ -137,7 +171,9 @@ QGCView {
// Users is switching away from Plan View
function uploadOnSwitch() {
if (missionController.dirty && _autoSync) {
if (!_denyUpload()) {
if (_denyUpload()) {
return false
} else {
sendToVehicle()
}
}
......@@ -145,9 +181,9 @@ QGCView {
}
function upload() {
if (!_denyUpload()) {
sendToVehicle()
}
if (!_denyUpload()) {
sendToVehicle()
}
}
function loadFromSelectedFile() {
......
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