Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
kebekus committed Mar 14, 2024
2 parents cdd1ead + 4ded5b9 commit cd8e3f2
Show file tree
Hide file tree
Showing 10 changed files with 187 additions and 57 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Compile on iOS

on:
push:
branches: [ feature/cleanup ]

jobs:
build:

runs-on: macos-latest

steps:
- name: Checkout Enroute
uses: actions/checkout@v4
with:
path: enroute
submodules: recursive
- name: Checkout Enroute Dependencies
uses: actions/checkout@v4
with:
path: enrouteDependencies
repository: Akaflieg-Freiburg/enrouteDependencies
submodules: recursive
- name: Set up macOS
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install Ninja
run: brew install ninja
- name: Install Qt for Desktop
uses: jurplel/install-qt-action@v3
with:
cache: 'true'
cache-key-prefix: 'install-qt-action-macOS-host'
version: '6.6.*'
modules: 'qt5compat qthttpserver qtimageformats qtlocation qtmultimedia qtpositioning qtshadertools qtspeech qtwebsockets qtwebview'
- name: Set QT_HOST_PATH
run: |
echo QT_HOST_PATH=$Qt6_DIR >> $GITHUB_ENV
- name: Install Qt for iOS
uses: jurplel/install-qt-action@v3
with:
cache: 'true'
cache-key-prefix: 'install-qt-action-iOS'
target: 'ios'
version: '6.6.*'
modules: 'qt5compat qthttpserver qtimageformats qtlocation qtmultimedia qtpositioning qtshadertools qtsensors qtspeech qtwebsockets qtwebview'
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: macos
- name: Compile EnrouteDependencies
run: |
Qt6_DIR_BASE=$(dirname "$Qt6_DIR") ./buildscript-ios.sh
cp -prv Qt/* $Qt6_DIR/../..
working-directory: enrouteDependencies
- name: Compile Enroute Flight Navigation
run: |
$Qt6_DIR/bin/qt-cmake \
-B build-enroute \
-S enroute \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER_LAUNCHER="ccache" \
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
-DCMAKE_INSTALL_PREFIX=. \
-- -sdk iphonesimulator
cmake --build build-enroute
- name: Package
run: |
brew install create-dmg
create-dmg enroute-iphonesimulator.dmg build-enroute/src/Debug-iphonesimulator
- name: Upload to developerBuilds
run: |
gh release upload --clobber developerBuilds ../enroute-iphonesimulator.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: enroute
16 changes: 14 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Compile on MacOS

on:
push:
branches: [ feature/cleanup ]
branches: [ develop ]

jobs:
build:
Expand Down Expand Up @@ -30,6 +30,7 @@ jobs:
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
cache: 'true'
version: '6.6.*'
modules: 'qt5compat qthttpserver qtimageformats qtlocation qtmultimedia qtpositioning qtshadertools qtspeech qtwebsockets qtwebview'
- name: ccache
Expand All @@ -49,6 +50,17 @@ jobs:
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER_LAUNCHER="ccache" \
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
-DCMAKE_INSTALL_PREFIX:STRING=$PWD/app/usr
-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \
-DCMAKE_INSTALL_PREFIX=.
cmake --build build-enroute
- name: Package
run: |
cmake --build build-enroute --target install
$Qt6_DIR/bin/macdeployqt enroute.app -dmg
mv enroute.dmg enroute-macOS-universal.dmg
- name: Upload to developerBuilds
run: |
gh release upload --clobber developerBuilds ../enroute-macOS-universal.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: enroute
2 changes: 1 addition & 1 deletion 3rdParty/enrouteManual
Submodule enrouteManual updated 69 files
+4 −0 .gitignore
+0 −9 .vscode/ltex.dictionary.en-US.txt
+0 −3 .vscode/settings.json
+ 01-gettingStarted/autogenerated/01-03-01-ground.png
+ 01-gettingStarted/autogenerated/01-03-02-flight.png
+ 01-gettingStarted/autogenerated/01-03-03-EDFEinfo.png
+ 01-gettingStarted/autogenerated/01-03-04-Aircraft.png
+3 −4 02-tutorialBasic/01-traffic.rst
+5 −3 02-tutorialBasic/05-plan.rst
+ 02-tutorialBasic/autogenerated/02-01-01-traffic.png
+ 02-tutorialBasic/autogenerated/02-02-01-Nearby.png
+ 02-tutorialBasic/autogenerated/02-02-01-RouteEmpty.png
+ 02-tutorialBasic/autogenerated/02-02-02-RouteNonEmpty.png
+ 02-tutorialBasic/autogenerated/02-02-03-AddWP.png
+ 02-tutorialBasic/autogenerated/02-02-04-EnRoute.png
+ 02-tutorialBasic/autogenerated/02-03-01-Weather.png
+ 02-tutorialBasic/autogenerated/02-03-02-WeatherDialog.png
+ 03-tutorialAdvanced/autogenerated/03-03-VAC.png
+0 −12 04-additionalSoftware.rst
+0 −97 04-additionalSoftware/01-flightPlanning.rst
+0 −153 04-additionalSoftware/02-mapping.rst
+3 −3 04-referencePages.rst
+0 −0 04-referencePages/01-mainPage.rst
+0 −8 04-referencePages/02-settings.rst
+0 −0 04-referencePages/03-about.rst
+ 04-referencePages/AD-GLD.png
+ 04-referencePages/AD-GRASS.png
+ 04-referencePages/AD-INOP.png
+ 04-referencePages/AD-MIL-GRASS.png
+ 04-referencePages/AD-MIL-PAVED.png
+ 04-referencePages/AD-MIL.png
+ 04-referencePages/AD-PAVED.png
+ 04-referencePages/AD-UL.png
+ 04-referencePages/AD-WATER.png
+ 04-referencePages/AD.png
+ 04-referencePages/DVOR-DME.png
+ 04-referencePages/DVOR.png
+ 04-referencePages/DVORTAC.png
+ 04-referencePages/MRP.png
+ 04-referencePages/NDB.png
+ 04-referencePages/NOTAM.png
+ 04-referencePages/RP.png
+ 04-referencePages/VOR-DME.png
+ 04-referencePages/VOR.png
+ 04-referencePages/VORTAC.png
+ 04-referencePages/WP.png
+ 04-referencePages/self-noDirection.png
+ 04-referencePages/self-noPosition.png
+ 04-referencePages/self-withDirection.png
+ 04-referencePages/traffic-noDirection-green.png
+ 04-referencePages/traffic-noDirection-red.png
+ 04-referencePages/traffic-noDirection-yellow.png
+ 04-referencePages/traffic-withDirection-green.png
+ 04-referencePages/traffic-withDirection-red.png
+ 04-referencePages/traffic-withDirection-yellow.png
+1 −1 05-referenceWorkflow.rst
+8 −30 05-referenceWorkflow/01-share.rst
+2 −2 06-referenceTechnology.rst
+0 −0 06-referenceTechnology/01-trafficData.rst
+0 −0 06-referenceTechnology/02-platformNotes.rst
+7 −0 07-appendix.rst
+0 −0 07-appendix/01-dataSources.rst
+0 −0 07-appendix/02-license.rst
+333 −0 07-appendix/03-privacy.rst
+0 −0 07-appendix/04-authors.rst
+0 −0 07-appendix/licenses_overview.rst
+0 −7 08-appendix.rst
+0 −509 08-appendix/03-privacy.rst
+4 −5 index.rst
2 changes: 1 addition & 1 deletion 3rdParty/enrouteText
37 changes: 22 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
#
# Set up cmake
#

set(CMAKE_OSX_DEPLOYMENT_TARGET "14.0")
cmake_minimum_required(VERSION 3.16)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)


include(ExternalProject)
option(BUILD_DOC "Build developer documentation" OFF)




#
# Project data
#

project(enroute VERSION 2.30.9)
project(enroute VERSION 2.30.10)
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})
add_compile_definitions(PROJECT_VERSION="${PROJECT_VERSION}")
message("CMAKE_OSX_DEPLOYMENT_TARGET: ${CMAKE_OSX_DEPLOYMENT_TARGET}")


#
# Installation
#
Expand All @@ -35,12 +34,28 @@ include(GNUInstallDirs)
# Qt Setup
#

find_package(Qt6 6.6.2 COMPONENTS Concurrent Core Core5Compat Gui HttpServer LinguistTools Location Positioning Quick QuickControls2 QuickWidgets Sql Svg TextToSpeech Widgets REQUIRED)

if(CMAKE_SYSTEM_NAME STREQUAL "Android")
find_package(Qt6 COMPONENTS Sensors WebView REQUIRED)
endif()

if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
find_package(Qt6 COMPONENTS WebView REQUIRED)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
find_package(Qt6 COMPONENTS Sensors WebView REQUIRED)
endif()

if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(Qt6 COMPONENTS DBus Widgets REQUIRED)
endif()

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

find_package(Qt6 6.6.2 COMPONENTS Concurrent Core Core5Compat Gui HttpServer LinguistTools Location Positioning Quick QuickControls2 QuickWidgets Sql Svg TextToSpeech WebView Widgets REQUIRED)
qt_policy(SET QTP0002 NEW)


Expand All @@ -53,21 +68,13 @@ find_package(libzip REQUIRED)
find_package(Git REQUIRED)
find_package(QMapLibre COMPONENTS Location REQUIRED)


if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(Qt6 COMPONENTS DBus WebView Widgets REQUIRED)
endif()

if( ANDROID OR IOS)
find_package(Qt6 COMPONENTS Sensors WebView REQUIRED)
endif()

if(IOS)
set(PRODUCT_BUNDLE_IDENTIFIER de.akafliegfreiburg.enroute)
set(CMAKE_XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME AppIcon)
include(CMakeLists_ios.txt OPTIONAL)
endif()


#
# Create target collecting all documentation
#
Expand Down
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
Qt6::Sql
Qt6::Svg
Qt6::TextToSpeech
Qt6::WebView
Qt6::Widgets
QMapLibre::Location
libzip::zip
Expand Down
29 changes: 18 additions & 11 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ auto main(int argc, char *argv[]) -> int
QGuiApplication::setWindowIcon(QIcon(u":/icons/appIcon.png"_qs));

// Install translators
QString preferredLanguage = GlobalObject::platformAdaptor()->language();
QString const preferredLanguage = GlobalObject::platformAdaptor()->language();
auto* enrouteTranslator = new QTranslator(&app);
if (enrouteTranslator->load(QStringLiteral(":i18n/enroute_%1.qm").arg(preferredLanguage)))
{
Expand Down Expand Up @@ -139,18 +139,25 @@ auto main(int argc, char *argv[]) -> int
parser.setApplicationDescription(QCoreApplication::translate("main", "Enroute Flight Navigation is a free nagivation app for VFR pilots,\ndeveloped as a project of Akaflieg Freiburg."));
parser.addHelpOption();
parser.addVersionOption();
QCommandLineOption googlePlayScreenshotOption(QStringLiteral("sg"),
QCoreApplication::translate("main", "Run simulator and generate screenshots for GooglePlay"));
QCommandLineOption const googlePlayScreenshotOption(
QStringLiteral("sg"),
QCoreApplication::translate("main",
"Run simulator and generate screenshots for GooglePlay"));
parser.addOption(googlePlayScreenshotOption);
QCommandLineOption iosScreenshotOption(QStringLiteral("si"),
QCoreApplication::translate("main", "Run simulator and generate screenshots for iOS"));
QCommandLineOption const iosScreenshotOption(
QStringLiteral("si"),
QCoreApplication::translate("main", "Run simulator and generate screenshots for iOS"));
parser.addOption(iosScreenshotOption);
QCommandLineOption manualScreenshotOption(QStringLiteral("sm"),
QCoreApplication::translate("main", "Run simulator and generate screenshots for the manual"));
QCommandLineOption const manualScreenshotOption(
QStringLiteral("sm"),
QCoreApplication::translate("main",
"Run simulator and generate screenshots for the manual"));
parser.addOption(manualScreenshotOption);
QCommandLineOption extractStringOption("string",
QCoreApplication::translate("main", "look up string using Librarian::getStringFromRessource and print it to stdout"),
QCoreApplication::translate("main", "string name"));
QCommandLineOption const extractStringOption(
"string",
QCoreApplication::translate(
"main", "look up string using Librarian::getStringFromRessource and print it to stdout"),
QCoreApplication::translate("main", "string name"));
parser.addOption(extractStringOption);
parser.addPositionalArgument(QStringLiteral("[fileName]"), QCoreApplication::translate("main", "File to import."));
parser.process(app);
Expand All @@ -160,7 +167,7 @@ auto main(int argc, char *argv[]) -> int
{
parser.showHelp(-1);
}
QString stringName = parser.value(extractStringOption);
QString const stringName = parser.value(extractStringOption);
if (!stringName.isEmpty())
{
QTextStream out(stdout);
Expand Down
4 changes: 4 additions & 0 deletions src/platform/FileExchange_Abstract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ void Platform::FileExchange_Abstract::processText(const QString& text)
{
return;
}

#if __has_include (<QtWebView/QtWebView>)
if (text.contains(u"maps.app.goo.gl"_qs))
{
emit resolveURL(text, QUrl(text).host());
Expand All @@ -213,6 +215,8 @@ void Platform::FileExchange_Abstract::processText(const QString& text)
emit resolveURL(text, QUrl(text).host());
return;
}
#endif

emit unableToProcessText(text);
}

Expand Down
74 changes: 49 additions & 25 deletions src/platform/FileExchange_MacOS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,53 +18,77 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/

#include <QDesktopServices>
#include <QDir>
#include <QFileDialog>
#include <QMimeDatabase>
#include <QTemporaryFile>

#include "platform/FileExchange_MacOS.h"



Platform::FileExchange::FileExchange(QObject *parent)
: FileExchange_Abstract(parent)
{
// Standard constructor. Recall that the constructor must not call virtual functions.
// If you need virtual functions, use the methode deferredInitialization below.
#warning Not implemented
}


/*void Platform::FileExchange::deferredInitialization()
{
// This method is called immediately after the instance has been constructed.
// It can be used to implement initialization that calls virtual methods.
#warning Not implemented
}*/



