From 1e289bc4a204a4bc8994e4eed97d0640fe0a0458 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Sat, 5 Oct 2019 10:14:45 -0700 Subject: [PATCH] New reusable file dialog for KML/SHP loading --- src/QmlControls/KMLOrSHPFileDialog.qml | 24 +++++++++++++++++++ .../QGroundControl/Controls/qmldir | 1 + 2 files changed, 25 insertions(+) create mode 100644 src/QmlControls/KMLOrSHPFileDialog.qml diff --git a/src/QmlControls/KMLOrSHPFileDialog.qml b/src/QmlControls/KMLOrSHPFileDialog.qml new file mode 100644 index 000000000..272fe6ee6 --- /dev/null +++ b/src/QmlControls/KMLOrSHPFileDialog.qml @@ -0,0 +1,24 @@ +/**************************************************************************** + * + * (c) 2009-2016 QGROUNDCONTROL PROJECT + * + * QGroundControl is licensed according to the terms in the file + * COPYING.md in the root of the source code directory. + * + ****************************************************************************/ + +import QtQuick 2.11 + +import QGroundControl 1.0 +import QGroundControl.Controls 1.0 +import QGroundControl.ShapeFileHelper 1.0 + +QGCFileDialog { + id: kmlOrSHPLoadDialog + folder: QGroundControl.settingsManager.appSettings.missionSavePath + title: qsTr("Select Polygon File") + selectExisting: true + nameFilters: ShapeFileHelper.fileDialogKMLOrSHPFilters + fileExtension: QGroundControl.settingsManager.appSettings.kmlFileExtension + fileExtension2: QGroundControl.settingsManager.appSettings.shpFileExtension +} diff --git a/src/QmlControls/QGroundControl/Controls/qmldir b/src/QmlControls/QGroundControl/Controls/qmldir index 5d2fb829e..44e56cfa3 100644 --- a/src/QmlControls/QGroundControl/Controls/qmldir +++ b/src/QmlControls/QGroundControl/Controls/qmldir @@ -23,6 +23,7 @@ HackFileDialog 1.0 HackFileDialog.qml HeightIndicator 1.0 HeightIndicator.qml IndicatorButton 1.0 IndicatorButton.qml JoystickThumbPad 1.0 JoystickThumbPad.qml +KMLOrSHPFileDialog 1.0 KMLOrSHPFileDialog.qml LogReplayStatusBar 1.0 LogReplayStatusBar.qml MainWindowSavedState 1.0 MainWindowSavedState.qml MAVLinkMessageButton 1.0 MAVLinkMessageButton.qml -- 2.22.0