Skip to content

Commit

Permalink
Specialize file dialog for Android
Browse files Browse the repository at this point in the history
  • Loading branch information
kebekus committed Mar 4, 2025
1 parent 3245942 commit ae5ccc5
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [2.32.14] - 2025-03-xx

### Fixed
- Fix problem with the file picker dialog on Android, where files from external
sources were not opened. (#491)


## [2.32.13] - 2025-03-02

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ option(QTDEPLOY "Generate and run Qt deployment scripts" OFF)
# Project data
#

project(enroute VERSION 2.32.13)
project(enroute VERSION 2.32.14)
set(APP_ID de.akaflieg_freiburg.enroute)
set(DISPLAY_NAME "Enroute")
math(EXPR PROJECT_VERSION_CODE 10000*${PROJECT_VERSION_MAJOR}+100*${PROJECT_VERSION_MINOR}+${PROJECT_VERSION_PATCH})
Expand Down
5 changes: 4 additions & 1 deletion src/qml/pages/DataManagerPage.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2019-2023 by Stefan Kebekus *
* Copyright (C) 2019-2025 by Stefan Kebekus *
* [email protected] *
* *
* This program is free software; you can redistribute it and/or modify *
Expand Down Expand Up @@ -32,6 +32,7 @@ Page {
required property var dialogLoader
required property var stackView
property bool isIos: Qt.platform.os === "ios"
property bool isAndroid: Qt.platform.os === "android"

title: qsTr("Map and Data Library")

Expand Down Expand Up @@ -234,6 +235,8 @@ Page {
text: qsTr("Locate your file in the browser, then select 'Open with' from the share menu, and choose Enroute"),
standardButtons: Dialog.Ok})
Global.dialogLoader.active = true
} else if (isAndroid) {
FileExchange.openFilePicker("")
} else {
importFileDialog.open()
}
Expand Down
3 changes: 1 addition & 2 deletions src/qml/pages/FlightRouteEditor.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2019-2024 by Stefan Kebekus *
* Copyright (C) 2019-2025 by Stefan Kebekus *
* [email protected] *
* *
* This program is free software; you can redistribute it and/or modify *
Expand Down Expand Up @@ -268,7 +268,6 @@ Page {
standardButtons: Dialog.Ok})
Global.dialogLoader.active = true
} else if (isAndroid) {
console.log("AA")
FileExchange.openFilePicker("")
} else {
importFileDialog.open()
Expand Down
15 changes: 13 additions & 2 deletions src/qml/pages/FlightRouteLibrary.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2019-2024 by Stefan Kebekus *
* Copyright (C) 2019-2025 by Stefan Kebekus *
* [email protected] *
* *
* This program is free software; you can redistribute it and/or modify *
Expand Down Expand Up @@ -98,7 +98,18 @@ Page {
onTriggered: {
PlatformAdaptor.vibrateBrief()
highlighted = false
importFileDialog.open()
if (isIos) {
Global.dialogLoader.active = false
Global.dialogLoader.setSource("../dialogs/LongTextDialog.qml", {
title: qsTr("Import files"),
text: qsTr("Locate your file in the browser, then select 'Open with' from the share menu, and choose Enroute"),
standardButtons: Dialog.Ok})
Global.dialogLoader.active = true
} else if (isAndroid) {
FileExchange.openFilePicker("")
} else {
importFileDialog.open()
}
}

FileDialog {
Expand Down
4 changes: 3 additions & 1 deletion src/qml/pages/WaypointLibraryPage.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2022-2023 by Stefan Kebekus *
* Copyright (C) 2022-2025 by Stefan Kebekus *
* [email protected] *
* *
* This program is free software; you can redistribute it and/or modify *
Expand Down Expand Up @@ -106,6 +106,8 @@ Page {
text: qsTr("Locate your file in the browser, then select 'Open with' from the share menu, and choose Enroute"),
standardButtons: Dialog.Ok})
Global.dialogLoader.active = true
} else if (isAndroid) {
FileExchange.openFilePicker("")
} else {
importFileDialog.open()
}
Expand Down

0 comments on commit ae5ccc5

Please sign in to comment.