Commit c4891ae8 authored by Patrick José Pereira's avatar Patrick José Pereira

PlanView: Solve KML error

Fix #5812
Show an error message when creating a KML without 2 items at least
Signed-off-by: 's avatarPatrick José Pereira <patrickelectric@gmail.com>
parent 247f3ae3
...@@ -144,6 +144,14 @@ QGCView { ...@@ -144,6 +144,14 @@ QGCView {
} }
} }
Component {
id: noItemForKML
QGCViewMessage {
message: qsTr("You need at least one item to create a KML.")
}
}
PlanMasterController { PlanMasterController {
id: masterController id: masterController
...@@ -808,6 +816,11 @@ QGCView { ...@@ -808,6 +816,11 @@ QGCView {
Layout.fillWidth: true Layout.fillWidth: true
enabled: !masterController.syncInProgress enabled: !masterController.syncInProgress
onClicked: { onClicked: {
// First point do not count
if (_visualItems.count < 2) {
_qgcView.showDialog(noItemForKML, qsTr("KML"), _qgcView.showDialogDefaultWidth, StandardButton.Cancel)
return
}
dropPanel.hide() dropPanel.hide()
masterController.saveKmlToSelectedFile() masterController.saveKmlToSelectedFile()
} }
......
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