Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
dg0yt committed Feb 10, 2018
2 parents 5d93135 + 738c919 commit 334bedf
Show file tree
Hide file tree
Showing 583 changed files with 321,428 additions and 193,559 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
CMakeLists.txt.user
.idea
*.kdev4
*.pro.user*
CMakeLists.txt.user*
Expand Down
8 changes: 6 additions & 2 deletions 3rd-party/clipper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ cmake_minimum_required(VERSION 2.8.3)

# Configuration options

set(CLIPPER_VERSION_DEFAULT 6.1.3a)
set(CLIPPER_VERSION_DEFAULT 6.4.2)
if(CLIPPER_VERSION MATCHES "^5")
unset(CLIPPER_VERSION CACHE) # source incompatible
endif()
set(CLIPPER_VERSION ${CLIPPER_VERSION_DEFAULT} CACHE STRING
"Version number of the Clipper library, recommended value: 6.1.3a")
"Version number of the Clipper library")
mark_as_advanced(CLIPPER_VERSION)


Expand Down Expand Up @@ -57,6 +57,7 @@ else()
set(CLIPPER_MD5SUMS
# Schema: VERSION:MD5
6.1.3a:4dcd043ce48de59714f07bd3ec7ac62b
6.4.2:100b4ec56c5308bac2d10f3966e35e11
)
foreach(line ${CLIPPER_MD5SUMS})
if(${line} MATCHES "^${CLIPPER_VERSION}:")
Expand Down Expand Up @@ -107,6 +108,9 @@ ExternalProject_Get_Property(Clipper SOURCE_DIR)

# The actual library build

set(CMAKE_CXX_CLANG_TIDY "")
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "")

if(CMAKE_COMPILER_IS_GNUCXX)
string(REPLACE "-Wpedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif()
Expand Down
40 changes: 19 additions & 21 deletions 3rd-party/clipper/License.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
The Clipper Library (including Delphi, C++ & C# source code, other accompanying
code, examples and documentation), hereafter called "the Software", has been
released under the following license, terms and conditions:

Boost Software License - Version 1.0 - August 17th, 2003
http://www.boost.org/LICENSE_1_0.txt

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the Software covered by this license to use, reproduce,
display, distribute, execute, and transmit the Software, and to prepare
derivative works of the Software, and to permit third-parties to whom the
Software is furnished to do so, all subject to the following:
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including the
above license grant, this restriction and the following disclaimer, must be
included in all copies of the Software, in whole or in part, and all derivative
works of the Software, unless such copies or derivative works are solely in the
form of machine-executable object code generated by a source language processor.
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY
DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
26 changes: 26 additions & 0 deletions 3rd-party/clipper/License.txt.6.1.3a
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
The Clipper Library (including Delphi, C++ & C# source code, other accompanying
code, examples and documentation), hereafter called "the Software", has been
released under the following license, terms and conditions:

Boost Software License - Version 1.0 - August 17th, 2003
http://www.boost.org/LICENSE_1_0.txt

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the Software covered by this license to use, reproduce,
display, distribute, execute, and transmit the Software, and to prepare
derivative works of the Software, and to permit third-parties to whom the
Software is furnished to do so, all subject to the following:

The copyright notices in the Software and this entire statement, including the
above license grant, this restriction and the following disclaimer, must be
included in all copies of the Software, in whole or in part, and all derivative
works of the Software, unless such copies or derivative works are solely in the
form of machine-executable object code generated by a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY
DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
3 changes: 3 additions & 0 deletions 3rd-party/qtsingleapplication/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@

find_package(Qt5Widgets REQUIRED)
find_package(Qt5Network REQUIRED)

set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_CLANG_TIDY "")
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "")