//
// Methods
//

void Platform::FileExchange::importContent()
{
// Desktop: open file dialog and call processFileOpenRequest() on the filename.
// Mobile platforms: do nothing
#warning not implemented
auto fileNameX = QFileDialog::getOpenFileName(nullptr, tr("Import data"), QDir::homePath(), tr("All files (*)"));
if (!fileNameX.isEmpty())
{
processFileOpenRequest(fileNameX);
}
}

auto Platform::FileExchange::shareContent(const QByteArray & /*content*/,
const QString & /*mimeType*/,
const QString & /*fileNameTemplate*/) -> QString

auto Platform::FileExchange::shareContent(const QByteArray& content, const QString& mimeType, const QString& fileNameTemplate) -> QString
{
// Share file content
#warning not implemented
QMimeDatabase const mimeDataBase;
QMimeType const mime = mimeDataBase.mimeTypeForName(mimeType);

auto fileNameX = QFileDialog::getSaveFileName(nullptr, tr("Export flight route"), QDir::homePath()+"/"+fileNameTemplate+"."+mime.preferredSuffix(), tr("%1 (*.%2);;All files (*)").arg(mime.comment(), mime.preferredSuffix()));
if (fileNameX.isEmpty())
{
return QStringLiteral("abort");
}
QFile file(fileNameX);
if (!file.open(QIODevice::WriteOnly))
{
return tr("Unable to open file <strong>%1</strong>.").arg(fileNameX);
}

if (file.write(content) != content.size())
{
return tr("Unable to write to file <strong>%1</strong>.").arg(fileNameX);
}
file.close();
return {};
}

