Commit 552d2f0d authored by DonLakeFlyer's avatar DonLakeFlyer

Allow map tile import/export on mobile

parent 910ee096
......@@ -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 {
id: errorDialog
visible: false
......@@ -1044,10 +1069,9 @@ QGCView {
width: _bigButtonSize
enabled: QGroundControl.mapEngineManager.selectedCount > 0
onClicked: {
showList();
if(QGroundControl.mapEngineManager.exportSets()) {
rootLoader.sourceComponent = exportToDiskProgress
}
fileDialog.title = qsTr("Export Tile Set")
fileDialog.selectExisting = false
fileDialog.openForSave()
}
}
QGCButton {
......@@ -1200,11 +1224,10 @@ QGCView {
text: qsTr("Import")
width: _bigButtonSize * 1.25
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 {
......
......@@ -84,14 +84,12 @@ public:
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 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__)
virtual bool showOfflineMapExport () const { return false; }
virtual bool showOfflineMapImport () const { return false; }
virtual bool useMobileFileDialog () const { return true;}
#else
virtual bool showOfflineMapExport () const { return true; }
virtual bool showOfflineMapImport () const { return true; }
virtual bool useMobileFileDialog () const { return false;}
#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