set(QSINGLEAPP_SRCS
src/qtlocalpeer.cpp
Expand Down
2 changes: 1 addition & 1 deletion 3rd-party/qtsingleapplication/src/qtlocalpeer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ bool QtLocalPeer::isClient()
#endif
if (!res)
qWarning("QtSingleCoreApplication: listen on local socket failed, %s", qPrintable(server->errorString()));
QObject::connect(server, SIGNAL(newConnection()), SLOT(receiveConnection()));
QObject::connect(server, &QLocalServer::newConnection, this, &QtLocalPeer::receiveConnection);
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions 3rd-party/qtsingleapplication/src/qtlockedfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ class QT_QTLOCKEDFILE_EXPORT QtLockedFile : public QFile

QtLockedFile();
QtLockedFile(const QString &name);
~QtLockedFile();
~QtLockedFile() override;

bool open(OpenMode mode);
bool open(OpenMode mode) override;

bool lock(LockMode mode, bool block = true);
bool unlock();
Expand Down
6 changes: 3 additions & 3 deletions 3rd-party/qtsingleapplication/src/qtsingleapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void QtSingleApplication::sysInit(const QString &appId)
{
actWin = 0;
peer = new QtLocalPeer(this, appId);
connect(peer, SIGNAL(messageReceived(const QString&)), SIGNAL(messageReceived(const QString&)));
connect(peer, &QtLocalPeer::messageReceived, this, &QtSingleApplication::messageReceived);
}


Expand Down Expand Up @@ -288,9 +288,9 @@ void QtSingleApplication::setActivationWindow(QWidget* aw, bool activateOnMessag
{
actWin = aw;
if (activateOnMessage)
connect(peer, SIGNAL(messageReceived(const QString&)), this, SLOT(activateWindow()));
connect(peer, &QtLocalPeer::messageReceived, this, &QtSingleApplication::activateWindow);
else
disconnect(peer, SIGNAL(messageReceived(const QString&)), this, SLOT(activateWindow()));
disconnect(peer, &QtLocalPeer::messageReceived, this, &QtSingleApplication::activateWindow);
}


Expand Down
4 changes: 2 additions & 2 deletions 3rd-party/qtsingleapplication/src/qtsinglecoreapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ QtSingleCoreApplication::QtSingleCoreApplication(int &argc, char **argv)
: QCoreApplication(argc, argv)
{
peer = new QtLocalPeer(this);
connect(peer, SIGNAL(messageReceived(const QString&)), SIGNAL(messageReceived(const QString&)));
connect(peer, &QtLocalPeer::messageReceived, this, &QtSingleCoreApplication::messageReceived);
}


Expand All @@ -87,7 +87,7 @@ QtSingleCoreApplication::QtSingleCoreApplication(const QString &appId, int &argc
: QCoreApplication(argc, argv)
{
peer = new QtLocalPeer(this, appId);
connect(peer, SIGNAL(messageReceived(const QString&)), SIGNAL(messageReceived(const QString&)));
connect(peer, &QtLocalPeer::messageReceived, this, &QtSingleCoreApplication::messageReceived);
}


Expand Down
35 changes: 24 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,17 @@ include(FeatureSummary)

# Project declaration

project(Mapper VERSION 0.7.0 LANGUAGES CXX C)
project(Mapper VERSION 0.8.0 LANGUAGES CXX C)

set(Mapper_COPYRIGHT "(C) 2012-2017 The OpenOrienteering developers")
if(Mapper_VERSION_DISPLAY)
message(STATUS "Custom version display string: \"${Mapper_VERSION_DISPLAY}\"")
elseif(CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE MATCHES "Release|MinSizeRel|RelWithDebInfo")
set(Mapper_VERSION_DISPLAY "${CMAKE_BUILD_TYPE} ${Mapper_VERSION_MAJOR}.${Mapper_VERSION_MINOR}.${Mapper_VERSION_PATCH}")
else()
set(Mapper_VERSION_DISPLAY "${Mapper_VERSION_MAJOR}.${Mapper_VERSION_MINOR}.${Mapper_VERSION_PATCH}")
endif()

set(Mapper_COPYRIGHT "(C) 2012-2018 The OpenOrienteering developers")

set(android_manifest "${PROJECT_SOURCE_DIR}/android/AndroidManifest.xml")
file(READ "${android_manifest}" current)
Expand Down Expand Up @@ -56,8 +64,6 @@ if(APPLE)
"Minimum Mac OS X version to build for, recommended: 10.7")
endif()

option(Mapper_TRANSLATIONS_EMBEDDED "Embed all translations in the program executable")

option(Mapper_DEBUG_TRANSLATIONS "Debug missing translations" OFF)

# Used for some Linux distributions which do not provide the polyclipping lib.
Expand Down Expand Up @@ -187,8 +193,21 @@ if(NOT TARGET PROJ4::proj)
find_package(PROJ4 MODULE REQUIRED)
endif()

find_package(GDAL REQUIRED)
if(Mapper_USE_GDAL)
find_package(GDAL REQUIRED)
endif()


include("TestBigEndian")
test_big_endian(big_endian)
if(big_endian)
add_definitions(-DMAPPER_BIG_ENDIAN)
endif()


if(ANDROID OR big_endian)
add_definitions(-DNO_NATIVE_FILE_FORMAT)
endif()

if(UNIX AND NOT APPLE)
# set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib/${Mapper_PACKAGE_NAME}/lib")
Expand All @@ -206,12 +225,6 @@ else()
add_definitions(-DQT_NO_DEBUG -DQT_NO_DEBUG_OUTPUT -DQT_NO_WARNING_OUTPUT -DNDEBUG)
endif()

if(NOT Mapper_VERSION_PATCH LESS 99)
set(Mapper_VERSION_DISPLAY "unstable ${Mapper_VERSION_MAJOR}.${Mapper_VERSION_MINOR}.${Mapper_VERSION_PATCH}")
else()
set(Mapper_VERSION_DISPLAY "${Mapper_VERSION_MAJOR}.${Mapper_VERSION_MINOR}.${Mapper_VERSION_PATCH}")
endif()

# Subdirectories

add_subdirectory("doc/manual")
Expand Down
21 changes: 11 additions & 10 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,18 @@ git clone https://github.com/OpenOrienteering/mapper.git
The standard g++ (>= 4.9) compiler from a recent distribution should work. Make
sure that the required development and tool packages are installed. For a Ubuntu
or Debian system, install:

cmake,
doxygen,
libcups2-dev,
libgdal-dev,
libpolyclipping-dev
libproj-dev,
qt5-default,
qtbase5-dev, qtbase5-private-dev, qtbase5-dev-tools,
qttools5-dev, qttools5-dev-tools, libqt5sql5-sqlite,
```
cmake \
doxygen \
libcups2-dev \
libgdal-dev \
libpolyclipping-dev \
libproj-dev \
qt5-default \
qtbase5-dev qtbase5-private-dev qtbase5-dev-tools \
qttools5-dev qttools5-dev-tools libqt5sql5-sqlite \
zlib1g-dev
```

When not using Qt Creator, open a terminal, and create a build directory, e.g.
as subdirectory build in the source directory, and change to that directory.
Expand Down
2 changes: 1 addition & 1 deletion android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.7.0" android:versionCode="700" package="org.openorienteering.mapper" android:installLocation="auto">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.8.0" android:versionCode="800" package="org.openorienteering.mapper" android:installLocation="auto">
<application android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="@string/long_app_name" android:icon="@drawable/icon">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation"
android:name="org.openorienteering.mapper.MapperActivity"
Expand Down
60 changes: 51 additions & 9 deletions android/src/org/openorienteering/mapper/MapperActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,23 @@

package org.openorienteering.mapper;

import android.os.Bundle;
import android.os.Looper;
import android.os.Build;
import android.os.SystemClock;
import android.app.AlertDialog;
import android.content.Intent;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.location.GpsStatus;
import android.location.Location;
import android.location.LocationManager;
import android.location.LocationProvider;
import android.location.LocationListener;
import android.location.GpsStatus;
import android.os.Build;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Looper;
import android.os.SystemClock;
import android.provider.Settings;
import android.view.Gravity;
import android.view.Surface;
import android.widget.Toast;

Expand All @@ -49,6 +51,9 @@ public class MapperActivity extends org.qtproject.qt5.android.bindings.QtActivit
private String yes_string;
private String no_string;
private String gps_disabled_string;

private static Toast toast;
private static CountDownTimer toast_reset;

@Override
public void onCreate(Bundle savedInstanceState)
Expand Down Expand Up @@ -127,13 +132,50 @@ public static void setTranslatableStrings(String yes_string, String no_string, S
instance.gps_disabled_string = gps_disabled_string;
}

public static void showShortMessage(final String message)
public static void showToast(final String message, final int duration)
{
instance.runOnUiThread(new Runnable() {
public void run() {
if (toast_reset != null)
toast_reset.cancel();

if (toast == null)
{
toast = Toast.makeText(instance, "", Toast.LENGTH_SHORT);
toast.setGravity(Gravity.BOTTOM|Gravity.CENTER_HORIZONTAL, 0, 4);
}

toast.setText(message);
toast.show();

if (duration <= 0)
return;

toast_reset = new CountDownTimer(duration, 500) {
public void onTick(long millisUntilFinished)
{
toast.show();
}

public void onFinish() {
toast.cancel();
}
};
toast_reset.start();
}
} );
}

public static void hideToast()
{
instance.runOnUiThread(new Runnable() {
public void run() {
Toast.makeText(instance, message, Toast.LENGTH_SHORT).show();
if (toast_reset != null)
toast_reset.cancel();
if (toast != null)
toast.cancel();
}
});
} );
}

/** Locks the current display orientation.
Expand Down
Loading

0 comments on commit 334bedf

Please sign in to comment.