Commit 4d868b9f authored by Don Gagne's avatar Don Gagne

New user model for upload while active mission

parent e2f3457b
......@@ -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