From d7e0b27e025ee4b56e9c1dfbc1f5c1998555bbb1 Mon Sep 17 00:00:00 2001 From: DoinLakeFlyer Date: Tue, 25 Feb 2020 08:56:35 -0800 Subject: [PATCH] Are you sure check on preset delete --- src/PlanView/SurveyItemEditor.qml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/PlanView/SurveyItemEditor.qml b/src/PlanView/SurveyItemEditor.qml index b9c1616f1..431940ef0 100644 --- a/src/PlanView/SurveyItemEditor.qml +++ b/src/PlanView/SurveyItemEditor.qml @@ -440,7 +440,19 @@ Rectangle { Layout.fillWidth: true text: qsTr("Delete Preset") enabled: missionItem.presetNames.length != 0 - onClicked: missionItem.deletePreset(presetCombo.textAt(presetCombo.currentIndex)) + onClicked: mainWindow.showComponentDialog(deletePresetMessage, qsTr("Delete Preset"), mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No) + + Component { + id: deletePresetMessage + QGCViewMessage { + message: qsTr("Are you sure you want to delete '%1' preset?").arg(presetName) + property string presetName: presetCombo.textAt(presetCombo.currentIndex) + function accept() { + missionItem.deletePreset(presetName) + hideDialog() + } + } + } } } -- 2.22.0