auto Platform::FileExchange::viewContent(const QByteArray & /*content*/,
const QString & /*mimeType*/,
const QString & /*fileNameTemplate*/) -> QString

auto Platform::FileExchange::viewContent(const QByteArray& content, const QString& /*mimeType*/, const QString& fileNameTemplate) -> QString
{
// View file content
#warning not implemented
return {};
QTemporaryFile tmpFile(fileNameTemplate.arg(QStringLiteral("XXXXXX")));
tmpFile.setAutoRemove(false);
if (!tmpFile.open()) {
return tr("Unable to open temporary file.");
}
tmpFile.write(content);
tmpFile.close();

bool const success = QDesktopServices::openUrl(
QUrl("file://" + tmpFile.fileName(), QUrl::TolerantMode));
if (success)
{
return {};
}
return tr("Unable to open data in other app.");
}
2 changes: 1 addition & 1 deletion src/qml/pages/FlightRouteEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ Page {

MenuItem {
text: qsTr("Reverse")
enabled: (Navigator.flightRoute.size > 0) && (sv.currentIndex === 0)
enabled: (Navigator.flightRoute.size > 1) && (sv.currentIndex === 0)

onTriggered: {
PlatformAdaptor.vibrateBrief()
Expand Down

0 comments on commit cd8e3f2

Please sign in to comment.