Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Akaflieg-Freiburg/enroute
Browse files Browse the repository at this point in the history
  • Loading branch information
kebekus committed Feb 17, 2020
2 parents 920c82a + c72c061 commit d32c887
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 10 deletions.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
cmake_minimum_required(VERSION 3.13)
include(ExternalProject)
include(GNUInstallDirs)
option(BUILD_DOC "Build documentation" OFF)


#
Expand Down Expand Up @@ -41,7 +42,11 @@ if( ANDROID )
endif()

# Create target collecting all documentation
add_custom_target(doc)
if ( BUILD_DOC )
add_custom_target(fulldoc ALL)
else()
add_custom_target(fulldoc)
endif()

# Subdirectories
add_subdirectory(3rdParty)
Expand Down
17 changes: 9 additions & 8 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -207,17 +207,18 @@ endif()
# Generate unix executable
#
if (NOT ANDROID)
# Configure Doxyfile
configure_file(Doxyfile.in Doxyfile)

# Add executable and libraries
add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Positioning Qt5::Quick Qt5::Sql Qt5::Svg qhttpengine)

# Install
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})

# Generate documentation
add_custom_target(enroute_doc COMMAND doxygen)
add_dependencies(doc enroute_doc)
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()


#
# Generate documentation
#
configure_file(Doxyfile.in Doxyfile)
add_custom_target(enroute_doc COMMAND doxygen)
add_dependencies(fulldoc enroute_doc)
11 changes: 11 additions & 0 deletions src/MapManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,17 @@ bool MapManager::geoMapUpdatesAvailable() const
}


QString MapManager::geoMapUpdateSize() const
{
qint64 downloadSize = 0;
foreach(auto geoMapPtr, _geoMaps)
if (geoMapPtr->updatable())
downloadSize += geoMapPtr->remoteFileSize();

return QLocale::system().formattedDataSize(downloadSize, 1, QLocale::DataSizeSIFormat);
}


QMap<QString, Downloadable*> MapManager::aviationMaps() const
{
QMap<QString, Downloadable *> result;
Expand Down
6 changes: 6 additions & 0 deletions src/MapManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ class MapManager : public QObject
/*! \brief Getter function for the property with the same name */
bool geoMapUpdatesAvailable() const;

/*! \brief Gives an estimate for the download size, as a localized string */
Q_PROPERTY(QString geoMapUpdateSize READ geoMapUpdateSize NOTIFY geoMapUpdatesAvailableChanged)

/*! \brief Getter function for the property with the same name */
QString geoMapUpdateSize() const;

/*! \brief List of available aviation maps
This method return a QMap that contains pointers to all known aviation maps
Expand Down
2 changes: 1 addition & 1 deletion src/qml/dialogs/UpdateMapDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ LongTextDialog {
id: mud

title: qsTr("Map updates available")
text: qsTr("<p>One or several of your installed maps can be updated. You might wish to update now if you have a fast and inexpensive internet connection.</p>")
text: qsTr(`<p>One or several of your installed maps can be updated. The estimated download size is ${mapManager.geoMapUpdateSize}.</p>`)

footer: DialogButtonBox {
ToolButton {
Expand Down

0 comments on commit d32c887

Please sign in to comment.