From 70fced38efbbfae2ee13faebe2ff9ec607799ec9 Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Wed, 20 Jun 2018 15:14:24 -0400 Subject: [PATCH] Add a dialog asking the user for confirmation before removing all items and clearing the vehicle. --- src/PlanView/PlanView.qml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/PlanView/PlanView.qml b/src/PlanView/PlanView.qml index dbeef74f3..ac0d2adc2 100644 --- a/src/PlanView/PlanView.qml +++ b/src/PlanView/PlanView.qml @@ -815,6 +815,17 @@ QGCView { } } + Component { + id: clearVehicleMissionDialog + QGCViewMessage { + message: qsTr("Are you sure you want to remove all mission items and clear the mission from the vehicle?") + function accept() { + masterController.removeAllFromVehicle() + hideDialog() + } + } + } + //- ToolStrip DropPanel Components Component { @@ -995,7 +1006,7 @@ QGCView { visible: !QGroundControl.corePlugin.options.disableVehicleConnection onClicked: { dropPanel.hide() - masterController.removeAllFromVehicle() + _qgcView.showDialog(clearVehicleMissionDialog, text, _qgcView.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) } } -- 2.22.0