Unverified Commit f0b9e8cb authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #6327 from DonLakeFlyer/MobileTileImportExport

Allow map tile import/export on mobile
parents e992a0d0 552d2f0d
...@@ -213,6 +213,31 @@ QGCView { ...@@ -213,6 +213,31 @@ QGCView {
} }
} }
QGCFileDialog {
id: fileDialog
qgcView: offlineMapView
folder: QGroundControl.settingsManager.appSettings.missionSavePath
nameFilters: ["Tile Sets (*.qgctiledb)"]
fileExtension: "qgctiledb"
onAcceptedForSave: {
if (QGroundControl.mapEngineManager.exportSets(file)) {
rootLoader.sourceComponent = exportToDiskProgress
} else {
showList()
}
close()
}
onAcceptedForLoad: {
if(!QGroundControl.mapEngineManager.importSets(file)) {
showList();
mainWindow.enableToolbar()
}
close()
}
}
MessageDialog { MessageDialog {
id: errorDialog id: errorDialog
visible: false visible: false
...@@ -1044,10 +1069,9 @@ QGCView { ...@@ -1044,10 +1069,9 @@ QGCView {
width: _bigButtonSize width: _bigButtonSize
enabled: QGroundControl.mapEngineManager.selectedCount > 0 enabled: QGroundControl.mapEngineManager.selectedCount > 0
onClicked: { onClicked: {
showList(); fileDialog.title = qsTr("Export Tile Set")
if(QGroundControl.mapEngineManager.exportSets()) { fileDialog.selectExisting = false
rootLoader.sourceComponent = exportToDiskProgress fileDialog.openForSave()
}
} }
} }
QGCButton { QGCButton {
...@@ -1200,11 +1224,10 @@ QGCView { ...@@ -1200,11 +1224,10 @@ QGCView {
text: qsTr("Import") text: qsTr("Import")
width: _bigButtonSize * 1.25 width: _bigButtonSize * 1.25
onClicked: { onClicked: {
if(!QGroundControl.mapEngineManager.importSets()) {
showList();
mainWindow.enableToolbar()
rootLoader.sourceComponent = null rootLoader.sourceComponent = null
} fileDialog.title = qsTr("Import Tile Set")
fileDialog.selectExisting = true
fileDialog.openForLoad()
} }
} }
QGCButton { QGCButton {
......
...@@ -84,14 +84,12 @@ public: ...@@ -84,14 +84,12 @@ public:
virtual bool missionWaypointsOnly () const { return false; } ///< true: Only allow waypoints and complex items in Plan virtual bool missionWaypointsOnly () const { return false; } ///< true: Only allow waypoints and complex items in Plan
virtual bool multiVehicleEnabled () const { return true; } ///< false: multi vehicle support is disabled virtual bool multiVehicleEnabled () const { return true; } ///< false: multi vehicle support is disabled
virtual bool guidedActionsRequireRCRSSI () const { return false; } ///< true: Guided actions will be disabled is there is no RC RSSI virtual bool guidedActionsRequireRCRSSI () const { return false; } ///< true: Guided actions will be disabled is there is no RC RSSI
virtual bool showOfflineMapExport () const { return true; }
virtual bool showOfflineMapImport () const { return true; }
#if defined(__mobile__) #if defined(__mobile__)
virtual bool showOfflineMapExport () const { return false; }
virtual bool showOfflineMapImport () const { return false; }
virtual bool useMobileFileDialog () const { return true;} virtual bool useMobileFileDialog () const { return true;}
#else #else
virtual bool showOfflineMapExport () const { return true; }
virtual bool showOfflineMapImport () const { return true; }
virtual bool useMobileFileDialog () const { return false;} virtual bool useMobileFileDialog () const { return false;}
#endif #endif
......
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