summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.circleci/config.yml105
-rwxr-xr-xCMakeLists.txt39
-rw-r--r--build.gradle23
-rw-r--r--ci/setup_common_requirements.sh2
-rwxr-xr-xcmake/version.cmake2
-rw-r--r--gradle/wrapper/gradle-wrapper.jarbin0 -> 53636 bytes
-rw-r--r--gradle/wrapper/gradle-wrapper.properties6
-rw-r--r--gradlew160
-rw-r--r--gradlew.bat90
-rw-r--r--navit/android/AndroidManifest.xml45
-rw-r--r--navit/android/CMakeLists.txt4
-rw-r--r--navit/android/build.gradle53
-rw-r--r--navit/android/libs/android-support-v4.jarbin1364299 -> 0 bytes
-rw-r--r--navit/android/res/layout/ua_com_vassiliev_filebrowser_layout.xml166
-rw-r--r--navit/android/res/values/strings.xml1
-rw-r--r--navit/android/src/org/navitproject/navit/FileBrowserActivity.java860
-rw-r--r--navit/android/src/org/navitproject/navit/Navit.java1807
-rw-r--r--navit/android/src/org/navitproject/navit/NavitAddressSearchActivity.java768
-rwxr-xr-xnavit/android/src/org/navitproject/navit/NavitAppConfig.java141
-rw-r--r--navit/android/src/org/navitproject/navit/NavitDialogs.java26
-rw-r--r--navit/android/src/org/navitproject/navit/NavitDownloadSelectMapActivity.java479
-rw-r--r--navit/android/src/org/navitproject/navit/NavitGraphics.java618
-rw-r--r--navit/android/src/org/navitproject/navit/NavitMap.java8
-rw-r--r--navit/android/src/org/navitproject/navit/NavitMapDownloader.java1422
-rw-r--r--navit/android/src/org/navitproject/navit/NavitSpeech2.java16
-rw-r--r--navit/android/src/org/navitproject/navit/NavitTextTranslations.java204
-rw-r--r--navit/android/src/org/navitproject/navit/NavitVehicle.java3
-rw-r--r--navit/debug.c15
-rw-r--r--navit/geom.c43
-rw-r--r--navit/graphics.c38
-rw-r--r--navit/gui/gtk/gui_gtk_poi.c32
-rw-r--r--navit/gui/qml/skins/navit/ButtonIcon.qml78
-rw-r--r--navit/gui/qml/skins/navit/PageSettingsRules.qml72
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.chevron.down.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.chevron.up.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.cog.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.cogs.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.fullscreen.box.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.home.variant.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.information.circle.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.layer.delete.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.layer.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.location.checkin.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.map.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.power.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.rocket.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.transit.car.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.book.list.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.chevron.down.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.chevron.up.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.city.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.cog.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.cogs.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.fullscreen.box.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.home.variant.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.information.circle.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.layer.delete.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.layer.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.location.checkin.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.location.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.map.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.power.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.rocket.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.timer.rewind.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.transit.car.svg2
-rw-r--r--navit/gui/win32/ceglue.c154
-rw-r--r--navit/gui/win32/ceglue.h32
-rw-r--r--navit/icons/gui_layers.svg64
-rw-r--r--navit/map/garmin/garmin.c11
-rw-r--r--navit/map/mg/block.c13
-rw-r--r--navit/map/mg/street.c47
-rw-r--r--navit/map/mg/town.c3
-rw-r--r--navit/maptool/boundaries.c31
-rw-r--r--navit/maptool/ch.c15
-rw-r--r--navit/maptool/coastline.c125
-rw-r--r--navit/maptool/itembin.c14
-rw-r--r--navit/maptool/osm.c18
-rw-r--r--navit/maptool/osm_protobuf.c73
-rw-r--r--navit/maptool/osm_protobufdb.c81
-rw-r--r--navit/maptool/tile.c12
-rw-r--r--navit/navigation.c3
-rw-r--r--navit/route.c49
-rw-r--r--navit/script/download_index.html290
-rw-r--r--navit/script/mapextract.php450
-rw-r--r--navit/speech/cmdline/speech_cmdline.c9
-rwxr-xr-xnavit/support/espeak/espeak-data/voices/!v/m736
-rw-r--r--navit/support/win32/X11/XF86keysym.h378
-rw-r--r--navit/support/win32/addwinsock.c16
-rw-r--r--navit/support/win32/addwinsock.h16
-rw-r--r--navit/support/xgetopt/XGetopt.c432
-rw-r--r--navit/support/xgetopt/XGetopt.h58
-rw-r--r--navit/tools/latlon2bookmark/latlon2bookmark.c280
-rw-r--r--navit/track.c4
-rw-r--r--navit/vehicle/android/vehicle_android.c2
-rw-r--r--navit/vehicle/null/vehicle_null.c14
-rw-r--r--navit/vehicle/webos/bluetooth.c75
-rw-r--r--navit/vehicle/wince/vehicle_wince.c1
-rw-r--r--navit/xmlconfig.c20
-rw-r--r--po/af.po.in2
-rw-r--r--po/ar.po.in2
-rw-r--r--po/ast.po.in2
-rw-r--r--po/be.po.in2
-rw-r--r--po/bg.po.in2
-rw-r--r--po/bs.po.in2
-rw-r--r--po/ca.po.in2
-rw-r--r--po/ckb.po.in2
-rw-r--r--po/cs.po.in4
-rw-r--r--po/cy.po.in2
-rw-r--r--po/da.po.in2
-rw-r--r--po/de.po.in1001
-rw-r--r--po/de_CH.po.in2
-rw-r--r--po/el.po.in2
-rw-r--r--po/en.po.in7
-rw-r--r--po/en_AU.po.in7
-rw-r--r--po/en_CA.po.in7
-rw-r--r--po/en_GB.po.in9
-rw-r--r--po/eo.po.in2
-rw-r--r--po/es.po.in990
-rw-r--r--po/et.po.in2
-rw-r--r--po/eu.po.in2
-rw-r--r--po/fa.po.in2
-rw-r--r--po/fi.po.in2
-rw-r--r--po/fil.po.in2
-rw-r--r--po/fo.po.in2
-rw-r--r--po/fr.po.in4
-rw-r--r--po/fr_CH.po.in2
-rw-r--r--po/fy.po.in2
-rw-r--r--po/gl.po.in2
-rw-r--r--po/he.po.in2
-rw-r--r--po/hi.po.in2
-rw-r--r--po/hr.po.in2
-rw-r--r--po/hu.po.in2
-rw-r--r--po/id.po.in2
-rw-r--r--po/it.po.in4
-rw-r--r--po/ja.po.in2
-rw-r--r--po/jv.po.in2
-rw-r--r--po/kk.po.in2
-rw-r--r--po/kn.po.in2
-rw-r--r--po/ko.po.in2
-rw-r--r--po/ku.po.in2
-rw-r--r--po/lb.po.in2
-rw-r--r--po/lt.po.in4
-rw-r--r--po/lv.po.in4
-rw-r--r--po/mk.po.in2
-rw-r--r--po/ml.po.in2
-rw-r--r--po/mn.po.in2
-rw-r--r--po/mr.po.in2
-rw-r--r--po/nb.po.in2
-rw-r--r--po/nds.po.in2
-rw-r--r--po/nl.po.in4
-rw-r--r--po/nn.po.in2
-rw-r--r--po/pl.po.in2
-rw-r--r--po/pms.po.in2
-rw-r--r--po/pt.po.in4
-rw-r--r--po/pt_BR.po.in4
-rw-r--r--po/ro.po.in2
-rw-r--r--po/ru.po.in2
-rw-r--r--po/sc.po.in2
-rw-r--r--po/si.po.in2
-rw-r--r--po/sk.po.in2
-rw-r--r--po/sl.po.in2
-rw-r--r--po/sq.po.in2
-rw-r--r--po/sr.po.in4
-rw-r--r--po/sv.po.in2
-rw-r--r--po/sw.po.in2
-rw-r--r--po/ta.po.in2
-rw-r--r--po/te.po.in2
-rw-r--r--po/th.po.in2
-rw-r--r--po/tr.po.in2
-rw-r--r--po/uk.po.in2
-rw-r--r--po/ur.po.in2
-rw-r--r--po/vi.po.in2
-rw-r--r--po/zh_CN.po.in2
-rw-r--r--po/zh_HK.po.in2
-rw-r--r--po/zh_TW.po.in2
-rw-r--r--settings.gradle1
176 files changed, 5954 insertions, 6444 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 0089ed7c8..991ebefdc 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -9,10 +9,13 @@ jobs:
steps:
- checkout
- run:
+ name: Id
+ command: sudo cat /etc/*release
+ - run:
name: Setup requirements
command: |
bash ci/setup_common_requirements.sh
- apt-get install -y libpng12-dev librsvg2-bin libfreetype6-dev libdbus-glib-1-dev libgtk2.0-dev curl
+ apt-get install -y libpng12-dev libfreetype6-dev libdbus-glib-1-dev libgtk2.0-dev curl
- run:
name: Build for Linux
command: bash ci/build_linux.sh
@@ -37,45 +40,80 @@ jobs:
command: bash ci/update_doxygen.sh
- store_artifacts:
path: /root/project/doc
- build_android_arm:
+ build_android:
+ working_directory: ~/code
docker:
- - image: navit/android
+ - image: circleci/android:api-27-alpha
+ environment:
+ JVM_OPTS: -Xmx3200m
+ GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"'
steps:
- checkout
- run:
- name: Build for Android ARM
- command: |
- bash ci/build_android.sh
+ name: Id
+ command: sudo cat /etc/*release
- run:
- name: configure ssh git
- command: mkdir -p ~/.ssh/ && ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
- - add_ssh_keys:
- fingerprints:
- - "16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48"
- - run:
- name: Update beta channel on PlayStore
- command: bash ci/publish.sh
- - store_artifacts:
- path: android-arm/navit/android/bin
+ name: Install cmake gettext libsaxonb-java librsvg2-bin
+ command: |
+ sudo apt-get install cmake gettext libsaxonb-java librsvg2-bin
+ cmake ./ -Dsvg2png_scaling:STRING=-1,24,32,48,64,96,128 -Dsvg2png_scaling_nav:STRING=-1,24,32,48,64,96,128 -Dsvg2png_scaling_flag:STRING=-1,24,32,64,96
- run:
- name: Update Navit-Download-Center
+ name: Process icons
command: |
- bash ci/update_download_center.sh
- build_android_x86:
- docker:
- - image: navit/android
- steps:
- - checkout
+ cd navit/icons
+ make
+ sudo ls -la
+ mkdir ../android/res/drawable-nodpi
+ rename 'y/A-Z/a-z/' *
+ cp *.png ../android/res/drawable-nodpi
+ cd ../../
- run:
- name: Build for Android X86
+ name: Process translations
command: |
- bash ci/build_android_x86.sh
- - store_artifacts:
- path: android-x86/navit/android/bin
+ cd po
+ make
+ sudo ls -la
+ mkdir ../navit/android/res/raw
+ rename 'y/A-Z/a-z/' *
+ cp *.mo ../navit/android/res/raw
+ cd ../
- run:
- name: Update Navit-Download-Center
+ name: Move xml's
command: |
- bash ci/update_download_center.sh
+ cd navit
+ saxonb-xslt -s:navit_shipped.xml -xsl:xslt/android.xslt -o:navitldpi.xml OSD_SIZE=1 ICON_SMALL=24 ICON_MEDIUM=32 ICON_BIG=48
+ saxonb-xslt -s:navit_shipped.xml -xsl:xslt/android.xslt -o:navitmdpi.xml OSD_SIZE=1.33 ICON_SMALL=32 ICON_MEDIUM=48 ICON_BIG=64
+ saxonb-xslt -s:navit_shipped.xml -xsl:xslt/android.xslt -o:navithdpi.xml OSD_SIZE=2 ICON_SMALL=48 ICON_MEDIUM=64 ICON_BIG=96
+ saxonb-xslt -s:navit_shipped.xml -xsl:xslt/android.xslt -o:navitxhdpi.xml OSD_SIZE=2.67 ICON_SMALL=64 ICON_MEDIUM=96 ICON_BIG=128
+ saxonb-xslt -s:navit_shipped.xml -xsl:xslt/android.xslt -o:navitxxhdpi.xml OSD_SIZE=4 ICON_SMALL=96 ICON_MEDIUM=128 ICON_BIG=192
+ saxonb-xslt -s:navit_shipped.xml -xsl:xslt/android.xslt -o:navitxxxhdpi.xml OSD_SIZE=5.33 ICON_SMALL=128 ICON_MEDIUM=192 ICON_BIG=256
+ sudo ls -la
+ mv *dpi.xml android/res/raw
+ cd ../
+ - run:
+ name: Chmod permissions
+ command: sudo chmod +x ./gradlew
+ - run:
+ name: Download Dependencies
+ command: ./gradlew -v
+# command: ./gradlew androidDependencies
+ - run:
+ name: Install ndk
+ command: sdkmanager ndk-bundle
+ - run:
+ name: Build
+ command: ./gradlew assembleDebug
+ - run:
+ name: Run Tests
+ command: ./gradlew tasks --all
+ - store_artifacts:
+ path: navit/android/build/outputs/apk
+ destination: apk
+ - store_artifacts:
+ path: navit/android/build/outputs/logs
+ destination: logs
+ - store_test_results:
+ path: navit/android/build/test-results
build_win32:
<<: *defaults
steps:
@@ -170,8 +208,7 @@ workflows:
build_all:
jobs:
- build_linux
- - build_android_arm
- - build_android_x86
+ - build_android
- build_win32
- build_wince
- build_tomtom_minimal
@@ -179,8 +216,7 @@ workflows:
- run_doxygen:
requires:
- build_linux
- - build_android_arm
- - build_android_x86
+ - build_android
- build_win32
- build_wince
- build_tomtom_minimal
@@ -191,8 +227,7 @@ workflows:
- merge_trunk_in_master:
requires:
- build_linux
- - build_android_arm
- - build_android_x86
+ - build_android
- build_win32
- build_wince
- build_tomtom_minimal
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f4ce4cc97..03a2fd004 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -682,27 +682,34 @@ if (HAS_IFADDRS)
endif(HAS_IFADDRS)
if(ANDROID)
- find_program(ANDROID_LOCATION NAMES android android.bat)
- find_program(ANT_LOCATION NAMES ant)
- if (NOT ANT_LOCATION)
- message_error("Could not find ant. Please install ant and add it to the search path.")
- else()
- execute_process(COMMAND ${ANT_LOCATION} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cmake RESULT_VARIABLE ANT_VERSION_OK OUTPUT_QUIET ERROR_QUIET)
- if(ANT_VERSION_OK GREATER 0)
- message(WARNING "Old ant version detected. If you need crash reporter, update to at least ant 1.8")
+ message(STATUS "Using generator "${CMAKE_GENERATOR})
+ if (NOT ${CMAKE_GENERATOR} STREQUAL Ninja)
+ find_program(ANDROID_LOCATION NAMES android android.bat)
+ find_program(ANT_LOCATION NAMES ant)
+ if (NOT ANT_LOCATION)
+ message_error("Could not find ant. Please install ant and add it to the search path.")
+ else()
+ execute_process(COMMAND ${ANT_LOCATION} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cmake RESULT_VARIABLE ANT_VERSION_OK OUTPUT_QUIET ERROR_QUIET)
+ if(ANT_VERSION_OK GREATER 0)
+ message(WARNING "Old ant version detected. If you need crash reporter, update to at least ant 1.8")
+ endif()
endif()
- endif()
- if (NOT ANDROID_LOCATION)
- message_error( "Could not find 'Android SDK and AVD Manager'. Please install the android sdk and add the <android-sdk>/tools directory to the search path.")
- endif()
- set(XSLTS "android;${XSLTS}" CACHE STRING "define a semicolon seperated list of XSLTs to process")
+ if (NOT ANDROID_LOCATION)
+ message_error( "Could not find 'Android SDK and AVD Manager'. Please install the android sdk and add the <android-sdk>/tools directory to the search path.")
+ endif()
+ set(XSLTS "android;${XSLTS}" CACHE STRING "define a semicolon seperated list of XSLTs to process")
+ endif (NOT ${CMAKE_GENERATOR} STREQUAL Ninja)
list(APPEND NAVIT_LIBS log)
set(HAVE_API_ANDROID 1)
set_with_reason(speech/cmdline "Android detected" FALSE)
set_with_reason(graphics/null "Android detected" FALSE)
- set_with_reason(graphics/android "Android detected, NDK:${ANDROID_NDK_API_VERSION}, API:${ANDROID_API_VERSION}" TRUE)
- set_with_reason(speech/android "Android detected, NDK:${ANDROID_NDK_API_VERSION}, API:${ANDROID_API_VERSION}" TRUE)
- set_with_reason(vehicle/android "Android detected, NDK:${ANDROID_NDK_API_VERSION}, API:${ANDROID_API_VERSION}" TRUE)
+ set_with_reason(graphics/android "Android detected" TRUE)
+ set_with_reason(speech/android "Android detected" TRUE)
+ set_with_reason(vehicle/android "Android detected" TRUE)
+ set_with_reason(vehicle/file "Android detected" FALSE)
+ set_with_reason(map/filter "Android detected" FALSE)
+ set_with_reason(USE_NATIVE_LANGUAGE_SUPPORT "Android detected" TRUE)
+# set_with_reason(plugin/pedestrian "Android detected" TRUE)
set(SHARED_LIBNAVIT TRUE)
add_feature(XPM2PNG "Android detected" TRUE)
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 000000000..1ea4bd055
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,23 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:2.3.0'
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/ci/setup_common_requirements.sh b/ci/setup_common_requirements.sh
index 40a87dd07..6343194bb 100644
--- a/ci/setup_common_requirements.sh
+++ b/ci/setup_common_requirements.sh
@@ -1,4 +1,4 @@
#!/bin/sh
set -e
-apt-get update && apt-get install -y wget unzip cmake build-essential gettext imagemagick util-linux git ssh
+apt-get update && apt-get install -y wget unzip cmake build-essential gettext librsvg2-bin util-linux git ssh
diff --git a/cmake/version.cmake b/cmake/version.cmake
index e87806c54..0dd520a45 100755
--- a/cmake/version.cmake
+++ b/cmake/version.cmake
@@ -47,7 +47,7 @@ EXECUTE_PROCESS(
ERROR_STRIP_TRAILING_WHITESPACE
)
if(NOT DATE_CONVERT_ERROR)
- string(REGEX MATCH "[0-9]+" VERSION_CODE ${DATE_CONVERT_OUTPUT})
+ string(REGEX MATCH "[0-9]+" VERSION_CODE "${DATE_CONVERT_OUTPUT}")
else(NOT DATE_CONVERT_ERROR)
message(FATAL_ERROR "Date convert not working\nError message:\n${DATE_CONVERT_ERROR}")
endif(NOT DATE_CONVERT_ERROR)
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 000000000..13372aef5
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 000000000..cb189a155
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Fri Mar 03 10:50:57 CET 2017
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
diff --git a/gradlew b/gradlew
new file mode 100644
index 000000000..9d82f7891
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 000000000..aec99730b
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/navit/android/AndroidManifest.xml b/navit/android/AndroidManifest.xml
new file mode 100644
index 000000000..5080ec52b
--- /dev/null
+++ b/navit/android/AndroidManifest.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="org.navitproject.navit"
+ android:installLocation="auto">
+ <uses-feature android:name="android.hardware.location.network" android:required="false"/>
+ <uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
+ <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:resizeable="true" android:anyDensity="true"/>
+ <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+ <uses-permission android:name="android.permission.WAKE_LOCK" />
+ <uses-permission android:name="android.permission.INTERNET" />
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+ <application android:label="@string/app_name"
+ android:icon="@drawable/icon"
+ android:name=".NavitAppConfig"
+ android:theme="@style/NavitBaseTheme">
+ <activity android:name="Navit"
+ android:label="@string/app_name"
+ android:configChanges="locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|fontScale|screenSize"
+ android:theme="@style/NavitTheme">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ <intent-filter>
+ <action android:name="android.intent.action.VIEW" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <data android:scheme="google.navigation" />
+ </intent-filter>
+ </activity>
+ <activity android:name=".NavitAddressSearchActivity"
+ android:configChanges="orientation|screenSize|keyboardHidden">
+ </activity>
+ <activity android:name=".NavitDownloadSelectMapActivity"></activity>
+ <!-- <activity android:name=".NavitAddressResultListActivity"></activity> -->
+ <activity
+ android:name="FileBrowserActivity"
+ android:label="File browser"
+ android:configChanges="orientation|keyboardHidden">
+ <intent-filter>
+ <action android:name="ua.com.vassiliev.androidfilebrowser.SELECT_DIRECTORY_ACTION"></action>
+ </intent-filter>
+ </activity>
+ </application>
+</manifest>
diff --git a/navit/android/CMakeLists.txt b/navit/android/CMakeLists.txt
index 6a9b9c92f..e91c94d7b 100644
--- a/navit/android/CMakeLists.txt
+++ b/navit/android/CMakeLists.txt
@@ -1,4 +1,4 @@
-if (ANDROID)
+if (ANDROID AND NOT ${CMAKE_GENERATOR} STREQUAL Ninja)
FILE(GLOB SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*/*/*/*")
@@ -83,4 +83,4 @@ if (ANDROID)
add_dependencies(apkg android_resources)
add_dependencies(apkg-release android_resources)
-endif(ANDROID)
+endif(ANDROID AND NOT ${CMAKE_GENERATOR} STREQUAL Ninja)
diff --git a/navit/android/build.gradle b/navit/android/build.gradle
new file mode 100644
index 000000000..60b6516e9
--- /dev/null
+++ b/navit/android/build.gradle
@@ -0,0 +1,53 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 27
+ buildToolsVersion "27.0.3"
+ defaultConfig {
+ applicationId "org.navitproject.navit"
+ minSdkVersion 9
+ targetSdkVersion 27
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ ndk { // because mips was a problem with ndk 14
+ // and no need for, 'x86_64' and , 'armeabi' and , 'arm64-v8a'
+ abiFilters 'x86', 'armeabi-v7a'
+ }
+ externalNativeBuild {
+ cmake {
+ arguments '-DUSE_PLUGINS=n', '-DBUILD_MAPTOOL=n', '-DXSL_PROCESSING=n', '-DSAMPLE_MAP=n'
+ }
+ }
+ // https://github.com/googlesamples/android-ndk/blob/master/native-media/app/build.gradle
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+ sourceSets {
+ main {
+ manifest.srcFile "AndroidManifest.xml"
+ java.srcDirs = ["src"]
+ resources.srcDirs = ["src"]
+ renderscript.srcDirs = ["src"]
+ res.srcDirs = ["res"]
+ }
+ }
+ externalNativeBuild {
+ cmake {
+ path '../../CMakeLists.txt'
+ }
+ }
+}
+
+dependencies {
+ compile fileTree(include: ['*.jar'], dir: 'libs')
+ androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
+ exclude group: 'com.android.support', module: 'support-annotations'
+ })
+ testCompile 'junit:junit:4.12'
+ compile 'ch.acra:acra:4.9.2'
+}
diff --git a/navit/android/libs/android-support-v4.jar b/navit/android/libs/android-support-v4.jar
deleted file mode 100644
index aa0b1a5cc..000000000
--- a/navit/android/libs/android-support-v4.jar
+++ /dev/null
Binary files differ
diff --git a/navit/android/res/layout/ua_com_vassiliev_filebrowser_layout.xml b/navit/android/res/layout/ua_com_vassiliev_filebrowser_layout.xml
index 28bedf592..d45485f49 100644
--- a/navit/android/res/layout/ua_com_vassiliev_filebrowser_layout.xml
+++ b/navit/android/res/layout/ua_com_vassiliev_filebrowser_layout.xml
@@ -1,84 +1,84 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical"
- android:padding="3dp" >
-
- <!--
- android:layout_weight="1"
- android:layout_weight="1"
- android:layout_height="wrap_content"
- android:layout_width="fill_parent"
- android:layout_width="fill_parent"
- android:layout_gravity="top"
- android:background = "#f00"
- android:background = "#0f0"
-
- -->
-
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_margin="0dp"
- android:gravity="top"
- android:orientation="horizontal"
- android:padding="0dp" >
-
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_margin="0dp"
- android:layout_weight="1"
- android:gravity="top"
- android:orientation="horizontal"
- android:padding="0dp" >
-
- <Button
- android:id="@+id/upDirectoryButton"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="top"
- android:layout_margin="0dp"
- android:layout_weight="1"
- android:padding="0dp"
- android:drawableLeft="@drawable/dir_up"
- android:text="Up" />
- </LinearLayout>
-
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_margin="0dp"
- android:layout_weight="1"
- android:gravity="top"
- android:orientation="horizontal"
- android:padding="0dp" >
-
- <Button
- android:id="@+id/selectCurrentDirectoryButton"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="top"
- android:gravity = "center|center_vertical"
- android:layout_margin="0dp"
- android:layout_weight="1"
- android:padding="0dp"
- android:text="Select" />
- </LinearLayout>
- </LinearLayout>
-
- <TextView
- android:id="@+id/currentDirectoryTextView"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="Current folder: \n/THis/is/a/long/path/to/test/if/this/will/span/multiple/lines" />
-
- <ListView
- android:id="@+id/fileListView"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:layout_marginTop="5dp"
- android:layout_weight="1" />
-
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical"
+ android:padding="3dp" >
+
+ <!--
+ android:layout_weight="1"
+ android:layout_weight="1"
+ android:layout_height="wrap_content"
+ android:layout_width="fill_parent"
+ android:layout_width="fill_parent"
+ android:layout_gravity="top"
+ android:background = "#f00"
+ android:background = "#0f0"
+
+ -->
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="0dp"
+ android:gravity="top"
+ android:orientation="horizontal"
+ android:padding="0dp" >
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="0dp"
+ android:layout_weight="1"
+ android:gravity="top"
+ android:orientation="horizontal"
+ android:padding="0dp" >
+
+ <Button
+ android:id="@+id/upDirectoryButton"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top"
+ android:layout_margin="0dp"
+ android:layout_weight="1"
+ android:padding="0dp"
+ android:drawableLeft="@drawable/dir_up"
+ android:text="Up" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="0dp"
+ android:layout_weight="1"
+ android:gravity="top"
+ android:orientation="horizontal"
+ android:padding="0dp" >
+
+ <Button
+ android:id="@+id/selectCurrentDirectoryButton"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top"
+ android:gravity = "center|center_vertical"
+ android:layout_margin="0dp"
+ android:layout_weight="1"
+ android:padding="0dp"
+ android:text="Select" />
+ </LinearLayout>
+ </LinearLayout>
+
+ <TextView
+ android:id="@+id/currentDirectoryTextView"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="Current folder: \n/THis/is/a/long/path/to/test/if/this/will/span/multiple/lines" />
+
+ <ListView
+ android:id="@+id/fileListView"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_marginTop="5dp"
+ android:layout_weight="1" />
+
</LinearLayout> \ No newline at end of file
diff --git a/navit/android/res/values/strings.xml b/navit/android/res/values/strings.xml
index 3a730e807..7506c21e8 100644
--- a/navit/android/res/values/strings.xml
+++ b/navit/android/res/values/strings.xml
@@ -40,6 +40,7 @@
<string name="map_download_not_enough_free_space">Not enough free space</string>
<string name="map_no_fix">No location. Reopen after location fix.</string>
<string name="maps_for_current_location">Maps containing current location</string>
+ <string name="maps_installed">Installed maps</string>
<!-- ADDRESS SEARCH -->
<string name="address_search_title">Address search</string>
diff --git a/navit/android/src/org/navitproject/navit/FileBrowserActivity.java b/navit/android/src/org/navitproject/navit/FileBrowserActivity.java
index f3dac4894..d24be64e3 100644
--- a/navit/android/src/org/navitproject/navit/FileBrowserActivity.java
+++ b/navit/android/src/org/navitproject/navit/FileBrowserActivity.java
@@ -1,430 +1,430 @@
-package org.navitproject.navit;
-
-//Heavily based on code from
-//https://github.com/mburman/Android-File-Explore
-// Version of Aug 13, 2011
-//Also contributed:
-// Sugan Krishnan (https://github.com/rgksugan) - Jan 2013.
-//
-
-//Project type now is Android library:
-// http://developer.android.com/guide/developing/projects/projects-eclipse.html#ReferencingLibraryProject
-
-//General Java imports
-import java.io.File;
-import java.io.FilenameFilter;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Collections;
-
-//Android imports
-import android.app.Activity;
-import android.content.Intent;
-import android.content.res.Configuration;
-import android.graphics.Color;
-import android.os.Bundle;
-import android.os.Environment;
-import android.os.StatFs;
-import android.util.Log;
-import android.view.View.OnClickListener;
-import android.view.ViewGroup.LayoutParams;
-import android.view.*;
-import android.widget.*;
-
-//Import of resources file for file browser
-import org.navitproject.navit.R;
-
-public class FileBrowserActivity extends Activity {
- // Intent Action Constants
- public static final String INTENT_ACTION_SELECT_DIR = "ua.com.vassiliev.androidfilebrowser.SELECT_DIRECTORY_ACTION";
- public static final String INTENT_ACTION_SELECT_FILE = "ua.com.vassiliev.androidfilebrowser.SELECT_FILE_ACTION";
-
- // Intent parameters names constants
- public static final String startDirectoryParameter = "ua.com.vassiliev.androidfilebrowser.directoryPath";
- public static final String returnDirectoryParameter = "ua.com.vassiliev.androidfilebrowser.directoryPathRet";
- public static final String returnFileParameter = "ua.com.vassiliev.androidfilebrowser.filePathRet";
- public static final String showCannotReadParameter = "ua.com.vassiliev.androidfilebrowser.showCannotRead";
- public static final String filterExtension = "ua.com.vassiliev.androidfilebrowser.filterExtension";
-
- // Stores names of traversed directories
- ArrayList<String> pathDirsList = new ArrayList<String>();
-
- // Check if the first level of the directory structure is the one showing
- // private Boolean firstLvl = true;
-
- private static final String LOGTAG = "F_PATH";
-
- private List<Item> fileList = new ArrayList<Item>();
- private File path = null;
- private String chosenFile;
- // private static final int DIALOG_LOAD_FILE = 1000;
-
- ArrayAdapter<Item> adapter;
-
- private boolean showHiddenFilesAndDirs = true;
-
- private boolean directoryShownIsEmpty = false;
-
- private String filterFileExtension = null;
-
- // Action constants
- private static int currentAction = -1;
- private static final int SELECT_DIRECTORY = 1;
- private static final int SELECT_FILE = 2;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- // In case of
- // ua.com.vassiliev.androidfilebrowser.SELECT_DIRECTORY_ACTION
- // Expects com.mburman.fileexplore.directoryPath parameter to
- // point to the start folder.
- // If empty or null, will start from SDcard root.
- setContentView(R.layout.ua_com_vassiliev_filebrowser_layout);
-
- // Set action for this activity
- Intent thisInt = this.getIntent();
- currentAction = SELECT_DIRECTORY;// This would be a default action in
- // case not set by intent
- if (thisInt.getAction().equalsIgnoreCase(INTENT_ACTION_SELECT_FILE)) {
- Log.d(LOGTAG, "SELECT ACTION - SELECT FILE");
- currentAction = SELECT_FILE;
- }
-
- showHiddenFilesAndDirs = thisInt.getBooleanExtra(
- showCannotReadParameter, true);
-
- filterFileExtension = thisInt.getStringExtra(filterExtension);
-
- setInitialDirectory();
-
- parseDirectoryPath();
- loadFileList();
- this.createFileListAdapter();
- this.initializeButtons();
- this.initializeFileListView();
- updateCurrentDirectoryTextView();
- Log.d(LOGTAG, path.getAbsolutePath());
- }
-
- private void setInitialDirectory() {
- Intent thisInt = this.getIntent();
- String requestedStartDir = thisInt
- .getStringExtra(startDirectoryParameter);
-
- if (requestedStartDir != null && requestedStartDir.length() > 0) {// if(requestedStartDir!=null
- File tempFile = new File(requestedStartDir);
- if (tempFile.isDirectory())
- this.path = tempFile;
- }// if(requestedStartDir!=null
-
- if (this.path == null) {// No or invalid directory supplied in intent
- // parameter
- if (Environment.getExternalStorageDirectory().isDirectory()
- && Environment.getExternalStorageDirectory().canRead())
- path = Environment.getExternalStorageDirectory();
- else
- path = new File("/");
- }// if(this.path==null) {//No or invalid directory supplied in intent
- // parameter
- }// private void setInitialDirectory() {
-
- private void parseDirectoryPath() {
- pathDirsList.clear();
- String pathString = path.getAbsolutePath();
- String[] parts = pathString.split("/");
- int i = 0;
- while (i < parts.length) {
- pathDirsList.add(parts[i]);
- i++;
- }
- }
-
- private void initializeButtons() {
- Button upDirButton = (Button) this.findViewById(R.id.upDirectoryButton);
- upDirButton.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- Log.d(LOGTAG, "onclick for upDirButton");
- loadDirectoryUp();
- loadFileList();
- adapter.notifyDataSetChanged();
- updateCurrentDirectoryTextView();
- }
- });// upDirButton.setOnClickListener(
-
- Button selectFolderButton = (Button) this
- .findViewById(R.id.selectCurrentDirectoryButton);
- if (currentAction == SELECT_DIRECTORY) {
- selectFolderButton.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- Log.d(LOGTAG, "onclick for selectFolderButton");
- returnDirectoryFinishActivity();
- }
- });
- } else {// if(currentAction == this.SELECT_DIRECTORY) {
- selectFolderButton.setVisibility(View.GONE);
- }// } else {//if(currentAction == this.SELECT_DIRECTORY) {
- }// private void initializeButtons() {
-
- private void loadDirectoryUp() {
- // present directory removed from list
- String s = pathDirsList.remove(pathDirsList.size() - 1);
- // path modified to exclude present directory
- path = new File(path.toString().substring(0,
- path.toString().lastIndexOf(s)));
- fileList.clear();
- }
-
- private void updateCurrentDirectoryTextView() {
- int i = 0;
- String curDirString = "";
- while (i < pathDirsList.size()) {
- curDirString += pathDirsList.get(i) + "/";
- i++;
- }
- if (pathDirsList.size() == 0) {
- ((Button) this.findViewById(R.id.upDirectoryButton))
- .setEnabled(false);
- curDirString = "/";
- } else
- ((Button) this.findViewById(R.id.upDirectoryButton))
- .setEnabled(true);
- long freeSpace = getFreeSpace(curDirString);
- String formattedSpaceString = formatBytes(freeSpace);
- if (freeSpace == 0) {
- Log.d(LOGTAG, "NO FREE SPACE");
- File currentDir = new File(curDirString);
- if(!currentDir.canWrite())
- formattedSpaceString = "NON Writable";
- }
-
- ((Button) this.findViewById(R.id.selectCurrentDirectoryButton))
- .setText("Select\n[" + formattedSpaceString
- + "]");
-
- ((TextView) this.findViewById(R.id.currentDirectoryTextView))
- .setText("Current directory: " + curDirString);
- }// END private void updateCurrentDirectoryTextView() {
-
- private void showToast(String message) {
- Toast.makeText(this, message, Toast.LENGTH_LONG).show();
- }
-
- private void initializeFileListView() {
- ListView lView = (ListView) this.findViewById(R.id.fileListView);
- LinearLayout.LayoutParams lParam = new LinearLayout.LayoutParams(
- LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
- lParam.setMargins(15, 5, 15, 5);
- lView.setAdapter(this.adapter);
- lView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
- public void onItemClick(AdapterView<?> parent, View view,
- int position, long id) {
- chosenFile = fileList.get(position).file;
- File sel = new File(path + "/" + chosenFile);
- Log.d(LOGTAG, "Clicked:" + chosenFile);
- if (sel.isDirectory()) {
- if (sel.canRead()) {
- // Adds chosen directory to list
- pathDirsList.add(chosenFile);
- path = new File(sel + "");
- Log.d(LOGTAG, "Just reloading the list");
- loadFileList();
- adapter.notifyDataSetChanged();
- updateCurrentDirectoryTextView();
- Log.d(LOGTAG, path.getAbsolutePath());
- } else {// if(sel.canRead()) {
- showToast("Path does not exist or cannot be read");
- }// } else {//if(sel.canRead()) {
- }// if (sel.isDirectory()) {
- // File picked or an empty directory message clicked
- else {// if (sel.isDirectory()) {
- Log.d(LOGTAG, "item clicked");
- if (!directoryShownIsEmpty) {
- Log.d(LOGTAG, "File selected:" + chosenFile);
- returnFileFinishActivity(sel.getAbsolutePath());
- }
- }// else {//if (sel.isDirectory()) {
- }// public void onClick(DialogInterface dialog, int which) {
- });// lView.setOnClickListener(
- }// private void initializeFileListView() {
-
- private void returnDirectoryFinishActivity() {
- Intent retIntent = new Intent();
- retIntent.putExtra(returnDirectoryParameter, path.getAbsolutePath());
- this.setResult(RESULT_OK, retIntent);
- this.finish();
- }// END private void returnDirectoryFinishActivity() {
-
- private void returnFileFinishActivity(String filePath) {
- Intent retIntent = new Intent();
- retIntent.putExtra(returnFileParameter, filePath);
- this.setResult(RESULT_OK, retIntent);
- this.finish();
- }// END private void returnDirectoryFinishActivity() {
-
- private void loadFileList() {
- try {
- path.mkdirs();
- } catch (SecurityException e) {
- Log.e(LOGTAG, "unable to write on the sd card ");
- }
- fileList.clear();
-
- if (path.exists() && path.canRead()) {
- FilenameFilter filter = new FilenameFilter() {
- public boolean accept(File dir, String filename) {
- File sel = new File(dir, filename);
- boolean showReadableFile = showHiddenFilesAndDirs
- || sel.canRead();
- // Filters based on whether the file is hidden or not
- if (currentAction == SELECT_DIRECTORY) {
- return (sel.isDirectory() && showReadableFile);
- }
- if (currentAction == SELECT_FILE) {
-
- // If it is a file check the extension if provided
- if (sel.isFile() && filterFileExtension != null) {
- return (showReadableFile && sel.getName().endsWith(
- filterFileExtension));
- }
- return (showReadableFile);
- }
- return true;
- }// public boolean accept(File dir, String filename) {
- };// FilenameFilter filter = new FilenameFilter() {
-
- String[] fList = path.list(filter);
- this.directoryShownIsEmpty = false;
- for (int i = 0; i < fList.length; i++) {
- // Convert into file path
- File sel = new File(path, fList[i]);
- Log.d(LOGTAG,
- "File:" + fList[i] + " readable:"
- + (Boolean.valueOf(sel.canRead())).toString());
- int drawableID = R.drawable.file_icon;
- boolean canRead = sel.canRead();
- // Set drawables
- if (sel.isDirectory()) {
- if (canRead) {
- drawableID = R.drawable.folder_icon;
- } else {
- drawableID = R.drawable.folder_icon_light;
- }
- }
- fileList.add(i, new Item(fList[i], drawableID, canRead));
- }// for (int i = 0; i < fList.length; i++) {
- if (fileList.size() == 0) {
- // Log.d(LOGTAG, "This directory is empty");
- this.directoryShownIsEmpty = true;
- fileList.add(0, new Item("Directory is empty", -1, true));
- } else {// sort non empty list
- Collections.sort(fileList, new ItemFileNameComparator());
- }
- } else {
- Log.e(LOGTAG, "path does not exist or cannot be read");
- }
- // Log.d(TAG, "loadFileList finished");
- }// private void loadFileList() {
-
- private void createFileListAdapter() {
- adapter = new ArrayAdapter<Item>(this,
- android.R.layout.select_dialog_item, android.R.id.text1,
- fileList) {
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- // creates view
- View view = super.getView(position, convertView, parent);
- TextView textView = (TextView) view
- .findViewById(android.R.id.text1);
- // put the image on the text view
- int drawableID = 0;
- if (fileList.get(position).icon != -1) {
- // If icon == -1, then directory is empty
- drawableID = fileList.get(position).icon;
- }
- textView.setCompoundDrawablesWithIntrinsicBounds(drawableID, 0,
- 0, 0);
-
- textView.setEllipsize(null);
-
- // add margin between image and text (support various screen
- // densities)
- // int dp5 = (int) (5 *
- // getResources().getDisplayMetrics().density + 0.5f);
- int dp3 = (int) (3 * getResources().getDisplayMetrics().density + 0.5f);
- // TODO: change next line for empty directory, so text will be
- // centered
- textView.setCompoundDrawablePadding(dp3);
- return view;
- }// public View getView(int position, View convertView, ViewGroup
- };// adapter = new ArrayAdapter<Item>(this,
- }// private createFileListAdapter(){
-
- private class Item {
- public String file;
- public int icon;
- public boolean canRead;
-
- public Item(String file, Integer icon, boolean canRead) {
- this.file = file;
- this.icon = icon;
- }
-
- @Override
- public String toString() {
- return file;
- }
- }// END private class Item {
-
- private class ItemFileNameComparator implements Comparator<Item> {
- public int compare(Item lhs, Item rhs) {
- return lhs.file.toLowerCase().compareTo(rhs.file.toLowerCase());
- }
- }
-
- public void onConfigurationChanged(Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
- Log.d(LOGTAG, "ORIENTATION_LANDSCAPE");
- } else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
- Log.d(LOGTAG, "ORIENTATION_PORTRAIT");
- }
- // Layout apparently changes itself, only have to provide good onMeasure
- // in custom components
- // TODO: check with keyboard
- // if(newConfig.keyboard == Configuration.KEYBOARDHIDDEN_YES)
- }// END public void onConfigurationChanged(Configuration newConfig) {
-
- public static long getFreeSpace(String path) {
- StatFs stat = new StatFs(path);
- long availSize = (long) stat.getAvailableBlocks()
- * (long) stat.getBlockSize();
- return availSize;
- }// END public static long getFreeSpace(String path) {
-
- public static String formatBytes(long bytes) {
- // TODO: add flag to which part is needed (e.g. GB, MB, KB or bytes)
- String retStr = "";
- // One binary gigabyte equals 1,073,741,824 bytes.
- if (bytes > 1073741824) {// Add GB
- long gbs = bytes / 1073741824;
- retStr += (new Long(gbs)).toString() + "GB ";
- bytes = bytes - (gbs * 1073741824);
- }
- // One MB - 1048576 bytes
- if (bytes > 1048576) {// Add GB
- long mbs = bytes / 1048576;
- retStr += (new Long(mbs)).toString() + "MB ";
- bytes = bytes - (mbs * 1048576);
- }
- if (bytes > 1024) {
- long kbs = bytes / 1024;
- retStr += (new Long(kbs)).toString() + "KB";
- bytes = bytes - (kbs * 1024);
- } else
- retStr += (new Long(bytes)).toString() + " bytes";
- return retStr;
- }// public static String formatBytes(long bytes){
-
-}// END public class FileBrowserActivity extends Activity {
+package org.navitproject.navit;
+
+//Heavily based on code from
+//https://github.com/mburman/Android-File-Explore
+// Version of Aug 13, 2011
+//Also contributed:
+// Sugan Krishnan (https://github.com/rgksugan) - Jan 2013.
+//
+
+//Project type now is Android library:
+// http://developer.android.com/guide/developing/projects/projects-eclipse.html#ReferencingLibraryProject
+
+//General Java imports
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Collections;
+
+//Android imports
+import android.app.Activity;
+import android.content.Intent;
+import android.content.res.Configuration;
+import android.graphics.Color;
+import android.os.Bundle;
+import android.os.Environment;
+import android.os.StatFs;
+import android.util.Log;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup.LayoutParams;
+import android.view.*;
+import android.widget.*;
+
+//Import of resources file for file browser
+import org.navitproject.navit.R;
+
+public class FileBrowserActivity extends Activity {
+ // Intent Action Constants
+ public static final String INTENT_ACTION_SELECT_DIR = "ua.com.vassiliev.androidfilebrowser.SELECT_DIRECTORY_ACTION";
+ public static final String INTENT_ACTION_SELECT_FILE = "ua.com.vassiliev.androidfilebrowser.SELECT_FILE_ACTION";
+
+ // Intent parameters names constants
+ public static final String startDirectoryParameter = "ua.com.vassiliev.androidfilebrowser.directoryPath";
+ public static final String returnDirectoryParameter = "ua.com.vassiliev.androidfilebrowser.directoryPathRet";
+ public static final String returnFileParameter = "ua.com.vassiliev.androidfilebrowser.filePathRet";
+ public static final String showCannotReadParameter = "ua.com.vassiliev.androidfilebrowser.showCannotRead";
+ public static final String filterExtension = "ua.com.vassiliev.androidfilebrowser.filterExtension";
+
+ // Stores names of traversed directories
+ ArrayList<String> pathDirsList = new ArrayList<String>();
+
+ // Check if the first level of the directory structure is the one showing
+ // private Boolean firstLvl = true;
+
+ private static final String LOGTAG = "F_PATH";
+
+ private List<Item> fileList = new ArrayList<Item>();
+ private File path = null;
+ private String chosenFile;
+ // private static final int DIALOG_LOAD_FILE = 1000;
+
+ ArrayAdapter<Item> adapter;
+
+ private boolean showHiddenFilesAndDirs = true;
+
+ private boolean directoryShownIsEmpty = false;
+
+ private String filterFileExtension = null;
+
+ // Action constants
+ private static int currentAction = -1;
+ private static final int SELECT_DIRECTORY = 1;
+ private static final int SELECT_FILE = 2;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ // In case of
+ // ua.com.vassiliev.androidfilebrowser.SELECT_DIRECTORY_ACTION
+ // Expects com.mburman.fileexplore.directoryPath parameter to
+ // point to the start folder.
+ // If empty or null, will start from SDcard root.
+ setContentView(R.layout.ua_com_vassiliev_filebrowser_layout);
+
+ // Set action for this activity
+ Intent thisInt = this.getIntent();
+ currentAction = SELECT_DIRECTORY;// This would be a default action in
+ // case not set by intent
+ if (thisInt.getAction().equalsIgnoreCase(INTENT_ACTION_SELECT_FILE)) {
+ Log.d(LOGTAG, "SELECT ACTION - SELECT FILE");
+ currentAction = SELECT_FILE;
+ }
+
+ showHiddenFilesAndDirs = thisInt.getBooleanExtra(
+ showCannotReadParameter, true);
+
+ filterFileExtension = thisInt.getStringExtra(filterExtension);
+
+ setInitialDirectory();
+
+ parseDirectoryPath();
+ loadFileList();
+ this.createFileListAdapter();
+ this.initializeButtons();
+ this.initializeFileListView();
+ updateCurrentDirectoryTextView();
+ Log.d(LOGTAG, path.getAbsolutePath());
+ }
+
+ private void setInitialDirectory() {
+ Intent thisInt = this.getIntent();
+ String requestedStartDir = thisInt
+ .getStringExtra(startDirectoryParameter);
+
+ if (requestedStartDir != null && requestedStartDir.length() > 0) {// if(requestedStartDir!=null
+ File tempFile = new File(requestedStartDir);
+ if (tempFile.isDirectory())
+ this.path = tempFile;
+ }// if(requestedStartDir!=null
+
+ if (this.path == null) {// No or invalid directory supplied in intent
+ // parameter
+ if (Environment.getExternalStorageDirectory().isDirectory()
+ && Environment.getExternalStorageDirectory().canRead())
+ path = Environment.getExternalStorageDirectory();
+ else
+ path = new File("/");
+ }// if(this.path==null) {//No or invalid directory supplied in intent
+ // parameter
+ }// private void setInitialDirectory() {
+
+ private void parseDirectoryPath() {
+ pathDirsList.clear();
+ String pathString = path.getAbsolutePath();
+ String[] parts = pathString.split("/");
+ int i = 0;
+ while (i < parts.length) {
+ pathDirsList.add(parts[i]);
+ i++;
+ }
+ }
+
+ private void initializeButtons() {
+ Button upDirButton = (Button) this.findViewById(R.id.upDirectoryButton);
+ upDirButton.setOnClickListener(new OnClickListener() {
+ public void onClick(View v) {
+ Log.d(LOGTAG, "onclick for upDirButton");
+ loadDirectoryUp();
+ loadFileList();
+ adapter.notifyDataSetChanged();
+ updateCurrentDirectoryTextView();
+ }
+ });// upDirButton.setOnClickListener(
+
+ Button selectFolderButton = (Button) this
+ .findViewById(R.id.selectCurrentDirectoryButton);
+ if (currentAction == SELECT_DIRECTORY) {
+ selectFolderButton.setOnClickListener(new OnClickListener() {
+ public void onClick(View v) {
+ Log.d(LOGTAG, "onclick for selectFolderButton");
+ returnDirectoryFinishActivity();
+ }
+ });
+ } else {// if(currentAction == this.SELECT_DIRECTORY) {
+ selectFolderButton.setVisibility(View.GONE);
+ }// } else {//if(currentAction == this.SELECT_DIRECTORY) {
+ }// private void initializeButtons() {
+
+ private void loadDirectoryUp() {
+ // present directory removed from list
+ String s = pathDirsList.remove(pathDirsList.size() - 1);
+ // path modified to exclude present directory
+ path = new File(path.toString().substring(0,
+ path.toString().lastIndexOf(s)));
+ fileList.clear();
+ }
+
+ private void updateCurrentDirectoryTextView() {
+ int i = 0;
+ String curDirString = "";
+ while (i < pathDirsList.size()) {
+ curDirString += pathDirsList.get(i) + "/";
+ i++;
+ }
+ if (pathDirsList.size() == 0) {
+ ((Button) this.findViewById(R.id.upDirectoryButton))
+ .setEnabled(false);
+ curDirString = "/";
+ } else
+ ((Button) this.findViewById(R.id.upDirectoryButton))
+ .setEnabled(true);
+ long freeSpace = getFreeSpace(curDirString);
+ String formattedSpaceString = formatBytes(freeSpace);
+ if (freeSpace == 0) {
+ Log.d(LOGTAG, "NO FREE SPACE");
+ File currentDir = new File(curDirString);
+ if(!currentDir.canWrite())
+ formattedSpaceString = "NON Writable";
+ }
+
+ ((Button) this.findViewById(R.id.selectCurrentDirectoryButton))
+ .setText("Select\n[" + formattedSpaceString
+ + "]");
+
+ ((TextView) this.findViewById(R.id.currentDirectoryTextView))
+ .setText("Current directory: " + curDirString);
+ }// END private void updateCurrentDirectoryTextView() {
+
+ private void showToast(String message) {
+ Toast.makeText(this, message, Toast.LENGTH_LONG).show();
+ }
+
+ private void initializeFileListView() {
+ ListView lView = (ListView) this.findViewById(R.id.fileListView);
+ LinearLayout.LayoutParams lParam = new LinearLayout.LayoutParams(
+ LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
+ lParam.setMargins(15, 5, 15, 5);
+ lView.setAdapter(this.adapter);
+ lView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ public void onItemClick(AdapterView<?> parent, View view,
+ int position, long id) {
+ chosenFile = fileList.get(position).file;
+ File sel = new File(path + "/" + chosenFile);
+ Log.d(LOGTAG, "Clicked:" + chosenFile);
+ if (sel.isDirectory()) {
+ if (sel.canRead()) {
+ // Adds chosen directory to list
+ pathDirsList.add(chosenFile);
+ path = new File(sel + "");
+ Log.d(LOGTAG, "Just reloading the list");
+ loadFileList();
+ adapter.notifyDataSetChanged();
+ updateCurrentDirectoryTextView();
+ Log.d(LOGTAG, path.getAbsolutePath());
+ } else {// if(sel.canRead()) {
+ showToast("Path does not exist or cannot be read");
+ }// } else {//if(sel.canRead()) {
+ }// if (sel.isDirectory()) {
+ // File picked or an empty directory message clicked
+ else {// if (sel.isDirectory()) {
+ Log.d(LOGTAG, "item clicked");
+ if (!directoryShownIsEmpty) {
+ Log.d(LOGTAG, "File selected:" + chosenFile);
+ returnFileFinishActivity(sel.getAbsolutePath());
+ }
+ }// else {//if (sel.isDirectory()) {
+ }// public void onClick(DialogInterface dialog, int which) {
+ });// lView.setOnClickListener(
+ }// private void initializeFileListView() {
+
+ private void returnDirectoryFinishActivity() {
+ Intent retIntent = new Intent();
+ retIntent.putExtra(returnDirectoryParameter, path.getAbsolutePath());
+ this.setResult(RESULT_OK, retIntent);
+ this.finish();
+ }// END private void returnDirectoryFinishActivity() {
+
+ private void returnFileFinishActivity(String filePath) {
+ Intent retIntent = new Intent();
+ retIntent.putExtra(returnFileParameter, filePath);
+ this.setResult(RESULT_OK, retIntent);
+ this.finish();
+ }// END private void returnDirectoryFinishActivity() {
+
+ private void loadFileList() {
+ try {
+ path.mkdirs();
+ } catch (SecurityException e) {
+ Log.e(LOGTAG, "unable to write on the sd card ");
+ }
+ fileList.clear();
+
+ if (path.exists() && path.canRead()) {
+ FilenameFilter filter = new FilenameFilter() {
+ public boolean accept(File dir, String filename) {
+ File sel = new File(dir, filename);
+ boolean showReadableFile = showHiddenFilesAndDirs
+ || sel.canRead();
+ // Filters based on whether the file is hidden or not
+ if (currentAction == SELECT_DIRECTORY) {
+ return (sel.isDirectory() && showReadableFile);
+ }
+ if (currentAction == SELECT_FILE) {
+
+ // If it is a file check the extension if provided
+ if (sel.isFile() && filterFileExtension != null) {
+ return (showReadableFile && sel.getName().endsWith(
+ filterFileExtension));
+ }
+ return (showReadableFile);
+ }
+ return true;
+ }// public boolean accept(File dir, String filename) {
+ };// FilenameFilter filter = new FilenameFilter() {
+
+ String[] fList = path.list(filter);
+ this.directoryShownIsEmpty = false;
+ for (int i = 0; i < fList.length; i++) {
+ // Convert into file path
+ File sel = new File(path, fList[i]);
+ Log.d(LOGTAG,
+ "File:" + fList[i] + " readable:"
+ + (Boolean.valueOf(sel.canRead())).toString());
+ int drawableID = R.drawable.file_icon;
+ boolean canRead = sel.canRead();
+ // Set drawables
+ if (sel.isDirectory()) {
+ if (canRead) {
+ drawableID = R.drawable.folder_icon;
+ } else {
+ drawableID = R.drawable.folder_icon_light;
+ }
+ }
+ fileList.add(i, new Item(fList[i], drawableID, canRead));
+ }// for (int i = 0; i < fList.length; i++) {
+ if (fileList.size() == 0) {
+ // Log.d(LOGTAG, "This directory is empty");
+ this.directoryShownIsEmpty = true;
+ fileList.add(0, new Item("Directory is empty", -1, true));
+ } else {// sort non empty list
+ Collections.sort(fileList, new ItemFileNameComparator());
+ }
+ } else {
+ Log.e(LOGTAG, "path does not exist or cannot be read");
+ }
+ // Log.d(TAG, "loadFileList finished");
+ }// private void loadFileList() {
+
+ private void createFileListAdapter() {
+ adapter = new ArrayAdapter<Item>(this,
+ android.R.layout.select_dialog_item, android.R.id.text1,
+ fileList) {
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ // creates view
+ View view = super.getView(position, convertView, parent);
+ TextView textView = (TextView) view
+ .findViewById(android.R.id.text1);
+ // put the image on the text view
+ int drawableID = 0;
+ if (fileList.get(position).icon != -1) {
+ // If icon == -1, then directory is empty
+ drawableID = fileList.get(position).icon;
+ }
+ textView.setCompoundDrawablesWithIntrinsicBounds(drawableID, 0,
+ 0, 0);
+
+ textView.setEllipsize(null);
+
+ // add margin between image and text (support various screen
+ // densities)
+ // int dp5 = (int) (5 *
+ // getResources().getDisplayMetrics().density + 0.5f);
+ int dp3 = (int) (3 * getResources().getDisplayMetrics().density + 0.5f);
+ // TODO: change next line for empty directory, so text will be
+ // centered
+ textView.setCompoundDrawablePadding(dp3);
+ return view;
+ }// public View getView(int position, View convertView, ViewGroup
+ };// adapter = new ArrayAdapter<Item>(this,
+ }// private createFileListAdapter(){
+
+ private class Item {
+ public String file;
+ public int icon;
+ public boolean canRead;
+
+ public Item(String file, Integer icon, boolean canRead) {
+ this.file = file;
+ this.icon = icon;
+ }
+
+ @Override
+ public String toString() {
+ return file;
+ }
+ }// END private class Item {
+
+ private class ItemFileNameComparator implements Comparator<Item> {
+ public int compare(Item lhs, Item rhs) {
+ return lhs.file.toLowerCase().compareTo(rhs.file.toLowerCase());
+ }
+ }
+
+ public void onConfigurationChanged(Configuration newConfig) {
+ super.onConfigurationChanged(newConfig);
+ if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
+ Log.d(LOGTAG, "ORIENTATION_LANDSCAPE");
+ } else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
+ Log.d(LOGTAG, "ORIENTATION_PORTRAIT");
+ }
+ // Layout apparently changes itself, only have to provide good onMeasure
+ // in custom components
+ // TODO: check with keyboard
+ // if(newConfig.keyboard == Configuration.KEYBOARDHIDDEN_YES)
+ }// END public void onConfigurationChanged(Configuration newConfig) {
+
+ public static long getFreeSpace(String path) {
+ StatFs stat = new StatFs(path);
+ long availSize = (long) stat.getAvailableBlocks()
+ * (long) stat.getBlockSize();
+ return availSize;
+ }// END public static long getFreeSpace(String path) {
+
+ public static String formatBytes(long bytes) {
+ // TODO: add flag to which part is needed (e.g. GB, MB, KB or bytes)
+ String retStr = "";
+ // One binary gigabyte equals 1,073,741,824 bytes.
+ if (bytes > 1073741824) {// Add GB
+ long gbs = bytes / 1073741824;
+ retStr += (new Long(gbs)).toString() + "GB ";
+ bytes = bytes - (gbs * 1073741824);
+ }
+ // One MB - 1048576 bytes
+ if (bytes > 1048576) {// Add GB
+ long mbs = bytes / 1048576;
+ retStr += (new Long(mbs)).toString() + "MB ";
+ bytes = bytes - (mbs * 1048576);
+ }
+ if (bytes > 1024) {
+ long kbs = bytes / 1024;
+ retStr += (new Long(kbs)).toString() + "KB";
+ bytes = bytes - (kbs * 1024);
+ } else
+ retStr += (new Long(bytes)).toString() + " bytes";
+ return retStr;
+ }// public static String formatBytes(long bytes){
+
+}// END public class FileBrowserActivity extends Activity {
diff --git a/navit/android/src/org/navitproject/navit/Navit.java b/navit/android/src/org/navitproject/navit/Navit.java
index f0cb5c3b5..cf0096453 100644
--- a/navit/android/src/org/navitproject/navit/Navit.java
+++ b/navit/android/src/org/navitproject/navit/Navit.java
@@ -1,911 +1,896 @@
-/**
- * Navit, a modular navigation system.
- * Copyright (C) 2005-2008 Navit Team
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-package org.navitproject.navit;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import android.annotation.TargetApi;
-import android.app.Activity;
-import android.app.ActivityManager.TaskDescription;
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.app.Notification;
-import android.app.NotificationManager;
-import android.app.PendingIntent;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.res.Configuration;
-import android.content.res.Resources;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.graphics.Color;
-import android.graphics.Point;
-import android.Manifest;
-import android.media.AudioManager;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Environment;
-import android.os.Message;
-import android.os.PowerManager;
-import android.support.v4.app.ActivityCompat;
-import android.support.v4.content.ContextCompat;
-import android.text.SpannableString;
-import android.text.method.LinkMovementMethod;
-import android.text.util.Linkify;
-import android.util.DisplayMetrics;
-import android.util.Log;
-import android.view.Display;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.Window;
-import android.view.WindowManager;
-import android.view.inputmethod.InputMethodManager;
-import android.widget.RelativeLayout;
-import android.widget.TextView;
-import android.widget.Toast;
-import android.support.v4.app.NotificationCompat;
-
-
-public class Navit extends Activity
-{
-
- public NavitDialogs dialogs;
- private PowerManager.WakeLock wl;
- private NavitActivityResult ActivityResults[];
- public static InputMethodManager mgr = null;
- public static DisplayMetrics metrics = null;
- public static int status_bar_height = 0;
- public static int action_bar_default_height = 0;
- public static int navigation_bar_height = 0;
- public static int navigation_bar_height_landscape= 0;
- public static int navigation_bar_width = 0;
- public static Boolean show_soft_keyboard = false;
- public static Boolean show_soft_keyboard_now_showing = false;
- public static long last_pressed_menu_key = 0L;
- public static long time_pressed_menu_key = 0L;
- private static Intent startup_intent = null;
- private static long startup_intent_timestamp = 0L;
- public static String my_display_density = "mdpi";
- public static final int NavitDownloaderSelectMap_id = 967;
- public static final int NavitAddressSearch_id = 70;
- public static final int NavitSelectStorage_id = 43;
- public static String NavitLanguage;
- public static Resources NavitResources = null;
- static final String NAVIT_PACKAGE_NAME = "org.navitproject.navit";
- static final String TAG = "Navit";
- static String map_filename_path = null;
- static final String NAVIT_DATA_DIR = "/data/data/" + NAVIT_PACKAGE_NAME;
- static final String NAVIT_DATA_SHARE_DIR = NAVIT_DATA_DIR + "/share";
- public static final String NAVIT_PREFS = "NavitPrefs";
- Boolean isFullscreen = false;
- private static final int MY_PERMISSIONS_REQUEST_ALL = 101;
- public static NotificationManager nm;
-
-
- /**
- * @brief A Runnable to restore soft input when the user returns to the activity.
- *
- * An instance of this class can be passed to the main message queue in the Activity's
- * {@code onRestore()} method.
- */
- private class SoftInputRestorer implements Runnable {
- public void run() {
- Navit.this.showNativeKeyboard();
- }
- }
-
-
- public void removeFileIfExists(String source) {
- File file = new File(source);
-
- if (!file.exists())
- return;
-
- file.delete();
- }
-
- public void copyFileIfExists(String source, String destination) throws IOException {
- File file = new File(source);
-
- if (!file.exists())
- return;
-
- FileInputStream is = null;
- FileOutputStream os = null;
-
- try {
- is = new FileInputStream(source);
- os = new FileOutputStream(destination);
-
- int len;
- byte buffer[] = new byte[1024];
-
- while ((len = is.read(buffer)) != -1) {
- os.write(buffer, 0, len);
- }
- } finally {
- /* Close the FileStreams to prevent Resource leaks */
- if (is != null)
- is.close();
-
- if (os != null)
- os.close();
- }
- return;
- }
-
-
- public static String T(String in)
- {
- return NavitTextTranslations.get_text(in);
- }
-
- private boolean extractRes(String resname, String result) {
- boolean needs_update = false;
- Log.e(TAG, "Res Name " + resname + ", result " + result);
- int id = NavitResources.getIdentifier(resname, "raw", NAVIT_PACKAGE_NAME);
- Log.e(TAG, "Res ID " + id);
- if (id == 0)
- return false;
-
- File resultfile = new File(result);
- if (!resultfile.exists()) {
- needs_update = true;
- File path = resultfile.getParentFile();
- if ( !path.exists() && !resultfile.getParentFile().mkdirs())
- return false;
- } else {
- PackageManager pm = getPackageManager();
- ApplicationInfo appInfo;
- long apkUpdateTime = 0;
- try {
- appInfo = pm.getApplicationInfo(NAVIT_PACKAGE_NAME, 0);
- apkUpdateTime = new File(appInfo.sourceDir).lastModified();
- } catch (NameNotFoundException e) {
- Log.e(TAG, "Could not read package infos");
- e.printStackTrace();
- }
- if (apkUpdateTime > resultfile.lastModified())
- needs_update = true;
- }
-
- if (needs_update) {
- Log.e(TAG, "Extracting resource");
-
- try {
- InputStream resourcestream = NavitResources.openRawResource(id);
- FileOutputStream resultfilestream = new FileOutputStream(resultfile);
- byte[] buf = new byte[1024];
- int i = 0;
- while ((i = resourcestream.read(buf)) != -1) {
- resultfilestream.write(buf, 0, i);
- }
- resultfilestream.close();
- } catch (Exception e) {
- Log.e(TAG, "Exception " + e.getMessage());
- return false;
- }
- }
- return true;
- }
-
- private void showInfos()
- {
- SharedPreferences settings = getSharedPreferences(NAVIT_PREFS, MODE_PRIVATE);
- boolean firstStart = settings.getBoolean("firstStart", true);
-
- if (firstStart)
- {
- AlertDialog.Builder infobox = new AlertDialog.Builder(this);
- infobox.setTitle(getString(R.string.initial_info_box_title)); // TRANS
- infobox.setCancelable(false);
-
- infobox.setMessage(R.string.initial_info_box_message);
-
- // TRANS
- infobox.setPositiveButton(getString(R.string.initial_info_box_OK), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface arg0, int arg1) {
- Log.d(TAG, "Ok, user saw the infobox");
- }
- });
-
- // TRANS
- infobox.setNeutralButton(getString(R.string.initial_info_box_more_info), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface arg0, int arg1) {
- Log.d(TAG, "user wants more info, show the website");
- String url = "http://wiki.navit-project.org/index.php/Navit_on_Android";
- Intent i = new Intent(Intent.ACTION_VIEW);
- i.setData(Uri.parse(url));
- startActivity(i);
- }
- });
- infobox.show();
- SharedPreferences.Editor edit_settings = settings.edit();
- edit_settings.putBoolean("firstStart", false);
- edit_settings.commit();
- }
- }
-
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB)
- this.requestWindowFeature(Window.FEATURE_NO_TITLE);
- else
- this.getActionBar().hide();
-
- dialogs = new NavitDialogs(this);
-
- NavitResources = getResources();
-
- // only take arguments here, onResume gets called all the time (e.g. when screenblanks, etc.)
- Navit.startup_intent = this.getIntent();
- // hack! Remember time stamps, and only allow 4 secs. later in onResume to set target!
- Navit.startup_intent_timestamp = System.currentTimeMillis();
- Log.d(TAG, "**1**A " + startup_intent.getAction());
- Log.d(TAG, "**1**D " + startup_intent.getDataString());
-
- // init translated text
- NavitTextTranslations.init();
-
- // NOTIFICATION
- // Setup the status bar notification
- // This notification is removed in the exit() function
- nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); // Grab a handle to the NotificationManager
- PendingIntent appIntent = PendingIntent.getActivity(getApplicationContext(), 0, getIntent(), 0);
-
- NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
- builder.setContentIntent(appIntent);
- builder.setAutoCancel(false).setOngoing(true);
- builder.setContentTitle(getString(R.string.app_name));
- builder.setContentText(getString(R.string.notification_event_default));
- builder.setSmallIcon(R.drawable.ic_notify);
- Notification NavitNotification = builder.build();
- nm.notify(R.string.app_name, NavitNotification);// Show the notification
-
- // Status and navigation bar sizes
- // These are platform defaults and do not change with rotation, but we have to figure out which ones apply
- // (is the navigation bar visible? on the side or at the bottom?)
- Resources resources = getResources();
- int shid = resources.getIdentifier("status_bar_height", "dimen", "android");
- int adhid = resources.getIdentifier("action_bar_default_height", "dimen", "android");
- int nhid = resources.getIdentifier("navigation_bar_height", "dimen", "android");
- int nhlid = resources.getIdentifier("navigation_bar_height_landscape", "dimen", "android");
- int nwid = resources.getIdentifier("navigation_bar_width", "dimen", "android");
- status_bar_height = (shid > 0) ? resources.getDimensionPixelSize(shid) : 0;
- action_bar_default_height = (adhid > 0) ? resources.getDimensionPixelSize(adhid) : 0;
- navigation_bar_height = (nhid > 0) ? resources.getDimensionPixelSize(nhid) : 0;
- navigation_bar_height_landscape = (nhlid > 0) ? resources.getDimensionPixelSize(nhlid) : 0;
- navigation_bar_width = (nwid > 0) ? resources.getDimensionPixelSize(nwid) : 0;
- Log.d(TAG, String.format("status_bar_height=%d, action_bar_default_height=%d, navigation_bar_height=%d, navigation_bar_height_landscape=%d, navigation_bar_width=%d",
- status_bar_height, action_bar_default_height, navigation_bar_height, navigation_bar_height_landscape, navigation_bar_width));
- if ((ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED)||
- (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED)) {
- Log.d (TAG,"ask for permission(s)");
- ActivityCompat.requestPermissions(this,
- new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.ACCESS_FINE_LOCATION},MY_PERMISSIONS_REQUEST_ALL);
- }
- // get the local language -------------
- Locale locale = java.util.Locale.getDefault();
- String lang = locale.getLanguage();
- String langu = lang;
- String langc = lang;
- Log.d(TAG, "lang=" + lang);
- int pos = langu.indexOf('_');
- if (pos != -1)
- {
- langc = langu.substring(0, pos);
- NavitLanguage = langc + langu.substring(pos).toUpperCase(locale);
- Log.d(TAG, "substring lang " + NavitLanguage.substring(pos).toUpperCase(locale));
- // set lang. for translation
- NavitTextTranslations.main_language = langc;
- NavitTextTranslations.sub_language = NavitLanguage.substring(pos).toUpperCase(locale);
- }
- else
- {
- String country = locale.getCountry();
- Log.d(TAG, "Country1 " + country);
- Log.d(TAG, "Country2 " + country.toUpperCase(locale));
- NavitLanguage = langc + "_" + country.toUpperCase(locale);
- // set lang. for translation
- NavitTextTranslations.main_language = langc;
- NavitTextTranslations.sub_language = country.toUpperCase(locale);
- }
- Log.d(TAG, "Language " + lang);
-
- SharedPreferences prefs = getSharedPreferences(NAVIT_PREFS,MODE_PRIVATE);
- map_filename_path = prefs.getString("filenamePath", Environment.getExternalStorageDirectory().getPath() + "/navit/");
-
- // make sure the new path for the navitmap.bin file(s) exist!!
- File navit_maps_dir = new File(map_filename_path);
- navit_maps_dir.mkdirs();
-
- // make sure the share dir exists
- File navit_data_share_dir = new File(NAVIT_DATA_SHARE_DIR);
- navit_data_share_dir.mkdirs();
-
- Display display_ = getWindowManager().getDefaultDisplay();
- int width_ = display_.getWidth();
- int height_ = display_.getHeight();
- metrics = new DisplayMetrics();
- display_.getMetrics(Navit.metrics);
- int densityDpi = (int)(( Navit.metrics.density*160)-.5f);
- Log.d(TAG, "Navit -> pixels x=" + width_ + " pixels y=" + height_);
- Log.d(TAG, "Navit -> dpi=" + densityDpi);
- Log.d(TAG, "Navit -> density=" + Navit.metrics.density);
- Log.d(TAG, "Navit -> scaledDensity=" + Navit.metrics.scaledDensity);
-
- ActivityResults = new NavitActivityResult[16];
- setVolumeControlStream(AudioManager.STREAM_MUSIC);
- PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
- wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE,"NavitDoNotDimScreen");
-
- if (!extractRes(langc, NAVIT_DATA_DIR + "/locale/" + langc + "/LC_MESSAGES/navit.mo"))
- {
- Log.e(TAG, "Failed to extract language resource " + langc);
- }
-
- if (densityDpi <= 120)
- {
- my_display_density = "ldpi";
- }
- else if (densityDpi <= 160)
- {
- my_display_density = "mdpi";
- }
- else if (densityDpi < 240)
- {
- my_display_density = "hdpi";
- }
- else if (densityDpi < 320)
- {
- my_display_density = "xhdpi";
- }
- else if (densityDpi < 480)
- {
- my_display_density = "xxhdpi";
- }
- else if (densityDpi < 640)
- {
- my_display_density = "xxxhdpi";
- }
- else
- {
- Log.e(TAG, "found device of very high density ("+densityDpi+")");
- Log.e(TAG, "using xxxhdpi values");
- my_display_density = "xxxhdpi";
- }
-
- if (!extractRes("navit" + my_display_density, NAVIT_DATA_DIR + "/share/navit.xml"))
- {
- Log.e(TAG, "Failed to extract navit.xml for " + my_display_density);
- }
-
- // --> dont use android.os.Build.VERSION.SDK_INT, needs API >= 4
- Log.d(TAG, "android.os.Build.VERSION.SDK_INT=" + Integer.valueOf(android.os.Build.VERSION.SDK));
- NavitMain(this, NavitLanguage, Integer.valueOf(android.os.Build.VERSION.SDK), my_display_density, NAVIT_DATA_DIR+"/bin/navit",map_filename_path);
-
- showInfos();
-
- Navit.mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
- }
-
- @Override
- public void onResume()
- {
- super.onResume();
- Log.d(TAG, "OnResume");
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
- /* Required to make system bars fully transparent */
- getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
- | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
- | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
- }
- //InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
- // DEBUG
- // intent_data = "google.navigation:q=Wien Burggasse 27";
- // intent_data = "google.navigation:q=48.25676,16.643";
- // intent_data = "google.navigation:ll=48.25676,16.643&q=blabla-strasse";
- // intent_data = "google.navigation:ll=48.25676,16.643";
- if (startup_intent != null)
- {
- if (System.currentTimeMillis() <= Navit.startup_intent_timestamp + 4000L)
- {
- Log.d(TAG, "**2**A " + startup_intent.getAction());
- Log.d(TAG, "**2**D " + startup_intent.getDataString());
- String navi_scheme = startup_intent.getScheme();
- if ( navi_scheme != null && navi_scheme.equals("google.navigation")) {
- parseNavigationURI(startup_intent.getData().getSchemeSpecificPart());
- }
- }
- else {
- Log.e(TAG, "timestamp for navigate_to expired! not using data");
- }
- }
- Log.d(TAG, "onResume");
- if (show_soft_keyboard_now_showing) {
- /* Calling showNativeKeyboard() directly won't work here, we need to use the message queue */
- View cf = getCurrentFocus();
- if (cf == null)
- Log.e(TAG, "no view in focus, can't get a handler");
- else
- cf.getHandler().post(new SoftInputRestorer());
- }
- }
-
- @Override
- public void onPause() {
- super.onPause();
- Log.d(TAG, "onPause");
- if (show_soft_keyboard_now_showing) {
- Log.d(TAG, "onPause:hiding soft input");
- this.hideNativeKeyboard();
- show_soft_keyboard_now_showing = true;
- }
- }
-
- @Override
- public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
- switch (requestCode) {
- case MY_PERMISSIONS_REQUEST_ALL: {
- if (grantResults.length > 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED
- && grantResults[1] == PackageManager.PERMISSION_GRANTED) {
- // ok, we got permissions
- } else {
- AlertDialog.Builder infobox = new AlertDialog.Builder(this);
- infobox.setTitle(getString(R.string.permissions_info_box_title)); // TRANS
- infobox.setCancelable(false);
- infobox.setMessage(getString(R.string.permissions_not_granted));
- // TRANS
- infobox.setPositiveButton(getString(R.string.initial_info_box_OK), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface arg0, int arg1) {
- exit();
- }
- });
- infobox.show();
- }
- return;
- }
- }
- }
-
- private void parseNavigationURI(String schemeSpecificPart) {
- String naviData[]= schemeSpecificPart.split("&");
- Pattern p = Pattern.compile("(.*)=(.*)");
- Map<String,String> params = new HashMap<String,String>();
- for (int count=0; count < naviData.length; count++) {
- Matcher m = p.matcher(naviData[count]);
-
- if (m.matches()) {
- params.put(m.group(1), m.group(2));
- }
- }
-
- // d: google.navigation:q=blabla-strasse # (this happens when you are offline, or from contacts)
- // a: google.navigation:ll=48.25676,16.643&q=blabla-strasse
- // c: google.navigation:ll=48.25676,16.643
- // b: google.navigation:q=48.25676,16.643
-
- Float lat;
- Float lon;
- Bundle b = new Bundle();
-
- String geoString = params.get("ll");
- if (geoString != null) {
- String address = params.get("q");
- if (address != null) b.putString("q", address);
- }
- else {
- geoString = params.get("q");
- }
-
- if ( geoString != null) {
- if (geoString.matches("^[+-]{0,1}\\d+(|\\.\\d*),[+-]{0,1}\\d+(|\\.\\d*)$")) {
- String geo[] = geoString.split(",");
- if (geo.length == 2) {
- try {
- lat = Float.valueOf(geo[0]);
- lon = Float.valueOf(geo[1]);
- b.putFloat("lat", lat);
- b.putFloat("lon", lon);
- Message msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_SET_DESTINATION.ordinal());
-
- msg.setData(b);
- msg.sendToTarget();
- Log.e(TAG, "target found (b): " + geoString);
- } catch (NumberFormatException e) { } // nothing to do here
- }
- }
- else {
- start_targetsearch_from_intent(geoString);
- }
- }
- }
-
- public void setActivityResult(int requestCode, NavitActivityResult ActivityResult)
- {
- ActivityResults[requestCode] = ActivityResult;
- }
-
- /*
- * This is unused since we dont have the dropdown
- * TODO: recheck if this is right and remove this!
- */
- @Override
- public boolean onPrepareOptionsMenu(Menu menu)
- {
- super.onPrepareOptionsMenu(menu);
- //Log.e("Navit","onPrepareOptionsMenu");
- // this gets called every time the menu is opened!!
- // change menu items here!
- menu.clear();
-
- // group-id,item-id,sort order number
- //menu.add(1, 1, 100, getString(R.string.optionsmenu_zoom_in)); //TRANS
- //menu.add(1, 2, 200, getString(R.string.optionsmenu_zoom_out)); //TRANS
-
- menu.add(1, 3, 300, getString(R.string.optionsmenu_download_maps)); //TRANS
- menu.add(1, 5, 400, getString(R.string.optionsmenu_toggle_poi)); //TRANS
-
- menu.add(1, 6, 500, getString(R.string.optionsmenu_address_search)); //TRANS
- menu.add(1, 10, 600, getString(R.string.optionsmenu_set_map_location));
-
- menu.add(1, 99, 900, getString(R.string.optionsmenu_exit_navit)); //TRANS
-
- /* Only show the Backup to SD-Card Option if we really have one */
- if(Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED))
- menu.add(1, 7, 700, getString(R.string.optionsmenu_backup_restore)); //TRANS
-
- return true;
- }
-
- // define callback id here
- public static NavitGraphics N_NavitGraphics = null;
-
- // callback id gets set here when called from NavitGraphics
- public static void setKeypressCallback(int kp_cb_id, NavitGraphics ng)
- {
- N_NavitGraphics = ng;
- }
-
- public static void setMotionCallback(int mo_cb_id, NavitGraphics ng)
- {
- N_NavitGraphics = ng;
- }
-
- public void start_targetsearch_from_intent(String target_address)
- {
- if (target_address == null || target_address.equals(""))
- {
- // empty search string entered
- Toast.makeText(getApplicationContext(), getString(R.string.address_search_not_found), Toast.LENGTH_LONG).show(); //TRANS
- }
- else
- {
- Intent search_intent = new Intent(this, NavitAddressSearchActivity.class);
- search_intent.putExtra("search_string", target_address);
- this.startActivityForResult(search_intent, NavitAddressSearch_id);
- }
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item)
- {
- runOptionsItem(item.getItemId());
- return true;
- }
-
- public void runOptionsItem(int id)
- {
- switch (id)
- {
- case 1 :
- // zoom in
- Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_ZOOM_IN.ordinal()).sendToTarget();
- // if we zoom, hide the bubble
- Log.d(TAG, "onOptionsItemSelected -> zoom in");
- break;
- case 2 :
- // zoom out
- Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_ZOOM_OUT.ordinal()).sendToTarget();
- // if we zoom, hide the bubble
- Log.d(TAG, "onOptionsItemSelected -> zoom out");
- break;
- case 3 :
- // map download menu
- Intent map_download_list_activity = new Intent(this, NavitDownloadSelectMapActivity.class);
- startActivityForResult(map_download_list_activity, Navit.NavitDownloaderSelectMap_id);
- break;
- case 5 :
- // toggle the normal POI layers and labels (to avoid double POIs)
- Message msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_CALL_CMD.ordinal());
- Bundle b = new Bundle();
- b.putString("cmd", "toggle_layer(\"POI Symbols\");");
- msg.setData(b);
- msg.sendToTarget();
-
- msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_CALL_CMD.ordinal());
- b = new Bundle();
- b.putString("cmd", "toggle_layer(\"POI Labels\");");
- msg.setData(b);
- msg.sendToTarget();
-
- // toggle full POI icons on/off
- msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_CALL_CMD.ordinal());
- b = new Bundle();
- b.putString("cmd", "toggle_layer(\"Android-POI-Icons-full\");");
- msg.setData(b);
- msg.sendToTarget();
-
- break;
- case 6 :
- // ok startup address search activity
- Intent search_intent = new Intent(this, NavitAddressSearchActivity.class);
- this.startActivityForResult(search_intent, NavitAddressSearch_id);
- break;
- case 7 :
- /* Backup / Restore */
- showDialog(NavitDialogs.DIALOG_BACKUP_RESTORE);
- break;
- case 10:
- setMapLocation();
- break;
- case 99 :
- // exit
- this.onStop();
- this.exit();
- break;
- }
- }
-
-
- /**
- * @brief Shows the Options menu.
- *
- * Calling this method has the same effect as pressing the hardware Menu button, where present, or touching
- * the overflow button in the Action bar.
- */
- public void showMenu() {
- openOptionsMenu();
- }
-
-
- /**
- * @brief Shows the native keyboard or other input method.
- *
- * @return {@code true} if an input method is going to be displayed, {@code false} if not
- */
- public int showNativeKeyboard() {
- /*
- * Apologies for the huge mess that this function is, but Android's soft input API is a big
- * nightmare. Its devs have mercifully given us an option to show or hide the keyboard, but
- * there is no reliable way to figure out if it is actually showing, let alone how much of the
- * screen it occupies, so our best bet is guesswork.
- */
- Configuration config = getResources().getConfiguration();
- if ((config.keyboard == Configuration.KEYBOARD_QWERTY) && (config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO))
- /* physical keyboard present, exit */
- return 0;
-
- /* Use SHOW_FORCED here, else keyboard won't show in landscape mode */
- mgr.showSoftInput(getCurrentFocus(), InputMethodManager.SHOW_FORCED);
- show_soft_keyboard_now_showing = true;
-
- /*
- * Crude way to estimate the height occupied by the keyboard: for AOSP on KitKat and Lollipop it
- * is about 62-63% of available screen width (in portrait mode) but no more than slightly above
- * 46% of height (in landscape mode).
- */
- Display display_ = getWindowManager().getDefaultDisplay();
- int width_ = display_.getWidth();
- int height_ = display_.getHeight();
- int maxHeight = height_ * 47 / 100;
- int inputHeight = width_ * 63 / 100;
- if (inputHeight > (maxHeight))
- inputHeight = maxHeight;
-
- /* the receiver isn't going to fire before the UI thread becomes idle, well after this method returns */
- Log.d(TAG, "showNativeKeyboard:return (assuming true)");
- return inputHeight;
- }
-
-
- /**
- * @brief Hides the native keyboard or other input method.
- */
- public void hideNativeKeyboard() {
- mgr.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
- show_soft_keyboard_now_showing = false;
- }
-
-
- void setDestination(float latitude, float longitude, String address) {
- Toast.makeText( getApplicationContext(),getString(R.string.address_search_set_destination) + "\n" + address, Toast.LENGTH_LONG).show(); //TRANS
-
- Message msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_SET_DESTINATION.ordinal());
- Bundle b = new Bundle();
- b.putFloat("lat", latitude);
- b.putFloat("lon", longitude);
- b.putString("q", address);
- msg.setData(b);
- msg.sendToTarget();
- }
-
- protected void onActivityResult(int requestCode, int resultCode, Intent data)
- {
- switch (requestCode)
- {
- case Navit.NavitDownloaderSelectMap_id :
- if (resultCode == Activity.RESULT_OK)
- {
- Message msg = dialogs.obtainMessage(NavitDialogs.MSG_START_MAP_DOWNLOAD
- , data.getIntExtra("map_index", -1), 0);
- msg.sendToTarget();
- }
- break;
- case NavitAddressSearch_id :
- if (resultCode == Activity.RESULT_OK) {
- Bundle destination = data.getExtras();
- Toast.makeText( getApplicationContext(),getString(R.string.address_search_set_destination) + "\n" + destination.getString(("q")), Toast.LENGTH_LONG).show(); //TRANS
-
- Message msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_SET_DESTINATION.ordinal());
- msg.setData(destination);
- msg.sendToTarget();
- }
- break;
- case NavitSelectStorage_id :
- if(resultCode == RESULT_OK) {
- String newDir = data.getStringExtra(FileBrowserActivity.returnDirectoryParameter);
- Log.d(TAG, "selected path= "+newDir);
- if(!newDir.contains("/navit"))
- newDir = newDir+"/navit/";
- else
- newDir = newDir+"/";
- SharedPreferences prefs = this.getSharedPreferences(NAVIT_PREFS,MODE_PRIVATE);
- SharedPreferences.Editor prefs_editor = prefs.edit();
- prefs_editor.putString("filenamePath", newDir);
- prefs_editor.commit();
- Toast.makeText(this, String.format(Navit.T("New location set to %s\nRestart Navit to apply the changes."),newDir),Toast.LENGTH_LONG).show();
- }
- else Log.w(TAG, "select path failed");
- break;
- default :
- ActivityResults[requestCode].onActivityResult(requestCode, resultCode, data);
- break;
- }
- }
-
- @Override
- protected void onPrepareDialog(int id, Dialog dialog) {
- dialogs.prepareDialog(id, dialog);
- super.onPrepareDialog(id, dialog);
- }
-
- protected Dialog onCreateDialog(int id)
- {
- return dialogs.createDialog(id);
- }
-
- @Override
- public boolean onSearchRequested() {
- /* Launch the internal Search Activity */
- Intent search_intent = new Intent(this, NavitAddressSearchActivity.class);
- this.startActivityForResult(search_intent, NavitAddressSearch_id);
-
- return true;
- }
-
- public boolean setMapLocation()
- {
- Intent fileExploreIntent = new Intent(this,FileBrowserActivity.class);
- fileExploreIntent
- .putExtra(FileBrowserActivity.startDirectoryParameter, "/mnt")
- .setAction(FileBrowserActivity.INTENT_ACTION_SELECT_DIR);
- startActivityForResult(fileExploreIntent,NavitSelectStorage_id);
-
- return true;
- }
-
- @Override
- public void onDestroy()
- {
- super.onDestroy();
- Log.d(TAG, "OnDestroy");
- // TODO next call will kill our app the hard way. This should not be necessary, but ensures navit is
- // properly restarted and no resources are wasted with navit in background. Remove this call after
- // code review
- NavitDestroy();
- }
-
- public void fullscreen(int fullscreen) {
- int w, h;
-
- isFullscreen = (fullscreen != 0);
- if (isFullscreen) {
- getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
- getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
- }
- else {
- getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
- getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
- }
-
- Display display_ = getWindowManager().getDefaultDisplay();
- if (Build.VERSION.SDK_INT < 17) {
- w = display_.getWidth();
- h = display_.getHeight();
- } else {
- Point size = new Point();
- display_.getRealSize(size);
- w = size.x;
- h = size.y;
- }
- Log.d(TAG, String.format("Toggle fullscreen, w=%d, h=%d", w, h));
- N_NavitGraphics.handleResize(w, h);
- }
-
- public void disableSuspend()
- {
- wl.acquire();
- wl.release();
- }
-
- public void exit()
- {
- nm.cancelAll();
- NavitVehicle.removeListener();
- NavitDestroy();
- }
-
- public native void NavitMain(Navit x, String lang, int version, String display_density_string, String path, String path2);
- public native void NavitDestroy();
-
- /*
- * this is used to load the 'navit' native library on
- * application startup. The library has already been unpacked at
- * installation time by the package manager.
- */
- static
- {
- System.loadLibrary("navit");
- }
-}
+/**
+ * Navit, a modular navigation system.
+ * Copyright (C) 2005-2008 Navit Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+package org.navitproject.navit;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.NameNotFoundException;
+import android.content.res.Configuration;
+import android.content.res.Resources;
+import android.graphics.Point;
+import android.Manifest;
+import android.media.AudioManager;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Environment;
+import android.os.Message;
+import android.os.PowerManager;
+import android.util.DisplayMetrics;
+import android.util.Log;
+import android.view.Display;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.Toast;
+import android.support.v4.app.NotificationCompat;
+import android.support.v4.app.ActivityCompat;
+import android.support.v4.content.ContextCompat;
+
+public class Navit extends Activity
+{
+
+ private NavitDialogs dialogs;
+ private PowerManager.WakeLock wl;
+ private NavitActivityResult ActivityResults[];
+ public static InputMethodManager mgr = null;
+ public static DisplayMetrics metrics = null;
+ public static int status_bar_height = 0;
+ private static int action_bar_default_height = 0;
+ public static int navigation_bar_height = 0;
+ public static int navigation_bar_height_landscape = 0;
+ public static int navigation_bar_width = 0;
+ public static Boolean show_soft_keyboard = false;
+ public static Boolean show_soft_keyboard_now_showing = false;
+ public static long last_pressed_menu_key = 0L;
+ public static long time_pressed_menu_key = 0L;
+ private static Intent startup_intent = null;
+ private static long startup_intent_timestamp = 0L;
+ private static String my_display_density = "mdpi";
+ private static final int NavitDownloaderSelectMap_id = 967;
+ private static final int NavitAddressSearch_id = 70;
+ private static final int NavitSelectStorage_id = 43;
+ private static String NavitLanguage;
+ public static Resources NavitResources = null;
+ private static final String NAVIT_PACKAGE_NAME = "org.navitproject.navit";
+ private static final String TAG = "Navit";
+ static String map_filename_path = null;
+ static final String NAVIT_DATA_DIR = "/data/data/" + NAVIT_PACKAGE_NAME;
+ private static final String NAVIT_DATA_SHARE_DIR = NAVIT_DATA_DIR + "/share";
+ public static final String NAVIT_PREFS = "NavitPrefs";
+ Boolean isFullscreen = false;
+ private static final int MY_PERMISSIONS_REQUEST_ALL = 101;
+ private static NotificationManager nm;
+ private static Navit navit;
+
+ public static Navit getInstance() {
+ return navit;
+ }
+
+
+ /**
+ * @brief A Runnable to restore soft input when the user returns to the activity.
+ *
+ * An instance of this class can be passed to the main message queue in the Activity's
+ * {@code onRestore()} method.
+ */
+ private class SoftInputRestorer implements Runnable {
+ public void run() {
+ Navit.this.showNativeKeyboard();
+ }
+ }
+
+
+ public void removeFileIfExists(String source) {
+ File file = new File(source);
+
+ if (!file.exists())
+ return;
+
+ file.delete();
+ }
+
+ public void copyFileIfExists(String source, String destination) throws IOException {
+ File file = new File(source);
+
+ if (!file.exists())
+ return;
+
+ FileInputStream is = null;
+ FileOutputStream os = null;
+
+ try {
+ is = new FileInputStream(source);
+ os = new FileOutputStream(destination);
+
+ int len;
+ byte buffer[] = new byte[1024];
+
+ while ((len = is.read(buffer)) != -1) {
+ os.write(buffer, 0, len);
+ }
+ } finally {
+ /* Close the FileStreams to prevent Resource leaks */
+ if (is != null)
+ is.close();
+
+ if (os != null)
+ os.close();
+ }
+ }
+
+ public String T(String in)
+ {
+ return getLocalizedString(in);
+ }
+
+ private boolean extractRes(String resname, String result) {
+ boolean needs_update = false;
+ Log.e(TAG, "Res Name " + resname + ", result " + result);
+ int id = NavitResources.getIdentifier(resname, "raw", NAVIT_PACKAGE_NAME);
+ Log.e(TAG, "Res ID " + id);
+ if (id == 0)
+ return false;
+
+ File resultfile = new File(result);
+ if (!resultfile.exists()) {
+ needs_update = true;
+ File path = resultfile.getParentFile();
+ if ( !path.exists() && !resultfile.getParentFile().mkdirs())
+ return false;
+ } else {
+ PackageManager pm = getPackageManager();
+ ApplicationInfo appInfo;
+ long apkUpdateTime = 0;
+ try {
+ appInfo = pm.getApplicationInfo(NAVIT_PACKAGE_NAME, 0);
+ apkUpdateTime = new File(appInfo.sourceDir).lastModified();
+ } catch (NameNotFoundException e) {
+ Log.e(TAG, "Could not read package infos");
+ e.printStackTrace();
+ }
+ if (apkUpdateTime > resultfile.lastModified())
+ needs_update = true;
+ }
+
+ if (needs_update) {
+ Log.e(TAG, "Extracting resource");
+
+ try {
+ InputStream resourcestream = NavitResources.openRawResource(id);
+ FileOutputStream resultfilestream = new FileOutputStream(resultfile);
+ byte[] buf = new byte[1024];
+ int i = 0;
+ while ((i = resourcestream.read(buf)) != -1) {
+ resultfilestream.write(buf, 0, i);
+ }
+ resultfilestream.close();
+ } catch (Exception e) {
+ Log.e(TAG, "Exception " + e.getMessage());
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private void showInfos()
+ {
+ SharedPreferences settings = getSharedPreferences(NAVIT_PREFS, MODE_PRIVATE);
+ boolean firstStart = settings.getBoolean("firstStart", true);
+
+ if (firstStart)
+ {
+ AlertDialog.Builder infobox = new AlertDialog.Builder(this);
+ infobox.setTitle(getString(R.string.initial_info_box_title)); // TRANS
+ infobox.setCancelable(false);
+
+ infobox.setMessage(R.string.initial_info_box_message);
+
+ // TRANS
+ infobox.setPositiveButton(getString(R.string.initial_info_box_OK), new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface arg0, int arg1) {
+ Log.d(TAG, "Ok, user saw the infobox");
+ }
+ });
+
+ // TRANS
+ infobox.setNeutralButton(getString(R.string.initial_info_box_more_info), new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface arg0, int arg1) {
+ Log.d(TAG, "user wants more info, show the website");
+ String url = "http://wiki.navit-project.org/index.php/Navit_on_Android";
+ Intent i = new Intent(Intent.ACTION_VIEW);
+ i.setData(Uri.parse(url));
+ startActivity(i);
+ }
+ });
+ infobox.show();
+ SharedPreferences.Editor edit_settings = settings.edit();
+ edit_settings.putBoolean("firstStart", false);
+ edit_settings.apply();
+ }
+ }
+
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB)
+ this.requestWindowFeature(Window.FEATURE_NO_TITLE);
+ else
+ this.getActionBar().hide();
+
+ navit = this;
+ dialogs = new NavitDialogs(this);
+
+ NavitResources = getResources();
+
+ // only take arguments here, onResume gets called all the time (e.g. when screenblanks, etc.)
+ Navit.startup_intent = this.getIntent();
+ // hack! Remember time stamps, and only allow 4 secs. later in onResume to set target!
+ Navit.startup_intent_timestamp = System.currentTimeMillis();
+ Log.d(TAG, "**1**A " + startup_intent.getAction());
+ Log.d(TAG, "**1**D " + startup_intent.getDataString());
+
+ // NOTIFICATION
+ // Setup the status bar notification
+ // This notification is removed in the exit() function
+ nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); // Grab a handle to the NotificationManager
+ PendingIntent appIntent = PendingIntent.getActivity(getApplicationContext(), 0, getIntent(), 0);
+
+ NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
+ builder.setContentIntent(appIntent);
+ builder.setAutoCancel(false).setOngoing(true);
+ builder.setContentTitle(getString(R.string.app_name));
+ builder.setContentText(getString(R.string.notification_event_default));
+ builder.setSmallIcon(R.drawable.ic_notify);
+ Notification NavitNotification = builder.build();
+ nm.notify(R.string.app_name, NavitNotification);// Show the notification
+
+ // Status and navigation bar sizes
+ // These are platform defaults and do not change with rotation, but we have to figure out which ones apply
+ // (is the navigation bar visible? on the side or at the bottom?)
+ Resources resources = getResources();
+ int shid = resources.getIdentifier("status_bar_height", "dimen", "android");
+ int adhid = resources.getIdentifier("action_bar_default_height", "dimen", "android");
+ int nhid = resources.getIdentifier("navigation_bar_height", "dimen", "android");
+ int nhlid = resources.getIdentifier("navigation_bar_height_landscape", "dimen", "android");
+ int nwid = resources.getIdentifier("navigation_bar_width", "dimen", "android");
+ status_bar_height = (shid > 0) ? resources.getDimensionPixelSize(shid) : 0;
+ action_bar_default_height = (adhid > 0) ? resources.getDimensionPixelSize(adhid) : 0;
+ navigation_bar_height = (nhid > 0) ? resources.getDimensionPixelSize(nhid) : 0;
+ navigation_bar_height_landscape = (nhlid > 0) ? resources.getDimensionPixelSize(nhlid) : 0;
+ navigation_bar_width = (nwid > 0) ? resources.getDimensionPixelSize(nwid) : 0;
+ Log.d(TAG, String.format("status_bar_height=%d, action_bar_default_height=%d, navigation_bar_height=%d, navigation_bar_height_landscape=%d, navigation_bar_width=%d",
+ status_bar_height, action_bar_default_height, navigation_bar_height, navigation_bar_height_landscape, navigation_bar_width));
+ if ((ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED)||
+ (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED)) {
+ Log.d (TAG,"ask for permission(s)");
+ ActivityCompat.requestPermissions(this,
+ new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.ACCESS_FINE_LOCATION},MY_PERMISSIONS_REQUEST_ALL);
+ }
+ // get the local language -------------
+ Locale locale = java.util.Locale.getDefault();
+ String lang = locale.getLanguage();
+ String langc = lang;
+ Log.d(TAG, "lang=" + lang);
+ int pos = lang.indexOf('_');
+ if (pos != -1)
+ {
+ langc = lang.substring(0, pos);
+ NavitLanguage = langc + lang.substring(pos).toUpperCase(locale);
+ Log.d(TAG, "substring lang " + NavitLanguage.substring(pos).toUpperCase(locale));
+ }
+ else
+ {
+ String country = locale.getCountry();
+ Log.d(TAG, "Country1 " + country);
+ Log.d(TAG, "Country2 " + country.toUpperCase(locale));
+ NavitLanguage = langc + "_" + country.toUpperCase(locale);
+ }
+ Log.d(TAG, "Language " + lang);
+
+ SharedPreferences prefs = getSharedPreferences(NAVIT_PREFS,MODE_PRIVATE);
+ map_filename_path = prefs.getString("filenamePath", Environment.getExternalStorageDirectory().getPath() + "/navit/");
+
+ // make sure the new path for the navitmap.bin file(s) exist!!
+ File navit_maps_dir = new File(map_filename_path);
+ navit_maps_dir.mkdirs();
+
+ // make sure the share dir exists
+ File navit_data_share_dir = new File(NAVIT_DATA_SHARE_DIR);
+ navit_data_share_dir.mkdirs();
+
+ Display display_ = getWindowManager().getDefaultDisplay();
+ int width_ = display_.getWidth();
+ int height_ = display_.getHeight();
+ metrics = new DisplayMetrics();
+ display_.getMetrics(Navit.metrics);
+ int densityDpi = (int)(( Navit.metrics.density*160)-.5f);
+ Log.d(TAG, "Navit -> pixels x=" + width_ + " pixels y=" + height_);
+ Log.d(TAG, "Navit -> dpi=" + densityDpi);
+ Log.d(TAG, "Navit -> density=" + Navit.metrics.density);
+ Log.d(TAG, "Navit -> scaledDensity=" + Navit.metrics.scaledDensity);
+
+ ActivityResults = new NavitActivityResult[16];
+ setVolumeControlStream(AudioManager.STREAM_MUSIC);
+ PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
+ wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE,"NavitDoNotDimScreen");
+
+ if (!extractRes(langc, NAVIT_DATA_DIR + "/locale/" + langc + "/LC_MESSAGES/navit.mo"))
+ {
+ Log.e(TAG, "Failed to extract language resource " + langc);
+ }
+
+ if (densityDpi <= 120)
+ {
+ my_display_density = "ldpi";
+ }
+ else if (densityDpi <= 160)
+ {
+ my_display_density = "mdpi";
+ }
+ else if (densityDpi < 240)
+ {
+ my_display_density = "hdpi";
+ }
+ else if (densityDpi < 320)
+ {
+ my_display_density = "xhdpi";
+ }
+ else if (densityDpi < 480)
+ {
+ my_display_density = "xxhdpi";
+ }
+ else if (densityDpi < 640)
+ {
+ my_display_density = "xxxhdpi";
+ }
+ else
+ {
+ Log.e(TAG, "found device of very high density ("+densityDpi+")");
+ Log.e(TAG, "using xxxhdpi values");
+ my_display_density = "xxxhdpi";
+ }
+
+ if (!extractRes("navit" + my_display_density, NAVIT_DATA_DIR + "/share/navit.xml"))
+ {
+ Log.e(TAG, "Failed to extract navit.xml for " + my_display_density);
+ }
+
+ Log.d(TAG, "android.os.Build.VERSION.SDK_INT=" + Integer.valueOf(android.os.Build.VERSION.SDK));
+ NavitMain(this, NavitLanguage, Integer.valueOf(android.os.Build.VERSION.SDK), my_display_density, NAVIT_DATA_DIR+"/bin/navit",map_filename_path);
+
+ showInfos();
+
+ Navit.mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
+ }
+
+ @Override
+ public void onResume()
+ {
+ super.onResume();
+ Log.d(TAG, "OnResume");
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
+ /* Required to make system bars fully transparent */
+ getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+ | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
+ }
+ //InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
+ // DEBUG
+ // intent_data = "google.navigation:q=Wien Burggasse 27";
+ // intent_data = "google.navigation:q=48.25676,16.643";
+ // intent_data = "google.navigation:ll=48.25676,16.643&q=blabla-strasse";
+ // intent_data = "google.navigation:ll=48.25676,16.643";
+ if (startup_intent != null)
+ {
+ if (System.currentTimeMillis() <= Navit.startup_intent_timestamp + 4000L)
+ {
+ Log.d(TAG, "**2**A " + startup_intent.getAction());
+ Log.d(TAG, "**2**D " + startup_intent.getDataString());
+ String navi_scheme = startup_intent.getScheme();
+ if ( navi_scheme != null && navi_scheme.equals("google.navigation")) {
+ parseNavigationURI(startup_intent.getData().getSchemeSpecificPart());
+ }
+ }
+ else {
+ Log.e(TAG, "timestamp for navigate_to expired! not using data");
+ }
+ }
+ Log.d(TAG, "onResume");
+ if (show_soft_keyboard_now_showing) {
+ /* Calling showNativeKeyboard() directly won't work here, we need to use the message queue */
+ View cf = getCurrentFocus();
+ if (cf == null)
+ Log.e(TAG, "no view in focus, can't get a handler");
+ else
+ cf.getHandler().post(new SoftInputRestorer());
+ }
+ }
+
+ @Override
+ public void onPause() {
+ super.onPause();
+ Log.d(TAG, "onPause");
+ if (show_soft_keyboard_now_showing) {
+ Log.d(TAG, "onPause:hiding soft input");
+ this.hideNativeKeyboard();
+ show_soft_keyboard_now_showing = true;
+ }
+ }
+
+ @Override
+ public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
+ switch (requestCode) {
+ case MY_PERMISSIONS_REQUEST_ALL: {
+ if (grantResults.length > 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED
+ && grantResults[1] == PackageManager.PERMISSION_GRANTED) {
+ return;
+ }
+ AlertDialog.Builder infobox = new AlertDialog.Builder(this);
+ infobox.setTitle(getString(R.string.permissions_info_box_title)); // TRANS
+ infobox.setCancelable(false);
+ infobox.setMessage(getString(R.string.permissions_not_granted));
+ // TRANS
+ infobox.setPositiveButton(getString(R.string.initial_info_box_OK), new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface arg0, int arg1) {
+ exit();
+ }
+ });
+ infobox.show();
+ }
+ }
+ }
+
+ private void parseNavigationURI(String schemeSpecificPart) {
+ String naviData[]= schemeSpecificPart.split("&");
+ Pattern p = Pattern.compile("(.*)=(.*)");
+ Map<String,String> params = new HashMap<String,String>();
+ for (int count=0; count < naviData.length; count++) {
+ Matcher m = p.matcher(naviData[count]);
+
+ if (m.matches()) {
+ params.put(m.group(1), m.group(2));
+ }
+ }
+
+ // d: google.navigation:q=blabla-strasse # (this happens when you are offline, or from contacts)
+ // a: google.navigation:ll=48.25676,16.643&q=blabla-strasse
+ // c: google.navigation:ll=48.25676,16.643
+ // b: google.navigation:q=48.25676,16.643
+
+ Float lat;
+ Float lon;
+ Bundle b = new Bundle();
+
+ String geoString = params.get("ll");
+ if (geoString != null) {
+ String address = params.get("q");
+ if (address != null) b.putString("q", address);
+ }
+ else {
+ geoString = params.get("q");
+ }
+
+ if ( geoString != null) {
+ if (geoString.matches("^[+-]{0,1}\\d+(|\\.\\d*),[+-]{0,1}\\d+(|\\.\\d*)$")) {
+ String geo[] = geoString.split(",");
+ if (geo.length == 2) {
+ try {
+ lat = Float.valueOf(geo[0]);
+ lon = Float.valueOf(geo[1]);
+ b.putFloat("lat", lat);
+ b.putFloat("lon", lon);
+ Message msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_SET_DESTINATION.ordinal());
+
+ msg.setData(b);
+ msg.sendToTarget();
+ Log.e(TAG, "target found (b): " + geoString);
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ else {
+ start_targetsearch_from_intent(geoString);
+ }
+ }
+ }
+
+ public void setActivityResult(int requestCode, NavitActivityResult ActivityResult)
+ {
+ ActivityResults[requestCode] = ActivityResult;
+ }
+
+ /*
+ * This is unused since we dont have the dropdown
+ * TODO: recheck if this is right and remove this!
+ */
+ @Override
+ public boolean onPrepareOptionsMenu(Menu menu)
+ {
+ super.onPrepareOptionsMenu(menu);
+ //Log.e("Navit","onPrepareOptionsMenu");
+ // this gets called every time the menu is opened!!
+ // change menu items here!
+ menu.clear();
+
+ // group-id,item-id,sort order number
+ //menu.add(1, 1, 100, getString(R.string.optionsmenu_zoom_in)); //TRANS
+ //menu.add(1, 2, 200, getString(R.string.optionsmenu_zoom_out)); //TRANS
+
+ menu.add(1, 3, 300, getString(R.string.optionsmenu_download_maps)); //TRANS
+ menu.add(1, 5, 400, getString(R.string.optionsmenu_toggle_poi)); //TRANS
+
+ menu.add(1, 6, 500, getString(R.string.optionsmenu_address_search)); //TRANS
+ menu.add(1, 10, 600, getString(R.string.optionsmenu_set_map_location));
+
+ menu.add(1, 99, 900, getString(R.string.optionsmenu_exit_navit)); //TRANS
+
+ /* Only show the Backup to SD-Card Option if we really have one */
+ if(Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED))
+ menu.add(1, 7, 700, getString(R.string.optionsmenu_backup_restore)); //TRANS
+
+ return true;
+ }
+
+ // define callback id here
+ private NavitGraphics N_NavitGraphics = null;
+
+ // callback id gets set here when called from NavitGraphics
+ public void setKeypressCallback(int kp_cb_id, NavitGraphics ng)
+ {
+ N_NavitGraphics = ng;
+ }
+
+ public void setMotionCallback(int mo_cb_id, NavitGraphics ng)
+ {
+ N_NavitGraphics = ng;
+ }
+
+ public NavitGraphics getNavitGraphics() {
+ return N_NavitGraphics;
+ }
+
+
+ public void start_targetsearch_from_intent(String target_address)
+ {
+ if (target_address == null || target_address.equals(""))
+ {
+ // empty search string entered
+ Toast.makeText(getApplicationContext(), getString(R.string.address_search_not_found), Toast.LENGTH_LONG).show(); //TRANS
+ }
+ else
+ {
+ Intent search_intent = new Intent(this, NavitAddressSearchActivity.class);
+ search_intent.putExtra("search_string", target_address);
+ this.startActivityForResult(search_intent, NavitAddressSearch_id);
+ }
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item)
+ {
+ runOptionsItem(item.getItemId());
+ return true;
+ }
+
+ public void runOptionsItem(int id)
+ {
+ switch (id)
+ {
+ case 1 :
+ // zoom in
+ Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_ZOOM_IN.ordinal()).sendToTarget();
+ // if we zoom, hide the bubble
+ Log.d(TAG, "onOptionsItemSelected -> zoom in");
+ break;
+ case 2 :
+ // zoom out
+ Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_ZOOM_OUT.ordinal()).sendToTarget();
+ // if we zoom, hide the bubble
+ Log.d(TAG, "onOptionsItemSelected -> zoom out");
+ break;
+ case 3 :
+ // map download menu
+ Intent map_download_list_activity = new Intent(this, NavitDownloadSelectMapActivity.class);
+ startActivityForResult(map_download_list_activity, Navit.NavitDownloaderSelectMap_id);
+ break;
+ case 5 :
+ // toggle the normal POI layers and labels (to avoid double POIs)
+ Message msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_CALL_CMD.ordinal());
+ Bundle b = new Bundle();
+ b.putString("cmd", "toggle_layer(\"POI Symbols\");");
+ msg.setData(b);
+ msg.sendToTarget();
+
+ msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_CALL_CMD.ordinal());
+ b = new Bundle();
+ b.putString("cmd", "toggle_layer(\"POI Labels\");");
+ msg.setData(b);
+ msg.sendToTarget();
+
+ // toggle full POI icons on/off
+ msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_CALL_CMD.ordinal());
+ b = new Bundle();
+ b.putString("cmd", "toggle_layer(\"Android-POI-Icons-full\");");
+ msg.setData(b);
+ msg.sendToTarget();
+
+ break;
+ case 6 :
+ // ok startup address search activity
+ Intent search_intent = new Intent(this, NavitAddressSearchActivity.class);
+ this.startActivityForResult(search_intent, NavitAddressSearch_id);
+ break;
+ case 7 :
+ /* Backup / Restore */
+ showDialog(NavitDialogs.DIALOG_BACKUP_RESTORE);
+ break;
+ case 10:
+ setMapLocation();
+ break;
+ case 99 :
+ // exit
+ this.onStop();
+ this.exit();
+ break;
+ }
+ }
+
+
+ /**
+ * @brief Shows the Options menu.
+ *
+ * Calling this method has the same effect as pressing the hardware Menu button, where present, or touching
+ * the overflow button in the Action bar.
+ */
+ public void showMenu() {
+ openOptionsMenu();
+ }
+
+
+ /**
+ * @brief Shows the native keyboard or other input method.
+ */
+ public int showNativeKeyboard() {
+ /*
+ * Apologies for the huge mess that this function is, but Android's soft input API is a big
+ * nightmare. Its devs have mercifully given us an option to show or hide the keyboard, but
+ * there is no reliable way to figure out if it is actually showing, let alone how much of the
+ * screen it occupies, so our best bet is guesswork.
+ */
+ Configuration config = getResources().getConfiguration();
+ if ((config.keyboard == Configuration.KEYBOARD_QWERTY) && (config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO))
+ /* physical keyboard present, exit */
+ return 0;
+
+ /* Use SHOW_FORCED here, else keyboard won't show in landscape mode */
+ mgr.showSoftInput(getCurrentFocus(), InputMethodManager.SHOW_FORCED);
+ show_soft_keyboard_now_showing = true;
+
+ /*
+ * Crude way to estimate the height occupied by the keyboard: for AOSP on KitKat and Lollipop it
+ * is about 62-63% of available screen width (in portrait mode) but no more than slightly above
+ * 46% of height (in landscape mode).
+ */
+ Display display_ = getWindowManager().getDefaultDisplay();
+ int width_ = display_.getWidth();
+ int height_ = display_.getHeight();
+ int maxHeight = height_ * 47 / 100;
+ int inputHeight = width_ * 63 / 100;
+ if (inputHeight > (maxHeight))
+ inputHeight = maxHeight;
+
+ /* the receiver isn't going to fire before the UI thread becomes idle, well after this method returns */
+ Log.d(TAG, "showNativeKeyboard:return (assuming true)");
+ return inputHeight;
+ }
+
+
+ /**
+ * @brief Hides the native keyboard or other input method.
+ */
+ public void hideNativeKeyboard() {
+ mgr.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
+ show_soft_keyboard_now_showing = false;
+ }
+
+
+ void setDestination(float latitude, float longitude, String address) {
+ Toast.makeText( getApplicationContext(),getString(R.string.address_search_set_destination) + "\n" + address, Toast.LENGTH_LONG).show(); //TRANS
+
+ Message msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_SET_DESTINATION.ordinal());
+ Bundle b = new Bundle();
+ b.putFloat("lat", latitude);
+ b.putFloat("lon", longitude);
+ b.putString("q", address);
+ msg.setData(b);
+ msg.sendToTarget();
+ }
+
+ protected void onActivityResult(int requestCode, int resultCode, Intent data)
+ {
+ switch (requestCode)
+ {
+ case Navit.NavitDownloaderSelectMap_id :
+ if (resultCode == Activity.RESULT_OK)
+ {
+ Message msg = dialogs.obtainMessage(NavitDialogs.MSG_START_MAP_DOWNLOAD
+ , data.getIntExtra("map_index", -1), 0);
+ msg.sendToTarget();
+ }
+ break;
+ case NavitAddressSearch_id :
+ if (resultCode == Activity.RESULT_OK) {
+ Bundle destination = data.getExtras();
+ Toast.makeText( getApplicationContext(),getString(R.string.address_search_set_destination) + "\n" + destination.getString(("q")), Toast.LENGTH_LONG).show(); //TRANS
+
+ Message msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_SET_DESTINATION.ordinal());
+ msg.setData(destination);
+ msg.sendToTarget();
+ }
+ break;
+ case NavitSelectStorage_id :
+ if(resultCode == RESULT_OK) {
+ String newDir = data.getStringExtra(FileBrowserActivity.returnDirectoryParameter);
+ Log.d(TAG, "selected path= "+newDir);
+ if(!newDir.contains("/navit"))
+ newDir = newDir+"/navit/";
+ else
+ newDir = newDir+"/";
+ SharedPreferences prefs = this.getSharedPreferences(NAVIT_PREFS,MODE_PRIVATE);
+ SharedPreferences.Editor prefs_editor = prefs.edit();
+ prefs_editor.putString("filenamePath", newDir);
+ prefs_editor.apply();
+ Toast.makeText(this, String.format(T("New location set to %s\nRestart Navit to apply the changes."),newDir),Toast.LENGTH_LONG).show();
+ }
+ else Log.w(TAG, "select path failed");
+ break;
+ default :
+ ActivityResults[requestCode].onActivityResult(requestCode, resultCode, data);
+ break;
+ }
+ }
+
+ @Override
+ protected void onPrepareDialog(int id, Dialog dialog) {
+ dialogs.prepareDialog(id);
+ super.onPrepareDialog(id, dialog);
+ }
+
+ protected Dialog onCreateDialog(int id)
+ {
+ return dialogs.createDialog(id);
+ }
+
+ @Override
+ public boolean onSearchRequested() {
+ /* Launch the internal Search Activity */
+ Intent search_intent = new Intent(this, NavitAddressSearchActivity.class);
+ this.startActivityForResult(search_intent, NavitAddressSearch_id);
+
+ return true;
+ }
+
+ private void setMapLocation()
+ {
+ Intent fileExploreIntent = new Intent(this,FileBrowserActivity.class);
+ fileExploreIntent
+ .putExtra(FileBrowserActivity.startDirectoryParameter, "/mnt")
+ .setAction(FileBrowserActivity.INTENT_ACTION_SELECT_DIR);
+ startActivityForResult(fileExploreIntent,NavitSelectStorage_id);
+ }
+
+ @Override
+ public void onDestroy()
+ {
+ super.onDestroy();
+ Log.d(TAG, "OnDestroy");
+ // next call will kill our app the hard way. This should not be necessary, but ensures navit is
+ // properly restarted and no resources are wasted with navit in background. Remove this call after
+ // code review
+ NavitDestroy();
+ }
+
+ public void fullscreen(int fullscreen) {
+ int w, h;
+
+ isFullscreen = (fullscreen != 0);
+ if (isFullscreen) {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
+ }
+ else {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
+ getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ }
+
+ Display display_ = getWindowManager().getDefaultDisplay();
+ if (Build.VERSION.SDK_INT < 17) {
+ w = display_.getWidth();
+ h = display_.getHeight();
+ } else {
+ Point size = new Point();
+ display_.getRealSize(size);
+ w = size.x;
+ h = size.y;
+ }
+ Log.d(TAG, String.format("Toggle fullscreen, w=%d, h=%d", w, h));
+ N_NavitGraphics.handleResize(w, h);
+ }
+
+ public void disableSuspend()
+ {
+ wl.acquire();
+ wl.release();
+ }
+
+ private void exit()
+ {
+ nm.cancelAll();
+ NavitVehicle.removeListener();
+ NavitDestroy();
+ }
+
+ public native void NavitMain(Navit x, String lang, int version, String display_density_string, String path, String path2);
+ public native void NavitDestroy();
+
+
+ protected String getLocalizedString(String text)
+ {
+ return NavitGraphics.CallbackLocalizedString(text);
+ }
+
+
+ /*
+ * this is used to load the 'navit' native library on
+ * application startup. The library has already been unpacked at
+ * installation time by the package manager.
+ */
+ static
+ {
+ System.loadLibrary("navit");
+ }
+}
diff --git a/navit/android/src/org/navitproject/navit/NavitAddressSearchActivity.java b/navit/android/src/org/navitproject/navit/NavitAddressSearchActivity.java
index 80d285fa5..1fbe65a86 100644
--- a/navit/android/src/org/navitproject/navit/NavitAddressSearchActivity.java
+++ b/navit/android/src/org/navitproject/navit/NavitAddressSearchActivity.java
@@ -1,385 +1,383 @@
-/**
- * Navit, a modular navigation system.
- * Copyright (C) 2005-2008 Navit Team
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-package org.navitproject.navit;
-
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Locale;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.app.ProgressDialog;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.os.Bundle;
-import android.util.Log;
-import android.util.TypedValue;
-import android.view.Gravity;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.WindowManager;
-import android.widget.AdapterView;
-import android.widget.AdapterView.OnItemClickListener;
-import android.widget.ArrayAdapter;
-import android.widget.Button;
-import android.widget.CheckBox;
-import android.widget.EditText;
-import android.widget.ImageButton;
-import android.widget.LinearLayout;
-import android.widget.ListView;
-import android.widget.RelativeLayout;
-import android.widget.Toast;
-import android.widget.RelativeLayout.LayoutParams;
-import android.widget.TextView;
-
-public class NavitAddressSearchActivity extends Activity {
- public static final class NavitAddress {
- public NavitAddress(int type, float latitude, float longitude, String address) {
- result_type = type;
- lat = latitude;
- lon = longitude;
- addr = address;
- }
-
- int result_type;
- float lat;
- float lon;
- String addr;
- }
-
- private static final String TAG = "NavitAddress";
- private static final int ADDRESS_RESULT_PROGRESS_MAX = 10;
-
- private List<NavitAddress> Addresses_found = null;
- private List<NavitAddress> addresses_shown = null;
- private String mAddressString = "";
- private boolean mPartialSearch = false;
- private String mCountry;
- private ImageButton mCountryButton;
- ProgressDialog search_results_wait = null;
- public RelativeLayout NavitAddressSearchActivity_layout;
- private int search_results_towns = 0;
- private int search_results_streets = 0;
- private int search_results_streets_hn = 0;
- private long search_handle = 0;
-
- // TODO remember settings
- private static String last_address_search_string = "";
- private static Boolean last_address_partial_match = false;
- private static String last_country = "";
-
- private int getDrawableID(String resourceName) {
- int drawableId = 0;
- try {
- Class<?> res = R.drawable.class;
- Field field = res.getField(resourceName);
- drawableId = field.getInt(null);
- } catch (Exception e) {
- Log.e("NavitAddressSearch", "Failure to get drawable id.", e);
- }
- return drawableId;
- }
-
- private void setCountryButtonImage() {
- // We have all images stored as drawable_nodpi resources which allows native code to manipulate them
- // without interference with android builtin choosing and scaling system. But that makes us to
- // reinvent the wheel here to show an image in android native interface.
- int flag_icon_sizes[]={24,32,48,64,96};
- int exact_size, nearest_size;
- exact_size=(int)(Navit.metrics.density*24.0 -.5);
- nearest_size=flag_icon_sizes[0];
- for(int size: flag_icon_sizes) {
- nearest_size=size;
- if(exact_size<=size)
- break;
- }
- mCountryButton.setImageResource(getDrawableID("country_" + mCountry+"_"+nearest_size+"_"+nearest_size));
- }
-
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- Bundle extras = getIntent().getExtras();
- if ( extras != null )
- {
- String search_string = extras.getString(("search_string"));
- if (search_string != null) {
- mPartialSearch = true;
- mAddressString = search_string;
- executeSearch();
- return;
- }
- }
-
- mPartialSearch = last_address_partial_match;
- mAddressString = last_address_search_string;
-
- getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND, WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
- LinearLayout panel = new LinearLayout(this);
- panel.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
- panel.setOrientation(LinearLayout.VERTICAL);
-
- // address: label and text field
- SharedPreferences settings = getSharedPreferences(Navit.NAVIT_PREFS, MODE_PRIVATE);
- mCountry = settings.getString(("DefaultCountry") , null);
-
- if (mCountry == null) {
- Locale defaultLocale = Locale.getDefault();
- mCountry = defaultLocale.getCountry().toLowerCase(defaultLocale);
- SharedPreferences.Editor edit_settings = settings.edit();
- edit_settings.putString("DefaultCountry", mCountry);
- edit_settings.commit();
- }
-
- mCountryButton = new ImageButton(this);
-
- setCountryButtonImage();
-
- mCountryButton.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- requestCountryDialog();
- }
- });
-
- // address: label and text field
- TextView addr_view = new TextView(this);
- addr_view.setText(Navit.T("Enter Destination")); // TRANS
- addr_view.setTextSize(TypedValue.COMPLEX_UNIT_SP, 20f);
- addr_view.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
- addr_view.setPadding(4, 4, 4, 4);
-
- // partial match checkbox
- final CheckBox checkboxPartialMatch = new CheckBox(this);
- checkboxPartialMatch.setText(Navit.T("partial match")); // TRANS
- checkboxPartialMatch.setChecked(last_address_partial_match);
- checkboxPartialMatch.setGravity(Gravity.CENTER);
-
- final EditText address_string = new EditText(this);
- address_string.setText(last_address_search_string);
- address_string.setSelectAllOnFocus(true);
-
- // search button
- final Button btnSearch = new Button(this);
- btnSearch.setText(Navit.T("Search")); // TRANS
- btnSearch.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
- btnSearch.setGravity(Gravity.CENTER);
- btnSearch.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- mPartialSearch = checkboxPartialMatch.isChecked();
- mAddressString = address_string.getText().toString();
- last_address_partial_match = mPartialSearch;
- last_address_search_string = mAddressString;
- executeSearch();
- }
- });
-
- ListView lastAddresses = new ListView(this);
- NavitAppConfig navitConfig = (NavitAppConfig) getApplicationContext();
-
- final List<NavitAddress> addresses = navitConfig.getLastAddresses();
- int addressCount = addresses.size();
- if (addressCount > 0) {
- String[] strAddresses = new String[addressCount];
- for (int addrIndex = 0; addrIndex < addressCount; addrIndex++) {
- strAddresses[addrIndex] = addresses.get(addrIndex).addr;
- }
- ArrayAdapter<String> addressList =
- new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, strAddresses);
- lastAddresses.setAdapter(addressList);
- lastAddresses.setOnItemClickListener(new OnItemClickListener() {
- public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
- NavitAddress addressSelected = addresses.get(arg2);
- Intent resultIntent = new Intent();
-
- resultIntent.putExtra("lat", addressSelected.lat);
- resultIntent.putExtra("lon", addressSelected.lon);
- resultIntent.putExtra("q", addressSelected.addr);
-
- setResult(Activity.RESULT_OK, resultIntent);
- finish();
- }
- });
- }
-
- String title = getString(R.string.address_search_title);
-
- if (title != null && title.length() > 0)
- this.setTitle(title);
-
- LinearLayout searchSettingsLayout = new LinearLayout(this);
- searchSettingsLayout.setOrientation(LinearLayout.HORIZONTAL);
-
- searchSettingsLayout.addView(mCountryButton);
- searchSettingsLayout.addView(checkboxPartialMatch);
- panel.addView(addr_view);
- panel.addView(address_string);
- panel.addView(searchSettingsLayout);
- panel.addView(btnSearch);
- panel.addView(lastAddresses);
-
- setContentView(panel);
- }
-
- private void requestCountryDialog() {
- final String[][] all_countries = NavitGraphics.GetAllCountries();
-
- Comparator<String[]> country_comperator = new Comparator<String[]>() {
- public int compare(String[] object1, String[] object2) {
- return object1[1].compareTo(object2[1]);
- }
- };
-
- Arrays.sort(all_countries, country_comperator);
-
- AlertDialog.Builder mapModeChooser = new AlertDialog.Builder(this);
- // ToDo also show icons and country code
- String[] country_name = new String[all_countries.length];
-
- for (int country_index = 0; country_index < all_countries.length; country_index++) {
- country_name[country_index] = all_countries[country_index][1];
- }
-
- mapModeChooser.setItems(country_name, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int item) {
- SharedPreferences settings = getSharedPreferences(Navit.NAVIT_PREFS, MODE_PRIVATE);
- mCountry = all_countries[item][0];
- SharedPreferences.Editor edit_settings = settings.edit();
- edit_settings.putString("DefaultCountry", mCountry);
- edit_settings.commit();
-
- setCountryButtonImage();
- }
- });
-
- AlertDialog d=mapModeChooser.create();
- d.getListView().setFastScrollEnabled(true);
- d.show();
- }
-
- /**
- * start a search on the map
- */
- public void receiveAddress(int type, float latitude, float longitude, String address) {
- Log.e(TAG, "(" + String.valueOf(latitude) + ", " + String.valueOf(longitude) + ") " + address);
-
- switch (type) {
- case 0:
- search_results_towns++;
- break;
- case 1:
- search_results_streets++;
- break;
- case 2:
- search_results_streets_hn++;
- break;
-
- }
- search_results_wait.setMessage(Navit.T("Towns") + ":" + search_results_towns + " "
- + Navit.T("Streets") + ":" + search_results_streets + "/"
- + search_results_streets_hn);
-
- search_results_wait.setProgress(Addresses_found.size() % (ADDRESS_RESULT_PROGRESS_MAX + 1));
-
- Addresses_found.add(new NavitAddress(type, latitude, longitude, address));
- }
-
- public void finishAddressSearch() {
- if (Addresses_found.isEmpty()) {
- Toast.makeText( getApplicationContext(),getString(R.string.address_search_not_found) + "\n" + mAddressString, Toast.LENGTH_LONG).show(); //TRANS
- setResult(Activity.RESULT_CANCELED);
- finish();
- }
- ListView addressesFound = new ListView(this);
- addressesFound.setFastScrollEnabled(true);
- ArrayAdapter<String> addressList =
- new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1);
-
- addresses_shown = new ArrayList<NavitAddress>();
-
- for (NavitAddress currentAddress : Addresses_found) {
- if (currentAddress.result_type != 0 || search_results_streets == 0) {
- addressList.add(currentAddress.addr);
- addresses_shown.add(currentAddress);
- }
- }
-
- addressesFound.setAdapter(addressList);
-
- addressesFound.setOnItemClickListener(new OnItemClickListener() {
- public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
- NavitAddress addressSelected = addresses_shown.get(arg2);
- Intent resultIntent = new Intent();
-
- resultIntent.putExtra("lat", addressSelected.lat);
- resultIntent.putExtra("lon", addressSelected.lon);
- resultIntent.putExtra("q", addressSelected.addr);
-
- setResult(Activity.RESULT_OK, resultIntent);
- finish();
- }
- });
-
- setContentView(addressesFound);
- search_results_wait.dismiss();
- }
-
- public native long CallbackStartAddressSearch(int partial_match, String country, String s);
- public native void CallbackCancelAddressSearch(long handle);
-
- @Override
- protected Dialog onCreateDialog(int id) {
- search_results_wait = new ProgressDialog(this);
- search_results_wait.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
- search_results_wait.setTitle("Loading search results");
- search_results_wait.setMessage("--");
- search_results_wait.setCancelable(true);
- search_results_wait.setProgress(0);
- search_results_wait.setMax(10);
-
- Addresses_found = new ArrayList<NavitAddress>();
- search_results_towns = 0;
- search_results_streets = 0;
- search_results_streets_hn = 0;
-
- search_handle = CallbackStartAddressSearch(mPartialSearch ? 1 : 0, mCountry, mAddressString);
-
- search_results_wait.setOnCancelListener(new DialogInterface.OnCancelListener() {
- @Override
- public void onCancel(DialogInterface dialog) {
- CallbackCancelAddressSearch(search_handle);
- search_handle = 0;
- search_results_wait.dismiss();
- }
- });
- return search_results_wait;
- }
-
- void executeSearch() {
- showDialog(0);
- }
-}
-
+/**
+ * Navit, a modular navigation system.
+ * Copyright (C) 2005-2008 Navit Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+package org.navitproject.navit;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Locale;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.app.ProgressDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.util.Log;
+import android.util.TypedValue;
+import android.view.Gravity;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.WindowManager;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemClickListener;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.RelativeLayout;
+import android.widget.Toast;
+import android.widget.RelativeLayout.LayoutParams;
+import android.widget.TextView;
+
+public class NavitAddressSearchActivity extends Activity {
+ public static final class NavitAddress {
+ public NavitAddress(int type, float latitude, float longitude, String address) {
+ result_type = type;
+ lat = latitude;
+ lon = longitude;
+ addr = address;
+ }
+
+ final int result_type;
+ final float lat;
+ final float lon;
+ final String addr;
+ }
+
+ private static final String TAG = "NavitAddress";
+ private static final int ADDRESS_RESULT_PROGRESS_MAX = 10;
+
+ private List<NavitAddress> Addresses_found = null;
+ private List<NavitAddress> addresses_shown = null;
+ private String mAddressString = "";
+ private boolean mPartialSearch = false;
+ private String mCountry;
+ private ImageButton mCountryButton;
+ private ProgressDialog search_results_wait = null;
+ public RelativeLayout NavitAddressSearchActivity_layout;
+ private int search_results_towns = 0;
+ private int search_results_streets = 0;
+ private int search_results_streets_hn = 0;
+ private long search_handle = 0;
+
+ // TODO remember settings
+ private static String last_address_search_string = "";
+ private static Boolean last_address_partial_match = false;
+ private static String last_country = "";
+
+ private int getDrawableID(String resourceName) {
+ int drawableId = 0;
+ try {
+ Class<?> res = R.drawable.class;
+ Field field = res.getField(resourceName);
+ drawableId = field.getInt(null);
+ } catch (Exception e) {
+ Log.e(TAG, "Failure to get drawable id.", e);
+ }
+ return drawableId;
+ }
+
+ private void setCountryButtonImage() {
+ // We have all images stored as drawable_nodpi resources which allows native code to manipulate them
+ // without interference with android builtin choosing and scaling system. But that makes us to
+ // reinvent the wheel here to show an image in android native interface.
+ int flag_icon_sizes[]={24,32,48,64,96};
+ int exact_size, nearest_size;
+ exact_size=(int)(Navit.metrics.density*24.0 -.5);
+ nearest_size=flag_icon_sizes[0];
+ for(int size: flag_icon_sizes) {
+ nearest_size=size;
+ if(exact_size<=size)
+ break;
+ }
+ mCountryButton.setImageResource(getDrawableID("country_" + mCountry+"_"+nearest_size+"_"+nearest_size));
+ }
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ Bundle extras = getIntent().getExtras();
+ if ( extras != null )
+ {
+ String search_string = extras.getString(("search_string"));
+ if (search_string != null) {
+ mPartialSearch = true;
+ mAddressString = search_string;
+ executeSearch();
+ return;
+ }
+ }
+
+ mPartialSearch = last_address_partial_match;
+ mAddressString = last_address_search_string;
+
+ getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND, WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
+ LinearLayout panel = new LinearLayout(this);
+ panel.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
+ panel.setOrientation(LinearLayout.VERTICAL);
+
+ // address: label and text field
+ SharedPreferences settings = getSharedPreferences(Navit.NAVIT_PREFS, MODE_PRIVATE);
+ mCountry = settings.getString(("DefaultCountry") , null);
+
+ if (mCountry == null) {
+ Locale defaultLocale = Locale.getDefault();
+ mCountry = defaultLocale.getCountry().toLowerCase(defaultLocale);
+ SharedPreferences.Editor edit_settings = settings.edit();
+ edit_settings.putString("DefaultCountry", mCountry);
+ edit_settings.apply();
+ }
+
+ mCountryButton = new ImageButton(this);
+
+ setCountryButtonImage();
+
+ mCountryButton.setOnClickListener(new OnClickListener() {
+ public void onClick(View v) {
+ requestCountryDialog();
+ }
+ });
+
+ // address: label and text field
+ TextView addr_view = new TextView(this);
+ addr_view.setText(Navit.getInstance().T("Enter Destination")); // TRANS
+ addr_view.setTextSize(TypedValue.COMPLEX_UNIT_SP, 20f);
+ addr_view.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
+ addr_view.setPadding(4, 4, 4, 4);
+
+ // partial match checkbox
+ final CheckBox checkboxPartialMatch = new CheckBox(this);
+ checkboxPartialMatch.setText(Navit.getInstance().T("partial match")); // TRANS
+ checkboxPartialMatch.setChecked(last_address_partial_match);
+ checkboxPartialMatch.setGravity(Gravity.CENTER);
+
+ final EditText address_string = new EditText(this);
+ address_string.setText(last_address_search_string);
+ address_string.setSelectAllOnFocus(true);
+
+ // search button
+ final Button btnSearch = new Button(this);
+ btnSearch.setText(Navit.getInstance().T("Search")); // TRANS
+ btnSearch.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
+ btnSearch.setGravity(Gravity.CENTER);
+ btnSearch.setOnClickListener(new OnClickListener() {
+ public void onClick(View v) {
+ mPartialSearch = checkboxPartialMatch.isChecked();
+ mAddressString = address_string.getText().toString();
+ last_address_partial_match = mPartialSearch;
+ last_address_search_string = mAddressString;
+ executeSearch();
+ }
+ });
+
+ ListView lastAddresses = new ListView(this);
+ NavitAppConfig navitConfig = (NavitAppConfig) getApplicationContext();
+
+ final List<NavitAddress> addresses = navitConfig.getLastAddresses();
+ int addressCount = addresses.size();
+ if (addressCount > 0) {
+ String[] strAddresses = new String[addressCount];
+ for (int addrIndex = 0; addrIndex < addressCount; addrIndex++) {
+ strAddresses[addrIndex] = addresses.get(addrIndex).addr;
+ }
+ ArrayAdapter<String> addressList =
+ new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, strAddresses);
+ lastAddresses.setAdapter(addressList);
+ lastAddresses.setOnItemClickListener(new OnItemClickListener() {
+ public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
+ NavitAddress addressSelected = addresses.get(arg2);
+ Intent resultIntent = new Intent();
+
+ resultIntent.putExtra("lat", addressSelected.lat);
+ resultIntent.putExtra("lon", addressSelected.lon);
+ resultIntent.putExtra("q", addressSelected.addr);
+
+ setResult(Activity.RESULT_OK, resultIntent);
+ finish();
+ }
+ });
+ }
+
+ String title = getString(R.string.address_search_title);
+ this.setTitle(title);
+
+ LinearLayout searchSettingsLayout = new LinearLayout(this);
+ searchSettingsLayout.setOrientation(LinearLayout.HORIZONTAL);
+
+ searchSettingsLayout.addView(mCountryButton);
+ searchSettingsLayout.addView(checkboxPartialMatch);
+ panel.addView(addr_view);
+ panel.addView(address_string);
+ panel.addView(searchSettingsLayout);
+ panel.addView(btnSearch);
+ panel.addView(lastAddresses);
+
+ setContentView(panel);
+ }
+
+ private void requestCountryDialog() {
+ final String[][] all_countries = NavitGraphics.GetAllCountries();
+
+ Comparator<String[]> country_comperator = new Comparator<String[]>() {
+ public int compare(String[] object1, String[] object2) {
+ return object1[1].compareTo(object2[1]);
+ }
+ };
+
+ Arrays.sort(all_countries, country_comperator);
+
+ AlertDialog.Builder mapModeChooser = new AlertDialog.Builder(this);
+ // ToDo also show icons and country code
+ String[] country_name = new String[all_countries.length];
+
+ for (int country_index = 0; country_index < all_countries.length; country_index++) {
+ country_name[country_index] = all_countries[country_index][1];
+ }
+
+ mapModeChooser.setItems(country_name, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int item) {
+ SharedPreferences settings = getSharedPreferences(Navit.NAVIT_PREFS, MODE_PRIVATE);
+ mCountry = all_countries[item][0];
+ SharedPreferences.Editor edit_settings = settings.edit();
+ edit_settings.putString("DefaultCountry", mCountry);
+ edit_settings.apply();
+
+ setCountryButtonImage();
+ }
+ });
+
+ AlertDialog d=mapModeChooser.create();
+ d.getListView().setFastScrollEnabled(true);
+ d.show();
+ }
+
+ /**
+ * start a search on the map
+ */
+ public void receiveAddress(int type, float latitude, float longitude, String address) {
+ Log.e(TAG, "(" + String.valueOf(latitude) + ", " + String.valueOf(longitude) + ") " + address);
+
+ switch (type) {
+ case 0:
+ search_results_towns++;
+ break;
+ case 1:
+ search_results_streets++;
+ break;
+ case 2:
+ search_results_streets_hn++;
+ break;
+
+ }
+ search_results_wait.setMessage(Navit.getInstance().T("Towns") + ":" + search_results_towns + " "
+ + Navit.getInstance().T("Streets") + ":" + search_results_streets + "/"
+ + search_results_streets_hn);
+
+ search_results_wait.setProgress(Addresses_found.size() % (ADDRESS_RESULT_PROGRESS_MAX + 1));
+
+ Addresses_found.add(new NavitAddress(type, latitude, longitude, address));
+ }
+
+ public void finishAddressSearch() {
+ if (Addresses_found.isEmpty()) {
+ Toast.makeText( getApplicationContext(),getString(R.string.address_search_not_found) + "\n" + mAddressString, Toast.LENGTH_LONG).show(); //TRANS
+ setResult(Activity.RESULT_CANCELED);
+ finish();
+ }
+ ListView addressesFound = new ListView(this);
+ addressesFound.setFastScrollEnabled(true);
+ ArrayAdapter<String> addressList =
+ new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1);
+
+ addresses_shown = new ArrayList<NavitAddress>();
+
+ for (NavitAddress currentAddress : Addresses_found) {
+ if (currentAddress.result_type != 0 || search_results_streets == 0) {
+ addressList.add(currentAddress.addr);
+ addresses_shown.add(currentAddress);
+ }
+ }
+
+ addressesFound.setAdapter(addressList);
+
+ addressesFound.setOnItemClickListener(new OnItemClickListener() {
+ public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
+ NavitAddress addressSelected = addresses_shown.get(arg2);
+ Intent resultIntent = new Intent();
+
+ resultIntent.putExtra("lat", addressSelected.lat);
+ resultIntent.putExtra("lon", addressSelected.lon);
+ resultIntent.putExtra("q", addressSelected.addr);
+
+ setResult(Activity.RESULT_OK, resultIntent);
+ finish();
+ }
+ });
+
+ setContentView(addressesFound);
+ search_results_wait.dismiss();
+ }
+
+ public native long CallbackStartAddressSearch(int partial_match, String country, String s);
+ public native void CallbackCancelAddressSearch(long handle);
+
+ @Override
+ protected Dialog onCreateDialog(int id) {
+ search_results_wait = new ProgressDialog(this);
+ search_results_wait.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
+ search_results_wait.setTitle("Loading search results");
+ search_results_wait.setMessage("--");
+ search_results_wait.setCancelable(true);
+ search_results_wait.setProgress(0);
+ search_results_wait.setMax(10);
+
+ Addresses_found = new ArrayList<NavitAddress>();
+ search_results_towns = 0;
+ search_results_streets = 0;
+ search_results_streets_hn = 0;
+
+ search_handle = CallbackStartAddressSearch(mPartialSearch ? 1 : 0, mCountry, mAddressString);
+
+ search_results_wait.setOnCancelListener(new DialogInterface.OnCancelListener() {
+ @Override
+ public void onCancel(DialogInterface dialog) {
+ CallbackCancelAddressSearch(search_handle);
+ search_handle = 0;
+ search_results_wait.dismiss();
+ }
+ });
+ return search_results_wait;
+ }
+
+ private void executeSearch() {
+ showDialog(0);
+ }
+}
+
diff --git a/navit/android/src/org/navitproject/navit/NavitAppConfig.java b/navit/android/src/org/navitproject/navit/NavitAppConfig.java
index 1a1a61f94..7cc5a6173 100755
--- a/navit/android/src/org/navitproject/navit/NavitAppConfig.java
+++ b/navit/android/src/org/navitproject/navit/NavitAppConfig.java
@@ -1,71 +1,70 @@
-package org.navitproject.navit;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.navitproject.navit.NavitAddressSearchActivity.NavitAddress;
-
-import android.app.Application;
-import android.content.SharedPreferences;
-import android.util.Log;
-
-
-public class NavitAppConfig extends Application {
-
- private static final int MAX_LAST_ADDRESSES = 10;
- private static final String TAG = "Navit";
-
- private List<NavitAddress> mLastAddresses = null;
- private int mLastAddressField;
- private SharedPreferences mSettings;
-
- @Override
- public void onCreate() {
- mSettings = getSharedPreferences(Navit.NAVIT_PREFS, MODE_PRIVATE);
- super.onCreate();
- }
-
- public List<NavitAddress> getLastAddresses() {
- if (mLastAddresses == null) {
- mLastAddresses = new ArrayList<NavitAddress>();
- int mLastAddressField = mSettings.getInt("LastAddress", -1);
- if (mLastAddressField >= 0) {
- int index = mLastAddressField;
- do {
- String addr_str = mSettings.getString("LastAddress_" + String.valueOf(index), "");
-
- if (addr_str.length() > 0) {
- mLastAddresses.add(new NavitAddress(
- 1,
- mSettings.getFloat("LastAddress_Lat_" + String.valueOf(index), 0),
- mSettings.getFloat("LastAddress_Lon_" + String.valueOf(index), 0),
- addr_str));
- }
-
- if (--index < 0) index = MAX_LAST_ADDRESSES - 1;
-
- } while (index != mLastAddressField);
- }
- }
- return mLastAddresses;
- }
-
- public void addLastAddress(NavitAddress newAddress) {
- getLastAddresses();
-
- mLastAddresses.add(newAddress);
- if (mLastAddresses.size() > MAX_LAST_ADDRESSES) mLastAddresses.remove(0);
-
- mLastAddressField++;
- if (mLastAddressField >= MAX_LAST_ADDRESSES) mLastAddressField = 0;
-
- SharedPreferences.Editor editSettings = mSettings.edit();
-
- editSettings.putInt("LastAddress", mLastAddressField);
- editSettings.putString("LastAddress_" + String.valueOf(mLastAddressField), newAddress.addr);
- editSettings.putFloat("LastAddress_Lat_" + String.valueOf(mLastAddressField), newAddress.lat);
- editSettings.putFloat("LastAddress_Lon_" + String.valueOf(mLastAddressField), newAddress.lon);
-
- editSettings.commit();
- }
-}
+package org.navitproject.navit;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.navitproject.navit.NavitAddressSearchActivity.NavitAddress;
+
+import android.app.Application;
+import android.content.SharedPreferences;
+
+
+public class NavitAppConfig extends Application {
+
+ private static final int MAX_LAST_ADDRESSES = 10;
+ private static final String TAG = "Navit";
+
+ private List<NavitAddress> mLastAddresses = null;
+ private int mLastAddressField;
+ private SharedPreferences mSettings;
+
+ @Override
+ public void onCreate() {
+ mSettings = getSharedPreferences(Navit.NAVIT_PREFS, MODE_PRIVATE);
+ super.onCreate();
+ }
+
+ public List<NavitAddress> getLastAddresses() {
+ if (mLastAddresses == null) {
+ mLastAddresses = new ArrayList<NavitAddress>();
+ int mLastAddressField = mSettings.getInt("LastAddress", -1);
+ if (mLastAddressField >= 0) {
+ int index = mLastAddressField;
+ do {
+ String addr_str = mSettings.getString("LastAddress_" + String.valueOf(index), "");
+
+ if (addr_str.length() > 0) {
+ mLastAddresses.add(new NavitAddress(
+ 1,
+ mSettings.getFloat("LastAddress_Lat_" + String.valueOf(index), 0),
+ mSettings.getFloat("LastAddress_Lon_" + String.valueOf(index), 0),
+ addr_str));
+ }
+
+ if (--index < 0) index = MAX_LAST_ADDRESSES - 1;
+
+ } while (index != mLastAddressField);
+ }
+ }
+ return mLastAddresses;
+ }
+
+ public void addLastAddress(NavitAddress newAddress) {
+ getLastAddresses();
+
+ mLastAddresses.add(newAddress);
+ if (mLastAddresses.size() > MAX_LAST_ADDRESSES) mLastAddresses.remove(0);
+
+ mLastAddressField++;
+ if (mLastAddressField >= MAX_LAST_ADDRESSES) mLastAddressField = 0;
+
+ SharedPreferences.Editor editSettings = mSettings.edit();
+
+ editSettings.putInt("LastAddress", mLastAddressField);
+ editSettings.putString("LastAddress_" + String.valueOf(mLastAddressField), newAddress.addr);
+ editSettings.putFloat("LastAddress_Lat_" + String.valueOf(mLastAddressField), newAddress.lat);
+ editSettings.putFloat("LastAddress_Lon_" + String.valueOf(mLastAddressField), newAddress.lon);
+
+ editSettings.apply();
+ }
+}
diff --git a/navit/android/src/org/navitproject/navit/NavitDialogs.java b/navit/android/src/org/navitproject/navit/NavitDialogs.java
index 10f30d5b3..3d39227c4 100644
--- a/navit/android/src/org/navitproject/navit/NavitDialogs.java
+++ b/navit/android/src/org/navitproject/navit/NavitDialogs.java
@@ -19,24 +19,22 @@ public class NavitDialogs extends Handler{
// Dialogs
public static final int DIALOG_MAPDOWNLOAD = 1;
public static final int DIALOG_BACKUP_RESTORE = 2;
- public static final int DIALOG_SELECT_BACKUP = 3;
+ private static final int DIALOG_SELECT_BACKUP = 3;
// dialog messages
static final int MSG_MAP_DOWNLOAD_FINISHED = 0;
static final int MSG_PROGRESS_BAR = 1;
static final int MSG_TOAST = 2;
static final int MSG_TOAST_LONG = 3;
- static final int MSG_POSITION_MENU = 6;
- static final int MSG_START_MAP_DOWNLOAD = 7;
- static final int MSG_REMOVE_DIALOG_GENERIC = 99;
- static Handler mHandler;
-
+ static final int MSG_START_MAP_DOWNLOAD = 7;
+ private static final int MSG_REMOVE_DIALOG_GENERIC = 99;
+ private static Handler mHandler;
+ private final String TAG = "NavitDialogs";
private ProgressDialog mapdownloader_dialog = null;
private NavitMapDownloader mapdownloader = null;
-
private Navit mActivity;
- public NavitDialogs(Navit activity) {
+ NavitDialogs(Navit activity) {
super();
mActivity = activity;
mHandler = this;
@@ -69,12 +67,12 @@ public class NavitDialogs extends Handler{
mActivity.removeDialog(DIALOG_MAPDOWNLOAD);
if (msg.getData().getInt("value1") == 1) {
Message msg_out =
- Message.obtain(Navit.N_NavitGraphics.callback_handler,
+ Message.obtain(Navit.getInstance().getNavitGraphics().callback_handler,
NavitGraphics.msg_type.CLB_LOAD_MAP.ordinal());
msg_out.setData(msg.getData());
msg_out.sendToTarget();
- msg_out = Message.obtain(Navit.N_NavitGraphics.callback_handler,
+ msg_out = Message.obtain(Navit.getInstance().getNavitGraphics().callback_handler,
NavitGraphics.msg_type.CLB_CALL_CMD.ordinal());
Bundle b = new Bundle();
int mi=msg.getData().getInt("value2");
@@ -102,7 +100,7 @@ public class NavitDialogs extends Handler{
case MSG_START_MAP_DOWNLOAD:
{
int download_map_id = msg.arg1;
- Log.d("Navit", "PRI id=" + download_map_id);
+ Log.d(TAG, "PRI id=" + download_map_id);
// set map id to download
// show the map download progressbar, and download the map
@@ -140,7 +138,7 @@ public class NavitDialogs extends Handler{
{
public void onDismiss(DialogInterface dialog)
{
- Log.e("Navit", "onDismiss: mapdownloader_dialog");
+ Log.e(TAG, "onDismiss: mapdownloader_dialog");
if(mapdownloader!=null)
mapdownloader.stop_thread();
}
@@ -148,7 +146,7 @@ public class NavitDialogs extends Handler{
mapdownloader_dialog.setOnDismissListener(onDismissListener);
// show license for OSM maps
Toast.makeText(mActivity.getApplicationContext(),
- Navit.T("Map data (c) OpenStreetMap contributors, ODBL"),
+ Navit.getInstance().T("Map data (c) OpenStreetMap contributors, ODBL"),
Toast.LENGTH_LONG).show(); //TRANS
return mapdownloader_dialog;
@@ -209,7 +207,7 @@ public class NavitDialogs extends Handler{
return null;
}
- public void prepareDialog(int id, Dialog dialog) {
+ public void prepareDialog(int id) {
/* Remove the Dialog to force Android to rerun onCreateDialog */
if(id == DIALOG_SELECT_BACKUP)
diff --git a/navit/android/src/org/navitproject/navit/NavitDownloadSelectMapActivity.java b/navit/android/src/org/navitproject/navit/NavitDownloadSelectMapActivity.java
index 9cc056e31..3c47cef1a 100644
--- a/navit/android/src/org/navitproject/navit/NavitDownloadSelectMapActivity.java
+++ b/navit/android/src/org/navitproject/navit/NavitDownloadSelectMapActivity.java
@@ -1,238 +1,241 @@
-/**
- * Navit, a modular navigation system.
- * Copyright (C) 2005-2008 Navit Team
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-package org.navitproject.navit;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.app.ExpandableListActivity;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.location.Location;
-import android.location.LocationManager;
-import android.os.Bundle;
-import android.os.Message;
-import android.os.StatFs;
-import android.util.Log;
-import android.view.View;
-import android.widget.ExpandableListView;
-import android.widget.RelativeLayout;
-import android.widget.SimpleExpandableListAdapter;
-import android.widget.TextView;
-
-public class NavitDownloadSelectMapActivity extends ExpandableListActivity {
-
- private static SimpleExpandableListAdapter adapter = null;
- private static final String MAP_BULLETPOINT = " * ";
- private static ArrayList<HashMap<String, String>> downloaded_maps_childs = null;
- private static ArrayList<HashMap<String, String>> maps_current_position_childs = null;
- private static boolean currentLocationKnown = false;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- if (adapter == null) {
- adapter = createAdapter();
- }
- updateDownloadedMaps();
- updateMapsForLocation(NavitMapDownloader.osm_maps);
- setListAdapter(adapter);
- try {
- setTitle(String.valueOf(getFreeSpace() / 1024 / 1024) + "MB available");
- } catch (Exception e) {
- Log.e("Navit","Exception "+e.getClass().getName()+" during getFreeSpace, reporting 'no sdcard present'");
- NavitDialogs.sendDialogMessage(NavitDialogs.MSG_TOAST_LONG, null,
- String.format(Navit.T("Current map location %s is not available\nPlease restart Navit after you attach an SD card or select a different map location."),Navit.map_filename_path),
- -1, 0, 0);
- finish();
- }
- }
-
- protected long getFreeSpace()
- {
- StatFs fsInfo = new StatFs(Navit.map_filename_path);
- return (long)fsInfo.getAvailableBlocks() * fsInfo.getBlockSize();
- }
-
- private void updateDownloadedMaps() {
- downloaded_maps_childs.clear();
- for (NavitMap map : NavitMapDownloader.getAvailableMaps()) {
- HashMap<String, String> child = new HashMap<String, String>();
- child.put("map_name", map.mapName + " " + (map.size() / 1024 / 1024) + "MB");
- child.put("map_location", map.getLocation());
- downloaded_maps_childs.add(child);
- }
- }
-
- private void updateMapsForLocation(NavitMapDownloader.osm_map_values osm_maps[]) {
- Location currentLocation = NavitVehicle.lastLocation;
- if (maps_current_position_childs.size() == 0 || (currentLocation != null && !currentLocationKnown)) {
- if (currentLocation == null) {
- LocationManager mapLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
- List<String> providers = mapLocationManager.getProviders(true);
- long lastUpdate = 0;
- long bestUpdateTime = -1;
- for (String provider : providers) {
- Location lastKnownLocation = mapLocationManager.getLastKnownLocation(provider);
- if (lastKnownLocation != null) {
- lastUpdate = lastKnownLocation.getTime();
- if (lastUpdate > bestUpdateTime) {
- currentLocation = lastKnownLocation;
- bestUpdateTime = lastUpdate;
- }
- }
- }
- } else currentLocationKnown = true;
-
- if (currentLocation != null) {
- // if this map contains data to our current position, add it to
- // the
- // MapsOfCurrentLocation-list
- for (int currentMapIndex = 0; currentMapIndex < osm_maps.length; currentMapIndex++) {
- if (osm_maps[currentMapIndex].isInMap(currentLocation)) {
- HashMap<String, String> currentPositionMapChild = new HashMap<String, String>();
- currentPositionMapChild.put("map_name", osm_maps[currentMapIndex].map_name + " "
- + (osm_maps[currentMapIndex].est_size_bytes / 1024 / 1024) + "MB");
- currentPositionMapChild.put("map_index", String.valueOf(currentMapIndex));
-
- maps_current_position_childs.add(currentPositionMapChild);
- }
- }
- }
- }
- }
-
- private SimpleExpandableListAdapter createAdapter() {
-
- NavitMapDownloader.osm_map_values osm_maps[] = NavitMapDownloader.osm_maps;
-
- ArrayList<HashMap<String, String>> resultGroups = new ArrayList<HashMap<String, String>>();
- ArrayList<ArrayList<HashMap<String, String>>> resultChilds =
- new ArrayList<ArrayList<HashMap<String, String>>>();
-
- // add already downloaded maps (group and empty child list
- HashMap<String, String> downloaded_maps_hash = new HashMap<String, String>();
- downloaded_maps_hash.put("category_name", Navit.T("Downloaded maps"));
- resultGroups.add(downloaded_maps_hash);
- downloaded_maps_childs = new ArrayList<HashMap<String, String>>();
- resultChilds.add(downloaded_maps_childs);
-
- ArrayList<HashMap<String, String>> secList = new ArrayList<HashMap<String, String>>();
- maps_current_position_childs = new ArrayList<HashMap<String, String>>();
- // maps containing the current location
- HashMap<String, String> matching_maps = new HashMap<String, String>();
- matching_maps.put("category_name", Navit.NavitResources.getString(R.string.maps_for_current_location));
- resultGroups.add(matching_maps);
- resultChilds.add(maps_current_position_childs);
-
- // add all maps
- for (int currentMapIndex = 0; currentMapIndex < osm_maps.length; currentMapIndex++) {
- if (osm_maps[currentMapIndex].level == 0) {
- if (secList != null && secList.size() > 0) {
- resultChilds.add(secList);
- }
- secList = new ArrayList<HashMap<String, String>>();
- HashMap<String, String> map_info_hash = new HashMap<String, String>();
- map_info_hash.put("category_name", osm_maps[currentMapIndex].map_name);
- resultGroups.add(map_info_hash);
- }
-
- HashMap<String, String> child = new HashMap<String, String>();
- child.put("map_name", (osm_maps[currentMapIndex].level > 1 ? MAP_BULLETPOINT : "")
- + osm_maps[currentMapIndex].map_name + " "
- + (osm_maps[currentMapIndex].est_size_bytes / 1024 / 1024) + "MB");
- child.put("map_index", String.valueOf(currentMapIndex));
-
- secList.add(child);
- }
- resultChilds.add(secList);
-
- return new SimpleExpandableListAdapter(this, resultGroups, android.R.layout.simple_expandable_list_item_1,
- new String[] { "category_name" }, new int[] { android.R.id.text1 }, resultChilds,
- android.R.layout.simple_expandable_list_item_1, new String[] { "map_name" },
- new int[] { android.R.id.text1 });
- }
-
- @Override
- public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
- super.onChildClick(parent, v, groupPosition, childPosition, id);
- Log.d("Navit", "p:" + groupPosition + ", child_pos:" + childPosition);
-
- @SuppressWarnings("unchecked")
- HashMap<String, String> child = (HashMap<String, String>) adapter.getChild(groupPosition, childPosition);
-
- String map_index = child.get("map_index");
- if (map_index != null) {
- int mi=Integer.parseInt(map_index);
- if(NavitMapDownloader.osm_maps[mi].est_size_bytes/1024/1024/950>=4) {
- NavitDialogs.sendDialogMessage(NavitDialogs.MSG_TOAST_LONG, null,
- Navit.T("Sorry, we currently do not support maps above 3.8G on Android, please select a smaller one."),
- -1, 0, 0);
- return true;
- }
- Intent resultIntent = new Intent();
- resultIntent.putExtra("map_index", mi);
- setResult(Activity.RESULT_OK, resultIntent);
- finish();
- } else {
- // ask user if to delete this map
- askForMapDeletion(child.get("map_location"));
- }
- return true;
- }
-
- private void askForMapDeletion(final String map_location) {
- AlertDialog.Builder deleteMapBox = new AlertDialog.Builder(this);
- deleteMapBox.setTitle(R.string.map_delete); // Android also takes recource id
- deleteMapBox.setCancelable(true);
-
- NavitMap maptoDelete = new NavitMap(map_location);
- deleteMapBox.setMessage(maptoDelete.mapName + " " + String.valueOf(maptoDelete.size() / 1024 / 1024) + "MB");
-
-
- // TRANS
- deleteMapBox.setPositiveButton(getString(R.string.yes), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface arg0, int arg1) {
- Log.e("Navit", "Delete Map");
- Message msg =
- Message.obtain(Navit.N_NavitGraphics.callback_handler,
- NavitGraphics.msg_type.CLB_DELETE_MAP.ordinal());
- Bundle b = new Bundle();
- b.putString("title", map_location);
- msg.setData(b);
- msg.sendToTarget();
- finish();
- }
- });
-
- // TRANS
- deleteMapBox.setNegativeButton(getString(R.string.no), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface arg0, int arg1) {
- Log.e("Navit", "don't delete map");
- }
- });
- deleteMapBox.show();
- }
-}
+/**
+ * Navit, a modular navigation system.
+ * Copyright (C) 2005-2008 Navit Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+package org.navitproject.navit;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import android.Manifest;
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.ExpandableListActivity;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.location.Location;
+import android.location.LocationManager;
+import android.os.Bundle;
+import android.os.Message;
+import android.os.StatFs;
+import android.support.v4.app.ActivityCompat;
+import android.util.Log;
+import android.view.View;
+import android.widget.ExpandableListView;
+import android.widget.SimpleExpandableListAdapter;
+
+public class NavitDownloadSelectMapActivity extends ExpandableListActivity {
+
+ private static final String TAG = "DownloadSelectMap";
+ private static SimpleExpandableListAdapter adapter = null;
+ private static final String MAP_BULLETPOINT = " * ";
+ private static ArrayList<HashMap<String, String>> downloaded_maps_childs = null;
+ private static ArrayList<HashMap<String, String>> maps_current_position_childs = null;
+ private static boolean currentLocationKnown = false;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ if (adapter == null) {
+ adapter = createAdapter();
+ }
+ updateDownloadedMaps();
+ updateMapsForLocation(NavitMapDownloader.osm_maps);
+ setListAdapter(adapter);
+ try {
+ setTitle(String.valueOf(getFreeSpace() / 1024 / 1024) + "MB available");
+ } catch (Exception e) {
+ Log.e(TAG, "Exception " + e.getClass().getName() + " during getFreeSpace, reporting 'no sdcard present'");
+ NavitDialogs.sendDialogMessage(NavitDialogs.MSG_TOAST_LONG, null,
+ String.format(Navit.getInstance().T("Current map location %s is not available\nPlease restart Navit after you attach an SD card or select a different map location."), Navit.map_filename_path),
+ -1, 0, 0);
+ finish();
+ }
+ }
+
+ private long getFreeSpace() {
+ StatFs fsInfo = new StatFs(Navit.map_filename_path);
+ return (long) fsInfo.getAvailableBlocks() * fsInfo.getBlockSize();
+ }
+
+ private void updateDownloadedMaps() {
+ downloaded_maps_childs.clear();
+ for (NavitMap map : NavitMapDownloader.getAvailableMaps()) {
+ HashMap<String, String> child = new HashMap<String, String>();
+ child.put("map_name", map.mapName + " " + (map.size() / 1024 / 1024) + "MB");
+ child.put("map_location", map.getLocation());
+ downloaded_maps_childs.add(child);
+ }
+ }
+
+ private void updateMapsForLocation(NavitMapDownloader.osm_map_values osm_maps[]) {
+ Location currentLocation = NavitVehicle.lastLocation;
+ if (maps_current_position_childs.size() == 0 || (currentLocation != null && !currentLocationKnown)) {
+ if (currentLocation == null) {
+ LocationManager mapLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
+ List<String> providers = mapLocationManager.getProviders(true);
+ long lastUpdate;
+ long bestUpdateTime = -1;
+ for (String provider : providers) {
+ if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
+ && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
+ return;
+ }
+ Location lastKnownLocation = mapLocationManager.getLastKnownLocation(provider);
+ if (lastKnownLocation != null) {
+ lastUpdate = lastKnownLocation.getTime();
+ if (lastUpdate > bestUpdateTime) {
+ currentLocation = lastKnownLocation;
+ bestUpdateTime = lastUpdate;
+ }
+ }
+ }
+ } else currentLocationKnown = true;
+
+ if (currentLocation != null) {
+ // if this map contains data to our current position, add it to
+ // the MapsOfCurrentLocation-list
+ for (int currentMapIndex = 0; currentMapIndex < osm_maps.length; currentMapIndex++) {
+ if (osm_maps[currentMapIndex].isInMap(currentLocation)) {
+ HashMap<String, String> currentPositionMapChild = new HashMap<String, String>();
+ currentPositionMapChild.put("map_name", osm_maps[currentMapIndex].map_name + " "
+ + (osm_maps[currentMapIndex].est_size_bytes / 1024 / 1024) + "MB");
+ currentPositionMapChild.put("map_index", String.valueOf(currentMapIndex));
+
+ maps_current_position_childs.add(currentPositionMapChild);
+ }
+ }
+ }
+ }
+ }
+
+ private SimpleExpandableListAdapter createAdapter() {
+
+ NavitMapDownloader.osm_map_values osm_maps[] = NavitMapDownloader.osm_maps;
+
+ ArrayList<HashMap<String, String>> resultGroups = new ArrayList<HashMap<String, String>>();
+ ArrayList<ArrayList<HashMap<String, String>>> resultChilds =
+ new ArrayList<ArrayList<HashMap<String, String>>>();
+
+ // add already downloaded maps (group and empty child list
+ HashMap<String, String> downloaded_maps_hash = new HashMap<String, String>();
+ downloaded_maps_hash.put("category_name", Navit.getInstance().T(getString(R.string.maps_installed)));
+ resultGroups.add(downloaded_maps_hash);
+ downloaded_maps_childs = new ArrayList<HashMap<String, String>>();
+ resultChilds.add(downloaded_maps_childs);
+
+ ArrayList<HashMap<String, String>> secList = new ArrayList<HashMap<String, String>>();
+ maps_current_position_childs = new ArrayList<HashMap<String, String>>();
+ // maps containing the current location
+ HashMap<String, String> matching_maps = new HashMap<String, String>();
+ matching_maps.put("category_name", Navit.getInstance().T(getString(R.string.maps_for_current_location)));
+ resultGroups.add(matching_maps);
+ resultChilds.add(maps_current_position_childs);
+
+ // add all maps
+ for (int currentMapIndex = 0; currentMapIndex < osm_maps.length; currentMapIndex++) {
+ if (osm_maps[currentMapIndex].level == 0) {
+ if (secList.size() > 0) {
+ resultChilds.add(secList);
+ }
+ secList = new ArrayList<HashMap<String, String>>();
+ HashMap<String, String> map_info_hash = new HashMap<String, String>();
+ map_info_hash.put("category_name", osm_maps[currentMapIndex].map_name);
+ resultGroups.add(map_info_hash);
+ }
+
+ HashMap<String, String> child = new HashMap<String, String>();
+ child.put("map_name", (osm_maps[currentMapIndex].level > 1 ? MAP_BULLETPOINT : "")
+ + osm_maps[currentMapIndex].map_name + " "
+ + (osm_maps[currentMapIndex].est_size_bytes / 1024 / 1024) + "MB");
+ child.put("map_index", String.valueOf(currentMapIndex));
+
+ secList.add(child);
+ }
+ resultChilds.add(secList);
+
+ return new SimpleExpandableListAdapter(this, resultGroups, android.R.layout.simple_expandable_list_item_1,
+ new String[] { "category_name" }, new int[] { android.R.id.text1 }, resultChilds,
+ android.R.layout.simple_expandable_list_item_1, new String[] { "map_name" },
+ new int[] { android.R.id.text1 });
+ }
+
+ @Override
+ public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
+ super.onChildClick(parent, v, groupPosition, childPosition, id);
+ Log.d(TAG, "p:" + groupPosition + ", child_pos:" + childPosition);
+
+ @SuppressWarnings("unchecked")
+ HashMap<String, String> child = (HashMap<String, String>) adapter.getChild(groupPosition, childPosition);
+
+ String map_index = child.get("map_index");
+ if (map_index != null) {
+ int mi=Integer.parseInt(map_index);
+ if(NavitMapDownloader.osm_maps[mi].est_size_bytes/1024/1024/950>=4) {
+ NavitDialogs.sendDialogMessage(NavitDialogs.MSG_TOAST_LONG, null,
+ Navit.getInstance().T("Sorry, we currently do not support maps above 3.8G on Android, please select a smaller one."),
+ -1, 0, 0);
+ return true;
+ }
+ Intent resultIntent = new Intent();
+ resultIntent.putExtra("map_index", mi);
+ setResult(Activity.RESULT_OK, resultIntent);
+ finish();
+ } else {
+ // ask user if to delete this map
+ askForMapDeletion(child.get("map_location"));
+ }
+ return true;
+ }
+
+ private void askForMapDeletion(final String map_location) {
+ AlertDialog.Builder deleteMapBox = new AlertDialog.Builder(this);
+ deleteMapBox.setTitle(R.string.map_delete); // Android also takes recource id
+ deleteMapBox.setCancelable(true);
+
+ NavitMap maptoDelete = new NavitMap(map_location);
+ deleteMapBox.setMessage(maptoDelete.mapName + " " + String.valueOf(maptoDelete.size() / 1024 / 1024) + "MB");
+
+ // TRANS
+ deleteMapBox.setPositiveButton(Navit.getInstance().T(getString(R.string.yes)), new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface arg0, int arg1) {
+ Log.d(TAG, "Delete Map");
+ Message msg =
+ Message.obtain(Navit.getInstance().getNavitGraphics().callback_handler,
+ NavitGraphics.msg_type.CLB_DELETE_MAP.ordinal());
+ Bundle b = new Bundle();
+ b.putString("title", map_location);
+ msg.setData(b);
+ msg.sendToTarget();
+ finish();
+ }
+ });
+
+ // TRANS
+ deleteMapBox.setNegativeButton(Navit.getInstance().T(getString(R.string.no)), new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface arg0, int arg1) {
+ Log.d(TAG, "don't delete map");
+ }
+ });
+ deleteMapBox.show();
+ }
+}
diff --git a/navit/android/src/org/navitproject/navit/NavitGraphics.java b/navit/android/src/org/navitproject/navit/NavitGraphics.java
index a2d8e405f..35b44cf0f 100644
--- a/navit/android/src/org/navitproject/navit/NavitGraphics.java
+++ b/navit/android/src/org/navitproject/navit/NavitGraphics.java
@@ -23,13 +23,12 @@ import java.io.File;
import java.lang.reflect.Method;
import java.util.ArrayList;
+import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.res.Configuration;
-import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
-import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Path;
@@ -38,7 +37,7 @@ import android.graphics.Rect;
import android.os.Build;
import android.os.Handler;
import android.os.Message;
-import android.util.FloatMath;
+import android.support.v4.view.ViewConfigurationCompat;
import android.util.Log;
import android.view.ContextMenu;
import android.view.Gravity;
@@ -55,32 +54,31 @@ import android.widget.RelativeLayout;
public class NavitGraphics
{
- private NavitGraphics parent_graphics;
- private ArrayList<NavitGraphics> overlays = new ArrayList<NavitGraphics>();
- int bitmap_w;
- int bitmap_h;
- int pos_x;
- int pos_y;
- int pos_wraparound;
- int overlay_disabled;
- int bgcolor;
- float trackball_x, trackball_y;
- View view;
- SystemBarTintView navigationTintView;
- SystemBarTintView statusTintView;
- FrameLayout frameLayout;
- RelativeLayout relativelayout;
- NavitCamera camera;
- Activity activity;
-
- public static Boolean in_map = false;
-
+ private static final String TAG = "NavitGraphics";
+ private final NavitGraphics parent_graphics;
+ private final ArrayList<NavitGraphics> overlays = new ArrayList<NavitGraphics>();
+ private int bitmap_w;
+ private int bitmap_h;
+ private int pos_x;
+ private int pos_y;
+ private int pos_wraparound;
+ private int overlay_disabled;
+ private int bgcolor;
+ private float trackball_x, trackball_y;
+ private View view;
+ private SystemBarTintView navigationTintView;
+ private SystemBarTintView statusTintView;
+ private FrameLayout frameLayout;
+ private RelativeLayout relativelayout;
+ private NavitCamera camera;
+ private Navit activity;
+ private static Boolean in_map = false;
// for menu key
- private static long time_for_long_press = 300L;
- private static long interval_for_long_press = 200L;
+ private static final long time_for_long_press = 300L;
+
private Handler timer_handler = new Handler();
-
+
public void setBackgroundColor(int bgcolor) {
this.bgcolor = bgcolor;
if (navigationTintView != null)
@@ -89,7 +87,7 @@ public class NavitGraphics
statusTintView.setBackgroundColor(bgcolor);
}
- public void SetCamera(int use_camera)
+ private void SetCamera(int use_camera)
{
if (use_camera != 0 && camera == null)
{
@@ -100,7 +98,7 @@ public class NavitGraphics
}
}
- protected Rect get_rect()
+ private Rect get_rect()
{
Rect ret=new Rect();
ret.left=pos_x;
@@ -136,9 +134,9 @@ public class NavitGraphics
Method eventGetX = null;
Method eventGetY = null;
-
- public PointF mPressedPosition = null;
-
+
+ PointF mPressedPosition = null;
+
public NavitView(Context context) {
super(context);
try
@@ -148,17 +146,17 @@ public class NavitGraphics
}
catch (Exception e)
{
- Log.e("NavitGraphics", "Multitouch zoom not supported");
+ Log.e(TAG, "Multitouch zoom not supported");
}
}
@Override
protected void onCreateContextMenu(ContextMenu menu) {
super.onCreateContextMenu(menu);
-
- menu.setHeaderTitle(Navit.T("Position")+"..");
- menu.add(1, 1, NONE, Navit.T("Route to here")).setOnMenuItemClickListener(this);
- menu.add(1, 2, NONE, Navit.T("Cancel")).setOnMenuItemClickListener(this);
+
+ menu.setHeaderTitle(activity.T("Position")+"..");
+ menu.add(1, 1, NONE, activity.T("Route to here")).setOnMenuItemClickListener(this);
+ menu.add(1, 2, NONE, activity.T("Cancel")).setOnMenuItemClickListener(this);
}
@Override
@@ -198,8 +196,6 @@ public class NavitGraphics
{
if (Navit.mgr != null)
{
- //Log.e("NavitGraphics", "view -> SHOW SoftInput");
- //Log.e("NavitGraphics", "view mgr=" + String.valueOf(Navit.mgr));
Navit.mgr.showSoftInput(this, InputMethodManager.SHOW_IMPLICIT);
Navit.show_soft_keyboard_now_showing = true;
// clear the variable now, keyboard will stay on screen until backbutton pressed
@@ -212,18 +208,18 @@ public class NavitGraphics
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh)
{
- Log.e("Navit", "NavitGraphics -> onSizeChanged pixels x=" + w + " pixels y=" + h);
- Log.e("Navit", "NavitGraphics -> onSizeChanged density=" + Navit.metrics.density);
- Log.e("Navit", "NavitGraphics -> onSizeChanged scaledDensity="
+ Log.d(TAG, "onSizeChanged pixels x=" + w + " pixels y=" + h);
+ Log.d(TAG, "onSizeChanged density=" + Navit.metrics.density);
+ Log.d(TAG, "onSizeChanged scaledDensity="
+ Navit.metrics.scaledDensity);
super.onSizeChanged(w, h, oldw, oldh);
handleResize(w, h);
}
- public void do_longpress_action()
+ void do_longpress_action()
{
- Log.e("NavitGraphics", "do_longpress_action enter");
+ Log.d(TAG, "do_longpress_action enter");
activity.openContextMenu(this);
}
@@ -243,15 +239,16 @@ public class NavitGraphics
e.printStackTrace();
}
}
- catch (NoSuchFieldException ex) {}
-
+ catch (NoSuchFieldException ex) {
+ ex.printStackTrace();
+ }
return ret_value;
}
+ @SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouchEvent(MotionEvent event)
{
- //Log.e("NavitGraphics", "onTouchEvent");
super.onTouchEvent(event);
int x = (int) event.getX();
int y = (int) event.getY();
@@ -275,91 +272,74 @@ public class NavitGraphics
}
else if ((switch_value == MotionEvent.ACTION_UP) || (switch_value == _ACTION_POINTER_UP_))
{
- Log.e("NavitGraphics", "ACTION_UP");
+ Log.d(TAG, "ACTION_UP");
- if ( touch_mode == DRAG )
- {
- Log.e("NavitGraphics", "onTouch move");
+ switch (touch_mode) {
+ case DRAG:
+ Log.d(TAG, "onTouch move");
- MotionCallback(MotionCallbackID, x, y);
- ButtonCallback(ButtonCallbackID, 0, 1, x, y); // up
- }
- else if (touch_mode == ZOOM)
- {
- //Log.e("NavitGraphics", "onTouch zoom");
+ MotionCallback(MotionCallbackID, x, y);
+ ButtonCallback(ButtonCallbackID, 0, 1, x, y); // up
- float newDist = spacing(getFloatValue(event, 0), getFloatValue(event, 1));
- float scale = 0;
- if (newDist > 10f)
- {
- scale = newDist / oldDist;
- }
+ break;
+ case ZOOM:
+ float newDist = spacing(getFloatValue(event, 0), getFloatValue(event, 1));
+ float scale = 0;
+ if (newDist > 10f) {
+ scale = newDist / oldDist;
+ }
- if (scale > 1.3)
- {
- // zoom in
- CallbackMessageChannel(1, null);
- //Log.e("NavitGraphics", "onTouch zoom in");
- }
- else if (scale < 0.8)
- {
- // zoom out
- CallbackMessageChannel(2, null);
- //Log.e("NavitGraphics", "onTouch zoom out");
- }
- }
- else if (touch_mode == PRESSED)
- {
- if (in_map) ButtonCallback(ButtonCallbackID, 1, 1, x, y); // down
- ButtonCallback(ButtonCallbackID, 0, 1, x, y); // up
+ if (scale > 1.3) {
+ // zoom in
+ CallbackMessageChannel(1, null);
+ } else if (scale < 0.8) {
+ // zoom out
+ CallbackMessageChannel(2, null);
+ }
+ break;
+ case PRESSED:
+ if (in_map) ButtonCallback(ButtonCallbackID, 1, 1, x, y); // down
+ ButtonCallback(ButtonCallbackID, 0, 1, x, y); // up
+
+ break;
}
touch_mode = NONE;
}
else if (switch_value == MotionEvent.ACTION_MOVE)
{
- //Log.e("NavitGraphics", "ACTION_MOVE");
-
- if (touch_mode == DRAG)
- {
- MotionCallback(MotionCallbackID, x, y);
- }
- else if (touch_mode == ZOOM)
- {
- float newDist = spacing(getFloatValue(event, 0), getFloatValue(event, 1));
- float scale = newDist / oldDist;
- Log.e("NavitGraphics", "New scale = " + scale);
- if (scale > 1.2)
- {
- // zoom in
- CallbackMessageChannel(1, "");
- oldDist = newDist;
- //Log.e("NavitGraphics", "onTouch zoom in");
- }
- else if (scale < 0.8)
- {
- oldDist = newDist;
- // zoom out
- CallbackMessageChannel(2, "");
- //Log.e("NavitGraphics", "onTouch zoom out");
- }
- }
- else if (touch_mode == PRESSED)
- {
- Log.e("NavitGraphics", "Start drag mode");
- if ( spacing(mPressedPosition, new PointF(event.getX(), event.getY())) > 20f) {
- ButtonCallback(ButtonCallbackID, 1, 1, x, y); // down
- touch_mode = DRAG;
- }
+ switch (touch_mode) {
+ case DRAG:
+ MotionCallback(MotionCallbackID, x, y);
+ break;
+ case ZOOM:
+ float newDist = spacing(getFloatValue(event, 0), getFloatValue(event, 1));
+ float scale = newDist / oldDist;
+ Log.d(TAG, "New scale = " + scale);
+ if (scale > 1.2) {
+ // zoom in
+ CallbackMessageChannel(1, "");
+ oldDist = newDist;
+ } else if (scale < 0.8) {
+ oldDist = newDist;
+ // zoom out
+ CallbackMessageChannel(2, "");
+ }
+ break;
+ case PRESSED:
+ Log.d(TAG, "Start drag mode");
+ if (spacing(mPressedPosition, new PointF(event.getX(), event.getY())) > 20f) {
+ ButtonCallback(ButtonCallbackID, 1, 1, x, y); // down
+ touch_mode = DRAG;
+ }
+ break;
}
}
else if (switch_value == _ACTION_POINTER_DOWN_)
{
- //Log.e("NavitGraphics", "ACTION_POINTER_DOWN");
oldDist = spacing(getFloatValue(event, 0), getFloatValue(event, 1));
if (oldDist > 2f)
{
touch_mode = ZOOM;
- //Log.e("NavitGraphics", "--> zoom");
}
}
return true;
@@ -382,143 +362,108 @@ public class NavitGraphics
{
Float x = (java.lang.Float) eventGetX.invoke(instance, argument);
Float y = (java.lang.Float) eventGetY.invoke(instance, argument);
- pos.set(x.floatValue(), y.floatValue());
+ pos.set(x, y);
}
- catch (Exception e){}
+ catch (Exception e){
+ e.printStackTrace();
+ }
}
return pos;
}
-
+
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
int i;
String s = null;
- boolean handled = true;
+ long interval_for_long_press = 200L;
i = event.getUnicodeChar();
- //Log.e("NavitGraphics", "onKeyDown " + keyCode + " " + i);
- // Log.e("NavitGraphics","Unicode "+event.getUnicodeChar());
if (i == 0)
{
- if (keyCode == android.view.KeyEvent.KEYCODE_DEL)
- {
- s = java.lang.String.valueOf((char) 8);
- }
- else if (keyCode == android.view.KeyEvent.KEYCODE_MENU)
- {
- if (!in_map)
- {
- // if last menukeypress is less than 0.2 seconds away then count longpress
- if ((System.currentTimeMillis() - Navit.last_pressed_menu_key) < interval_for_long_press)
- {
- Navit.time_pressed_menu_key = Navit.time_pressed_menu_key
- + (System.currentTimeMillis() - Navit.last_pressed_menu_key);
- //Log.e("NavitGraphics", "press time=" + Navit.time_pressed_menu_key);
-
- // on long press let softkeyboard popup
- if (Navit.time_pressed_menu_key > time_for_long_press)
- {
- //Log.e("NavitGraphics", "long press menu key!!");
- Navit.show_soft_keyboard = true;
+ switch (keyCode) {
+ case KeyEvent.KEYCODE_DEL:
+ s = String.valueOf((char) 8);
+ break;
+ case KeyEvent.KEYCODE_MENU:
+ if (!in_map) {
+ // if last menukeypress is less than 0.2 seconds away then count longpress
+ if ((System.currentTimeMillis() - Navit.last_pressed_menu_key) < interval_for_long_press) {
+ Navit.time_pressed_menu_key = Navit.time_pressed_menu_key
+ + (System.currentTimeMillis() - Navit.last_pressed_menu_key);
+ // on long press let softkeyboard popup
+ if (Navit.time_pressed_menu_key > time_for_long_press) {
+ Navit.show_soft_keyboard = true;
+ Navit.time_pressed_menu_key = 0L;
+ // need to draw to get the keyboard showing
+ this.postInvalidate();
+ }
+ } else {
Navit.time_pressed_menu_key = 0L;
- // need to draw to get the keyboard showing
- this.postInvalidate();
}
+ Navit.last_pressed_menu_key = System.currentTimeMillis();
+ // if in menu view:
+ // use as OK (Enter) key
+ // dont use menu key here (use it in onKeyUp)
+ return true;
+ } else {
+ // if on map view:
+ // volume UP
+ //s = java.lang.String.valueOf((char) 1);
+ return true;
}
- else
- {
- Navit.time_pressed_menu_key = 0L;
+ case KeyEvent.KEYCODE_SEARCH:
+ /* Handle event in Main Activity if map is shown */
+ if (in_map)
+ return false;
+
+ s = String.valueOf((char) 19);
+ break;
+ case KeyEvent.KEYCODE_BACK:
+ s = String.valueOf((char) 27);
+ break;
+ case KeyEvent.KEYCODE_CALL:
+ s = String.valueOf((char) 3);
+ break;
+ case KeyEvent.KEYCODE_VOLUME_UP:
+ if (!in_map) {
+ // if in menu view:
+ // use as UP key
+ s = String.valueOf((char) 16);
+ } else {
+ // if on map view:
+ // volume UP
+ //s = java.lang.String.valueOf((char) 21);
+ return false;
}
- Navit.last_pressed_menu_key = System.currentTimeMillis();
- // if in menu view:
- // use as OK (Enter) key
- s = java.lang.String.valueOf((char) 13);
- handled = true;
- // dont use menu key here (use it in onKeyUp)
- return handled;
- }
- else
- {
- // if on map view:
- // volume UP
- //s = java.lang.String.valueOf((char) 1);
- handled = false;
- return handled;
- }
- }
- else if (keyCode == android.view.KeyEvent.KEYCODE_SEARCH)
- {
- /* Handle event in Main Activity if map is shown */
- if(in_map)
- return false;
-
- s = java.lang.String.valueOf((char) 19);
- }
- else if (keyCode == android.view.KeyEvent.KEYCODE_BACK)
- {
- //Log.e("NavitGraphics", "KEYCODE_BACK down");
- s = java.lang.String.valueOf((char) 27);
- }
- else if (keyCode == android.view.KeyEvent.KEYCODE_CALL)
- {
- s = java.lang.String.valueOf((char) 3);
- }
- else if (keyCode == android.view.KeyEvent.KEYCODE_VOLUME_UP)
- {
- if (!in_map)
- {
- // if in menu view:
- // use as UP key
- s = java.lang.String.valueOf((char) 16);
- handled = true;
- }
- else
- {
- // if on map view:
- // volume UP
- //s = java.lang.String.valueOf((char) 21);
- handled = false;
- return handled;
- }
- }
- else if (keyCode == android.view.KeyEvent.KEYCODE_VOLUME_DOWN)
- {
- if (!in_map)
- {
- // if in menu view:
- // use as DOWN key
- s = java.lang.String.valueOf((char) 14);
- handled = true;
- }
- else
- {
- // if on map view:
- // volume DOWN
- //s = java.lang.String.valueOf((char) 4);
- handled = false;
- return handled;
- }
- }
- else if (keyCode == android.view.KeyEvent.KEYCODE_DPAD_CENTER)
- {
- s = java.lang.String.valueOf((char) 13);
- }
- else if (keyCode == android.view.KeyEvent.KEYCODE_DPAD_DOWN)
- {
- s = java.lang.String.valueOf((char) 14);
- }
- else if (keyCode == android.view.KeyEvent.KEYCODE_DPAD_LEFT)
- {
- s = java.lang.String.valueOf((char) 2);
- }
- else if (keyCode == android.view.KeyEvent.KEYCODE_DPAD_RIGHT)
- {
- s = java.lang.String.valueOf((char) 6);
- }
- else if (keyCode == android.view.KeyEvent.KEYCODE_DPAD_UP)
- {
- s = java.lang.String.valueOf((char) 16);
+ break;
+ case KeyEvent.KEYCODE_VOLUME_DOWN:
+ if (!in_map) {
+ // if in menu view:
+ // use as DOWN key
+ s = String.valueOf((char) 14);
+ } else {
+ // if on map view:
+ // volume DOWN
+ //s = java.lang.String.valueOf((char) 4);
+ return false;
+ }
+ break;
+ case KeyEvent.KEYCODE_DPAD_CENTER:
+ s = String.valueOf((char) 13);
+ break;
+ case KeyEvent.KEYCODE_DPAD_DOWN:
+ s = String.valueOf((char) 14);
+ break;
+ case KeyEvent.KEYCODE_DPAD_LEFT:
+ s = String.valueOf((char) 2);
+ break;
+ case KeyEvent.KEYCODE_DPAD_RIGHT:
+ s = String.valueOf((char) 6);
+ break;
+ case KeyEvent.KEYCODE_DPAD_UP:
+ s = String.valueOf((char) 16);
+ break;
}
}
else if (i == 10)
@@ -530,91 +475,50 @@ public class NavitGraphics
{
KeypressCallback(KeypressCallbackID, s);
}
- return handled;
+ return true;
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event)
{
- //Log.e("NavitGraphics", "onKeyUp " + keyCode);
-
int i;
String s = null;
- boolean handled = true;
i = event.getUnicodeChar();
if (i == 0)
{
- if (keyCode == android.view.KeyEvent.KEYCODE_VOLUME_UP)
- {
- if (!in_map)
- {
- //s = java.lang.String.valueOf((char) 16);
- handled = true;
- return handled;
- }
- else
- {
- //s = java.lang.String.valueOf((char) 21);
- handled = false;
- return handled;
- }
- }
- else if (keyCode == android.view.KeyEvent.KEYCODE_VOLUME_DOWN)
- {
- if (!in_map)
- {
- //s = java.lang.String.valueOf((char) 14);
- handled = true;
- return handled;
- }
- else
- {
- //s = java.lang.String.valueOf((char) 4);
- handled = false;
- return handled;
- }
- }
- else if (keyCode == android.view.KeyEvent.KEYCODE_SEARCH) {
- /* Handle event in Main Activity if map is shown */
- if(in_map)
- return false;
- }
- else if (keyCode == android.view.KeyEvent.KEYCODE_BACK)
- {
- if (Navit.show_soft_keyboard_now_showing)
- {
- Navit.show_soft_keyboard_now_showing = false;
- }
- //Log.e("NavitGraphics", "KEYCODE_BACK up");
- //s = java.lang.String.valueOf((char) 27);
- handled = true;
- return handled;
- }
- else if (keyCode == android.view.KeyEvent.KEYCODE_MENU)
- {
- if (!in_map)
- {
- if (Navit.show_soft_keyboard_now_showing)
- {
- // if soft keyboard showing on screen, dont use menu button as select key
+ switch (keyCode) {
+ case KeyEvent.KEYCODE_VOLUME_UP:
+ return (!in_map);
+ case KeyEvent.KEYCODE_VOLUME_DOWN:
+ return (!in_map);
+ case KeyEvent.KEYCODE_SEARCH:
+ /* Handle event in Main Activity if map is shown */
+ if (in_map)
+ return false;
+ break;
+ case KeyEvent.KEYCODE_BACK:
+ if (Navit.show_soft_keyboard_now_showing) {
+ Navit.show_soft_keyboard_now_showing = false;
}
- else
- {
- // if in menu view:
- // use as OK (Enter) key
- s = java.lang.String.valueOf((char) 13);
- handled = true;
+ //s = java.lang.String.valueOf((char) 27);
+ return true;
+ case KeyEvent.KEYCODE_MENU:
+ if (!in_map) {
+ if (Navit.show_soft_keyboard_now_showing) {
+ // if soft keyboard showing on screen, dont use menu button as select key
+ } else {
+ // if in menu view:
+ // use as OK (Enter) key
+ s = String.valueOf((char) 13);
+ }
+ } else {
+ // if on map view:
+ // volume UP
+ //s = java.lang.String.valueOf((char) 1);
+ return false;
}
- }
- else
- {
- // if on map view:
- // volume UP
- //s = java.lang.String.valueOf((char) 1);
- handled = false;
- return handled;
- }
+ break;
}
}
else if(i!=10)
@@ -626,14 +530,14 @@ public class NavitGraphics
{
KeypressCallback(KeypressCallbackID, s);
}
- return handled;
+ return true;
}
@Override
public boolean onKeyMultiple (int keyCode, int count, KeyEvent event)
{
- String s = null;
+ String s;
if(keyCode == KeyEvent.KEYCODE_UNKNOWN) {
s=event.getCharacters();
KeypressCallback(KeypressCallbackID, s);
@@ -645,8 +549,6 @@ public class NavitGraphics
@Override
public boolean onTrackballEvent(MotionEvent event)
{
- //Log.e("NavitGraphics", "onTrackball " + event.getAction() + " " + event.getX() + " "
- // + event.getY());
String s = null;
if (event.getAction() == android.view.MotionEvent.ACTION_DOWN)
{
@@ -656,7 +558,6 @@ public class NavitGraphics
{
trackball_x += event.getX();
trackball_y += event.getY();
- //Log.e("NavitGraphics", "trackball " + trackball_x + " " + trackball_y);
if (trackball_x <= -1)
{
s = java.lang.String.valueOf((char) 2);
@@ -684,13 +585,6 @@ public class NavitGraphics
}
return true;
}
- @Override
- protected void onFocusChanged(boolean gainFocus, int direction,
- Rect previouslyFocusedRect)
- {
- super.onFocusChanged(gainFocus, direction, previouslyFocusedRect);
- //Log.e("NavitGraphics", "FocusChange " + gainFocus);
- }
public void run() {
if (in_map && touch_mode == PRESSED)
@@ -701,7 +595,7 @@ public class NavitGraphics
}
}
-
+
private class SystemBarTintView extends View {
public SystemBarTintView(Context context) {
@@ -710,13 +604,13 @@ public class NavitGraphics
}
}
-
+
public NavitGraphics(final Activity activity, NavitGraphics parent, int x, int y, int w, int h,
int wraparound, int use_camera)
{
if (parent == null)
{
- this.activity = activity;
+ this.activity = (Navit) activity;
view = new NavitView(activity);
//activity.registerForContextMenu(view);
view.setClickable(false);
@@ -762,14 +656,14 @@ public class NavitGraphics
parent_graphics = parent;
}
- static public enum msg_type {
+ public enum msg_type {
CLB_ZOOM_IN, CLB_ZOOM_OUT, CLB_REDRAW, CLB_MOVE, CLB_BUTTON_UP, CLB_BUTTON_DOWN, CLB_SET_DESTINATION
, CLB_SET_DISPLAY_DESTINATION, CLB_CALL_CMD, CLB_COUNTRY_CHOOSER, CLB_LOAD_MAP, CLB_UNLOAD_MAP, CLB_DELETE_MAP
- };
+ }
- static public msg_type[] msg_values = msg_type.values();
+ static private final msg_type[] msg_values = msg_type.values();
- public Handler callback_handler = new Handler()
+ public final Handler callback_handler = new Handler()
{
public void handleMessage(Message msg)
{
@@ -832,8 +726,7 @@ public class NavitGraphics
private Canvas draw_canvas;
private Bitmap draw_bitmap;
private int SizeChangedCallbackID, PaddingChangedCallbackID, ButtonCallbackID, MotionCallbackID, KeypressCallbackID;
- // private int count;
-
+
/**
* @brief Adjust views used to tint navigation and status bars.
*
@@ -849,12 +742,12 @@ public class NavitGraphics
if (frameLayout == null)
return;
- if (!(activity instanceof Navit)) {
- Log.e("NavitGraphics", "Main Activity is not a Navit instance, cannot update padding");
+ if (activity == null) {
+ Log.w(TAG, "Main Activity is not a Navit instance, cannot update padding");
return;
}
- Navit navit = (Navit) activity;
+ Navit navit = activity;
/*
* Determine visibility of status bar.
@@ -867,8 +760,8 @@ public class NavitGraphics
* This logic is based on the presence of a hardware menu button and is known to work on
* devices which allow switching between hw and sw buttons (OnePlus One running CyanogenMod).
*/
- final Boolean isNavShowing = !ViewConfiguration.get(navit.getApplication()).hasPermanentMenuKey();
- Log.d("NavitGraphics", String.format("isStatusShowing=%b isNavShowing=%b", isStatusShowing, isNavShowing));
+ final Boolean isNavShowing = !ViewConfigurationCompat.hasPermanentMenuKey(ViewConfiguration.get(navit));
+ Log.d(TAG, String.format("isStatusShowing=%b isNavShowing=%b", isStatusShowing, isNavShowing));
/*
* Determine where the navigation bar would be displayed.
@@ -877,7 +770,7 @@ public class NavitGraphics
*/
final Boolean isLandscape = (navit.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE);
final Boolean isNavAtBottom = (!isLandscape) || (navit.getResources().getConfiguration().smallestScreenWidthDp >= 600);
- Log.d("NavitGraphics", String.format("isNavAtBottom=%b (Configuration.smallestScreenWidthDp=%d, isLandscape=%b)",
+ Log.d(TAG, String.format("isNavAtBottom=%b (Configuration.smallestScreenWidthDp=%d, isLandscape=%b)",
isNavAtBottom, navit.getResources().getConfiguration().smallestScreenWidthDp, isLandscape));
int left = 0;
@@ -898,7 +791,7 @@ public class NavitGraphics
/* Prevent tint views from overlapping when navigation is on the right */
statusLayoutParams.setMargins(0, 0, (isNavShowing && !isNavAtBottom) ? Navit.navigation_bar_width : 0, 0);
statusTintView.setLayoutParams(statusLayoutParams);
- Log.d("NavitGraphics", String.format("statusTintView: width=%d height=%d",
+ Log.d(TAG, String.format("statusTintView: width=%d height=%d",
statusTintView.getWidth(), statusTintView.getHeight()));
navigationTintView.setVisibility(isNavShowing ? View.VISIBLE : View.GONE);
LayoutParams navigationLayoutParams = new FrameLayout.LayoutParams(
@@ -906,12 +799,12 @@ public class NavitGraphics
isNavAtBottom ? bottom : LayoutParams.MATCH_PARENT, // Y
Gravity.BOTTOM | Gravity.RIGHT);
navigationTintView.setLayoutParams(navigationLayoutParams);
- Log.d("NavitGraphics", String.format("navigationTintView: width=%d height=%d",
+ Log.d(TAG, String.format("navigationTintView: width=%d height=%d",
navigationTintView.getWidth(), navigationTintView.getHeight()));
}
});
- Log.d("NavitGraphics", String.format("Padding left=%d top=%d right=%d bottom=%d", left, top, right, bottom));
+ Log.d(TAG, String.format("Padding left=%d top=%d right=%d bottom=%d", left, top, right, bottom));
PaddingChangedCallback(PaddingChangedCallbackID, left, top, right, bottom);
}
@@ -927,7 +820,7 @@ public class NavitGraphics
if (this.parent_graphics != null)
this.parent_graphics.handleResize(w, h);
else {
- Log.d("NavitGraphics", String.format("handleResize w=%d h=%d", w, h));
+ Log.d(TAG, String.format("handleResize w=%d h=%d", w, h));
adjustSystemBarsTintingViews();
@@ -960,7 +853,7 @@ public class NavitGraphics
else
return ViewConfiguration.get(activity.getApplication()).hasPermanentMenuKey();
}
-
+
public void setSizeChangedCallback(int id)
{
SizeChangedCallbackID = id;
@@ -976,14 +869,18 @@ public class NavitGraphics
public void setMotionCallback(int id)
{
MotionCallbackID = id;
- Navit.setMotionCallback(id, this);
+ if(activity != null){
+ activity.setMotionCallback(id, this);
+ }
}
public void setKeypressCallback(int id)
{
KeypressCallbackID = id;
// set callback id also in main intent (for menus)
- Navit.setKeypressCallback(id, this);
+ if(activity != null) {
+ activity.setKeypressCallback(id, this);
+ }
}
@@ -991,7 +888,6 @@ public class NavitGraphics
{
int i, ndashes;
float [] intervals;
- // Log.e("NavitGraphics","draw_polyline");
paint.setStrokeWidth(c[0]);
paint.setARGB(c[1],c[2],c[3],c[4]);
paint.setStyle(Paint.Style.STROKE);
@@ -1021,7 +917,6 @@ public class NavitGraphics
protected void draw_polygon(Paint paint, int c[])
{
- //Log.e("NavitGraphics","draw_polygon");
paint.setStrokeWidth(c[0]);
paint.setARGB(c[1],c[2],c[3],c[4]);
paint.setStyle(Paint.Style.FILL);
@@ -1038,7 +933,6 @@ public class NavitGraphics
}
protected void draw_rectangle(Paint paint, int x, int y, int w, int h)
{
- //Log.e("NavitGraphics","draw_rectangle");
Rect r = new Rect(x, y, x + w, y + h);
paint.setStyle(Paint.Style.FILL);
paint.setAntiAlias(true);
@@ -1047,10 +941,6 @@ public class NavitGraphics
}
protected void draw_circle(Paint paint, int x, int y, int r)
{
- //Log.e("NavitGraphics","draw_circle");
- // float fx = x;
- // float fy = y;
- // float fr = r / 2;
paint.setStyle(Paint.Style.STROKE);
draw_canvas.drawCircle(x, y, r / 2, paint);
}
@@ -1091,9 +981,6 @@ public class NavitGraphics
}
protected void draw_image(Paint paint, int x, int y, Bitmap bitmap)
{
- //Log.e("NavitGraphics","draw_image");
- // float fx = x;
- // float fy = y;
draw_canvas.drawBitmap(bitmap, x, y, null);
}
@@ -1116,14 +1003,14 @@ public class NavitGraphics
*/
protected void draw_image_warp(Paint paint, int count, int p0x, int p0y, int p1x, int p1y, int p2x, int p2y, Bitmap bitmap)
{
-
+
float width;
float scale;
float deltaY;
float deltaX;
float angle;
Matrix matrix;
-
+
if (count == 3)
{
matrix = new Matrix();
@@ -1140,14 +1027,11 @@ public class NavitGraphics
}
/* These constants must be synchronized with enum draw_mode_num in graphics.h. */
- public static final int draw_mode_begin = 0;
- public static final int draw_mode_end = 1;
+ private static final int draw_mode_begin = 0;
+ private static final int draw_mode_end = 1;
protected void draw_mode(int mode)
{
- //Log.e("NavitGraphics", "draw_mode mode=" + mode + " parent_graphics="
- // + String.valueOf(parent_graphics));
-
if (mode == draw_mode_end) {
if (parent_graphics == null) {
view.invalidate();
@@ -1162,13 +1046,12 @@ public class NavitGraphics
}
protected void draw_drag(int x, int y)
{
- //Log.e("NavitGraphics","draw_drag");
pos_x = x;
pos_y = y;
}
protected void overlay_disable(int disable)
{
- Log.e("NavitGraphics","overlay_disable: " + disable + "Parent: " + (parent_graphics != null));
+ Log.d(TAG,"overlay_disable: " + disable + "Parent: " + (parent_graphics != null));
// assume we are NOT in map view mode!
if (parent_graphics == null)
in_map = (disable==0);
@@ -1182,7 +1065,6 @@ public class NavitGraphics
protected void overlay_resize(int x, int y, int w, int h, int wraparound)
{
- //Log.e("NavitGraphics","overlay_resize");
draw_bitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
bitmap_w = w;
bitmap_h = h;
@@ -1192,19 +1074,5 @@ public class NavitGraphics
draw_canvas.setBitmap(draw_bitmap);
}
- public static String getLocalizedString(String text)
- {
- String ret = CallbackLocalizedString(text);
- //Log.e("NavitGraphics", "callback_handler -> lozalized string=" + ret);
- return ret;
- }
-
-
-
-
- /**
- * get localized string
- */
- public static native String CallbackLocalizedString(String s);
-
+ public static native String CallbackLocalizedString(String s);
}
diff --git a/navit/android/src/org/navitproject/navit/NavitMap.java b/navit/android/src/org/navitproject/navit/NavitMap.java
index b7bd265a4..274cbdd8b 100644
--- a/navit/android/src/org/navitproject/navit/NavitMap.java
+++ b/navit/android/src/org/navitproject/navit/NavitMap.java
@@ -3,11 +3,11 @@ package org.navitproject.navit;
import java.io.File;
public class NavitMap {
- String fileName;
+ private String fileName;
String mapName;
- String mapPath;
+ private String mapPath;
- public NavitMap(String path, String map_file_name) {
+ NavitMap(String path, String map_file_name) {
mapPath = path;
fileName = map_file_name;
if (map_file_name.endsWith(".bin")) {
@@ -17,7 +17,7 @@ public class NavitMap {
}
}
- public NavitMap(String map_location) {
+ NavitMap(String map_location) {
File mapFile = new File(map_location);
mapPath = mapFile.getParent() + "/";
diff --git a/navit/android/src/org/navitproject/navit/NavitMapDownloader.java b/navit/android/src/org/navitproject/navit/NavitMapDownloader.java
index feda451b8..3a7c59e03 100644
--- a/navit/android/src/org/navitproject/navit/NavitMapDownloader.java
+++ b/navit/android/src/org/navitproject/navit/NavitMapDownloader.java
@@ -1,711 +1,711 @@
-/**
- * Navit, a modular navigation system.
- * Copyright (C) 2005-2008 Navit Team
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-package org.navitproject.navit;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.OutputStream;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-
-import android.location.Location;
-import android.os.Bundle;
-import android.os.Message;
-import android.os.StatFs;
-import android.util.Log;
-
-/**
- * @author rikky
- *
- */
-public class NavitMapDownloader extends Thread
-{
- public static class osm_map_values
- {
- String lon1;
- String lat1;
- String lon2;
- String lat2;
- String map_name = "";
- long est_size_bytes = 0;
- int level = 0;
-
-
- public osm_map_values(String mapname, String lon_1, String lat_1, String lon_2, String lat_2,
- long bytes_est, int level)
- {
- this.map_name = mapname;
- this.lon1 = lon_1;
- this.lat1 = lat_1;
- this.lon2 = lon_2;
- this.lat2 = lat_2;
- this.est_size_bytes = bytes_est;
- this.level = level;
- }
-
- public boolean isInMap(Location location) {
- double longitude_1 = Double.valueOf(this.lon1);
- double latitude_1 = Double.valueOf(this.lat1);
- double longitude_2 = Double.valueOf(this.lon2);
- double latitude_2 = Double.valueOf(this.lat2);
-
- if (location.getLongitude() < longitude_1)
- return false;
- if (location.getLongitude() > longitude_2)
- return false;
- if (location.getLatitude() < latitude_1)
- return false;
- if (location.getLatitude() > latitude_2)
- return false;
-
- return true;
- }
- }
-
- //
- // define the maps here
- // size estimations updated 2017-06-22
- //
- public static final osm_map_values[] osm_maps = {
- new osm_map_values(Navit.T("Whole Planet"), "-180", "-90", "180", "90", 23992258630L, 0),
- new osm_map_values(Navit.T("Africa"), "-30.89", "-36.17", "61.68", "38.40", 2070076339L, 0),
- new osm_map_values(Navit.T("Angola"), "11.4", "-18.1", "24.2", "-5.3", 127557789L, 1),
- new osm_map_values(Navit.T("Burundi"), "28.9", "-4.5", "30.9", "-2.2", 124049667L, 1),
- new osm_map_values(Navit.T("Canary Islands"), "-18.69", "26.52", "-12.79", "29.99", 133565815L, 1),
- new osm_map_values(Navit.T("Congo, Democratic Republic of the"), "11.7", "-13.6", "31.5", "5.7", 244228485L, 1),
- new osm_map_values(Navit.T("Ethiopia"), "32.89", "3.33", "48.07", "14.97", 153067406L, 1),
- new osm_map_values(Navit.T("Guinea"), "-15.47", "7.12", "-7.58", "12.74", 188047126L, 1),
- new osm_map_values(Navit.T("Cote d'Ivoire"), "-8.72", "4.09", "-2.43", "10.80", 132187496L, 1),
- new osm_map_values(Navit.T("Kenya"), "33.8", "-5.2", "42.4", "4.9", 190073089L, 1),
- new osm_map_values(Navit.T("Lesotho"), "26.9", "-30.7", "29.6", "-28.4", 196189429L, 1),
- new osm_map_values(Navit.T("Liberia"), "-15.00", "-0.73", "-7.20", "8.65", 156257253L, 1),
- new osm_map_values(Navit.T("Libya"), "9.32", "19.40", "25.54", "33.63", 126046917L, 1),
- new osm_map_values(Navit.T("Madagascar"), "42.25", "-26.63", "51.20", "-11.31", 145210721L, 1),
- new osm_map_values(Navit.T("Namibia")+"+"+Navit.T("Botswana"), "11.4", "-29.1", "29.5", "-16.9", 248970987L, 1),
- new osm_map_values(Navit.T("Reunion"), "55.2", "-21.4", "55.9", "-20.9", 126008774L, 1),
- new osm_map_values(Navit.T("Rwanda"), "28.8", "-2.9", "30.9", "-1.0", 128267595L, 1),
- new osm_map_values(Navit.T("South Africa")+"+"+Navit.T("Lesotho"), "15.93", "-36.36", "33.65", "-22.08", 307280006L, 1),
- new osm_map_values(Navit.T("Tanzania, United Republic of"), "29.19", "-11.87", "40.74", "-0.88", 253621029L, 1),
- new osm_map_values(Navit.T("Uganda"), "29.3", "-1.6", "35.1", "4.3", 179134521L, 1),
- new osm_map_values(Navit.T("Asia"), "23.8", "0.1", "195.0", "82.4", 5113673780L, 0),
- new osm_map_values(Navit.T("Azerbaijan"), "44.74", "38.34", "51.69", "42.37", 138346406L, 1),
- new osm_map_values(Navit.T("China"), "67.3", "5.3", "135.0", "54.5", 1718108758L, 1),
- new osm_map_values(Navit.T("Cyprus"), "32.0", "34.5", "34.9", "35.8", 118472448L, 1),
- new osm_map_values(Navit.T("India")+"+"+Navit.T("Nepal"), "67.9", "5.5", "89.6", "36.0", 601877877L, 1),
- new osm_map_values(Navit.T("Indonesia"), "93.7", "-17.3", "155.5", "7.6", 420741405L, 1),
- new osm_map_values(Navit.T("Iran, Islamic Republic of"), "43.5", "24.4", "63.6", "40.4", 242016066L, 1),
- new osm_map_values(Navit.T("Iraq"), "38.7", "28.5", "49.2", "37.4", 160751805L, 1),
- new osm_map_values(Navit.T("Israel"), "33.99", "29.8", "35.95", "33.4", 155685778L, 1),
- new osm_map_values(Navit.T("Japan")+"+"+Navit.T("Korea"), "123.6", "25.2", "151.3", "47.1", 1029080156L, 1),
- new osm_map_values(Navit.T("Kazakhstan"), "46.44", "40.89", "87.36", "55.45", 407633007L, 1),
- new osm_map_values(Navit.T("Kyrgyzstan"), "69.23", "39.13", "80.33", "43.29", 147997835L, 1),
- new osm_map_values(Navit.T("Malaysia")+"+"+Navit.T("Singapore"), "94.3", "-5.9", "108.6", "6.8", 168816435L, 1),
- new osm_map_values(Navit.T("Mongolia"), "87.5", "41.4", "120.3", "52.7", 153534851L, 1),
- new osm_map_values(Navit.T("Pakistan"), "60.83", "23.28", "77.89", "37.15", 217644321L, 1),
- new osm_map_values(Navit.T("Philippines"), "115.58", "4.47", "127.85", "21.60", 281428307L, 1),
- new osm_map_values(Navit.T("Saudi Arabia"), "33.2", "16.1", "55.9", "33.5", 242648303L, 1),
- new osm_map_values(Navit.T("Taiwan"), "119.1", "21.5", "122.5", "25.2", 1029080156L, 1),
- new osm_map_values(Navit.T("Thailand"), "97.5", "5.7", "105.2", "19.7", 185135492L, 1),
- new osm_map_values(Navit.T("Turkey"), "25.1", "35.8", "46.4", "42.8", 331087441L, 1),
- new osm_map_values(Navit.T("Turkmenistan"), "51.78", "35.07", "66.76", "42.91", 131045087L, 1),
- new osm_map_values(Navit.T("UAE+Other"), "51.5", "22.6", "56.7", "26.5", 128934674L, 1),
- new osm_map_values(Navit.T("Australia")+"+"+Navit.T("Oceania"), "89.84", "-57.39", "179.79", "7.26", 782722650L, 0),
- new osm_map_values(Navit.T("Australia"), "110.5", "-44.2", "154.9", "-9.2", 348652900L, 0),
- new osm_map_values(Navit.T("Tasmania"), "144.0", "-45.1", "155.3", "-24.8", 253231890L, 1),
- new osm_map_values(Navit.T("Victoria")+"+"+Navit.T("New South Wales"), "140.7", "-39.4", "153.7", "-26.9", 241500829L, 1),
- new osm_map_values(Navit.T("New Caledonia"), "157.85", "-25.05", "174.15", "-16.85", 115512336L, 1),
- new osm_map_values(Navit.T("New Zealand"), "165.2", "-47.6", "179.1", "-33.7", 239264192L, 1),
- new osm_map_values(Navit.T("Europe"), "-12.97", "33.59", "34.15", "72.10", 11984126789L, 0),
- new osm_map_values(Navit.T("Western Europe"), "-17.6", "34.5", "42.9", "70.9", 12648810717L, 1),
- new osm_map_values(Navit.T("Austria"), "9.4", "46.32", "17.21", "49.1", 898273634L, 1),
- new osm_map_values(Navit.T("Azores"), "-31.62", "36.63", "-24.67", "40.13", 112687225L, 1),
- new osm_map_values(Navit.T("BeNeLux"), "2.08", "48.87", "7.78", "54.52", 1771971595L, 1),
- new osm_map_values(Navit.T("Netherlands"), "3.07", "50.75", "7.23", "53.73", 1191828033L, 1),
- new osm_map_values(Navit.T("Denmark"), "7.65", "54.32", "15.58", "58.07", 365606979L, 1),
- new osm_map_values(Navit.T("Faroe Islands"), "-7.8", "61.3", "-6.1", "62.5", 109377568L, 1),
- new osm_map_values(Navit.T("France"), "-5.45", "42.00", "8.44", "51.68", 3907969744L, 1),
- new osm_map_values(Navit.T("Alsace"), "6.79", "47.27", "8.48", "49.17", 354249349L, 2),
- new osm_map_values(Navit.T("Aquitaine"), "-2.27", "42.44", "1.50", "45.76", 443715019L, 2),
- new osm_map_values(Navit.T("Auvergne"), "2.01", "44.57", "4.54", "46.85", 287663213L, 2),
- new osm_map_values(Navit.T("Basse-Normandie"), "-2.09", "48.13", "1.03", "49.98", 262352354L, 2),
- new osm_map_values(Navit.T("Bourgogne"), "2.80", "46.11", "5.58", "48.45", 298868796L, 2),
- new osm_map_values(Navit.T("Bretagne"), "-5.58", "46.95", "-0.96", "48.99", 382770794L, 2),
- new osm_map_values(Navit.T("Centre"), "0.01", "46.29", "3.18", "48.99", 474224721L, 2),
- new osm_map_values(Navit.T("Champagne-Ardenne"), "3.34", "47.53", "5.94", "50.28", 269947824L, 2),
- new osm_map_values(Navit.T("Corse"), "8.12", "41.32", "9.95", "43.28", 129902146L, 2),
- new osm_map_values(Navit.T("Franche-Comte"), "5.20", "46.21", "7.83", "48.07", 324476070L, 2),
- new osm_map_values(Navit.T("Haute-Normandie"), "-0.15", "48.62", "1.85", "50.18", 202782876L, 2),
- new osm_map_values(Navit.T("Ile-de-France"), "1.40", "48.07", "3.61", "49.29", 311052699L, 2),
- new osm_map_values(Navit.T("Languedoc-Roussillon"), "1.53", "42.25", "4.89", "45.02", 380145667L, 2),
- new osm_map_values(Navit.T("Limousin"), "0.58", "44.87", "2.66", "46.50", 206696539L, 2),
- new osm_map_values(Navit.T("Lorraine"), "4.84", "47.77", "7.72", "49.73", 330777318L, 2),
- new osm_map_values(Navit.T("Midi-Pyrenees"), "-0.37", "42.18", "3.50", "45.10", 462618363L, 2),
- new osm_map_values(Navit.T("Nord-pas-de-Calais"), "1.42", "49.92", "4.49", "51.31", 368467511L, 2),
- new osm_map_values(Navit.T("Pays-de-la-Loire"), "-2.88", "46.20", "0.97", "48.62", 499471143L, 2),
- new osm_map_values(Navit.T("Picardie"), "1.25", "48.79", "4.31", "50.43", 374308041L, 2),
- new osm_map_values(Navit.T("Poitou-Charentes"), "-1.69", "45.04", "1.26", "47.23", 342125526L, 2),
- new osm_map_values(Navit.T("Provence-Alpes-Cote-d-Azur"), "4.21", "42.91", "7.99", "45.18", 390306134L, 2),
- new osm_map_values(Navit.T("Rhone-Alpes"), "3.65", "44.07", "7.88", "46.64", 510797942L, 2),
- new osm_map_values(Navit.T("Germany"), "5.18", "46.84", "15.47", "55.64", 3521359466L, 1),
- new osm_map_values(Navit.T("Baden-Wuerttemberg"), "7.32", "47.14", "10.57", "49.85", 674361124L, 2),
- new osm_map_values(Navit.T("Bayern"), "8.92", "47.22", "13.90", "50.62", 860161150L, 2),
- new osm_map_values(Navit.T("Mittelfranken"), "9.86", "48.78", "11.65", "49.84", 203055195L, 2),
- new osm_map_values(Navit.T("Niederbayern"), "11.55", "47.75", "14.12", "49.42", 312924770L, 2),
- new osm_map_values(Navit.T("Oberbayern"), "10.67", "47.05", "13.57", "49.14", 382734883L, 2),
- new osm_map_values(Navit.T("Oberfranken"), "10.31", "49.54", "12.49", "50.95", 235258691L, 2),
- new osm_map_values(Navit.T("Oberpfalz"), "11.14", "48.71", "13.47", "50.43", 264536012L, 2),
- new osm_map_values(Navit.T("Schwaben"), "9.27", "47.10", "11.36", "49.09", 321141607L, 2),
- new osm_map_values(Navit.T("Unterfranken"), "8.59", "49.16", "10.93", "50.67", 303720890L, 2),
- new osm_map_values(Navit.T("Berlin"), "13.03", "52.28", "13.81", "52.73", 169019946L, 2),
- new osm_map_values(Navit.T("Brandenburg"), "11.17", "51.30", "14.83", "53.63", 323497599L, 2),
- new osm_map_values(Navit.T("Bremen"), "8.43", "52.96", "9.04", "53.66", 150963608L, 2),
- new osm_map_values(Navit.T("Hamburg"), "9.56", "53.34", "10.39", "53.80", 156284421L, 2),
- new osm_map_values(Navit.T("Hessen"), "7.72", "49.34", "10.29", "51.71", 432279328L, 2),
- new osm_map_values(Navit.T("Mecklenburg-Vorpommern"), "10.54", "53.05", "14.48", "55.05", 213183908L, 2),
- new osm_map_values(Navit.T("Niedersachsen"), "6.40", "51.24", "11.69", "54.22", 819766939L, 2),
- new osm_map_values(Navit.T("Nordrhein-westfalen"), "5.46", "50.26", "9.52", "52.59", 967053517L, 2),
- new osm_map_values(Navit.T("Rheinland-Pfalz"), "6.06", "48.91", "8.56", "51.00", 442868899L, 2),
- new osm_map_values(Navit.T("Saarland"), "6.30", "49.06", "7.46", "49.69", 157721162L, 2),
- new osm_map_values(Navit.T("Sachsen-Anhalt"), "10.50", "50.88", "13.26", "53.11", 287785088L, 2),
- new osm_map_values(Navit.T("Sachsen"), "11.82", "50.11", "15.10", "51.73", 342620834L, 2),
- new osm_map_values(Navit.T("Schleswig-Holstein"), "7.41", "53.30", "11.98", "55.20", 280293910L, 2),
- new osm_map_values(Navit.T("Thueringen"), "9.81", "50.15", "12.72", "51.70", 269428239L, 2),
- new osm_map_values(Navit.T("Germany")+"+"+Navit.T("Austria")+"+"+Navit.T("Switzerland"), "3.4", "44.5", "18.6", "55.1", 5746126429L, 1),
- new osm_map_values(Navit.T("Iceland"), "-25.3", "62.8", "-11.4", "67.5", 124837162L, 1),
- new osm_map_values(Navit.T("Ireland"), "-11.17", "51.25", "-5.23", "55.9", 234750271L, 1),
- new osm_map_values(Navit.T("Italy"), "6.52", "36.38", "18.96", "47.19", 1610171395L, 1),
- new osm_map_values(Navit.T("Spain")+"+"+Navit.T("Portugal"), "-11.04", "34.87", "4.62", "44.41", 1039624918L, 1),
- new osm_map_values(Navit.T("Mallorca"), "2.2", "38.8", "4.7", "40.2", 137200636L, 2),
- new osm_map_values(Navit.T("Galicia"), "-10.0", "41.7", "-6.3", "44.1", 174549553L, 2),
- new osm_map_values(Navit.T("Scandinavia"), "4.0", "54.4", "32.1", "71.5", 1398661090L, 1),
- new osm_map_values(Navit.T("Finland"), "18.6", "59.2", "32.3", "70.3", 460997178L, 1),
- new osm_map_values(Navit.T("Denmark"), "7.49", "54.33", "13.05", "57.88", 321870414L, 1),
- new osm_map_values(Navit.T("Switzerland"), "5.79", "45.74", "10.59", "47.84", 552565332L, 1),
- new osm_map_values(Navit.T("United Kingdom"), "-9.7", "49.6", "2.2", "61.2", 901724648L, 1),
- new osm_map_values(Navit.T("England"), "-7.80", "48.93", "2.41", "56.14", 937728414L, 1),
- new osm_map_values(Navit.T("Buckinghamshire"), "-1.19", "51.44", "-0.43", "52.25", 142256978L, 2),
- new osm_map_values(Navit.T("Cambridgeshire"), "-0.55", "51.96", "0.56", "52.79", 142334001L, 2),
- new osm_map_values(Navit.T("Cumbria"), "-3.96", "53.85", "-2.11", "55.24", 144422460L, 2),
- new osm_map_values(Navit.T("East yorkshire with hull"), "-1.16", "53.50", "0.54", "54.26", 141518744L, 2),
- new osm_map_values(Navit.T("Essex"), "-0.07", "51.40", "1.36", "52.14", 162542730L, 2),
- new osm_map_values(Navit.T("Herefordshire"), "-3.19", "51.78", "-2.29", "52.45", 129368660L, 2),
- new osm_map_values(Navit.T("Kent"), "-0.02", "50.81", "1.65", "51.53", 145482562L, 2),
- new osm_map_values(Navit.T("Lancashire"), "-3.20", "53.43", "-2.00", "54.29", 148964975L, 2),
- new osm_map_values(Navit.T("Leicestershire"), "-1.65", "52.34", "-0.61", "53.03", 154199956L, 2),
- new osm_map_values(Navit.T("Norfolk"), "0.10", "52.30", "2.04", "53.41", 146017009L, 2),
- new osm_map_values(Navit.T("Nottinghamshire"), "-1.39", "52.73", "-0.62", "53.55", 147986548L, 2),
- new osm_map_values(Navit.T("Oxfordshire"), "-1.77", "51.41", "-0.82", "52.22", 142240992L, 2),
- new osm_map_values(Navit.T("Shropshire"), "-3.29", "52.26", "-2.18", "53.05", 136909363L, 2),
- new osm_map_values(Navit.T("Somerset"), "-3.89", "50.77", "-2.20", "51.40", 145186096L, 2),
- new osm_map_values(Navit.T("South yorkshire"), "-1.88", "53.25", "-0.80", "53.71", 145902650L, 2),
- new osm_map_values(Navit.T("Suffolk"), "0.29", "51.88", "1.81", "52.60", 143799697L, 2),
- new osm_map_values(Navit.T("Surrey"), "-0.90", "51.02", "0.10", "51.52", 157987139L, 2),
- new osm_map_values(Navit.T("Wiltshire"), "-2.41", "50.90", "-1.44", "51.76", 138652346L, 2),
- new osm_map_values(Navit.T("Scotland"), "-8.13", "54.49", "-0.15", "61.40", 258853845L, 2),
- new osm_map_values(Navit.T("Wales"), "-5.56", "51.28", "-2.60", "53.60", 193593409L, 2),
- new osm_map_values(Navit.T("Albania"), "19.09", "39.55", "21.12", "42.72", 146199817L, 1),
- new osm_map_values(Navit.T("Belarus"), "23.12", "51.21", "32.87", "56.23", 324470696L, 1),
- new osm_map_values(Navit.T("Russian Federation"), "27.9", "41.5", "190.4", "77.6", 2148314279L, 1),
- new osm_map_values(Navit.T("Bulgaria"), "24.7", "42.1", "24.8", "42.1", 109869373L, 1),
- new osm_map_values(Navit.T("Bosnia and Herzegovina"), "15.69", "42.52", "19.67", "45.32", 187122485L, 1),
- new osm_map_values(Navit.T("Czech Republic"), "11.91", "48.48", "19.02", "51.17", 904838442L, 1),
- new osm_map_values(Navit.T("Croatia"), "13.4", "42.1", "19.4", "46.9", 460854751L, 1),
- new osm_map_values(Navit.T("Estonia"), "21.5", "57.5", "28.2", "59.6", 173378927L, 1),
- new osm_map_values(Navit.T("Greece"), "28.9", "37.8", "29.0", "37.8", 109435051L, 1),
- new osm_map_values(Navit.T("Crete"), "23.3", "34.5", "26.8", "36.0", 115985063L, 1),
- new osm_map_values(Navit.T("Hungary"), "16.08", "45.57", "23.03", "48.39", 350318541L, 1),
- new osm_map_values(Navit.T("Latvia"), "20.7", "55.6", "28.3", "58.1", 188188140L, 1),
- new osm_map_values(Navit.T("Lithuania"), "20.9", "53.8", "26.9", "56.5", 217852597L, 1),
- new osm_map_values(Navit.T("Poland"), "13.6", "48.8", "24.5", "55.0", 1464968657L, 1),
- new osm_map_values(Navit.T("Romania"), "20.3", "43.5", "29.9", "48.4", 347931565L, 1),
- new osm_map_values(Navit.T("Ukraine"), "22.0", "44.3", "40.4", "52.4", 793611912L, 1),
- new osm_map_values(Navit.T("North America"), "-178.1", "6.5", "-10.4", "84.0", 5601866516L, 0),
- new osm_map_values(Navit.T("Alaska"), "-179.5", "49.5", "-129", "71.6", 207746039L, 1),
- new osm_map_values(Navit.T("Canada"), "-141.3", "41.5", "-52.2", "70.2", 2635719651L, 1),
- new osm_map_values(Navit.T("Hawaii"), "-161.07", "18.49", "-154.45", "22.85", 115016656L, 1),
- new osm_map_values(Navit.T("USA")+Navit.T(" (except Alaska and Hawaii)"), "-125.4", "24.3", "-66.5", "49.3", 4060487198L, 1),
- new osm_map_values(Navit.T("Midwest"), "-104.11", "35.92", "-80.46", "49.46", 1145596450L, 2),
- new osm_map_values(Navit.T("Michigan"), "-90.47", "41.64", "-79.00", "49.37", 538247019L, 2),
- new osm_map_values(Navit.T("Ohio"), "-84.87", "38.05", "-79.85", "43.53", 277022336L, 2),
- new osm_map_values(Navit.T("Northeast"), "-80.58", "38.72", "-66.83", "47.53", 1017160709L, 2),
- new osm_map_values(Navit.T("Massachusetts"), "-73.56", "40.78", "-68.67", "42.94", 340055487L, 2),
- new osm_map_values(Navit.T("Vermont"), "-73.49", "42.68", "-71.41", "45.07", 139626067L, 2),
- new osm_map_values(Navit.T("Pacific"), "-180.05", "15.87", "-129.75", "73.04", 207090640L, 2),
- new osm_map_values(Navit.T("South"), "-106.70", "23.98", "-71.46", "40.70", 1747935356L, 2),
- new osm_map_values(Navit.T("Arkansas"), "-94.67", "32.95", "-89.59", "36.60", 155658661L, 2),
- new osm_map_values(Navit.T("District of Columbia"), "-77.17", "38.74", "-76.86", "39.05", 129235755L, 2),
- new osm_map_values(Navit.T("Florida"), "-88.75", "23.63", "-77.67", "31.05", 224022108L, 2),
- new osm_map_values(Navit.T("Louisiana"), "-94.09", "28.09", "-88.62", "33.07", 210120605L, 2),
- new osm_map_values(Navit.T("Maryland"), "-79.54", "37.83", "-74.99", "40.22", 276462622L, 2),
- new osm_map_values(Navit.T("Mississippi"), "-91.71", "29.99", "-88.04", "35.05", 177858031L, 2),
- new osm_map_values(Navit.T("Oklahoma"), "-103.41", "33.56", "-94.38", "37.38", 200061473L, 2),
- new osm_map_values(Navit.T("Texas"), "-106.96", "25.62", "-92.97", "36.58", 430089141L, 2),
- new osm_map_values(Navit.T("Virginia"), "-83.73", "36.49", "-74.25", "39.52", 384187569L, 2),
- new osm_map_values(Navit.T("West Virginia"), "-82.70", "37.15", "-77.66", "40.97", 220552071L, 2),
- new osm_map_values(Navit.T("West"), "-133.11", "31.28", "-101.99", "49.51", 1152909162L, 2),
- new osm_map_values(Navit.T("Arizona"), "-114.88", "30.01", "-108.99", "37.06", 182826833L, 2),
- new osm_map_values(Navit.T("California"), "-125.94", "32.43", "-114.08", "42.07", 586923326L, 2),
- new osm_map_values(Navit.T("Colorado"), "-109.11", "36.52", "-100.41", "41.05", 228623724L, 2),
- new osm_map_values(Navit.T("Idaho"), "-117.30", "41.93", "-110.99", "49.18", 170684507L, 2),
- new osm_map_values(Navit.T("Montana"), "-116.10", "44.31", "-102.64", "49.74", 176229800L, 2),
- new osm_map_values(Navit.T("New Mexico"), "-109.10", "26.98", "-96.07", "37.05", 361793070L, 2),
- new osm_map_values(Navit.T("Nevada"), "-120.2", "35.0", "-113.8", "42.1", 200614482L, 2),
- new osm_map_values(Navit.T("Oregon"), "-124.8", "41.8", "-116.3", "46.3", 211462685L, 2),
- new osm_map_values(Navit.T("Utah"), "-114.11", "36.95", "-108.99", "42.05", 151590197L, 2),
- new osm_map_values(Navit.T("Washington State"), "-125.0", "45.5", "-116.9", "49.0", 222553768L, 2),
- new osm_map_values(Navit.T("South+Middle America"), "-83.5", "-56.3", "-30.8", "13.7", 958895383L, 0),
- new osm_map_values(Navit.T("Argentina"), "-73.9", "-57.3", "-51.6", "-21.0", 376857648L, 1),
- new osm_map_values(Navit.T("Argentina")+"+"+Navit.T("Chile"), "-77.2", "-56.3", "-52.7", "-16.1", 420275812L, 1),
- new osm_map_values(Navit.T("Bolivia"), "-70.5", "-23.1", "-57.3", "-9.3", 175937824L, 1),
- new osm_map_values(Navit.T("Brazil"), "-71.4", "-34.7", "-32.8", "5.4", 664872975L, 1),
- new osm_map_values(Navit.T("Chile"), "-81.77", "-58.50", "-65.46", "-17.41", 241657330L, 1),
- new osm_map_values(Navit.T("Cuba"), "-85.3", "19.6", "-74.0", "23.6", 129043575L, 1),
- new osm_map_values(Navit.T("Colombia"), "-79.1", "-4.0", "-66.7", "12.6", 212016580L, 1),
- new osm_map_values(Navit.T("Ecuador"), "-82.6", "-5.4", "-74.4", "2.3", 158857591L, 1),
- new osm_map_values(Navit.T("Guyana")+"+"+Navit.T("Suriname")+"+"+Navit.T("Guyane Francaise"), "-62.0", "1.0", "-51.2", "8.9", 123000072L, 1),
- new osm_map_values(Navit.T("Haiti")+"+"+Navit.T("Dominican Republic"), "-74.8", "17.3", "-68.2", "20.1", 149925689L, 1),
- new osm_map_values(Navit.T("Jamaica"), "-78.6", "17.4", "-75.9", "18.9", 113961998L, 1),
- new osm_map_values(Navit.T("Mexico"), "-117.6", "14.1", "-86.4", "32.8", 551307973L, 1),
- new osm_map_values(Navit.T("Paraguay"), "-63.8", "-28.1", "-53.6", "-18.8", 159498397L, 1),
- new osm_map_values(Navit.T("Peru"), "-82.4", "-18.1", "-67.5", "0.4", 212490557L, 1),
- new osm_map_values(Navit.T("Uruguay"), "-59.2", "-36.5", "-51.7", "-29.7", 157482719L, 1),
- new osm_map_values(Navit.T("Venezuela"), "-73.6", "0.4", "-59.7", "12.8", 167295729L, 1)
- };
-
- private String map_filename_path;
-
- public static NavitMap[] getAvailableMaps() {
- class filterMaps implements FilenameFilter {
- public boolean accept(File dir, String filename) {
- if (filename.endsWith(".bin"))
- return true;
- return false;
- }
- }
- NavitMap maps[] = new NavitMap[0];
- File map_dir = new File(Navit.map_filename_path);
- String map_file_names[] = map_dir.list(new filterMaps());
- if (map_file_names != null) {
- maps = new NavitMap[map_file_names.length];
- for (int map_file_index = 0; map_file_index < map_file_names.length; map_file_index++) {
- maps[map_file_index] = new NavitMap(Navit.map_filename_path, map_file_names[map_file_index]);
- }
- }
- return maps;
- }
- private Boolean stop_me = false;
- private osm_map_values map_values;
- private int map_id;
- private long uiLastUpdated = -1;
-
- private Boolean retryDownload = false; //Download failed, but
- //we should try to resume
- private static final int SOCKET_CONNECT_TIMEOUT = 60000; // 60 secs.
- private static final int SOCKET_READ_TIMEOUT = 120000; // 120 secs.
- private static final int MAP_WRITE_FILE_BUFFER = 1024 * 64;
- private static final int MAP_WRITE_MEM_BUFFER = 1024 * 64;
- private static final int MAP_READ_FILE_BUFFER = 1024 * 64;
- private static final int UPDATE_PROGRESS_TIME_NS = 1000 * 1000000; // 1ns=1E-9s
- private static final int MAX_RETRIES = 5;
- private static final String TAG = "NavitMapDownloader";
-
- protected int retry_counter = 0;
-
- public NavitMapDownloader(int map_id) {
- this.map_values = osm_maps[map_id];
- this.map_id=map_id;
- this.map_filename_path=Navit.map_filename_path;
- }
-
- public void run() {
- stop_me = false;
- retry_counter = 0;
-
- Log.v(TAG, "start download " + map_values.map_name);
- updateProgress(0, map_values.est_size_bytes, Navit.T("downloading") + ": " + map_values.map_name);
-
- boolean success;
- do {
- try {
- Thread.sleep(10 + retry_counter * 1000);
- } catch (InterruptedException e1) {}
- retryDownload = false;
- success = download_osm_map();
- } while ( !success
- && retryDownload
- && retry_counter < MAX_RETRIES
- && !stop_me);
-
- if (success) {
- toast(map_values.map_name + " " + Navit.T("ready"));
- getMapInfoFile().delete();
- Log.d(TAG, "success");
- }
-
- if (success || stop_me ) {
- NavitDialogs.sendDialogMessage( NavitDialogs.MSG_MAP_DOWNLOAD_FINISHED
- , map_filename_path + map_values.map_name + ".bin", null, -1, success ? 1 : 0 , map_id );
- }
- }
-
- public void stop_thread() {
- stop_me = true;
- Log.d(TAG, "stop_me -> true");
- }
-
- protected boolean checkFreeSpace(long needed_bytes) {
- long free_space = getFreeSpace();
-
- if ( needed_bytes <= 0 )
- needed_bytes = MAP_WRITE_FILE_BUFFER;
-
- if (free_space < needed_bytes ) {
- String msg;
- Log.e(TAG, "Not enough free space or media not available. Please free at least " + needed_bytes / 1024 /1024 + "Mb.");
- if(free_space<0)
- msg=Navit.T("Media selected for map storage is not available");
- else
- msg=Navit.T("Not enough free space");
- updateProgress(free_space, needed_bytes, Navit.T("Error downloading map!") + "\n" + msg);
- return false;
- }
- return true;
- }
-
- protected boolean deleteMap() {
- File finalOutputFile = getMapFile();
-
- if (finalOutputFile.exists()) {
- Message msg =
- Message.obtain(Navit.N_NavitGraphics.callback_handler,
- NavitGraphics.msg_type.CLB_DELETE_MAP.ordinal());
- Bundle b = new Bundle();
- b.putString("title", finalOutputFile.getAbsolutePath());
- msg.setData(b);
- msg.sendToTarget();
- return true;
- }
- return false;
- }
-
- /**
- * @param map_values
- * @return
- */
- protected boolean download_osm_map() {
- long already_read = 0;
- long real_size_bytes = 0;
- boolean resume = true;
-
- File outputFile = getDestinationFile();
- long old_download_size = outputFile.length();
-
- URL url = null;
- if (old_download_size > 0) {
- url = readFileInfo();
- }
-
- if (url == null) {
- resume = false;
- url = getDownloadURL();
- }
-
- // URL url = new URL("http://192.168.2.101:8080/zweibruecken.bin");
- URLConnection c = initConnection(url);
- if (c != null) {
-
- if (resume) {
- c.setRequestProperty("Range", "bytes=" + old_download_size + "-");
- already_read = old_download_size;
- }
- try {
- real_size_bytes=Long.parseLong(c.getHeaderField("Content-Length")) + already_read;
- } catch(Exception e) {
- real_size_bytes=-1;
- }
-
- long fileTime = c.getLastModified();
-
- if (!resume) {
- outputFile.delete();
- writeFileInfo(c, real_size_bytes);
- }
-
- if (real_size_bytes <= 0)
- real_size_bytes = map_values.est_size_bytes;
-
- Log.d(TAG, "size: " + real_size_bytes + ", read: " + already_read + ", timestamp: " + fileTime
- + ", Connection ref: " + c.getURL());
-
- if (checkFreeSpace(real_size_bytes - already_read)
- && downloadData(c, already_read, real_size_bytes, resume, outputFile)) {
-
- File finalOutputFile = getMapFile();
- // delete an already existing file first
- finalOutputFile.delete();
- // rename file to its final name
- outputFile.renameTo(finalOutputFile);
- return true;
- }
- }
- return false;
- }
-
- protected File getDestinationFile() {
- File outputFile = new File(map_filename_path, map_values.map_name + ".tmp");
- outputFile.getParentFile().mkdir();
- return outputFile;
- }
-
- protected boolean downloadData(URLConnection c, long already_read, long real_size_bytes
- , boolean resume,File outputFile) {
- boolean success = false;
- BufferedOutputStream buf = getOutputStream(outputFile, resume);
- BufferedInputStream bif = getInputStream(c);
-
- if (buf != null && bif != null) {
- success = readData(buf, bif, already_read, real_size_bytes);
- // always cleanup, as we might get errors when trying to resume
- try {
- buf.flush();
- buf.close();
-
- bif.close();
- } catch (IOException e) {
- }
- }
- return success;
- }
-
- protected URL getDownloadURL() {
- URL url = null;
- try {
- url =
- new URL("http://maps.navit-project.org/api/map/?bbox=" + map_values.lon1 + "," + map_values.lat1
- + "," + map_values.lon2 + "," + map_values.lat2);
- } catch (MalformedURLException e) {
- Log.e(TAG, "We failed to create a URL to " + map_values.map_name);
- e.printStackTrace();
- return null;
- }
- Log.v(TAG, "connect to " + url.toString());
- return url;
- }
-
- protected long getFreeSpace() {
- try {
- StatFs fsInfo = new StatFs(map_filename_path);
- return (long)fsInfo.getAvailableBlocks() * fsInfo.getBlockSize();
- } catch(Exception e) {
- return -1;
- }
- }
-
- protected BufferedInputStream getInputStream(URLConnection c) {
- BufferedInputStream bif = null;
- try {
- bif = new BufferedInputStream(c.getInputStream(), MAP_READ_FILE_BUFFER);
- } catch (FileNotFoundException e) {
- Log.e(TAG, "File not found on server: " + e);
- if (retry_counter > 0) {
- getMapInfoFile().delete();
- }
- enableRetry();
- bif = null;
- } catch (IOException e) {
- Log.e(TAG, "Error reading from server: " + e);
- enableRetry();
- bif = null;
- }
- return bif;
- }
-
- protected File getMapFile() {
- return new File(map_filename_path, map_values.map_name + ".bin");
- }
-
- protected File getMapInfoFile() {
- return new File(map_filename_path, map_values.map_name + ".tmp.info");
- }
-
- protected BufferedOutputStream getOutputStream(File outputFile, boolean resume) {
- BufferedOutputStream buf = null;
- try {
- buf = new BufferedOutputStream(new FileOutputStream(outputFile, resume), MAP_WRITE_FILE_BUFFER);
- } catch (FileNotFoundException e) {
- Log.e(TAG, "Could not open output file for writing: " + e);
- buf = null;
- }
- return buf;
- }
-
- protected URLConnection initConnection(URL url) {
- HttpURLConnection c = null;
- try {
- c = (HttpURLConnection) url.openConnection();
- c.setRequestMethod("GET");
- } catch (Exception e) {
- Log.e(TAG, "Failed connecting server: " + e);
- enableRetry();
- return null;
- }
-
- c.setReadTimeout(SOCKET_READ_TIMEOUT);
- c.setConnectTimeout(SOCKET_CONNECT_TIMEOUT);
- return c;
- }
-
- protected boolean readData(OutputStream buf, InputStream bif, long already_read, long real_size_bytes) {
- long start_timestamp = System.nanoTime();
- byte[] buffer = new byte[MAP_WRITE_MEM_BUFFER];
- int len1 = 0;
- long mapFileSize = real_size_bytes;
- long startOffset = already_read;
- boolean success = false;
-
- try {
- while (!stop_me && (len1 = bif.read(buffer)) != -1) {
- already_read += len1;
- updateProgress(start_timestamp, startOffset, already_read, mapFileSize);
-
- try {
- buf.write(buffer, 0, len1);
- } catch (IOException e) {
- Log.d(TAG, "Error: " + e);
- if ( !checkFreeSpace(real_size_bytes - already_read + MAP_WRITE_FILE_BUFFER)) {
- if (deleteMap()) {
- enableRetry();
- } else {
- updateProgress(already_read, real_size_bytes, Navit.T("Error downloading map!") + "\n"
- + Navit.T("Not enough free space"));
- }
- } else {
- updateProgress(already_read, real_size_bytes, Navit.T("Error writing map!"));
- }
-
- return false;
- }
- }
-
- if (stop_me) {
- toast(Navit.T("Map download aborted!"));
- } else if ( already_read < real_size_bytes ) {
- Log.d(TAG, "Server send only " + already_read + " bytes of " + real_size_bytes);
- enableRetry();
- } else {
- success = true;
- }
- } catch (IOException e) {
- Log.d(TAG, "Error: " + e);
-
- enableRetry();
- updateProgress(already_read, real_size_bytes, Navit.T("Error downloading map!"));
- }
-
- return success;
- }
-
- protected URL readFileInfo() {
- URL url = null;
- try {
- ObjectInputStream infoStream = new ObjectInputStream(new FileInputStream(getMapInfoFile()));
- String resume_proto = infoStream.readUTF();
- infoStream.readUTF(); // read the host name (unused for now)
- String resume_file = infoStream.readUTF();
- infoStream.close();
- // looks like the same file, try to resume
- Log.v(TAG, "Try to resume download");
- url = new URL(resume_proto + "://" + "maps.navit-project.org" + resume_file);
- } catch (Exception e) {
- getMapInfoFile().delete();
- }
- return url;
- }
-
- protected void toast(String message) {
- NavitDialogs.sendDialogMessage(NavitDialogs.MSG_TOAST, null, message, -1, 0, 0);
- }
-
- protected void updateProgress(long startTime, long offsetBytes, long readBytes, long maxBytes) {
- long currentTime = System.nanoTime();
-
- if ((currentTime > uiLastUpdated + UPDATE_PROGRESS_TIME_NS) && startTime!=currentTime) {
- float per_second_overall = (readBytes - offsetBytes) / ((currentTime - startTime) / 1000000000f);
- long bytes_remaining = maxBytes - readBytes;
- int eta_seconds = (int) (bytes_remaining / per_second_overall);
-
- String eta_string;
- if (eta_seconds > 60) {
- eta_string = (int) (eta_seconds / 60f) + " m";
- } else {
- eta_string = eta_seconds + " s";
- }
- String info =
- String.format("%s: %s\n %dMb / %dMb\n %.1f kb/s %s: %s", Navit.T("downloading")
- , map_values.map_name, readBytes / 1024 / 1024, maxBytes / 1024 / 1024,
- per_second_overall / 1024f, Navit.T("ETA"), eta_string);
-
- if (retry_counter > 0) {
- info += "\n Retry " + retry_counter + "/" + MAX_RETRIES;
- }
- Log.e(TAG, "info: " + info);
-
- updateProgress(readBytes, maxBytes, info);
- uiLastUpdated = currentTime;
- }
- }
-
- protected void updateProgress(long positionBytes, long maximumBytes, String infoText) {
- NavitDialogs.sendDialogMessage(NavitDialogs.MSG_PROGRESS_BAR, Navit.T("Map download"), infoText
- , NavitDialogs.DIALOG_MAPDOWNLOAD, (int) (maximumBytes / 1024),
- (int) (positionBytes / 1024));
- }
-
- protected void writeFileInfo(URLConnection c, long sizeInBytes) {
- ObjectOutputStream infoStream;
- try {
- infoStream = new ObjectOutputStream(new FileOutputStream(getMapInfoFile()));
- infoStream.writeUTF(c.getURL().getProtocol());
- infoStream.writeUTF(c.getURL().getHost());
- infoStream.writeUTF(c.getURL().getFile());
- infoStream.writeLong(sizeInBytes);
- infoStream.close();
- } catch (Exception e) {
- Log.e(TAG, "Could not write info file for map download. Resuming will not be possible. (" + e.getMessage() + ")");
- }
- }
-
- void enableRetry() {
- retryDownload = true;
- retry_counter++;
- }
- // dialog send helper methods
-}
+/**
+ * Navit, a modular navigation system.
+ * Copyright (C) 2005-2008 Navit Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+package org.navitproject.navit;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+
+import android.location.Location;
+import android.os.Bundle;
+import android.os.Message;
+import android.os.StatFs;
+import android.util.Log;
+
+/**
+ * @author rikky
+ *
+ */
+public class NavitMapDownloader extends Thread
+{
+ public static class osm_map_values
+ {
+ final String lon1;
+ final String lat1;
+ final String lon2;
+ final String lat2;
+ final String map_name;
+ final long est_size_bytes;
+ final int level;
+
+
+ private osm_map_values(String mapname, String lon_1, String lat_1, String lon_2, String lat_2,
+ long bytes_est, int level)
+ {
+ this.map_name = mapname;
+ this.lon1 = lon_1;
+ this.lat1 = lat_1;
+ this.lon2 = lon_2;
+ this.lat2 = lat_2;
+ this.est_size_bytes = bytes_est;
+ this.level = level;
+ }
+
+ public boolean isInMap(Location location) {
+ double longitude_1 = Double.valueOf(this.lon1);
+ double latitude_1 = Double.valueOf(this.lat1);
+ double longitude_2 = Double.valueOf(this.lon2);
+ double latitude_2 = Double.valueOf(this.lat2);
+
+ if (location.getLongitude() < longitude_1)
+ return false;
+ if (location.getLongitude() > longitude_2)
+ return false;
+ if (location.getLatitude() < latitude_1)
+ return false;
+ if (location.getLatitude() > latitude_2)
+ return false;
+
+ return true;
+ }
+ }
+
+ //
+ // define the maps here
+ // size estimations updated 2017-06-22
+ //
+ public static final osm_map_values[] osm_maps = {
+ new osm_map_values(Navit.getInstance().T("Whole Planet"), "-180", "-90", "180", "90", 23992258630L, 0),
+ new osm_map_values(Navit.getInstance().T("Africa"), "-30.89", "-36.17", "61.68", "38.40", 2070076339L, 0),
+ new osm_map_values(Navit.getInstance().T("Angola"), "11.4", "-18.1", "24.2", "-5.3", 127557789L, 1),
+ new osm_map_values(Navit.getInstance().T("Burundi"), "28.9", "-4.5", "30.9", "-2.2", 124049667L, 1),
+ new osm_map_values(Navit.getInstance().T("Canary Islands"), "-18.69", "26.52", "-12.79", "29.99", 133565815L, 1),
+ new osm_map_values(Navit.getInstance().T("Congo, Democratic Republic of the"), "11.7", "-13.6", "31.5", "5.7", 244228485L, 1),
+ new osm_map_values(Navit.getInstance().T("Ethiopia"), "32.89", "3.33", "48.07", "14.97", 153067406L, 1),
+ new osm_map_values(Navit.getInstance().T("Guinea"), "-15.47", "7.12", "-7.58", "12.74", 188047126L, 1),
+ new osm_map_values(Navit.getInstance().T("Cote d'Ivoire"), "-8.72", "4.09", "-2.43", "10.80", 132187496L, 1),
+ new osm_map_values(Navit.getInstance().T("Kenya"), "33.8", "-5.2", "42.4", "4.9", 190073089L, 1),
+ new osm_map_values(Navit.getInstance().T("Lesotho"), "26.9", "-30.7", "29.6", "-28.4", 196189429L, 1),
+ new osm_map_values(Navit.getInstance().T("Liberia"), "-15.00", "-0.73", "-7.20", "8.65", 156257253L, 1),
+ new osm_map_values(Navit.getInstance().T("Libya"), "9.32", "19.40", "25.54", "33.63", 126046917L, 1),
+ new osm_map_values(Navit.getInstance().T("Madagascar"), "42.25", "-26.63", "51.20", "-11.31", 145210721L, 1),
+ new osm_map_values(Navit.getInstance().T("Namibia")+"+"+Navit.getInstance().T("Botswana"), "11.4", "-29.1", "29.5", "-16.9", 248970987L, 1),
+ new osm_map_values(Navit.getInstance().T("Reunion"), "55.2", "-21.4", "55.9", "-20.9", 126008774L, 1),
+ new osm_map_values(Navit.getInstance().T("Rwanda"), "28.8", "-2.9", "30.9", "-1.0", 128267595L, 1),
+ new osm_map_values(Navit.getInstance().T("South Africa")+"+"+Navit.getInstance().T("Lesotho"), "15.93", "-36.36", "33.65", "-22.08", 307280006L, 1),
+ new osm_map_values(Navit.getInstance().T("Tanzania, United Republic of"), "29.19", "-11.87", "40.74", "-0.88", 253621029L, 1),
+ new osm_map_values(Navit.getInstance().T("Uganda"), "29.3", "-1.6", "35.1", "4.3", 179134521L, 1),
+ new osm_map_values(Navit.getInstance().T("Asia"), "23.8", "0.1", "195.0", "82.4", 5113673780L, 0),
+ new osm_map_values(Navit.getInstance().T("Azerbaijan"), "44.74", "38.34", "51.69", "42.37", 138346406L, 1),
+ new osm_map_values(Navit.getInstance().T("China"), "67.3", "5.3", "135.0", "54.5", 1718108758L, 1),
+ new osm_map_values(Navit.getInstance().T("Cyprus"), "32.0", "34.5", "34.9", "35.8", 118472448L, 1),
+ new osm_map_values(Navit.getInstance().T("India")+"+"+Navit.getInstance().T("Nepal"), "67.9", "5.5", "89.6", "36.0", 601877877L, 1),
+ new osm_map_values(Navit.getInstance().T("Indonesia"), "93.7", "-17.3", "155.5", "7.6", 420741405L, 1),
+ new osm_map_values(Navit.getInstance().T("Iran, Islamic Republic of"), "43.5", "24.4", "63.6", "40.4", 242016066L, 1),
+ new osm_map_values(Navit.getInstance().T("Iraq"), "38.7", "28.5", "49.2", "37.4", 160751805L, 1),
+ new osm_map_values(Navit.getInstance().T("Israel"), "33.99", "29.8", "35.95", "33.4", 155685778L, 1),
+ new osm_map_values(Navit.getInstance().T("Japan")+"+"+Navit.getInstance().T("Korea"), "123.6", "25.2", "151.3", "47.1", 1029080156L, 1),
+ new osm_map_values(Navit.getInstance().T("Kazakhstan"), "46.44", "40.89", "87.36", "55.45", 407633007L, 1),
+ new osm_map_values(Navit.getInstance().T("Kyrgyzstan"), "69.23", "39.13", "80.33", "43.29", 147997835L, 1),
+ new osm_map_values(Navit.getInstance().T("Malaysia")+"+"+Navit.getInstance().T("Singapore"), "94.3", "-5.9", "108.6", "6.8", 168816435L, 1),
+ new osm_map_values(Navit.getInstance().T("Mongolia"), "87.5", "41.4", "120.3", "52.7", 153534851L, 1),
+ new osm_map_values(Navit.getInstance().T("Pakistan"), "60.83", "23.28", "77.89", "37.15", 217644321L, 1),
+ new osm_map_values(Navit.getInstance().T("Philippines"), "115.58", "4.47", "127.85", "21.60", 281428307L, 1),
+ new osm_map_values(Navit.getInstance().T("Saudi Arabia"), "33.2", "16.1", "55.9", "33.5", 242648303L, 1),
+ new osm_map_values(Navit.getInstance().T("Taiwan"), "119.1", "21.5", "122.5", "25.2", 1029080156L, 1),
+ new osm_map_values(Navit.getInstance().T("Thailand"), "97.5", "5.7", "105.2", "19.7", 185135492L, 1),
+ new osm_map_values(Navit.getInstance().T("Turkey"), "25.1", "35.8", "46.4", "42.8", 331087441L, 1),
+ new osm_map_values(Navit.getInstance().T("Turkmenistan"), "51.78", "35.07", "66.76", "42.91", 131045087L, 1),
+ new osm_map_values(Navit.getInstance().T("UAE+Other"), "51.5", "22.6", "56.7", "26.5", 128934674L, 1),
+ new osm_map_values(Navit.getInstance().T("Australia")+"+"+Navit.getInstance().T("Oceania"), "89.84", "-57.39", "179.79", "7.26", 782722650L, 0),
+ new osm_map_values(Navit.getInstance().T("Australia"), "110.5", "-44.2", "154.9", "-9.2", 348652900L, 0),
+ new osm_map_values(Navit.getInstance().T("Tasmania"), "144.0", "-45.1", "155.3", "-24.8", 253231890L, 1),
+ new osm_map_values(Navit.getInstance().T("Victoria")+"+"+Navit.getInstance().T("New South Wales"), "140.7", "-39.4", "153.7", "-26.9", 241500829L, 1),
+ new osm_map_values(Navit.getInstance().T("New Caledonia"), "157.85", "-25.05", "174.15", "-16.85", 115512336L, 1),
+ new osm_map_values(Navit.getInstance().T("New Zealand"), "165.2", "-47.6", "179.1", "-33.7", 239264192L, 1),
+ new osm_map_values(Navit.getInstance().T("Europe"), "-12.97", "33.59", "34.15", "72.10", 11984126789L, 0),
+ new osm_map_values(Navit.getInstance().T("Western Europe"), "-17.6", "34.5", "42.9", "70.9", 12648810717L, 1),
+ new osm_map_values(Navit.getInstance().T("Austria"), "9.4", "46.32", "17.21", "49.1", 898273634L, 1),
+ new osm_map_values(Navit.getInstance().T("Azores"), "-31.62", "36.63", "-24.67", "40.13", 112687225L, 1),
+ new osm_map_values(Navit.getInstance().T("Belgium"), "2.3", "49.5", "6.5", "51.6", 733035524L, 1),
+ new osm_map_values(Navit.getInstance().T("BeNeLux"), "2.08", "48.87", "7.78", "54.52", 1771971595L, 1),
+ new osm_map_values(Navit.getInstance().T("Netherlands"), "3.07", "50.75", "7.23", "53.73", 1191828033L, 1),
+ new osm_map_values(Navit.getInstance().T("Denmark"), "7.65", "54.32", "15.58", "58.07", 365606979L, 1),
+ new osm_map_values(Navit.getInstance().T("Faroe Islands"), "-7.8", "61.3", "-6.1", "62.5", 109377568L, 1),
+ new osm_map_values(Navit.getInstance().T("France"), "-5.45", "42.00", "8.44", "51.68", 3907969744L, 1),
+ new osm_map_values(Navit.getInstance().T("Alsace"), "6.79", "47.27", "8.48", "49.17", 354249349L, 2),
+ new osm_map_values(Navit.getInstance().T("Aquitaine"), "-2.27", "42.44", "1.50", "45.76", 443715019L, 2),
+ new osm_map_values(Navit.getInstance().T("Auvergne"), "2.01", "44.57", "4.54", "46.85", 287663213L, 2),
+ new osm_map_values(Navit.getInstance().T("Basse-Normandie"), "-2.09", "48.13", "1.03", "49.98", 262352354L, 2),
+ new osm_map_values(Navit.getInstance().T("Bourgogne"), "2.80", "46.11", "5.58", "48.45", 298868796L, 2),
+ new osm_map_values(Navit.getInstance().T("Bretagne"), "-5.58", "46.95", "-0.96", "48.99", 382770794L, 2),
+ new osm_map_values(Navit.getInstance().T("Centre"), "0.01", "46.29", "3.18", "48.99", 474224721L, 2),
+ new osm_map_values(Navit.getInstance().T("Champagne-Ardenne"), "3.34", "47.53", "5.94", "50.28", 269947824L, 2),
+ new osm_map_values(Navit.getInstance().T("Corse"), "8.12", "41.32", "9.95", "43.28", 129902146L, 2),
+ new osm_map_values(Navit.getInstance().T("Franche-Comte"), "5.20", "46.21", "7.83", "48.07", 324476070L, 2),
+ new osm_map_values(Navit.getInstance().T("Haute-Normandie"), "-0.15", "48.62", "1.85", "50.18", 202782876L, 2),
+ new osm_map_values(Navit.getInstance().T("Ile-de-France"), "1.40", "48.07", "3.61", "49.29", 311052699L, 2),
+ new osm_map_values(Navit.getInstance().T("Languedoc-Roussillon"), "1.53", "42.25", "4.89", "45.02", 380145667L, 2),
+ new osm_map_values(Navit.getInstance().T("Limousin"), "0.58", "44.87", "2.66", "46.50", 206696539L, 2),
+ new osm_map_values(Navit.getInstance().T("Lorraine"), "4.84", "47.77", "7.72", "49.73", 330777318L, 2),
+ new osm_map_values(Navit.getInstance().T("Midi-Pyrenees"), "-0.37", "42.18", "3.50", "45.10", 462618363L, 2),
+ new osm_map_values(Navit.getInstance().T("Nord-pas-de-Calais"), "1.42", "49.92", "4.49", "51.31", 368467511L, 2),
+ new osm_map_values(Navit.getInstance().T("Pays-de-la-Loire"), "-2.88", "46.20", "0.97", "48.62", 499471143L, 2),
+ new osm_map_values(Navit.getInstance().T("Picardie"), "1.25", "48.79", "4.31", "50.43", 374308041L, 2),
+ new osm_map_values(Navit.getInstance().T("Poitou-Charentes"), "-1.69", "45.04", "1.26", "47.23", 342125526L, 2),
+ new osm_map_values(Navit.getInstance().T("Provence-Alpes-Cote-d-Azur"), "4.21", "42.91", "7.99", "45.18", 390306134L, 2),
+ new osm_map_values(Navit.getInstance().T("Rhone-Alpes"), "3.65", "44.07", "7.88", "46.64", 510797942L, 2),
+ new osm_map_values(Navit.getInstance().T("Germany"), "5.18", "46.84", "15.47", "55.64", 3521359466L, 1),
+ new osm_map_values(Navit.getInstance().T("Baden-Wuerttemberg"), "7.32", "47.14", "10.57", "49.85", 674361124L, 2),
+ new osm_map_values(Navit.getInstance().T("Bayern"), "8.92", "47.22", "13.90", "50.62", 860161150L, 2),
+ new osm_map_values(Navit.getInstance().T("Mittelfranken"), "9.86", "48.78", "11.65", "49.84", 203055195L, 2),
+ new osm_map_values(Navit.getInstance().T("Niederbayern"), "11.55", "47.75", "14.12", "49.42", 312924770L, 2),
+ new osm_map_values(Navit.getInstance().T("Oberbayern"), "10.67", "47.05", "13.57", "49.14", 382734883L, 2),
+ new osm_map_values(Navit.getInstance().T("Oberfranken"), "10.31", "49.54", "12.49", "50.95", 235258691L, 2),
+ new osm_map_values(Navit.getInstance().T("Oberpfalz"), "11.14", "48.71", "13.47", "50.43", 264536012L, 2),
+ new osm_map_values(Navit.getInstance().T("Schwaben"), "9.27", "47.10", "11.36", "49.09", 321141607L, 2),
+ new osm_map_values(Navit.getInstance().T("Unterfranken"), "8.59", "49.16", "10.93", "50.67", 303720890L, 2),
+ new osm_map_values(Navit.getInstance().T("Berlin"), "13.03", "52.28", "13.81", "52.73", 169019946L, 2),
+ new osm_map_values(Navit.getInstance().T("Brandenburg"), "11.17", "51.30", "14.83", "53.63", 323497599L, 2),
+ new osm_map_values(Navit.getInstance().T("Bremen"), "8.43", "52.96", "9.04", "53.66", 150963608L, 2),
+ new osm_map_values(Navit.getInstance().T("Hamburg"), "9.56", "53.34", "10.39", "53.80", 156284421L, 2),
+ new osm_map_values(Navit.getInstance().T("Hessen"), "7.72", "49.34", "10.29", "51.71", 432279328L, 2),
+ new osm_map_values(Navit.getInstance().T("Mecklenburg-Vorpommern"), "10.54", "53.05", "14.48", "55.05", 213183908L, 2),
+ new osm_map_values(Navit.getInstance().T("Niedersachsen"), "6.40", "51.24", "11.69", "54.22", 819766939L, 2),
+ new osm_map_values(Navit.getInstance().T("Nordrhein-westfalen"), "5.46", "50.26", "9.52", "52.59", 967053517L, 2),
+ new osm_map_values(Navit.getInstance().T("Rheinland-Pfalz"), "6.06", "48.91", "8.56", "51.00", 442868899L, 2),
+ new osm_map_values(Navit.getInstance().T("Saarland"), "6.30", "49.06", "7.46", "49.69", 157721162L, 2),
+ new osm_map_values(Navit.getInstance().T("Sachsen-Anhalt"), "10.50", "50.88", "13.26", "53.11", 287785088L, 2),
+ new osm_map_values(Navit.getInstance().T("Sachsen"), "11.82", "50.11", "15.10", "51.73", 342620834L, 2),
+ new osm_map_values(Navit.getInstance().T("Schleswig-Holstein"), "7.41", "53.30", "11.98", "55.20", 280293910L, 2),
+ new osm_map_values(Navit.getInstance().T("Thueringen"), "9.81", "50.15", "12.72", "51.70", 269428239L, 2),
+ new osm_map_values(Navit.getInstance().T("Germany")+"+"+Navit.getInstance().T("Austria")+"+"+Navit.getInstance().T("Switzerland"), "3.4", "44.5", "18.6", "55.1", 5746126429L, 1),
+ new osm_map_values(Navit.getInstance().T("Iceland"), "-25.3", "62.8", "-11.4", "67.5", 124837162L, 1),
+ new osm_map_values(Navit.getInstance().T("Ireland"), "-11.17", "51.25", "-5.23", "55.9", 234750271L, 1),
+ new osm_map_values(Navit.getInstance().T("Italy"), "6.52", "36.38", "18.96", "47.19", 1610171395L, 1),
+ new osm_map_values(Navit.getInstance().T("Spain")+"+"+Navit.getInstance().T("Portugal"), "-11.04", "34.87", "4.62", "44.41", 1039624918L, 1),
+ new osm_map_values(Navit.getInstance().T("Mallorca"), "2.2", "38.8", "4.7", "40.2", 137200636L, 2),
+ new osm_map_values(Navit.getInstance().T("Galicia"), "-10.0", "41.7", "-6.3", "44.1", 174549553L, 2),
+ new osm_map_values(Navit.getInstance().T("Scandinavia"), "4.0", "54.4", "32.1", "71.5", 1398661090L, 1),
+ new osm_map_values(Navit.getInstance().T("Finland"), "18.6", "59.2", "32.3", "70.3", 460997178L, 1),
+ new osm_map_values(Navit.getInstance().T("Denmark"), "7.49", "54.33", "13.05", "57.88", 321870414L, 1),
+ new osm_map_values(Navit.getInstance().T("Switzerland"), "5.79", "45.74", "10.59", "47.84", 552565332L, 1),
+ new osm_map_values(Navit.getInstance().T("United Kingdom"), "-9.7", "49.6", "2.2", "61.2", 901724648L, 1),
+ new osm_map_values(Navit.getInstance().T("England"), "-7.80", "48.93", "2.41", "56.14", 937728414L, 1),
+ new osm_map_values(Navit.getInstance().T("Buckinghamshire"), "-1.19", "51.44", "-0.43", "52.25", 142256978L, 2),
+ new osm_map_values(Navit.getInstance().T("Cambridgeshire"), "-0.55", "51.96", "0.56", "52.79", 142334001L, 2),
+ new osm_map_values(Navit.getInstance().T("Cumbria"), "-3.96", "53.85", "-2.11", "55.24", 144422460L, 2),
+ new osm_map_values(Navit.getInstance().T("East yorkshire with hull"), "-1.16", "53.50", "0.54", "54.26", 141518744L, 2),
+ new osm_map_values(Navit.getInstance().T("Essex"), "-0.07", "51.40", "1.36", "52.14", 162542730L, 2),
+ new osm_map_values(Navit.getInstance().T("Herefordshire"), "-3.19", "51.78", "-2.29", "52.45", 129368660L, 2),
+ new osm_map_values(Navit.getInstance().T("Kent"), "-0.02", "50.81", "1.65", "51.53", 145482562L, 2),
+ new osm_map_values(Navit.getInstance().T("Lancashire"), "-3.20", "53.43", "-2.00", "54.29", 148964975L, 2),
+ new osm_map_values(Navit.getInstance().T("Leicestershire"), "-1.65", "52.34", "-0.61", "53.03", 154199956L, 2),
+ new osm_map_values(Navit.getInstance().T("Norfolk"), "0.10", "52.30", "2.04", "53.41", 146017009L, 2),
+ new osm_map_values(Navit.getInstance().T("Nottinghamshire"), "-1.39", "52.73", "-0.62", "53.55", 147986548L, 2),
+ new osm_map_values(Navit.getInstance().T("Oxfordshire"), "-1.77", "51.41", "-0.82", "52.22", 142240992L, 2),
+ new osm_map_values(Navit.getInstance().T("Shropshire"), "-3.29", "52.26", "-2.18", "53.05", 136909363L, 2),
+ new osm_map_values(Navit.getInstance().T("Somerset"), "-3.89", "50.77", "-2.20", "51.40", 145186096L, 2),
+ new osm_map_values(Navit.getInstance().T("South yorkshire"), "-1.88", "53.25", "-0.80", "53.71", 145902650L, 2),
+ new osm_map_values(Navit.getInstance().T("Suffolk"), "0.29", "51.88", "1.81", "52.60", 143799697L, 2),
+ new osm_map_values(Navit.getInstance().T("Surrey"), "-0.90", "51.02", "0.10", "51.52", 157987139L, 2),
+ new osm_map_values(Navit.getInstance().T("Wiltshire"), "-2.41", "50.90", "-1.44", "51.76", 138652346L, 2),
+ new osm_map_values(Navit.getInstance().T("Scotland"), "-8.13", "54.49", "-0.15", "61.40", 258853845L, 2),
+ new osm_map_values(Navit.getInstance().T("Wales"), "-5.56", "51.28", "-2.60", "53.60", 193593409L, 2),
+ new osm_map_values(Navit.getInstance().T("Albania"), "19.09", "39.55", "21.12", "42.72", 146199817L, 1),
+ new osm_map_values(Navit.getInstance().T("Belarus"), "23.12", "51.21", "32.87", "56.23", 324470696L, 1),
+ new osm_map_values(Navit.getInstance().T("Russian Federation"), "27.9", "41.5", "190.4", "77.6", 2148314279L, 1),
+ new osm_map_values(Navit.getInstance().T("Bulgaria"), "24.7", "42.1", "24.8", "42.1", 109869373L, 1),
+ new osm_map_values(Navit.getInstance().T("Bosnia and Herzegovina"), "15.69", "42.52", "19.67", "45.32", 187122485L, 1),
+ new osm_map_values(Navit.getInstance().T("Czech Republic"), "11.91", "48.48", "19.02", "51.17", 904838442L, 1),
+ new osm_map_values(Navit.getInstance().T("Croatia"), "13.4", "42.1", "19.4", "46.9", 460854751L, 1),
+ new osm_map_values(Navit.getInstance().T("Estonia"), "21.5", "57.5", "28.2", "59.6", 173378927L, 1),
+ new osm_map_values(Navit.getInstance().T("Greece"), "28.9", "37.8", "29.0", "37.8", 109435051L, 1),
+ new osm_map_values(Navit.getInstance().T("Crete"), "23.3", "34.5", "26.8", "36.0", 115985063L, 1),
+ new osm_map_values(Navit.getInstance().T("Hungary"), "16.08", "45.57", "23.03", "48.39", 350318541L, 1),
+ new osm_map_values(Navit.getInstance().T("Latvia"), "20.7", "55.6", "28.3", "58.1", 188188140L, 1),
+ new osm_map_values(Navit.getInstance().T("Lithuania"), "20.9", "53.8", "26.9", "56.5", 217852597L, 1),
+ new osm_map_values(Navit.getInstance().T("Poland"), "13.6", "48.8", "24.5", "55.0", 1464968657L, 1),
+ new osm_map_values(Navit.getInstance().T("Romania"), "20.3", "43.5", "29.9", "48.4", 347931565L, 1),
+ new osm_map_values(Navit.getInstance().T("Slovakia"), "16,8", "47,7", "22,6", "49,7", 420533039L, 1),
+ new osm_map_values(Navit.getInstance().T("Ukraine"), "22.0", "44.3", "40.4", "52.4", 793611912L, 1),
+ new osm_map_values(Navit.getInstance().T("North America"), "-178.1", "6.5", "-10.4", "84.0", 5601866516L, 0),
+ new osm_map_values(Navit.getInstance().T("Alaska"), "-179.5", "49.5", "-129", "71.6", 207746039L, 1),
+ new osm_map_values(Navit.getInstance().T("Canada"), "-141.3", "41.5", "-52.2", "70.2", 2635719651L, 1),
+ new osm_map_values(Navit.getInstance().T("Hawaii"), "-161.07", "18.49", "-154.45", "22.85", 115016656L, 1),
+ new osm_map_values(Navit.getInstance().T("USA")+Navit.getInstance().T(" (except Alaska and Hawaii)"), "-125.4", "24.3", "-66.5", "49.3", 4060487198L, 1),
+ new osm_map_values(Navit.getInstance().T("Midwest"), "-104.11", "35.92", "-80.46", "49.46", 1145596450L, 2),
+ new osm_map_values(Navit.getInstance().T("Michigan"), "-90.47", "41.64", "-79.00", "49.37", 538247019L, 2),
+ new osm_map_values(Navit.getInstance().T("Ohio"), "-84.87", "38.05", "-79.85", "43.53", 277022336L, 2),
+ new osm_map_values(Navit.getInstance().T("Northeast"), "-80.58", "38.72", "-66.83", "47.53", 1017160709L, 2),
+ new osm_map_values(Navit.getInstance().T("Massachusetts"), "-73.56", "40.78", "-68.67", "42.94", 340055487L, 2),
+ new osm_map_values(Navit.getInstance().T("Vermont"), "-73.49", "42.68", "-71.41", "45.07", 139626067L, 2),
+ new osm_map_values(Navit.getInstance().T("Pacific"), "-180.05", "15.87", "-129.75", "73.04", 207090640L, 2),
+ new osm_map_values(Navit.getInstance().T("South"), "-106.70", "23.98", "-71.46", "40.70", 1747935356L, 2),
+ new osm_map_values(Navit.getInstance().T("Arkansas"), "-94.67", "32.95", "-89.59", "36.60", 155658661L, 2),
+ new osm_map_values(Navit.getInstance().T("District of Columbia"), "-77.17", "38.74", "-76.86", "39.05", 129235755L, 2),
+ new osm_map_values(Navit.getInstance().T("Florida"), "-88.75", "23.63", "-77.67", "31.05", 224022108L, 2),
+ new osm_map_values(Navit.getInstance().T("Louisiana"), "-94.09", "28.09", "-88.62", "33.07", 210120605L, 2),
+ new osm_map_values(Navit.getInstance().T("Maryland"), "-79.54", "37.83", "-74.99", "40.22", 276462622L, 2),
+ new osm_map_values(Navit.getInstance().T("Mississippi"), "-91.71", "29.99", "-88.04", "35.05", 177858031L, 2),
+ new osm_map_values(Navit.getInstance().T("Oklahoma"), "-103.41", "33.56", "-94.38", "37.38", 200061473L, 2),
+ new osm_map_values(Navit.getInstance().T("Texas"), "-106.96", "25.62", "-92.97", "36.58", 430089141L, 2),
+ new osm_map_values(Navit.getInstance().T("Virginia"), "-83.73", "36.49", "-74.25", "39.52", 384187569L, 2),
+ new osm_map_values(Navit.getInstance().T("West Virginia"), "-82.70", "37.15", "-77.66", "40.97", 220552071L, 2),
+ new osm_map_values(Navit.getInstance().T("West"), "-133.11", "31.28", "-101.99", "49.51", 1152909162L, 2),
+ new osm_map_values(Navit.getInstance().T("Arizona"), "-114.88", "30.01", "-108.99", "37.06", 182826833L, 2),
+ new osm_map_values(Navit.getInstance().T("California"), "-125.94", "32.43", "-114.08", "42.07", 586923326L, 2),
+ new osm_map_values(Navit.getInstance().T("Colorado"), "-109.11", "36.52", "-100.41", "41.05", 228623724L, 2),
+ new osm_map_values(Navit.getInstance().T("Idaho"), "-117.30", "41.93", "-110.99", "49.18", 170684507L, 2),
+ new osm_map_values(Navit.getInstance().T("Montana"), "-116.10", "44.31", "-102.64", "49.74", 176229800L, 2),
+ new osm_map_values(Navit.getInstance().T("New Mexico"), "-109.10", "26.98", "-96.07", "37.05", 361793070L, 2),
+ new osm_map_values(Navit.getInstance().T("Nevada"), "-120.2", "35.0", "-113.8", "42.1", 200614482L, 2),
+ new osm_map_values(Navit.getInstance().T("Oregon"), "-124.8", "41.8", "-116.3", "46.3", 211462685L, 2),
+ new osm_map_values(Navit.getInstance().T("Utah"), "-114.11", "36.95", "-108.99", "42.05", 151590197L, 2),
+ new osm_map_values(Navit.getInstance().T("Washington State"), "-125.0", "45.5", "-116.9", "49.0", 222553768L, 2),
+ new osm_map_values(Navit.getInstance().T("South+Middle America"), "-83.5", "-56.3", "-30.8", "13.7", 958895383L, 0),
+ new osm_map_values(Navit.getInstance().T("Argentina"), "-73.9", "-57.3", "-51.6", "-21.0", 376857648L, 1),
+ new osm_map_values(Navit.getInstance().T("Argentina")+"+"+Navit.getInstance().T("Chile"), "-77.2", "-56.3", "-52.7", "-16.1", 420275812L, 1),
+ new osm_map_values(Navit.getInstance().T("Bolivia"), "-70.5", "-23.1", "-57.3", "-9.3", 175937824L, 1),
+ new osm_map_values(Navit.getInstance().T("Brazil"), "-71.4", "-34.7", "-32.8", "5.4", 664872975L, 1),
+ new osm_map_values(Navit.getInstance().T("Chile"), "-81.77", "-58.50", "-65.46", "-17.41", 241657330L, 1),
+ new osm_map_values(Navit.getInstance().T("Cuba"), "-85.3", "19.6", "-74.0", "23.6", 129043575L, 1),
+ new osm_map_values(Navit.getInstance().T("Colombia"), "-79.1", "-4.0", "-66.7", "12.6", 212016580L, 1),
+ new osm_map_values(Navit.getInstance().T("Ecuador"), "-82.6", "-5.4", "-74.4", "2.3", 158857591L, 1),
+ new osm_map_values(Navit.getInstance().T("Guyana")+"+"+Navit.getInstance().T("Suriname")+"+"+Navit.getInstance().T("Guyane Francaise"), "-62.0", "1.0", "-51.2", "8.9", 123000072L, 1),
+ new osm_map_values(Navit.getInstance().T("Haiti")+"+"+Navit.getInstance().T("Dominican Republic"), "-74.8", "17.3", "-68.2", "20.1", 149925689L, 1),
+ new osm_map_values(Navit.getInstance().T("Jamaica"), "-78.6", "17.4", "-75.9", "18.9", 113961998L, 1),
+ new osm_map_values(Navit.getInstance().T("Mexico"), "-117.6", "14.1", "-86.4", "32.8", 551307973L, 1),
+ new osm_map_values(Navit.getInstance().T("Paraguay"), "-63.8", "-28.1", "-53.6", "-18.8", 159498397L, 1),
+ new osm_map_values(Navit.getInstance().T("Peru"), "-82.4", "-18.1", "-67.5", "0.4", 212490557L, 1),
+ new osm_map_values(Navit.getInstance().T("Uruguay"), "-59.2", "-36.5", "-51.7", "-29.7", 157482719L, 1),
+ new osm_map_values(Navit.getInstance().T("Venezuela"), "-73.6", "0.4", "-59.7", "12.8", 167295729L, 1)
+ };
+
+ private final String map_filename_path;
+
+ public static NavitMap[] getAvailableMaps() {
+ class filterMaps implements FilenameFilter {
+ public boolean accept(File dir, String filename) {
+ return (filename.endsWith(".bin"));
+ }
+ }
+ NavitMap maps[] = new NavitMap[0];
+ File map_dir = new File(Navit.map_filename_path);
+ String map_file_names[] = map_dir.list(new filterMaps());
+ if (map_file_names != null) {
+ maps = new NavitMap[map_file_names.length];
+ for (int map_file_index = 0; map_file_index < map_file_names.length; map_file_index++) {
+ maps[map_file_index] = new NavitMap(Navit.map_filename_path, map_file_names[map_file_index]);
+ }
+ }
+ return maps;
+ }
+ private Boolean stop_me = false;
+ private final osm_map_values map_values;
+ private final int map_id;
+ private long uiLastUpdated = -1;
+
+ private Boolean retryDownload = false; //Download failed, but
+ //we should try to resume
+ private static final int SOCKET_CONNECT_TIMEOUT = 60000; // 60 secs.
+ private static final int SOCKET_READ_TIMEOUT = 120000; // 120 secs.
+ private static final int MAP_WRITE_FILE_BUFFER = 1024 * 64;
+ private static final int MAP_WRITE_MEM_BUFFER = 1024 * 64;
+ private static final int MAP_READ_FILE_BUFFER = 1024 * 64;
+ private static final int UPDATE_PROGRESS_TIME_NS = 1000 * 1000000; // 1ns=1E-9s
+ private static final int MAX_RETRIES = 5;
+ private static final String TAG = "NavitMapDownloader";
+ private int retry_counter = 0;
+
+ NavitMapDownloader(int map_id) {
+ this.map_values = osm_maps[map_id];
+ this.map_id=map_id;
+ this.map_filename_path=Navit.map_filename_path;
+ }
+
+ public void run() {
+ stop_me = false;
+ retry_counter = 0;
+
+ Log.v(TAG, "start download " + map_values.map_name);
+ updateProgress(0, map_values.est_size_bytes, Navit.getInstance().T("downloading") + ": " + map_values.map_name);
+
+ boolean success;
+ do {
+ try {
+ Thread.sleep(10 + retry_counter * 1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ retryDownload = false;
+ success = download_osm_map();
+ } while ( !success
+ && retryDownload
+ && retry_counter < MAX_RETRIES
+ && !stop_me);
+
+ if (success) {
+ toast(map_values.map_name + " " + Navit.getInstance().T("ready"));
+ getMapInfoFile().delete();
+ Log.d(TAG, "success");
+ }
+
+ if (success || stop_me ) {
+ NavitDialogs.sendDialogMessage( NavitDialogs.MSG_MAP_DOWNLOAD_FINISHED
+ , map_filename_path + map_values.map_name + ".bin", null, -1, success ? 1 : 0 , map_id );
+ }
+ }
+
+ public void stop_thread() {
+ stop_me = true;
+ Log.d(TAG, "stop_me -> true");
+ }
+
+ private boolean checkFreeSpace(long needed_bytes) {
+ long free_space = getFreeSpace();
+
+ if ( needed_bytes <= 0 )
+ needed_bytes = MAP_WRITE_FILE_BUFFER;
+
+ if (free_space < needed_bytes ) {
+ String msg;
+ Log.e(TAG, "Not enough free space or media not available. Please free at least " + needed_bytes / 1024 /1024 + "Mb.");
+ if(free_space<0)
+ msg=Navit.getInstance().T("Media selected for map storage is not available");
+ else
+ msg=Navit.getInstance().T("Not enough free space");
+ updateProgress(free_space, needed_bytes, Navit.getInstance().T("Error downloading map!") + "\n" + msg);
+ return false;
+ }
+ return true;
+ }
+
+ private boolean deleteMap() {
+ File finalOutputFile = getMapFile();
+
+ if (finalOutputFile.exists()) {
+ Message msg =
+ Message.obtain(Navit.getInstance().getNavitGraphics().callback_handler,
+ NavitGraphics.msg_type.CLB_DELETE_MAP.ordinal());
+ Bundle b = new Bundle();
+ b.putString("title", finalOutputFile.getAbsolutePath());
+ msg.setData(b);
+ msg.sendToTarget();
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @return
+ */
+ private boolean download_osm_map() {
+ long already_read = 0;
+ long real_size_bytes;
+ boolean resume = true;
+
+ File outputFile = getDestinationFile();
+ long old_download_size = outputFile.length();
+
+ URL url = null;
+ if (old_download_size > 0) {
+ url = readFileInfo();
+ }
+
+ if (url == null) {
+ resume = false;
+ url = getDownloadURL();
+ }
+
+ // URL url = new URL("http://192.168.2.101:8080/zweibruecken.bin");
+ URLConnection c = initConnection(url);
+ if (c != null) {
+
+ if (resume) {
+ c.setRequestProperty("Range", "bytes=" + old_download_size + "-");
+ already_read = old_download_size;
+ }
+ try {
+ real_size_bytes=Long.parseLong(c.getHeaderField("Content-Length")) + already_read;
+ } catch(Exception e) {
+ real_size_bytes=-1;
+ }
+
+ long fileTime = c.getLastModified();
+
+ if (!resume) {
+ outputFile.delete();
+ writeFileInfo(c, real_size_bytes);
+ }
+
+ if (real_size_bytes <= 0)
+ real_size_bytes = map_values.est_size_bytes;
+
+ Log.d(TAG, "size: " + real_size_bytes + ", read: " + already_read + ", timestamp: " + fileTime
+ + ", Connection ref: " + c.getURL());
+
+ if (checkFreeSpace(real_size_bytes - already_read)
+ && downloadData(c, already_read, real_size_bytes, resume, outputFile)) {
+
+ File finalOutputFile = getMapFile();
+ // delete an already existing file first
+ finalOutputFile.delete();
+ // rename file to its final name
+ outputFile.renameTo(finalOutputFile);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private File getDestinationFile() {
+ File outputFile = new File(map_filename_path, map_values.map_name + ".tmp");
+ outputFile.getParentFile().mkdir();
+ return outputFile;
+ }
+
+ private boolean downloadData(URLConnection c, long already_read, long real_size_bytes
+ , boolean resume,File outputFile) {
+ boolean success = false;
+ BufferedOutputStream buf = getOutputStream(outputFile, resume);
+ BufferedInputStream bif = getInputStream(c);
+
+ if (buf != null && bif != null) {
+ success = readData(buf, bif, already_read, real_size_bytes);
+ // always cleanup, as we might get errors when trying to resume
+ try {
+ buf.flush();
+ buf.close();
+
+ bif.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ return success;
+ }
+
+ private URL getDownloadURL() {
+ URL url;
+ try {
+ url =
+ new URL("http://maps.navit-project.org/api/map/?bbox=" + map_values.lon1 + "," + map_values.lat1
+ + "," + map_values.lon2 + "," + map_values.lat2);
+ } catch (MalformedURLException e) {
+ Log.e(TAG, "We failed to create a URL to " + map_values.map_name);
+ e.printStackTrace();
+ return null;
+ }
+ Log.v(TAG, "connect to " + url.toString());
+ return url;
+ }
+
+ private long getFreeSpace() {
+ try {
+ StatFs fsInfo = new StatFs(map_filename_path);
+ return (long)fsInfo.getAvailableBlocks() * fsInfo.getBlockSize();
+ } catch(Exception e) {
+ return -1;
+ }
+ }
+
+ private BufferedInputStream getInputStream(URLConnection c) {
+ BufferedInputStream bif;
+ try {
+ bif = new BufferedInputStream(c.getInputStream(), MAP_READ_FILE_BUFFER);
+ } catch (FileNotFoundException e) {
+ Log.e(TAG, "File not found on server: " + e);
+ if (retry_counter > 0) {
+ getMapInfoFile().delete();
+ }
+ enableRetry();
+ bif = null;
+ } catch (IOException e) {
+ Log.e(TAG, "Error reading from server: " + e);
+ enableRetry();
+ bif = null;
+ }
+ return bif;
+ }
+
+ private File getMapFile() {
+ return new File(map_filename_path, map_values.map_name + ".bin");
+ }
+
+ private File getMapInfoFile() {
+ return new File(map_filename_path, map_values.map_name + ".tmp.info");
+ }
+
+ private BufferedOutputStream getOutputStream(File outputFile, boolean resume) {
+ BufferedOutputStream buf;
+ try {
+ buf = new BufferedOutputStream(new FileOutputStream(outputFile, resume), MAP_WRITE_FILE_BUFFER);
+ } catch (FileNotFoundException e) {
+ Log.e(TAG, "Could not open output file for writing: " + e);
+ buf = null;
+ }
+ return buf;
+ }
+
+ private URLConnection initConnection(URL url) {
+ HttpURLConnection c;
+ try {
+ c = (HttpURLConnection) url.openConnection();
+ c.setRequestMethod("GET");
+ } catch (Exception e) {
+ Log.e(TAG, "Failed connecting server: " + e);
+ enableRetry();
+ return null;
+ }
+
+ c.setReadTimeout(SOCKET_READ_TIMEOUT);
+ c.setConnectTimeout(SOCKET_CONNECT_TIMEOUT);
+ return c;
+ }
+
+ private boolean readData(OutputStream buf, InputStream bif, long already_read, long real_size_bytes) {
+ long start_timestamp = System.nanoTime();
+ byte[] buffer = new byte[MAP_WRITE_MEM_BUFFER];
+ int len1;
+ long startOffset = already_read;
+ boolean success = false;
+
+ try {
+ while (!stop_me && (len1 = bif.read(buffer)) != -1) {
+ already_read += len1;
+ updateProgress(start_timestamp, startOffset, already_read, real_size_bytes);
+
+ try {
+ buf.write(buffer, 0, len1);
+ } catch (IOException e) {
+ Log.d(TAG, "Error: " + e);
+ if ( !checkFreeSpace(real_size_bytes - already_read + MAP_WRITE_FILE_BUFFER)) {
+ if (deleteMap()) {
+ enableRetry();
+ } else {
+ updateProgress(already_read, real_size_bytes, Navit.getInstance().T("Error downloading map!") + "\n"
+ + Navit.getInstance().T("Not enough free space"));
+ }
+ } else {
+ updateProgress(already_read, real_size_bytes, Navit.getInstance().T("Error writing map!"));
+ }
+
+ return false;
+ }
+ }
+
+ if (stop_me) {
+ toast(Navit.getInstance().T("Map download aborted!"));
+ } else if ( already_read < real_size_bytes ) {
+ Log.d(TAG, "Server send only " + already_read + " bytes of " + real_size_bytes);
+ enableRetry();
+ } else {
+ success = true;
+ }
+ } catch (IOException e) {
+ Log.d(TAG, "Error: " + e);
+
+ enableRetry();
+ updateProgress(already_read, real_size_bytes, Navit.getInstance().T("Error downloading map!"));
+ }
+
+ return success;
+ }
+
+ private URL readFileInfo() {
+ URL url = null;
+ try {
+ ObjectInputStream infoStream = new ObjectInputStream(new FileInputStream(getMapInfoFile()));
+ String resume_proto = infoStream.readUTF();
+ infoStream.readUTF(); // read the host name (unused for now)
+ String resume_file = infoStream.readUTF();
+ infoStream.close();
+ // looks like the same file, try to resume
+ Log.v(TAG, "Try to resume download");
+ url = new URL(resume_proto + "://" + "maps.navit-project.org" + resume_file);
+ } catch (Exception e) {
+ getMapInfoFile().delete();
+ }
+ return url;
+ }
+
+ private void toast(String message) {
+ NavitDialogs.sendDialogMessage(NavitDialogs.MSG_TOAST, null, message, -1, 0, 0);
+ }
+
+ private void updateProgress(long startTime, long offsetBytes, long readBytes, long maxBytes) {
+ long currentTime = System.nanoTime();
+
+ if ((currentTime > uiLastUpdated + UPDATE_PROGRESS_TIME_NS) && startTime!=currentTime) {
+ float per_second_overall = (readBytes - offsetBytes) / ((currentTime - startTime) / 1000000000f);
+ long bytes_remaining = maxBytes - readBytes;
+ int eta_seconds = (int) (bytes_remaining / per_second_overall);
+
+ String eta_string;
+ if (eta_seconds > 60) {
+ eta_string = (int) (eta_seconds / 60f) + " m";
+ } else {
+ eta_string = eta_seconds + " s";
+ }
+ String info =
+ String.format("%s: %s\n %dMb / %dMb\n %.1f kb/s %s: %s", Navit.getInstance().T("downloading")
+ , map_values.map_name, readBytes / 1024 / 1024, maxBytes / 1024 / 1024,
+ per_second_overall / 1024f, Navit.getInstance().T("ETA"), eta_string);
+
+ if (retry_counter > 0) {
+ info += "\n Retry " + retry_counter + "/" + MAX_RETRIES;
+ }
+ Log.d(TAG, "info: " + info);
+
+ updateProgress(readBytes, maxBytes, info);
+ uiLastUpdated = currentTime;
+ }
+ }
+
+ private void updateProgress(long positionBytes, long maximumBytes, String infoText) {
+ NavitDialogs.sendDialogMessage(NavitDialogs.MSG_PROGRESS_BAR, Navit.getInstance().T("Map download"), infoText
+ , NavitDialogs.DIALOG_MAPDOWNLOAD, (int) (maximumBytes / 1024),
+ (int) (positionBytes / 1024));
+ }
+
+ private void writeFileInfo(URLConnection c, long sizeInBytes) {
+ ObjectOutputStream infoStream;
+ try {
+ infoStream = new ObjectOutputStream(new FileOutputStream(getMapInfoFile()));
+ infoStream.writeUTF(c.getURL().getProtocol());
+ infoStream.writeUTF(c.getURL().getHost());
+ infoStream.writeUTF(c.getURL().getFile());
+ infoStream.writeLong(sizeInBytes);
+ infoStream.close();
+ } catch (Exception e) {
+ Log.e(TAG, "Could not write info file for map download. Resuming will not be possible. (" + e.getMessage() + ")");
+ }
+ }
+
+ private void enableRetry() {
+ retryDownload = true;
+ retry_counter++;
+ }
+ // dialog send helper methods
+}
diff --git a/navit/android/src/org/navitproject/navit/NavitSpeech2.java b/navit/android/src/org/navitproject/navit/NavitSpeech2.java
index b4ec85d4e..23419ac0f 100644
--- a/navit/android/src/org/navitproject/navit/NavitSpeech2.java
+++ b/navit/android/src/org/navitproject/navit/NavitSpeech2.java
@@ -20,7 +20,6 @@
package org.navitproject.navit;
import android.content.Intent;
-import android.content.Context;
import android.content.DialogInterface;
import android.content.pm.PackageManager;
import android.app.AlertDialog;
@@ -28,20 +27,21 @@ import android.speech.tts.TextToSpeech;
import android.util.Log;
+@SuppressWarnings("unused")
public class NavitSpeech2 implements TextToSpeech.OnInitListener, NavitActivityResult {
private TextToSpeech mTts;
- private Navit navit;
- int MY_DATA_CHECK_CODE=1;
+ private final Navit navit;
+ private final int MY_DATA_CHECK_CODE=1;
public void onInit(int status)
{
- Log.e("NavitSpeech2","Status "+status);
+ Log.d("NavitSpeech2","Status "+status);
}
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
- Log.e("NavitSpeech2","onActivityResult "+requestCode+" "+resultCode);
+ Log.d("NavitSpeech2","onActivityResult "+requestCode+" "+resultCode);
if (requestCode == MY_DATA_CHECK_CODE) {
if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
// success, create the TTS instance
@@ -53,7 +53,7 @@ public class NavitSpeech2 implements TextToSpeech.OnInitListener, NavitActivityR
.setTitle(R.string.TTS_title_data_missing)
.setMessage(R.string.TTS_qery_install_data)
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
+ public void onClick(DialogInterface dialog, int which) {
Intent installIntent = new Intent();
installIntent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
navit.startActivity(installIntent);
@@ -69,11 +69,11 @@ public class NavitSpeech2 implements TextToSpeech.OnInitListener, NavitActivityR
{
this.navit=navit;
navit.setActivityResult(1, this);
- Log.e("NavitSpeech2","Create");
+ Log.d("NavitSpeech2","Create");
Intent checkIntent = new Intent();
checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
if (navit.getPackageManager().resolveActivity(checkIntent, PackageManager.MATCH_DEFAULT_ONLY) != null) {
- Log.e("NavitSpeech2","ACTION_CHECK_TTS_DATA available");
+ Log.d("NavitSpeech2","ACTION_CHECK_TTS_DATA available");
navit.startActivityForResult(checkIntent, MY_DATA_CHECK_CODE);
} else {
Log.e("NavitSpeech2","ACTION_CHECK_TTS_DATA not available, assume tts is working");
diff --git a/navit/android/src/org/navitproject/navit/NavitTextTranslations.java b/navit/android/src/org/navitproject/navit/NavitTextTranslations.java
deleted file mode 100644
index 93aa5fe76..000000000
--- a/navit/android/src/org/navitproject/navit/NavitTextTranslations.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/**
- * Navit, a modular navigation system.
- * Copyright (C) 2005-2008 Navit Team
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-package org.navitproject.navit;
-
-import java.util.HashMap;
-
-import android.util.Log;
-
-public class NavitTextTranslations
-{
- static String main_language = "en";
- static String sub_language = "EN";
- static String fallback_language = "en";
- static String fallback_sub_language = "EN";
- private static HashMap<String, HashMap<String, String>> Navit_text_lookup = new HashMap<String, HashMap<String, String>>();
-
- public static void init()
- {
- Log.e("NavitTextTranslations", "initializing translated text ...");
- String k = null;
- String[] v = null;
-/*
- k = "exit navit";
- v = new String[]{"en", "Exit Navit", "de", "Navit beenden", "nl", "Navit afsluiten", "fr","Quittez Navit"};
- p(k, v);
-
- k = "zoom in";
- v = new String[]{"en", "Zoom in", "fr", "Zoom-avant"};
- p(k, v);
-
- k = "zoom out";
- v = new String[]{"en", "Zoom out", "fr", "Zoom-arrière", "nl", "Zoom uit"};
- p(k, v);
-
- k = "address search";
- v = new String[]{"en", "Address search", "de", "Adresse suchen", "nl", "Zoek adres", "fr","Cherchez adresse"};
- p(k, v);
-
- k = "Mapdownload";
- v = new String[]{"en", "Mapdownload", "de", "Kartendownload"};
- p(k, v);
-
- k = "downloading";
- v = new String[]{"en", "downloading"};
- p(k, v);
-
- k = "Downloaded maps";
- v = new String[]{"en", "Downloaded maps", "de", "Heruntergeladene Karten", "nl", "Gedownloade kaarten", "fr","Cartes téléchargées" };
- p(k, v);
-
- k = "ETA";
- v = new String[]{"en", "ETA", "de", "fertig in"};
- p(k, v);
-
- k = "Error downloading map";
- v = new String[]{"en", "Error downloading map!", "de", "Fehler beim Kartendownload"};
- p(k, v);
-
- k = "ready";
- v = new String[]{"en", "ready", "de", "fertig"};
- p(k, v);
-
- k = "Ok";
- v = new String[]{"en", "OK"};
- p(k, v);
-
- k = "No address found";
- v = new String[]{"en", "No address found", "de", "Keine Adresse gefunden"};
- p(k, v);
-
- k = "Enter: City and Street";
- v = new String[]{"en", "Enter: City, Street", "de", "Stadt und Straße:"};
- p(k, v);
-
- k = "No search string entered";
- v = new String[]{"en", "No text entered", "de", "Keine Eingabe"};
- p(k, v);
-
- k = "setting destination to";
- v = new String[]{"en", "Setting destination to:", "de", "neues Fahrziel"};
- p(k, v);
-
- k = "getting search results";
- v = new String[]{"en", "getting search results", "de", "lade Suchergebnisse"};
- p(k, v);
-
- k = "searching ...";
- v = new String[]{"en", "searching ...", "de", "Suche läuft ..."};
- p(k, v);
-
- k = "No Results found!";
- v = new String[]{"en", "No Results found!", "de", "Suche liefert kein Ergebnis!"};
- p(k, v);
-
- k = "Map data (c) OpenStreetMap contributors, CC-BY-SA";
- v = new String[]{"en", "Map data (c) OpenStreetMap contributors, CC-BY-SA"};
- p(k, v);
-
- k = "partial match";
- v = new String[]{"en", "partial match", "de", "ungefähr"};
- p(k, v);
-
- k = "Search";
- v = new String[]{"en", "Search", "de", "suchen"};
- p(k, v);
-
- k = "drive here";
- v = new String[]{"en", "Route to here", "de", "Ziel setzen"};
- p(k, v);
-
- k = "loading search results";
- v = new String[]{"en", "Loading search results", "de", "lade Suchergebnisse"};
- p(k, v);
-
- k = "towns";
- v = new String[]{"en", "Towns", "de", "Städte"};
- p(k, v);
-*/
- Log.e("NavitTextTranslations", "... ready");
- }
-
- private static void p(String key, String[] values)
- {
- HashMap<String, String> t = new HashMap<String, String>();
- //Log.e("NavitTextTranslations", "trying: " + key);
- try
- {
- for (int i = 0; i < (int) (values.length / 2); i++)
- {
- t.put(values[i * 2], values[(i * 2) + 1]);
- }
- Navit_text_lookup.put(key, t);
- }
- catch (Exception e)
- {
- Log.e("NavitTextTranslations", "!!Error in translationkey: " + key);
- }
- }
-
- public static String get_text(String in)
- {
- String out = null;
- //Log.e("NavitTextTranslations", "lookup L:" + main_language + " T:" + in);
- try
- {
- out = Navit_text_lookup.get(in).get(main_language);
- }
- catch (Exception e)
- {
- // most likely there is not translation yet
- //Log.e("NavitTextTranslations", "lookup: exception");
- out = null;
- }
-
- if (out == null)
- {
- // always return a string for output (use fallback language)
- //Log.e("NavitTextTranslations", "using default language");
- try
- {
- out = Navit_text_lookup.get(in).get(fallback_language);
- }
- catch (Exception e)
- {
- //Log.e("NavitTextTranslations", "using default language: exception");
- // most likely there is not translation yet
- out = null;
- }
- }
-
- if (out == null)
- {
- // if we still dont have any text, use the ".mo" file and call the c-function gettext(in)
- out = NavitGraphics.getLocalizedString(in);
- if (out != null)
- {
- HashMap<String, String> langmap = new HashMap<String, String>();
- langmap.put(main_language, out);
- Navit_text_lookup.put(in, langmap);
- }
-
- //Log.e("NavitTextTranslations", "return the value from gettext() = " + out);
- }
- return out;
- }
-
-}
diff --git a/navit/android/src/org/navitproject/navit/NavitVehicle.java b/navit/android/src/org/navitproject/navit/NavitVehicle.java
index e1a9c70f1..583d044c1 100644
--- a/navit/android/src/org/navitproject/navit/NavitVehicle.java
+++ b/navit/android/src/org/navitproject/navit/NavitVehicle.java
@@ -20,7 +20,6 @@
package org.navitproject.navit;
import java.util.List;
-import android.Manifest;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -40,7 +39,7 @@ import android.support.v4.content.ContextCompat;
public class NavitVehicle {
- public static final String GPS_FIX_CHANGE = "android.location.GPS_FIX_CHANGE";
+ private static final String GPS_FIX_CHANGE = "android.location.GPS_FIX_CHANGE";
public static Location lastLocation = null;
diff --git a/navit/debug.c b/navit/debug.c
index 3fd1c5386..2d6e8fdc5 100644
--- a/navit/debug.c
+++ b/navit/debug.c
@@ -308,14 +308,14 @@ debug_vprintf(dbg_level level, const char *module, const int mlen, const char *f
#if defined HAVE_API_WIN32_CE
#define vsnprintf _vsnprintf
#endif
- gchar *fmt_newline;
+ vsnprintf(debug_message+strlen(debug_message),sizeof(debug_message)-1-strlen(debug_message),fmt,ap);
#ifdef HAVE_API_WIN32_BASE
- fmt_newline = g_strconcat(fmt, "\r\n");
-#else
- fmt_newline = g_strconcat(fmt, "\n");
+ if (strlen(debug_message)<sizeof(debug_message))
+ debug_message[strlen(debug_message)] = '\r'; /* For Windows platforms, add \r at the end of the buffer (if any room) */
#endif
- vsnprintf(debug_message+strlen(debug_message),4095-strlen(debug_message),fmt_newline,ap);
- g_free(fmt_newline);
+ if (strlen(debug_message)<sizeof(debug_message))
+ debug_message[strlen(debug_message)] = '\n'; /* Add \n at the end of the buffer (if any room) */
+ debug_message[sizeof(debug_message)-1] = '\0'; /* Force NUL-termination of the string (if buffer size contraints did not allow for full string to fit */
#ifdef DEBUG_WIN32_CE_MESSAGEBOX
mbstowcs(muni, debug_message, strlen(debug_message)+1);
MessageBoxW(NULL, muni, TEXT("Navit - Error"), MB_APPLMODAL|MB_OK|MB_ICONERROR);
@@ -403,9 +403,6 @@ debug_dump_mallocs(void)
fprintf(stderr,"unfreed malloc from %s of size %d\n",head->where,head->size);
for (i = 0 ; i < 8 ; i++)
fprintf(stderr,"\tlist *%p\n",head->return_address[i]);
-#if 0
- fprintf(stderr,"%s\n",head+1);
-#endif
head=head->next;
}
}
diff --git a/navit/geom.c b/navit/geom.c
index 65ea4986b..0f40e2dac 100644
--- a/navit/geom.c
+++ b/navit/geom.c
@@ -93,19 +93,10 @@ geom_poly_area(struct coord *c, int count)
{
long long area=0;
int i,j=0;
-#if 0
- fprintf(stderr,"count=%d\n",count);
-#endif
for (i=0; i<count; i++) {
if (++j == count)
j=0;
-#if 0
- fprintf(stderr,"(%d+%d)*(%d-%d)=%d*%d="LONGLONG_FMT"\n",c[i].x,c[j].x,c[i].y,c[j].y,c[i].x+c[j].x,c[i].y-c[j].y,(long long)(c[i].x+c[j].x)*(c[i].y-c[j].y));
-#endif
area+=(long long)(c[i].x+c[j].x)*(c[i].y-c[j].y);
-#if 0
- fprintf(stderr,"area="LONGLONG_FMT"\n",area);
-#endif
}
return area/2;
}
@@ -205,12 +196,6 @@ geom_poly_point_inside(struct coord *cp, int count, struct coord *c)
while (cp < last) {
if ((cp[0].y > c->y) != (cp[1].y > c->y) &&
c->x < ((long long)cp[1].x-cp[0].x)*(c->y-cp[0].y)/(cp[1].y-cp[0].y)+cp[0].x) {
-#if 0
- fprintf(stderr," cross 0x%x,0x%x-0x%x,0x%x %dx%d",cp,cp[0].x,cp[0].y,cp[1].x,cp[1].y,cp[1].x-cp[0].x,c->y-cp[0].y);
- printf("type=selected_line\n");
- coord_print(projection_mg, &cp[0], stdout);
- coord_print(projection_mg, &cp[1], stdout);
-#endif
ret=!ret;
}
cp++;
@@ -236,15 +221,6 @@ geom_poly_segments_insert(GList *list, struct geom_poly_segment *first, struct g
count+=(first->last-first->first);
if (third)
count+=(third->last-third->first);
-#if 0
- fprintf(stderr,"count=%d first=%p second=%p third=%p\n",count,first,second,third);
- if (first)
- fprintf(stderr,"first:0x%x,0x%x-0x%x,0x%x (%d)\n",first->first->x,first->first->y,first->last->x,first->last->y, first->last-first->first+1);
- if (second)
- fprintf(stderr,"second:0x%x,0x%x-0x%x,0x%x (%d)\n",second->first->x,second->first->y,second->last->x,second->last->y, second->last-second->first+1);
- if (third)
- fprintf(stderr,"third:0x%x,0x%x-0x%x,0x%x (%d)\n",third->first->x,third->first->y,third->last->x,third->last->y, third->last-third->first+1);
-#endif
ret->first=g_new(struct coord, count);
pos=ret->first;
if (first) {
@@ -262,13 +238,7 @@ geom_poly_segments_insert(GList *list, struct geom_poly_segment *first, struct g
pos+=count;
}
ret->last=pos-1;
-#if 0
- fprintf(stderr,"result:0x%x,0x%x-0x%x,0x%x (%d)\n",ret->first->x,ret->first->y,ret->last->x,ret->last->y, ret->last-ret->first+1);
-#endif
list=g_list_prepend(list, ret);
-#if 0
- fprintf(stderr,"List=%p\n",list);
-#endif
return list;
}
@@ -361,30 +331,17 @@ int
geom_poly_segments_point_inside(GList *in, struct coord *c)
{
int open_matches=0,closed_matches=0;
-#if 0
- fprintf(stderr,"try 0x%x,0x%x:",c->x,c->y);
-#endif
while (in) {
struct geom_poly_segment *seg=in->data;
if (geom_poly_point_inside(seg->first, seg->last-seg->first+1, c)) {
-#if 0
- fprintf(stderr," inside");
-#endif
if (coord_is_equal(*seg->first,*seg->last))
closed_matches++;
else
open_matches++;
} else {
-#if 0
- fprintf(stderr," outside");
-#endif
}
in=g_list_next(in);
}
-#if 0
- fprintf(stderr,"\n");
- fprintf(stderr,"open_matches %d closed_matches %d\n",open_matches,closed_matches);
-#endif
if (closed_matches) {
if (closed_matches & 1)
return 1;
diff --git a/navit/graphics.c b/navit/graphics.c
index 69eabfc3e..ed10d88c4 100644
--- a/navit/graphics.c
+++ b/navit/graphics.c
@@ -1574,10 +1574,6 @@ draw_shape(struct draw_polyline_context *ctx, struct point *pnt, int wi)
struct draw_polyline_shape *shape=&ctx->shape;
struct draw_polyline_shape *prev=&ctx->prev_shape;
-#if 0
- dbg(lvl_debug,"enter %d,%d - %d,%d %d",pnt[0].x,pnt[0].y,pnt[1].x,pnt[1].y,wi);
-#endif
-
*prev=*shape;
if (prev->wi != wi && prev->l) {
prev->wi=wi;
@@ -1592,9 +1588,6 @@ draw_shape(struct draw_polyline_context *ctx, struct point *pnt, int wi)
shape->step=8;
else
shape->step=16;
-#if 0
- l = int_sqrt(dx * dx * lscale * lscale + dy * dy * lscale * lscale);
-#else
dxs=shape->dx*shape->dx;
dys=shape->dy*shape->dy;
lscales=lscale*lscale;
@@ -1602,7 +1595,7 @@ draw_shape(struct draw_polyline_context *ctx, struct point *pnt, int wi)
l = int_sqrt(dxs+dys)*lscale;
else
l = int_sqrt((dxs+dys)*lscales);
-#endif
+
shape->fow=fowler(-shape->dy, shape->dx);
dbg(lvl_debug,"fow=%d",shape->fow);
if (! l)
@@ -1712,11 +1705,6 @@ graphics_draw_polyline_as_polygon(struct graphics_priv *gra_priv, struct graphic
int max_circle_points=20;
if (count < 2)
return;
-#if 0
- dbg(lvl_debug,"count=%d",count);
- for (i = 0 ; i < count ; i++)
- dbg(lvl_debug,"%d,%d width %d",pnt[i].x,pnt[i].y,width[i]);
-#endif
ctx.shape.l=0;
ctx.shape.wi=0;
ctx.res=g_alloca(sizeof(struct point)*maxpoints);
@@ -1895,9 +1883,6 @@ graphics_draw_polyline_clipped(struct graphics *gra, struct graphics_gc *gc, str
if (points_to_draw_cnt > 1) {
if (poly) {
graphics_draw_polyline_as_polygon(gra->priv, gc->priv, points_to_draw, points_to_draw_cnt, w, gra->meth.draw_polygon);
-#if 0
- gra->meth.draw_lines(gra->priv, gc->priv, points_to_draw, points_to_draw_cnt);
-#endif
} else
gra->meth.draw_lines(gra->priv, gc->priv, points_to_draw, points_to_draw_cnt);
points_to_draw_cnt=0;
@@ -1967,12 +1952,6 @@ graphics_draw_polygon_clipped(struct graphics *gra, struct graphics_gc *gc, stru
struct point *pa2=g_alloca(sizeof(struct point) * (count_in < limit ? count_in*8+1:0));
int count_out,edge=3;
int i;
-#if 0
- r.lu.x+=20;
- r.lu.y+=20;
- r.rl.x-=20;
- r.rl.y-=20;
-#endif
if (count_in < limit) {
p1=pa1;
p2=pa2;
@@ -2136,18 +2115,6 @@ displayitem_draw(struct displayitem *di, void *dummy, struct display_context *dc
count=limit_count(di->c, count);
if (dc->type == type_poly_water_tiled)
mindist=0;
-#if 0
- if (dc->e->type == element_polygon) {
- int max=1000;
- int offset=5600;
- c+=offset;
- count-=offset;
- if (count < 0)
- count=0;
- if (count > max)
- count=max;
- }
-#endif
if (dc->e->type == element_polyline)
count=transform(dc->trans, dc->pro, di->c, pa, count, mindist, e->u.polyline.width, width);
else
@@ -2527,9 +2494,6 @@ do_draw(struct displaylist *displaylist, int cancel, int flags)
count=item_coord_get_within_selection(item, ca, item->type < type_line ? 1: max, displaylist->sel);
if (! count)
continue;
-#if 0
- dbg(lvl_debug,"%s 0x%x 0x%x",item_to_name(item->type), item->id_hi, item->id_lo);
-#endif
if (displaylist->dc.pro != pro)
transform_from_to_count(ca, displaylist->dc.pro, ca, pro, count);
if (count == max) {
diff --git a/navit/gui/gtk/gui_gtk_poi.c b/navit/gui/gtk/gui_gtk_poi.c
index ba2a00e98..d88b2de0f 100644
--- a/navit/gui/gtk/gui_gtk_poi.c
+++ b/navit/gui/gtk/gui_gtk_poi.c
@@ -35,6 +35,8 @@
#include "attr.h"
#include "util.h"
+#include "navigation.h" /* for KILOMETERS_TO_MILES */
+
static struct gtk_poi_search{
GtkWidget *entry_distance;
GtkWidget *label_distance;
@@ -108,18 +110,31 @@ model_poi (struct gtk_poi_search *search)
struct coord coord_item,center;
struct pcoord pc;
struct mapset_handle *h;
- int search_distance_meters,idist;
+ int search_distance_meters; /* distance to search the POI database, in meters, from the center of the screen. */
+ int idist; /* idist appears to be the distance in meters from the center of the screen to a POI. */
struct map *m;
struct map_rect *mr;
struct item *item;
struct point cursor_position;
enum item_type selected;
- search_distance_meters=1000*atoi((char *) gtk_entry_get_text(GTK_ENTRY(search->entry_distance)));
+ /* Respect the Imperial attribute as we enlighten the user. */
+ struct attr attr;
+ int imperial = FALSE; /* default to using metric measures. */
+ if (navit_get_attr(gtk_poi_search.nav, attr_imperial, &attr, NULL))
+ imperial=attr.u.num;
+
+ if (imperial == FALSE) {
+ /* Input is in kilometers */
+ search_distance_meters=1000*atoi((char *) gtk_entry_get_text(GTK_ENTRY(search->entry_distance)));
+ } else {
+ /* Input is in miles. */
+ search_distance_meters=atoi((char *) gtk_entry_get_text(GTK_ENTRY(search->entry_distance)))/METERS_TO_MILES;
+ }
cursor_position.x=navit_get_width(search->nav)/2;
cursor_position.y=navit_get_height(search->nav)/2;
- gtk_label_set_text(GTK_LABEL(search->label_distance),_("Distance from screen center (km)"));
+ gtk_label_set_text(GTK_LABEL(search->label_distance),_("Select a search radius from screen center"));
transform_reverse(navit_get_trans(search->nav), &cursor_position, &center);
pc.pro = transform_get_projection(navit_get_trans(search->nav));
@@ -146,6 +161,17 @@ model_poi (struct gtk_poi_search *search)
char direction[5];
gtk_list_store_append(search->store_poi, &iter);
get_compass_direction(direction,transform_get_angle_delta(&center,&coord_item,0),1);
+
+ /**
+ * If the user has selected imperial, translate idist from meters to
+ * feet. We convert to feet only, and not miles, because the code
+ * sorts on the numeric value of the distance, so it doesn't like two
+ * different units. Possible future enhancement?
+ */
+ if (imperial != FALSE) {
+ idist = idist * (FEET_PER_METER); /* convert meters to feet. */
+ }
+
gtk_list_store_set(search->store_poi, &iter, 0,direction, 1,idist,
2,g_strdup(label_attr.u.str), 3,coord_item.x, 4,coord_item.y ,-1);
}
diff --git a/navit/gui/qml/skins/navit/ButtonIcon.qml b/navit/gui/qml/skins/navit/ButtonIcon.qml
index f969ebb5a..9b5d6ae3a 100644
--- a/navit/gui/qml/skins/navit/ButtonIcon.qml
+++ b/navit/gui/qml/skins/navit/ButtonIcon.qml
@@ -1,40 +1,40 @@
-import Qt 4.7
-
-Rectangle {
+import Qt 4.7
+
+Rectangle {
id: container
-
- signal clicked
- property string text: "Button"
- property string icon: "Icon.png"
-
- color: "black"; smooth: true; opacity: 0.75
- width: imgItem.width+20; height: txtItem.height + 6 + imgItem.height;
- transformOrigin: Rectangle.Center;
-
- MouseArea { id: mr; anchors.fill: parent; onClicked: container.clicked() }
-
- Image {
- id: imgItem; source: gui.iconPath+container.icon; anchors.top: container.top; anchors.horizontalCenter: container.horizontalCenter;
- width: gui.height/4; height: gui.height/4
- }
-
- Text {
- id: txtItem; text: container.text; anchors.top: imgItem.bottom; anchors.horizontalCenter: container.horizontalCenter;
- color: "White"; font.pointSize: gui.height/32; horizontalAlignment: Qt.AlignHCenter
- }
-
- states: [
- State {
- name: "Pressed"; when: mr.pressed == true
- PropertyChanges { target: container; scale: 2.0 }
- PropertyChanges { target: container; opacity: 1 }
-
- }
- ]
-
- transitions: Transition {
- NumberAnimation { properties: "scale"; easing.type: "OutExpo"; duration: 200 }
- NumberAnimation { properties: "opacity"; easing.type: "InQuad"; duration: 200 }
- }
-
-}
+
+ signal clicked
+ property string text: "Button"
+ property string icon: "Icon.png"
+
+ color: "black"; smooth: true; opacity: 0.75
+ width: imgItem.width+20; height: txtItem.height + 6 + imgItem.height;
+ transformOrigin: Rectangle.Center;
+
+ MouseArea { id: mr; anchors.fill: parent; onClicked: container.clicked() }
+
+ Image {
+ id: imgItem; source: gui.iconPath+container.icon; anchors.top: container.top; anchors.horizontalCenter: container.horizontalCenter;
+ width: gui.height/4; height: gui.height/4
+ }
+
+ Text {
+ id: txtItem; text: container.text; anchors.top: imgItem.bottom; anchors.horizontalCenter: container.horizontalCenter;
+ color: "White"; font.pointSize: gui.height/32; horizontalAlignment: Qt.AlignHCenter
+ }
+
+ states: [
+ State {
+ name: "Pressed"; when: mr.pressed == true
+ PropertyChanges { target: container; scale: 2.0 }
+ PropertyChanges { target: container; opacity: 1 }
+
+ }
+ ]
+
+ transitions: Transition {
+ NumberAnimation { properties: "scale"; easing.type: "OutExpo"; duration: 200 }
+ NumberAnimation { properties: "opacity"; easing.type: "InQuad"; duration: 200 }
+ }
+
+}
diff --git a/navit/gui/qml/skins/navit/PageSettingsRules.qml b/navit/gui/qml/skins/navit/PageSettingsRules.qml
index e5238f584..37b18c8d4 100644
--- a/navit/gui/qml/skins/navit/PageSettingsRules.qml
+++ b/navit/gui/qml/skins/navit/PageSettingsRules.qml
@@ -1,38 +1,38 @@
import Qt 4.7
import "pagenavigation.js" as Navit
-
-Rectangle {
- id: page
-
- width: gui.width; height: gui.height
- border.width: 1
- color: "Black"
- opacity: 0
-
- function pageOpen() {
- page.opacity = 1;
- }
-
- Component.onCompleted: pageOpen();
-
- Behavior on opacity {
- NumberAnimation { id: opacityAnimation; duration: 300; alwaysRunToEnd: true }
- }
-
- VisualItemModel {
- id: selectorsModel
-
- ToggleSwitch { id: trackingSw; stOn: navit.getAttr("tracking"); text: "Lock on road"; onChanged: navit.setAttr("tracking",trackingSw.stOn) }
- ToggleSwitch { id: orientationSw; stOn: navit.getAttr("orientation"); text: "Northing"; onChanged: navit.setAttr("orientation",orientationSw.stOn) }
- ToggleSwitch { id: followcursorSw; stOn: navit.getAttr("follow_cursor"); text: "Map follows Vehicle"; onChanged: navit.setAttr("follow_cursor",followcursorSw.stOn) }
- ToggleSwitch { id: autozoomSw; stOn: navit.getAttr("autozoom_active"); text: "Auto zoom"; onChanged: navit.setAttr("autozoom_active",autozoomSw.stOn) }
- }
-
- ListView {
- id: selectorsList; model: selectorsModel
- focus: true; clip: true; orientation: Qt.Vertical
- anchors.verticalCenter: parent.verticalCenter; anchors.horizontalCenter: parent.horizontalCenter;
- width: trackingSw.width*1.5; height: trackingSw.height*4
- }
- Cellar {anchors.bottom: page.bottom; anchors.horizontalCenter: page.horizontalCenter; width: page.width }
-}
+
+Rectangle {
+ id: page
+
+ width: gui.width; height: gui.height
+ border.width: 1
+ color: "Black"
+ opacity: 0
+
+ function pageOpen() {
+ page.opacity = 1;
+ }
+
+ Component.onCompleted: pageOpen();
+
+ Behavior on opacity {
+ NumberAnimation { id: opacityAnimation; duration: 300; alwaysRunToEnd: true }
+ }
+
+ VisualItemModel {
+ id: selectorsModel
+
+ ToggleSwitch { id: trackingSw; stOn: navit.getAttr("tracking"); text: "Lock on road"; onChanged: navit.setAttr("tracking",trackingSw.stOn) }
+ ToggleSwitch { id: orientationSw; stOn: navit.getAttr("orientation"); text: "Northing"; onChanged: navit.setAttr("orientation",orientationSw.stOn) }
+ ToggleSwitch { id: followcursorSw; stOn: navit.getAttr("follow_cursor"); text: "Map follows Vehicle"; onChanged: navit.setAttr("follow_cursor",followcursorSw.stOn) }
+ ToggleSwitch { id: autozoomSw; stOn: navit.getAttr("autozoom_active"); text: "Auto zoom"; onChanged: navit.setAttr("autozoom_active",autozoomSw.stOn) }
+ }
+
+ ListView {
+ id: selectorsList; model: selectorsModel
+ focus: true; clip: true; orientation: Qt.Vertical
+ anchors.verticalCenter: parent.verticalCenter; anchors.horizontalCenter: parent.horizontalCenter;
+ width: trackingSw.width*1.5; height: trackingSw.height*4
+ }
+ Cellar {anchors.bottom: page.bottom; anchors.horizontalCenter: page.horizontalCenter; width: page.width }
+}
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.chevron.down.svg b/navit/gui/qt5_qml/skins/icons/appbar.chevron.down.svg
index 3917fc7cd..7dfd18eb4 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.chevron.down.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.chevron.down.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 37.8516,39.5833L 52.1016,24.9375L 52.1016,35.2292L 37.8516,50.2708L 23.6016,35.2292L 23.6016,24.9375L 37.8516,39.5833 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.chevron.up.svg b/navit/gui/qt5_qml/skins/icons/appbar.chevron.up.svg
index b737d9773..a84cb0b21 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.chevron.up.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.chevron.up.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 37.8516,35.625L 34.6849,38.7917L 23.6016,50.2708L 23.6016,39.9792L 37.8516,24.9375L 52.1016,39.9792L 52.1016,50.2708L 41.0182,38.7917L 37.8516,35.625 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.cog.svg b/navit/gui/qt5_qml/skins/icons/appbar.cog.svg
index 4ef1ef8c2..0c0590fcc 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.cog.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.cog.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 27.5314,21.8628L 33.0126,19.4224L 34.7616,23.3507C 36.6693,22.9269 38.6044,22.8903 40.4668,23.2026L 42.0083,19.1868L 47.6098,21.337L 46.0683,25.3528C 47.6612,26.3669 49.0747,27.6889 50.2088,29.2803L 54.1371,27.5313L 56.5776,33.0126L 52.6493,34.7616C 53.0731,36.6693 53.1097,38.6043 52.7974,40.4668L 56.8131,42.0083L 54.6629,47.6097L 50.6472,46.0683C 49.6331,47.6613 48.3111,49.0748 46.7197,50.2089L 48.4686,54.1372L 42.9874,56.5776L 41.2384,52.6493C 39.3307,53.0731 37.3957,53.1097 35.5333,52.7974L 33.9918,56.8131L 28.3903,54.6629L 29.9318,50.6472C 28.3388,49.6331 26.9252,48.3111 25.7911,46.7196L 21.8628,48.4686L 19.4224,42.9873L 23.3507,41.2383C 22.9269,39.3307 22.8903,37.3957 23.2026,35.5332L 19.1869,33.9918L 21.3371,28.3903L 25.3528,29.9318C 26.3669,28.3388 27.6889,26.9252 29.2804,25.7911L 27.5314,21.8628 Z M 34.3394,29.7781C 29.7985,31.7998 27.7564,37.1198 29.7781,41.6606C 31.7998,46.2015 37.1198,48.2436 41.6606,46.2219C 46.2015,44.2002 48.2436,38.8802 46.2219,34.3394C 44.2002,29.7985 38.8802,27.7564 34.3394,29.7781 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.cogs.svg b/navit/gui/qt5_qml/skins/icons/appbar.cogs.svg
index e3fdaa4ce..d8c1ab0fa 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.cogs.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.cogs.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 32.6227,68.9728C 33.1208,70.2446 33.7077,71.4719 34.3757,72.6471C 35.567,72.7702 36.7761,72.8333 38,72.8333C 40.6447,72.8333 43.2205,72.5386 45.6965,71.9802C 42.2807,68.5449 40.1698,63.8107 40.1698,58.5835C 40.1698,48.0901 48.6764,39.5835 59.1698,39.5835C 64.2047,39.5835 68.7822,41.5419 72.182,44.7385C 72.6094,42.5584 72.8333,40.3053 72.8333,38C 72.8333,36.442 72.731,34.908 72.5328,33.4041C 70.4772,32.3109 68.2718,31.4621 65.9554,30.8963L 65.6219,22.7367C 63.5664,22.3692 61.4511,22.1741 59.2916,22.1671L 57.491,30.1322C 54.2845,30.3184 51.2204,31.0348 48.3848,32.1949L 43.318,25.7887C 41.3995,26.7177 39.5749,27.8102 37.8622,29.0479L 41.0883,36.5527C 38.6742,38.5364 36.5919,40.9091 34.9373,43.575L 27.0703,41.3697C 26.073,43.2256 25.2319,45.178 24.5646,47.2093L 31.5867,51.385C 30.9883,53.6844 30.6698,56.0968 30.6698,58.5835L 30.746,60.6839L 23.0854,63.5239C 23.3743,65.6539 23.8474,67.7255 24.4881,69.7219L 32.6227,68.9728 Z M 27.0669,37.1755L 34.9338,39.3807C 35.9312,37.5248 36.7723,35.5724 37.4395,33.5412L 30.4175,29.3654C 31.0159,27.066 31.3344,24.6537 31.3344,22.1669L 31.2581,20.0665L 38.9187,17.2265C 38.6299,15.0965 38.1568,13.0249 37.5161,11.0285L 29.3815,11.7776C 28.4787,9.47258 27.2844,7.31377 25.8439,5.34655C 22.7943,6.48232 19.9467,8.03307 17.3698,9.93015C 20.1557,13.2359 21.8344,17.5054 21.8344,22.1669C 21.8344,32.5019 13.5826,40.9096 3.30816,41.1611C 3.60321,44.4411 4.35293,47.59 5.49381,50.5444C 8.34489,50.2806 11.0742,49.5968 13.6194,48.5555L 18.6861,54.9617C 20.6046,54.0327 22.4293,52.9403 24.142,51.7025L 20.9158,44.1977C 23.3299,42.2141 25.4123,39.8414 27.0669,37.1755 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.fullscreen.box.svg b/navit/gui/qt5_qml/skins/icons/appbar.fullscreen.box.svg
index 13e6840e5..a3e73f41a 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.fullscreen.box.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.fullscreen.box.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 19,57L 19,19L 57,19L 57,57L 19,57 Z M 24,29L 47,29L 47,52L 52,52L 52,24L 24,24L 24,29 Z M 24,34L 24,52L 42,52L 42,34L 24,34 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.home.variant.svg b/navit/gui/qt5_qml/skins/icons/appbar.home.variant.svg
index ea951fd19..273ff72cd 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.home.variant.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.home.variant.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76.0106" height="76.0106" viewBox="0 0 76.01 76.01" enable-background="new 0 0 76.01 76.01" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 24.0033,56.0078L 24.0033,38.0053L 22.0031,40.0056L 19.0027,35.0049L 38.0053,20.0028L 45.0063,25.5299L 45.0063,21.753L 49.0068,21.0029L 49.0068,28.6882L 57.008,35.0049L 54.0075,40.0056L 52.0073,38.0053L 52.0073,56.0078L 24.0033,56.0078 Z M 38.0053,26.9204L 27.0038,36.005L 27.0038,53.0074L 38.0045,53.0075L 38.0045,41.0061L 46.0058,41.0061L 46.0059,53.0075L 49.0068,53.0074L 49.0068,36.005L 38.0053,26.9204 Z M 30.004,41.0057L 35.0049,41.0057L 35.0049,47.0066L 30.004,47.0066L 30.004,41.0057 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.information.circle.svg b/navit/gui/qt5_qml/skins/icons/appbar.information.circle.svg
index 031bd37f5..35a156ae9 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.information.circle.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.information.circle.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 38,19C 48.4934,19 57,27.5066 57,38C 57,48.4934 48.4934,57 38,57C 27.5066,57 19,48.4934 19,38C 19,27.5066 27.5066,19 38,19 Z M 33.25,33.25L 33.25,36.4167L 36.4166,36.4167L 36.4166,47.5L 33.25,47.5L 33.25,50.6667L 44.3333,50.6667L 44.3333,47.5L 41.1666,47.5L 41.1666,36.4167L 41.1666,33.25L 33.25,33.25 Z M 38.7917,25.3333C 37.48,25.3333 36.4167,26.3967 36.4167,27.7083C 36.4167,29.02 37.48,30.0833 38.7917,30.0833C 40.1033,30.0833 41.1667,29.02 41.1667,27.7083C 41.1667,26.3967 40.1033,25.3333 38.7917,25.3333 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.layer.delete.svg b/navit/gui/qt5_qml/skins/icons/appbar.layer.delete.svg
index ddbeb21ca..5157af942 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.layer.delete.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.layer.delete.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76.0106" height="76.0106" viewBox="0 0 76.01 76.01" enable-background="new 0 0 76.01 76.01" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 18.5088,44.0374L 21.8676,40.6786L 27.4655,46.2765L 33.0634,40.6786L 36.4222,44.0374L 30.8243,49.6353L 36.4222,55.2332L 33.0634,58.592L 27.4655,52.994L 21.8676,58.592L 18.5088,55.2332L 24.1068,49.6353L 18.5088,44.0374 Z M 57.0079,38.0053L 38.0053,47.5066L 36.7482,46.8781L 39.5889,44.0374L 35.2559,39.7977L 38.0053,41.1724L 50.6737,34.8382L 57.0079,38.0053 Z M 19.0026,38.0053L 25.3369,34.8382L 32.3326,38.3361L 29.8968,40.7719L 28.1098,42.5589L 25.7193,41.3636L 21.8676,37.6052L 20.6459,38.8269L 19.0026,38.0053 Z M 38.0053,19.0027L 57.0079,28.504L 38.0053,38.0053L 19.0026,28.504L 38.0053,19.0027 Z M 57.0079,47.5066L 38.0053,57.008L 37.8778,56.9442L 39.5889,55.2332L 33.9909,49.6353L 34.6367,48.9895L 38.0053,50.6738L 50.6737,44.3395L 57.0079,47.5066 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.layer.svg b/navit/gui/qt5_qml/skins/icons/appbar.layer.svg
index 9eb28235c..b89bb2da3 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.layer.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.layer.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76.0106" height="76.0106" viewBox="0 0 76.01 76.01" enable-background="new 0 0 76.01 76.01" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 57.0079,38.0053L 38.0053,47.5066L 19.0027,38.0053L 25.3369,34.8382L 38.0053,41.1724L 50.6737,34.8382L 57.0079,38.0053 Z M 38.0053,19.0027L 57.0079,28.504L 38.0053,38.0053L 19.0026,28.504L 38.0053,19.0027 Z M 57.0079,47.5066L 38.0053,57.008L 19.0026,47.5066L 25.3369,44.3395L 38.0053,50.6737L 50.6737,44.3395L 57.0079,47.5066 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.location.checkin.svg b/navit/gui/qt5_qml/skins/icons/appbar.location.checkin.svg
index 3b21754c6..a58141d22 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.location.checkin.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.location.checkin.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-linejoin="round" d="M 38,19C 42.9706,19 47,23.0294 47,28C 47,30.5642 45.9276,32.878 38,49C 30.0724,32.878 29,30.5642 29,28C 29,23.0294 33.0294,19 38,19 Z M 38,24C 35.7909,24 34,25.7909 34,28C 34,30.2092 35.7909,32 38,32C 40.2091,32 42,30.2092 42,28C 42,25.7909 40.2091,24 38,24 Z M 19,57L 24,42L 31.5,42L 33.5,46L 27.6641,46L 25.3324,53L 50.6676,53L 48.3359,46L 42.5,46L 44.5,42L 52,42L 57,57L 19,57 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.map.svg b/navit/gui/qt5_qml/skins/icons/appbar.map.svg
index 241f71e59..0a157d0da 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.map.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.map.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 27.7083,23.75L 38.7917,26.9167L 48.2917,20.5833L 62,24L 62,51L 48.2917,47.5L 38.7917,53.8333L 27.7083,50.6667L 16,55.5L 16,28.5L 27.7083,23.75 Z M 27,46.25L 27,29L 20,31.75L 20,49L 27,46.25 Z M 49,25.5L 49,42.75L 58,45.25L 58,28L 49,25.5 Z M 39,31.5L 39,49L 48,43L 48,25.5L 39,31.5 Z M 28,28.75L 28,46L 38,48.5L 38,31.75L 28,28.75 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.power.svg b/navit/gui/qt5_qml/skins/icons/appbar.power.svg
index d3f865c0d..db23bca1f 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.power.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.power.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 36.4167,36.4167L 36.4167,17.4167L 41.1667,17.4167L 41.1667,36.4167L 36.4167,36.4167 Z M 57,39.5833C 57,50.0767 48.4934,58.5833 38,58.5833C 27.5066,58.5833 19,50.0767 19,39.5833C 19,30.7301 25.0552,23.2911 33.25,21.1819L 33.25,27.8374C 28.6079,29.7165 25.3333,34.2675 25.3333,39.5833C 25.3333,46.5789 31.0044,52.25 38,52.25C 44.9956,52.25 50.6667,46.5789 50.6667,39.5833C 50.6667,34.8949 48.1194,30.8014 44.3333,28.6113L 44.3333,21.6645C 51.7129,24.2728 57,31.3106 57,39.5833 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.rocket.svg b/navit/gui/qt5_qml/skins/icons/appbar.rocket.svg
index a8c5c273a..d3b9d0a16 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.rocket.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.rocket.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 38,19C 39.4823,20.6344 43,26.1259 43,41L 47,46L 47,55L 43,50L 33,50L 29,55L 29,46L 33,41C 33,26.1259 36.0177,20.6344 38,19 Z M 38,57.5L 35,51L 41,51L 38,57.5 Z M 38,27L 36.1552,27.4612L 35.6203,30.5949L 38,30L 40.2918,30.573L 39.6953,27.4238L 38,27 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.transit.car.svg b/navit/gui/qt5_qml/skins/icons/appbar.transit.car.svg
index 8ea1a7c5d..3a6e7a287 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.transit.car.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.transit.car.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 17.4167,50.6667C 16.5422,50.6667 15.8333,49.9578 15.8333,49.0833L 15.8333,39.5834C 15.8333,37.0877 17.2768,34.9292 19.3745,33.8972L 25.3333,19L 26.9167,19L 30.0833,19L 45.9167,19L 49.0833,19L 50.6667,19L 56.6255,33.8972C 58.7231,34.9292 60.1666,37.0877 60.1666,39.5834L 60.1667,49.0833C 60.1667,49.9578 59.4578,50.6667 58.5833,50.6667L 57,50.6667L 57,53.8333C 57,55.5822 55.5822,57 53.8333,57C 52.0844,57 50.6667,55.5822 50.6667,53.8333L 50.6667,50.6667L 25.3333,50.6667L 25.3333,53.8333C 25.3333,55.5822 23.9156,57 22.1667,57C 20.4178,57 19,55.5822 19,53.8333L 19,50.6667L 17.4167,50.6667 Z M 24.3833,33.25L 51.6166,33.25L 47.8166,23.75L 28.1833,23.75L 24.3833,33.25 Z M 24.1458,36.0209C 22.3969,36.0209 20.5833,37.8344 20.5833,39.5833C 20.5833,41.3322 22.3969,43.1458 24.1458,43.1458C 25.8947,43.1458 27.7083,41.3323 27.7083,39.5834C 27.7083,37.8345 25.8947,36.0209 24.1458,36.0209 Z M 51.8542,36.0208C 50.1053,36.0208 48.2917,37.8344 48.2917,39.5833C 48.2917,41.3322 50.1053,43.1458 51.8542,43.1458C 53.6031,43.1458 55.4167,41.3322 55.4167,39.5833C 55.4167,37.8344 53.6031,36.0208 51.8542,36.0208 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.book.list.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.book.list.svg
index 9dda725d2..c8e86b13f 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.book.list.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.book.list.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 22,19L 24,19L 24,57L 22,57L 22,19 Z M 26,57L 26,19.0001L 53.9999,19.0001L 53.9999,57L 26,57 Z M 30,24L 30,27L 50,27L 50,24L 30,24 Z M 30,32L 30,35L 33,35L 33,32L 30,32 Z M 36,32L 36,35L 49,35L 49,32L 36,32 Z M 30,40L 30,43L 33,43L 33,40L 30,40 Z M 36,40L 36,43L 48,43L 48,40L 36,40 Z M 30,48L 30,51L 33,51L 33,48L 30,48 Z M 36,48L 36,51L 50,51L 50,48L 36,48 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.chevron.down.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.chevron.down.svg
index 3917fc7cd..7dfd18eb4 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.chevron.down.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.chevron.down.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 37.8516,39.5833L 52.1016,24.9375L 52.1016,35.2292L 37.8516,50.2708L 23.6016,35.2292L 23.6016,24.9375L 37.8516,39.5833 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.chevron.up.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.chevron.up.svg
index b737d9773..a84cb0b21 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.chevron.up.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.chevron.up.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 37.8516,35.625L 34.6849,38.7917L 23.6016,50.2708L 23.6016,39.9792L 37.8516,24.9375L 52.1016,39.9792L 52.1016,50.2708L 41.0182,38.7917L 37.8516,35.625 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.city.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.city.svg
index f66893f7e..b23bfadeb 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.city.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.city.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 44.3333,30.0833L 57,30.0833L 57,57L 44.3333,57L 44.3333,30.0833 Z M 46.3125,35.2292L 46.3125,38L 49.0833,38L 49.0833,35.2292L 46.3125,35.2292 Z M 52.25,35.2292L 52.25,38L 55.0208,38L 55.0208,35.2292L 52.25,35.2292 Z M 46.3125,39.9792L 46.3125,42.75L 49.0833,42.75L 49.0833,39.9792L 46.3125,39.9792 Z M 52.25,39.9792L 52.25,42.75L 55.0208,42.75L 55.0208,39.9792L 52.25,39.9792 Z M 46.3125,44.7292L 46.3125,47.5L 49.0833,47.5L 49.0833,44.7292L 46.3125,44.7292 Z M 52.25,44.7292L 52.25,47.5L 55.0208,47.5L 55.0208,44.7292L 52.25,44.7292 Z M 46.3125,49.4792L 46.3125,52.25L 49.0833,52.25L 49.0833,49.4792L 46.3125,49.4792 Z M 52.25,49.4792L 52.25,52.25L 55.0208,52.25L 55.0208,49.4792L 52.25,49.4792 Z M 23.75,25.3333L 25.3333,22.1667L 26.9167,22.1667L 26.9167,18.2084L 28.5,18.2084L 28.5,22.1667L 31.6667,22.1667L 31.6667,18.2084L 33.25,18.2084L 33.25,22.1667L 34.8333,22.1667L 36.4167,25.3333L 36.4167,34.8334L 38.7917,34.8333L 41.1667,37.2083L 41.1667,57L 19,57L 19,37.2083L 21.375,34.8333L 23.75,34.8334L 23.75,25.3333 Z M 25.7291,27.3125L 25.7291,30.0834L 28.1041,30.0834L 28.1041,27.3125L 25.7291,27.3125 Z M 32.0625,27.3125L 32.0625,30.0834L 34.4375,30.0834L 34.4375,27.3125L 32.0625,27.3125 Z M 25.7291,32.0625L 25.7291,34.8334L 28.1041,34.8334L 28.1041,32.0625L 25.7291,32.0625 Z M 32.0625,32.0625L 32.0625,34.8334L 34.4375,34.8334L 34.4375,32.0625L 32.0625,32.0625 Z M 30.875,39.9792L 28.8958,39.9792L 28.8958,42.75L 30.875,42.75L 30.875,39.9792 Z M 24.5416,39.9792L 24.5416,42.75L 26.9166,42.75L 26.9166,39.9792L 24.5416,39.9792 Z M 36.0208,39.9792L 33.25,39.9792L 33.25,42.75L 36.0208,42.75L 36.0208,39.9792 Z M 30.875,44.7292L 28.8958,44.7292L 28.8958,47.5L 30.875,47.5L 30.875,44.7292 Z M 26.9166,44.7292L 24.5416,44.7292L 24.5416,47.5L 26.9166,47.5L 26.9166,44.7292 Z M 36.0208,44.7292L 33.25,44.7292L 33.25,47.5L 36.0208,47.5L 36.0208,44.7292 Z M 30.875,49.4792L 28.8958,49.4792L 28.8958,52.25L 30.875,52.25L 30.875,49.4792 Z M 26.9166,49.4792L 24.5416,49.4792L 24.5417,52.25L 26.9167,52.25L 26.9166,49.4792 Z M 36.0208,49.4792L 33.25,49.4792L 33.25,52.25L 36.0208,52.25L 36.0208,49.4792 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.cog.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.cog.svg
index 4ef1ef8c2..0c0590fcc 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.cog.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.cog.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 27.5314,21.8628L 33.0126,19.4224L 34.7616,23.3507C 36.6693,22.9269 38.6044,22.8903 40.4668,23.2026L 42.0083,19.1868L 47.6098,21.337L 46.0683,25.3528C 47.6612,26.3669 49.0747,27.6889 50.2088,29.2803L 54.1371,27.5313L 56.5776,33.0126L 52.6493,34.7616C 53.0731,36.6693 53.1097,38.6043 52.7974,40.4668L 56.8131,42.0083L 54.6629,47.6097L 50.6472,46.0683C 49.6331,47.6613 48.3111,49.0748 46.7197,50.2089L 48.4686,54.1372L 42.9874,56.5776L 41.2384,52.6493C 39.3307,53.0731 37.3957,53.1097 35.5333,52.7974L 33.9918,56.8131L 28.3903,54.6629L 29.9318,50.6472C 28.3388,49.6331 26.9252,48.3111 25.7911,46.7196L 21.8628,48.4686L 19.4224,42.9873L 23.3507,41.2383C 22.9269,39.3307 22.8903,37.3957 23.2026,35.5332L 19.1869,33.9918L 21.3371,28.3903L 25.3528,29.9318C 26.3669,28.3388 27.6889,26.9252 29.2804,25.7911L 27.5314,21.8628 Z M 34.3394,29.7781C 29.7985,31.7998 27.7564,37.1198 29.7781,41.6606C 31.7998,46.2015 37.1198,48.2436 41.6606,46.2219C 46.2015,44.2002 48.2436,38.8802 46.2219,34.3394C 44.2002,29.7985 38.8802,27.7564 34.3394,29.7781 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.cogs.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.cogs.svg
index e3fdaa4ce..d8c1ab0fa 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.cogs.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.cogs.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 32.6227,68.9728C 33.1208,70.2446 33.7077,71.4719 34.3757,72.6471C 35.567,72.7702 36.7761,72.8333 38,72.8333C 40.6447,72.8333 43.2205,72.5386 45.6965,71.9802C 42.2807,68.5449 40.1698,63.8107 40.1698,58.5835C 40.1698,48.0901 48.6764,39.5835 59.1698,39.5835C 64.2047,39.5835 68.7822,41.5419 72.182,44.7385C 72.6094,42.5584 72.8333,40.3053 72.8333,38C 72.8333,36.442 72.731,34.908 72.5328,33.4041C 70.4772,32.3109 68.2718,31.4621 65.9554,30.8963L 65.6219,22.7367C 63.5664,22.3692 61.4511,22.1741 59.2916,22.1671L 57.491,30.1322C 54.2845,30.3184 51.2204,31.0348 48.3848,32.1949L 43.318,25.7887C 41.3995,26.7177 39.5749,27.8102 37.8622,29.0479L 41.0883,36.5527C 38.6742,38.5364 36.5919,40.9091 34.9373,43.575L 27.0703,41.3697C 26.073,43.2256 25.2319,45.178 24.5646,47.2093L 31.5867,51.385C 30.9883,53.6844 30.6698,56.0968 30.6698,58.5835L 30.746,60.6839L 23.0854,63.5239C 23.3743,65.6539 23.8474,67.7255 24.4881,69.7219L 32.6227,68.9728 Z M 27.0669,37.1755L 34.9338,39.3807C 35.9312,37.5248 36.7723,35.5724 37.4395,33.5412L 30.4175,29.3654C 31.0159,27.066 31.3344,24.6537 31.3344,22.1669L 31.2581,20.0665L 38.9187,17.2265C 38.6299,15.0965 38.1568,13.0249 37.5161,11.0285L 29.3815,11.7776C 28.4787,9.47258 27.2844,7.31377 25.8439,5.34655C 22.7943,6.48232 19.9467,8.03307 17.3698,9.93015C 20.1557,13.2359 21.8344,17.5054 21.8344,22.1669C 21.8344,32.5019 13.5826,40.9096 3.30816,41.1611C 3.60321,44.4411 4.35293,47.59 5.49381,50.5444C 8.34489,50.2806 11.0742,49.5968 13.6194,48.5555L 18.6861,54.9617C 20.6046,54.0327 22.4293,52.9403 24.142,51.7025L 20.9158,44.1977C 23.3299,42.2141 25.4123,39.8414 27.0669,37.1755 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.fullscreen.box.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.fullscreen.box.svg
index 13e6840e5..a3e73f41a 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.fullscreen.box.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.fullscreen.box.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 19,57L 19,19L 57,19L 57,57L 19,57 Z M 24,29L 47,29L 47,52L 52,52L 52,24L 24,24L 24,29 Z M 24,34L 24,52L 42,52L 42,34L 24,34 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.home.variant.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.home.variant.svg
index ea951fd19..273ff72cd 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.home.variant.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.home.variant.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76.0106" height="76.0106" viewBox="0 0 76.01 76.01" enable-background="new 0 0 76.01 76.01" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 24.0033,56.0078L 24.0033,38.0053L 22.0031,40.0056L 19.0027,35.0049L 38.0053,20.0028L 45.0063,25.5299L 45.0063,21.753L 49.0068,21.0029L 49.0068,28.6882L 57.008,35.0049L 54.0075,40.0056L 52.0073,38.0053L 52.0073,56.0078L 24.0033,56.0078 Z M 38.0053,26.9204L 27.0038,36.005L 27.0038,53.0074L 38.0045,53.0075L 38.0045,41.0061L 46.0058,41.0061L 46.0059,53.0075L 49.0068,53.0074L 49.0068,36.005L 38.0053,26.9204 Z M 30.004,41.0057L 35.0049,41.0057L 35.0049,47.0066L 30.004,47.0066L 30.004,41.0057 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.information.circle.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.information.circle.svg
index 031bd37f5..35a156ae9 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.information.circle.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.information.circle.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 38,19C 48.4934,19 57,27.5066 57,38C 57,48.4934 48.4934,57 38,57C 27.5066,57 19,48.4934 19,38C 19,27.5066 27.5066,19 38,19 Z M 33.25,33.25L 33.25,36.4167L 36.4166,36.4167L 36.4166,47.5L 33.25,47.5L 33.25,50.6667L 44.3333,50.6667L 44.3333,47.5L 41.1666,47.5L 41.1666,36.4167L 41.1666,33.25L 33.25,33.25 Z M 38.7917,25.3333C 37.48,25.3333 36.4167,26.3967 36.4167,27.7083C 36.4167,29.02 37.48,30.0833 38.7917,30.0833C 40.1033,30.0833 41.1667,29.02 41.1667,27.7083C 41.1667,26.3967 40.1033,25.3333 38.7917,25.3333 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.layer.delete.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.layer.delete.svg
index ddbeb21ca..5157af942 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.layer.delete.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.layer.delete.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76.0106" height="76.0106" viewBox="0 0 76.01 76.01" enable-background="new 0 0 76.01 76.01" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 18.5088,44.0374L 21.8676,40.6786L 27.4655,46.2765L 33.0634,40.6786L 36.4222,44.0374L 30.8243,49.6353L 36.4222,55.2332L 33.0634,58.592L 27.4655,52.994L 21.8676,58.592L 18.5088,55.2332L 24.1068,49.6353L 18.5088,44.0374 Z M 57.0079,38.0053L 38.0053,47.5066L 36.7482,46.8781L 39.5889,44.0374L 35.2559,39.7977L 38.0053,41.1724L 50.6737,34.8382L 57.0079,38.0053 Z M 19.0026,38.0053L 25.3369,34.8382L 32.3326,38.3361L 29.8968,40.7719L 28.1098,42.5589L 25.7193,41.3636L 21.8676,37.6052L 20.6459,38.8269L 19.0026,38.0053 Z M 38.0053,19.0027L 57.0079,28.504L 38.0053,38.0053L 19.0026,28.504L 38.0053,19.0027 Z M 57.0079,47.5066L 38.0053,57.008L 37.8778,56.9442L 39.5889,55.2332L 33.9909,49.6353L 34.6367,48.9895L 38.0053,50.6738L 50.6737,44.3395L 57.0079,47.5066 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.layer.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.layer.svg
index 9eb28235c..b89bb2da3 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.layer.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.layer.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76.0106" height="76.0106" viewBox="0 0 76.01 76.01" enable-background="new 0 0 76.01 76.01" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 57.0079,38.0053L 38.0053,47.5066L 19.0027,38.0053L 25.3369,34.8382L 38.0053,41.1724L 50.6737,34.8382L 57.0079,38.0053 Z M 38.0053,19.0027L 57.0079,28.504L 38.0053,38.0053L 19.0026,28.504L 38.0053,19.0027 Z M 57.0079,47.5066L 38.0053,57.008L 19.0026,47.5066L 25.3369,44.3395L 38.0053,50.6737L 50.6737,44.3395L 57.0079,47.5066 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.location.checkin.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.location.checkin.svg
index 3b21754c6..a58141d22 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.location.checkin.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.location.checkin.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-linejoin="round" d="M 38,19C 42.9706,19 47,23.0294 47,28C 47,30.5642 45.9276,32.878 38,49C 30.0724,32.878 29,30.5642 29,28C 29,23.0294 33.0294,19 38,19 Z M 38,24C 35.7909,24 34,25.7909 34,28C 34,30.2092 35.7909,32 38,32C 40.2091,32 42,30.2092 42,28C 42,25.7909 40.2091,24 38,24 Z M 19,57L 24,42L 31.5,42L 33.5,46L 27.6641,46L 25.3324,53L 50.6676,53L 48.3359,46L 42.5,46L 44.5,42L 52,42L 57,57L 19,57 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.location.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.location.svg
index fff6bf3e1..22f2d7001 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.location.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.location.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 26.9167,13.8542L 50.6666,13.8542L 50.6667,39.5833L 26.9167,63.3333L 26.9167,13.8542 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.map.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.map.svg
index 241f71e59..0a157d0da 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.map.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.map.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 27.7083,23.75L 38.7917,26.9167L 48.2917,20.5833L 62,24L 62,51L 48.2917,47.5L 38.7917,53.8333L 27.7083,50.6667L 16,55.5L 16,28.5L 27.7083,23.75 Z M 27,46.25L 27,29L 20,31.75L 20,49L 27,46.25 Z M 49,25.5L 49,42.75L 58,45.25L 58,28L 49,25.5 Z M 39,31.5L 39,49L 48,43L 48,25.5L 39,31.5 Z M 28,28.75L 28,46L 38,48.5L 38,31.75L 28,28.75 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.power.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.power.svg
index d3f865c0d..db23bca1f 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.power.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.power.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 36.4167,36.4167L 36.4167,17.4167L 41.1667,17.4167L 41.1667,36.4167L 36.4167,36.4167 Z M 57,39.5833C 57,50.0767 48.4934,58.5833 38,58.5833C 27.5066,58.5833 19,50.0767 19,39.5833C 19,30.7301 25.0552,23.2911 33.25,21.1819L 33.25,27.8374C 28.6079,29.7165 25.3333,34.2675 25.3333,39.5833C 25.3333,46.5789 31.0044,52.25 38,52.25C 44.9956,52.25 50.6667,46.5789 50.6667,39.5833C 50.6667,34.8949 48.1194,30.8014 44.3333,28.6113L 44.3333,21.6645C 51.7129,24.2728 57,31.3106 57,39.5833 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.rocket.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.rocket.svg
index a8c5c273a..d3b9d0a16 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.rocket.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.rocket.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 38,19C 39.4823,20.6344 43,26.1259 43,41L 47,46L 47,55L 43,50L 33,50L 29,55L 29,46L 33,41C 33,26.1259 36.0177,20.6344 38,19 Z M 38,57.5L 35,51L 41,51L 38,57.5 Z M 38,27L 36.1552,27.4612L 35.6203,30.5949L 38,30L 40.2918,30.573L 39.6953,27.4238L 38,27 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.timer.rewind.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.timer.rewind.svg
index a02cff6b7..7aded7af0 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.timer.rewind.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.timer.rewind.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 53.8333,41.1667C 53.8333,49.9112 46.7445,57 38,57C 29.2555,57 22.1667,49.9112 22.1667,41.1667C 22.1667,32.9565 28.4156,26.2059 36.4167,25.4115L 36.4167,23.75L 31.6667,23.75L 31.6667,19L 44.3333,19L 44.3333,23.75L 39.5833,23.75L 39.5833,25.4115C 42.7678,25.7277 45.6747,26.9874 48.0205,28.907L 49.1629,27.7646L 46.9237,25.5254L 50.2825,22.1667L 57,28.8842L 53.6412,32.2429L 51.4021,30.0038L 50.2597,31.1462C 52.4932,33.8756 53.8333,37.3647 53.8333,41.1667 Z M 26.2296,39.5834L 30.0833,39.5834L 30.0833,42.75L 26.2296,42.75C 26.9347,48.0419 31.1248,52.232 36.4166,52.9371L 36.4166,49.0833L 39.5833,49.0833L 39.5833,52.9371C 44.8752,52.232 49.0653,48.0419 49.7703,42.75L 45.9166,42.75L 45.9166,39.5834L 49.7703,39.5834C 49.0652,34.2915 44.8751,30.1014 39.5833,29.3964L 39.5833,33.25L 36.4166,33.25L 36.4166,29.3964C 31.1248,30.1014 26.9347,34.2915 26.2296,39.5834 Z M 38,38C 39.7488,38 41.1666,39.4178 41.1666,41.1667C 41.1666,42.9156 39.7488,44.3334 38,44.3334L 31.6666,49.0834L 34.8333,41.1667C 34.8333,39.4178 36.2511,38 38,38 Z M 19.7917,33.25L 19.7917,26.938C 17.2963,30.5244 15.8333,34.883 15.8333,39.5833C 15.8333,51.8257 25.7577,61.75 38,61.75L 42.3542,61.75C 54.3778,61.75 64.1249,51.8257 64.125,39.5835C 64.125,54.0119 52.4284,65.7083 38,65.7083C 23.5716,65.7083 11.875,54.0118 11.875,39.5833C 11.875,33.9832 13.6371,28.7946 16.637,24.5417L 11.0833,24.5417L 15.0417,20.5834L 23.75,20.5833L 23.75,29.2917L 19.7917,33.25 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.transit.car.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.transit.car.svg
index 8ea1a7c5d..3a6e7a287 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.transit.car.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.transit.car.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 17.4167,50.6667C 16.5422,50.6667 15.8333,49.9578 15.8333,49.0833L 15.8333,39.5834C 15.8333,37.0877 17.2768,34.9292 19.3745,33.8972L 25.3333,19L 26.9167,19L 30.0833,19L 45.9167,19L 49.0833,19L 50.6667,19L 56.6255,33.8972C 58.7231,34.9292 60.1666,37.0877 60.1666,39.5834L 60.1667,49.0833C 60.1667,49.9578 59.4578,50.6667 58.5833,50.6667L 57,50.6667L 57,53.8333C 57,55.5822 55.5822,57 53.8333,57C 52.0844,57 50.6667,55.5822 50.6667,53.8333L 50.6667,50.6667L 25.3333,50.6667L 25.3333,53.8333C 25.3333,55.5822 23.9156,57 22.1667,57C 20.4178,57 19,55.5822 19,53.8333L 19,50.6667L 17.4167,50.6667 Z M 24.3833,33.25L 51.6166,33.25L 47.8166,23.75L 28.1833,23.75L 24.3833,33.25 Z M 24.1458,36.0209C 22.3969,36.0209 20.5833,37.8344 20.5833,39.5833C 20.5833,41.3322 22.3969,43.1458 24.1458,43.1458C 25.8947,43.1458 27.7083,41.3323 27.7083,39.5834C 27.7083,37.8345 25.8947,36.0209 24.1458,36.0209 Z M 51.8542,36.0208C 50.1053,36.0208 48.2917,37.8344 48.2917,39.5833C 48.2917,41.3322 50.1053,43.1458 51.8542,43.1458C 53.6031,43.1458 55.4167,41.3322 55.4167,39.5833C 55.4167,37.8344 53.6031,36.0208 51.8542,36.0208 Z "/>
diff --git a/navit/gui/win32/ceglue.c b/navit/gui/win32/ceglue.c
index a0817f935..772eb782d 100644
--- a/navit/gui/win32/ceglue.c
+++ b/navit/gui/win32/ceglue.c
@@ -1,77 +1,77 @@
-#include <windows.h>
-#include "ceglue.h"
-
-BOOL FAR (*SHFullScreenPtr)(HWND hwnd, DWORD state) = NULL;
-
-void InitCeGlue (void)
-{
- HINSTANCE ayg = LoadLibraryW (TEXT ("aygshell.dll"));
- if (ayg != NULL) {
- SHFullScreenPtr = (BOOL (*)(HWND, DWORD))
- GetProcAddressW (ayg, TEXT ("SHFullScreen"));
- }
-}
-
-// code to turn of screen adopted from
-// http://msdn.microsoft.com/en-us/library/ms838354.aspx
-
-// GDI Escapes for ExtEscape()
-#define QUERYESCSUPPORT 8
-
-// The following are unique to CE
-#define GETVFRAMEPHYSICAL 6144
-#define GETVFRAMELEN 6145
-#define DBGDRIVERSTAT 6146
-#define SETPOWERMANAGEMENT 6147
-#define GETPOWERMANAGEMENT 6148
-
-
-typedef enum _VIDEO_POWER_STATE {
- VideoPowerOn = 1,
- VideoPowerStandBy,
- VideoPowerSuspend,
- VideoPowerOff
-} VIDEO_POWER_STATE, *PVIDEO_POWER_STATE;
-
-
-typedef struct _VIDEO_POWER_MANAGEMENT {
- ULONG Length;
- ULONG DPMSVersion;
- ULONG PowerState;
-} VIDEO_POWER_MANAGEMENT, *PVIDEO_POWER_MANAGEMENT;
-
-
-int CeEnableBacklight(int enable)
-{
- HDC gdc;
- int iESC=SETPOWERMANAGEMENT;
-
- gdc = GetDC(NULL);
- if (ExtEscape(gdc, QUERYESCSUPPORT, sizeof(int), (LPCSTR)&iESC,
- 0, NULL)==0)
- {
- MessageBox(NULL,
- L"Sorry, your Pocket PC does not support DisplayOff",
- L"Pocket PC Display Off Feature",
- MB_OK);
- ReleaseDC(NULL, gdc);
- return FALSE;
- }
- else
- {
- VIDEO_POWER_MANAGEMENT vpm;
- vpm.Length = sizeof(VIDEO_POWER_MANAGEMENT);
- vpm.DPMSVersion = 0x0001;
- if (enable) {
- vpm.PowerState = VideoPowerOn;
- } else {
- vpm.PowerState = VideoPowerOff;
- }
- // Power off the display
- ExtEscape(gdc, SETPOWERMANAGEMENT, vpm.Length, (LPCSTR) &vpm,
- 0, NULL);
- ReleaseDC(NULL, gdc);
- return TRUE;
- }
-}
-
+#include <windows.h>
+#include "ceglue.h"
+
+BOOL FAR (*SHFullScreenPtr)(HWND hwnd, DWORD state) = NULL;
+
+void InitCeGlue (void)
+{
+ HINSTANCE ayg = LoadLibraryW (TEXT ("aygshell.dll"));
+ if (ayg != NULL) {
+ SHFullScreenPtr = (BOOL (*)(HWND, DWORD))
+ GetProcAddressW (ayg, TEXT ("SHFullScreen"));
+ }
+}
+
+// code to turn of screen adopted from
+// http://msdn.microsoft.com/en-us/library/ms838354.aspx
+
+// GDI Escapes for ExtEscape()
+#define QUERYESCSUPPORT 8
+
+// The following are unique to CE
+#define GETVFRAMEPHYSICAL 6144
+#define GETVFRAMELEN 6145
+#define DBGDRIVERSTAT 6146
+#define SETPOWERMANAGEMENT 6147
+#define GETPOWERMANAGEMENT 6148
+
+
+typedef enum _VIDEO_POWER_STATE {
+ VideoPowerOn = 1,
+ VideoPowerStandBy,
+ VideoPowerSuspend,
+ VideoPowerOff
+} VIDEO_POWER_STATE, *PVIDEO_POWER_STATE;
+
+
+typedef struct _VIDEO_POWER_MANAGEMENT {
+ ULONG Length;
+ ULONG DPMSVersion;
+ ULONG PowerState;
+} VIDEO_POWER_MANAGEMENT, *PVIDEO_POWER_MANAGEMENT;
+
+
+int CeEnableBacklight(int enable)
+{
+ HDC gdc;
+ int iESC=SETPOWERMANAGEMENT;
+
+ gdc = GetDC(NULL);
+ if (ExtEscape(gdc, QUERYESCSUPPORT, sizeof(int), (LPCSTR)&iESC,
+ 0, NULL)==0)
+ {
+ MessageBox(NULL,
+ L"Sorry, your Pocket PC does not support DisplayOff",
+ L"Pocket PC Display Off Feature",
+ MB_OK);
+ ReleaseDC(NULL, gdc);
+ return FALSE;
+ }
+ else
+ {
+ VIDEO_POWER_MANAGEMENT vpm;
+ vpm.Length = sizeof(VIDEO_POWER_MANAGEMENT);
+ vpm.DPMSVersion = 0x0001;
+ if (enable) {
+ vpm.PowerState = VideoPowerOn;
+ } else {
+ vpm.PowerState = VideoPowerOff;
+ }
+ // Power off the display
+ ExtEscape(gdc, SETPOWERMANAGEMENT, vpm.Length, (LPCSTR) &vpm,
+ 0, NULL);
+ ReleaseDC(NULL, gdc);
+ return TRUE;
+ }
+}
+
diff --git a/navit/gui/win32/ceglue.h b/navit/gui/win32/ceglue.h
index b0dc79d42..bb185dbed 100644
--- a/navit/gui/win32/ceglue.h
+++ b/navit/gui/win32/ceglue.h
@@ -1,16 +1,16 @@
-#ifndef CEGLUE_H
-#define CEGLUE_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern BOOL (*SHFullScreenPtr)(HWND hwnd, DWORD state);
-void InitCeGlue (void);
-
-int CeEnableBacklight(int enable);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
+#ifndef CEGLUE_H
+#define CEGLUE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern BOOL (*SHFullScreenPtr)(HWND hwnd, DWORD state);
+void InitCeGlue (void);
+
+int CeEnableBacklight(int enable);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/navit/icons/gui_layers.svg b/navit/icons/gui_layers.svg
index 810b5a1d6..44bb0a32e 100644
--- a/navit/icons/gui_layers.svg
+++ b/navit/icons/gui_layers.svg
@@ -1,33 +1,33 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="18.02128" height="18" id="svg5952">
- <defs id="defs5954">
- <linearGradient id="linearGradient2485-94">
- <stop id="stop2486-7" style="stop-color:#ffffff;stop-opacity:1" offset="0"/>
- <stop id="stop2487-83" style="stop-color:#aaaaaa;stop-opacity:1" offset="1"/>
- </linearGradient>
- <linearGradient id="linearGradient5704-5">
- <stop id="stop5706-120" style="stop-color:#5a5a5a;stop-opacity:1" offset="0"/>
- <stop id="stop5708-16" style="stop-color:#000000;stop-opacity:1" offset="1"/>
- </linearGradient>
- <linearGradient x1="974.19751" y1="182.46863" x2="979.80444" y2="184.8026" id="linearGradient4351" xlink:href="#linearGradient2485-94" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-173.95451)"/>
- <linearGradient x1="968.88806" y1="178.31856" x2="977.93347" y2="181.70978" id="linearGradient4353" xlink:href="#linearGradient5704-5" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-173.95451)"/>
- <linearGradient x1="974.19751" y1="182.46863" x2="979.80444" y2="184.8026" id="linearGradient4356" xlink:href="#linearGradient2485-94" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-170.95451)"/>
- <linearGradient x1="968.88806" y1="178.31856" x2="977.93347" y2="181.70978" id="linearGradient4358" xlink:href="#linearGradient5704-5" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-170.95451)"/>
- <linearGradient x1="974.19751" y1="182.46863" x2="979.80444" y2="184.8026" id="linearGradient4362" xlink:href="#linearGradient2485-94" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-167.95454)"/>
- <linearGradient x1="968.88806" y1="178.31856" x2="977.93347" y2="181.70978" id="linearGradient4364" xlink:href="#linearGradient5704-5" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-167.95454)"/>
- </defs>
- <metadata id="metadata5957">
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <use transform="translate(-961.86731,-168.04527)" id="use13602" x="0" y="0" width="1250" height="1250" xlink:href="#rect12856"/>
- <path d="m 5.5212776,14.545453 11.0000004,0 -4,-4.9999999 -11.0000004,0 4,4.9999999 z" id="use8977" style="color:#000000;fill:url(#linearGradient4362);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4364);stroke-width:0.99994743;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;display:inline"/>
- <path d="m 5.5212776,11.545483 11.0000004,0 -4,-4.9999999 -11.0000004,0 4,4.9999999 z" id="use8059" style="color:#000000;fill:url(#linearGradient4356);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4358);stroke-width:0.99994743;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;display:inline"/>
- <path d="m 5.5212776,8.5454831 11.0000004,0 -4,-5 -11.0000004,0 4,5 z" id="use8061" style="color:#000000;fill:url(#linearGradient4351);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4353);stroke-width:0.99994743;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;display:inline"/>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="18.02128" height="18" id="svg5952">
+ <defs id="defs5954">
+ <linearGradient id="linearGradient2485-94">
+ <stop id="stop2486-7" style="stop-color:#ffffff;stop-opacity:1" offset="0"/>
+ <stop id="stop2487-83" style="stop-color:#aaaaaa;stop-opacity:1" offset="1"/>
+ </linearGradient>
+ <linearGradient id="linearGradient5704-5">
+ <stop id="stop5706-120" style="stop-color:#5a5a5a;stop-opacity:1" offset="0"/>
+ <stop id="stop5708-16" style="stop-color:#000000;stop-opacity:1" offset="1"/>
+ </linearGradient>
+ <linearGradient x1="974.19751" y1="182.46863" x2="979.80444" y2="184.8026" id="linearGradient4351" xlink:href="#linearGradient2485-94" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-173.95451)"/>
+ <linearGradient x1="968.88806" y1="178.31856" x2="977.93347" y2="181.70978" id="linearGradient4353" xlink:href="#linearGradient5704-5" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-173.95451)"/>
+ <linearGradient x1="974.19751" y1="182.46863" x2="979.80444" y2="184.8026" id="linearGradient4356" xlink:href="#linearGradient2485-94" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-170.95451)"/>
+ <linearGradient x1="968.88806" y1="178.31856" x2="977.93347" y2="181.70978" id="linearGradient4358" xlink:href="#linearGradient5704-5" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-170.95451)"/>
+ <linearGradient x1="974.19751" y1="182.46863" x2="979.80444" y2="184.8026" id="linearGradient4362" xlink:href="#linearGradient2485-94" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-167.95454)"/>
+ <linearGradient x1="968.88806" y1="178.31856" x2="977.93347" y2="181.70978" id="linearGradient4364" xlink:href="#linearGradient5704-5" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-167.95454)"/>
+ </defs>
+ <metadata id="metadata5957">
+ <rdf:RDF>
+ <cc:Work rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+ <dc:title/>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <use transform="translate(-961.86731,-168.04527)" id="use13602" x="0" y="0" width="1250" height="1250" xlink:href="#rect12856"/>
+ <path d="m 5.5212776,14.545453 11.0000004,0 -4,-4.9999999 -11.0000004,0 4,4.9999999 z" id="use8977" style="color:#000000;fill:url(#linearGradient4362);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4364);stroke-width:0.99994743;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;display:inline"/>
+ <path d="m 5.5212776,11.545483 11.0000004,0 -4,-4.9999999 -11.0000004,0 4,4.9999999 z" id="use8059" style="color:#000000;fill:url(#linearGradient4356);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4358);stroke-width:0.99994743;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;display:inline"/>
+ <path d="m 5.5212776,8.5454831 11.0000004,0 -4,-5 -11.0000004,0 4,5 z" id="use8061" style="color:#000000;fill:url(#linearGradient4351);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4353);stroke-width:0.99994743;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;display:inline"/>
</svg> \ No newline at end of file
diff --git a/navit/map/garmin/garmin.c b/navit/map/garmin/garmin.c
index 2e7263081..4ef32a28e 100644
--- a/navit/map/garmin/garmin.c
+++ b/navit/map/garmin/garmin.c
@@ -814,17 +814,6 @@ garmin_get_selection(struct map_rect_priv *map, struct map_selection *sel)
}
return -1;
}
-#if 0
- sl = (18-(gm->maxlevel - gm->minlevel))/2;
- el = sl + (gm->maxlevel - gm->minlevel);
- if (level < sl)
- level = sl;
- if (level > el)
- level = el;
- level = level - sl;
- level = (gm->maxlevel - gm->minlevel) - level;
- dlog(3, "sl=%d el=%d level=%d\n", sl, el, level);
-#endif
sl = (18-gm->zoomlevels)/2;
el = sl + gm->zoomlevels;
if (level < sl)
diff --git a/navit/map/mg/block.c b/navit/map/mg/block.c
index 7e7326908..747e49b15 100644
--- a/navit/map/mg/block.c
+++ b/navit/map/mg/block.c
@@ -219,12 +219,6 @@ block_next(struct map_rect_priv *mr)
bt->order=0;
dbg(lvl_debug,"size 0x%x next 0x%x", block_get_size(bt->b), block_get_next(bt->b));
if (! mr->b.bt.block_count) {
-#if 0
- if (debug) {
- printf("idx rect ");
- block_rect_print(&mr->b.bt.b->r);
- }
-#endif
block_get_r(bt->b, &bt->r);
bt->r_curr=bt->r;
coord=get_u32(&mr->b.bt.p);
@@ -243,13 +237,6 @@ block_next(struct map_rect_priv *mr)
r_w=bt->r_curr.rl.x-bt->r_curr.lu.x;
r_h=bt->r_curr.lu.y-bt->r_curr.rl.y;
-#if 0
- if (debug) {
- printf(" rect1 ");
- block_rect_print(&bt->r_curr);
- printf(" %dx%d", r_w, r_h);
- }
-#endif
mr->b.b=NULL;
if (blk_num != -1) {
block_mem+=8;
diff --git a/navit/map/mg/street.c b/navit/map/mg/street.c
index 49f790e9c..cffd599ae 100644
--- a/navit/map/mg/street.c
+++ b/navit/map/mg/street.c
@@ -61,10 +61,6 @@ street_name_debug(struct street_name *sn, FILE *out)
static void
street_name_get(struct street_name *name, unsigned char **p)
{
-#if 0
- static FILE *out;
- static GHashTable *hash;
-#endif
unsigned char *start=*p;
name->len=get_u16_unal(p);
name->country=get_u16_unal(p);
@@ -79,18 +75,6 @@ street_name_get(struct street_name *name, unsigned char **p)
name->tmp_len=name->aux_len;
name->tmp_data=name->aux_data;
*p=start+name->len;
-#if 0
- if (! out) {
- out=fopen("hn.txt","a");
- }
- if (! hash) {
- hash=g_hash_table_new(NULL,NULL);
- }
- if (! g_hash_table_lookup(hash, *p)) {
- g_hash_table_insert(hash, *p, (void *)1);
- street_name_debug(name, out);
- }
-#endif
}
static int
@@ -414,13 +398,6 @@ street_get(struct map_rect_priv *mr, struct street_priv *street, struct item *it
struct coord c;
street_coord_get(street, &c, 1);
}
-#if 0
- if (street->housenumber) {
- if (street_get_housenumber(mr, street, item))
- return 1;
- street->housenumber=0;
- }
-#endif
if (mr->b.p == mr->b.p_start) {
street_get_data(street, &mr->b.p);
street->name_file=mr->m->file[file_strname_stn];
@@ -445,16 +422,8 @@ street_get(struct map_rect_priv *mr, struct street_priv *street, struct item *it
return 0;
if (street_str_get_segid(street->str) < 0)
street->type++;
-#if 0
- dbg_assert(street->p != NULL);
-#endif
street->next=NULL;
street->status_rewind=street->status=street_str_get_segid(&street->str[1]) >= 0 ? 0:1;
-#if 0
- if (street->type->country != 0x31) {
- printf("country=0x%x\n", street->type->country);
- }
-#endif
item->id_hi=street_type_get_country(street->type) | (mr->current_file << 16);
item->id_lo=street_str_get_segid(street->str) > 0 ? street_str_get_segid(street->str) : -street_str_get_segid(street->str);
switch(street_str_get_type(street->str) & 0x1f) {
@@ -530,13 +499,6 @@ street_get(struct map_rect_priv *mr, struct street_priv *street, struct item *it
street->flags|=(street_str_get_limit(street->str) & 0x30) ? AF_ONEWAY:0;
street->flags|=(street_str_get_limit(street->str) & 0x03) ? AF_ONEWAYREV:0;
}
-#if 0
- coord_debug=(street->str->unknown2 != 0x40 || street->str->unknown3 != 0x40);
- if (coord_debug) {
- item->type=type_street_unkn;
- printf("%d %02x %02x %02x %02x\n", street->str->segid, street->str->type, street->str->limit, street->str->unknown2, street->str->unknown3);
- }
-#endif
street->p_rewind=street->p;
street->name.len=0;
street->attr_next=attr_label;
@@ -580,12 +542,6 @@ street_get_byid(struct map_rect_priv *mr, struct street_priv *street, int id_hi,
street->str+=(res & 0xfff)-1;
dbg(lvl_debug,"segid 0x%x", street_str_get_segid(&street->str[1]));
return street_get(mr, street, item);
-#if 0
- mr->b.p=mr->b.block_start+(res & 0xffff);
- return town_get(mr, twn, item);
-#endif
-
- return 0;
}
struct street_name_index {
@@ -999,9 +955,6 @@ housenumber_search_setup(struct map_rect_priv *mr)
mr->search_str=g_strdup(mr->search_attr->u.str);
dbg(lvl_debug,"last %p",mr->b.p);
street_name_get(&mr->street.name, &mr->b.p);
-#if 0
- debug(mr);
-#endif
while (id > 0) {
id--;
dbg(lvl_debug,"loop");
diff --git a/navit/map/mg/town.c b/navit/map/mg/town.c
index 1399bca33..ace353a1d 100644
--- a/navit/map/mg/town.c
+++ b/navit/map/mg/town.c
@@ -137,9 +137,6 @@ town_get_data(struct town_priv *twn, unsigned char **p)
twn->unknown3=get_u8(p);
twn->postal_code2=get_string(p);
twn->unknown4=get_u32_unal(p);
-#if 0
- printf("%s\t%s\t%s\t%d\t%d\t%d\n",twn->name,twn->district,twn->postal_code1,twn->order, twn->country, twn->type);
-#endif
}
/*0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 */
static unsigned char limit[]={0,1,2,2,4,6,8,10,11,13,14,14,14,20,20,20,20,20,20};
diff --git a/navit/maptool/boundaries.c b/navit/maptool/boundaries.c
index 605b6fb7b..75e1d2479 100644
--- a/navit/maptool/boundaries.c
+++ b/navit/maptool/boundaries.c
@@ -308,37 +308,6 @@ process_boundaries_finish(GList *boundaries_list)
}
}
-#if 0
- printf("hierarchy\n");
-#endif
-#if 0
- boundaries_list=g_list_sort(boundaries_list, boundary_bbox_compare);
- l=boundaries_list;
- while (l) {
- struct boundary *boundary=l->data;
- GList *l2,*ln;
- ln=l2=g_list_next(l);
- while (l2) {
- struct boundary *boundary2=l2->data;
- if (bbox_contains_bbox(&boundary2->r, &boundary->r)) {
- boundaries_list=g_list_remove(boundaries_list, boundary);
- boundary2->children=g_list_append(boundary2->children, boundary);
-#if 0
- printf("found\n");
-#endif
- break;
- }
- l2=g_list_next(l2);
- }
- l=ln;
- }
- dump_hierarchy(boundaries_list,"");
-#if 0
- printf("hierarchy done\n");
- printf("test\n");
- test(boundaries_list);
-#endif
-#endif
return ret;
}
diff --git a/navit/maptool/ch.c b/navit/maptool/ch.c
index b3ebb31b3..59a4b7db2 100644
--- a/navit/maptool/ch.c
+++ b/navit/maptool/ch.c
@@ -262,9 +262,6 @@ ch_process_node(FILE *out, int node, int resolve)
memset(&ch_edge, 0, sizeof(ch_edge));
item_bin=init_item(type_ch_node);
oldnode=GPOINTER_TO_INT(g_hash_table_lookup(newnode_hash, GINT_TO_POINTER(node)));
-#if 0
- dbg(lvl_debug,"0x%x,0x%x",node_index[oldnode].x,node_index[oldnode].y);
-#endif
item_bin_add_coord(item_bin, &node_index[oldnode], 1);
fwd.first=oldnode;
rev.last=oldnode;
@@ -289,23 +286,14 @@ ch_process_node(FILE *out, int node, int resolve)
exit(1);
} else {
ch_edge.middle=*id;
-#if 0
- dbg(lvl_debug,"middle street id for is "ITEM_ID_FMT"",ITEM_ID_ARGS(*id));
-#endif
}
} else {
ch_edge.flags|=4;
id=g_hash_table_lookup(sgr_nodes_hash, GINT_TO_POINTER((int)edge->scmiddle));
dbg_assert(id != NULL);
ch_edge.middle=*id;
-#if 0
- dbg(lvl_debug,"middle node id for is "ITEM_ID_FMT"",ITEM_ID_ARGS(*id));
-#endif
}
id=g_hash_table_lookup(sgr_nodes_hash, GINT_TO_POINTER((int)edge->target));
-#if 0
- dbg(lvl_debug,"id for %d is "ITEM_ID_FMT"",edge->target,ITEM_ID_ARGS(*id));
-#endif
if (id == NULL) {
fprintf(stderr,"Failed to look up target %d\n",edge->target);
} else {
@@ -521,9 +509,6 @@ ch_assemble_map(char *map_suffix, char *suffix, struct zip_info *zip_info)
while (fread(&id, sizeof(id), 1, ref)) {
struct item_id *id2=g_slice_new(struct item_id);
*id2=id;
-#if 0
- dbg(lvl_debug,"%d is "ITEM_ID_FMT"",nodeid,ITEM_ID_ARGS(*id2));
-#endif
g_hash_table_insert(sgr_nodes_hash, GINT_TO_POINTER(nodeid), id2);
nodeid++;
}
diff --git a/navit/maptool/coastline.c b/navit/maptool/coastline.c
index 0c0ea6250..5de56f5b2 100644
--- a/navit/maptool/coastline.c
+++ b/navit/maptool/coastline.c
@@ -86,14 +86,8 @@ close_polygon(struct item_bin *ib, struct coord *from, struct coord *to, int dir
fromdist=distance_from_ll(to, bbox);
todist=distance_from_ll(from, bbox);
}
-#if 0
- fprintf(stderr,"close_polygon fromdist %d todist %d full %d dir %d\n", fromdist, todist, full, dir);
-#endif
if (fromdist > todist)
todist+=full;
-#if 0
- fprintf(stderr,"close_polygon corrected fromdist %d todist %d full %d dir %d\n", fromdist, todist, full, dir);
-#endif
for (i = 0 ; i < 8 ; i++) {
if (dir > 0)
e=i;
@@ -118,14 +112,8 @@ close_polygon(struct item_bin *ib, struct coord *from, struct coord *to, int dir
dist=distance_from_ll(&c, bbox);
if (e & 4)
dist+=full;
-#if 0
- fprintf(stderr,"dist %d %d\n",e,dist);
-#endif
if (dist > fromdist && dist < todist) {
item_bin_add_coord(ib, &c, 1);
-#if 0
- fprintf(stderr,"add\n");
-#endif
}
if (dist >= fromdist && dist <= todist) {
if (!corners)
@@ -161,9 +149,6 @@ tile_data_to_segments(int *tile_data)
curr+=ib->len+1;
count++;
}
-#if 0
- fprintf(stderr,"%d segments\n",count);
-#endif
return segments;
}
@@ -181,42 +166,12 @@ tile_collector_process_tile(char *tile, int *tile_data, struct coastline_tile_da
struct item_bin *ibt=(struct item_bin *)(tile_data+1);
struct coastline_tile *ct=g_new0(struct coastline_tile, 1);
ct->wayid=item_bin_get_wayid(ibt);
-#if 0
- if (strncmp(tile,"bcdbdcabddddba",7))
- return;
-#endif
-#if 0
- if (strncmp(tile,"bcdbdcaaaaddba",14))
- return;
-#endif
-#if 0
- fprintf(stderr,"tile %s of size %d\n", tile, *tile_data);
-#endif
tile_bbox(tile, &bbox, 0);
curr=tile_data_to_segments(tile_data);
sorted_segments=geom_poly_segments_sort(curr, geom_poly_segment_type_way_right_side);
g_list_foreach(curr,(GFunc)geom_poly_segment_destroy,NULL);
g_list_free(curr);
-#if 0
-{
- GList *sort_segments=sorted_segments;
- int count=0;
- while (sort_segments) {
- struct geom_poly_segment *seg=sort_segments->data;
- struct item_bin *ib=(struct item_bin *)buffer;
- char *text=g_strdup_printf("segment %d type %d %p %s area "LONGLONG_FMT,count++,seg->type,sort_segments,coord_is_equal(*seg->first, *seg->last) ? "closed":"open",geom_poly_area(seg->first,seg->last-seg->first+1));
- item_bin_init(ib, type_rg_segment);
- item_bin_add_coord(ib, seg->first, seg->last-seg->first+1);
- item_bin_add_attr_string(ib, attr_debug, text);
- // fprintf(stderr,"%s\n",text);
- g_free(text);
- // item_bin_dump(ib, stderr);
- item_bin_write_to_sink(ib, out, NULL);
- sort_segments=g_list_next(sort_segments);
- }
-}
-#endif
flags=0;
curr=sorted_segments;
while (curr) {
@@ -243,7 +198,6 @@ tile_collector_process_tile(char *tile, int *tile_data, struct coastline_tile_da
g_hash_table_insert(data->tile_edges, g_strdup(tile), ct);
return;
}
-#if 1
end=bbox.l;
tile_start_valid=0;
poly_start_valid=0;
@@ -307,49 +261,9 @@ tile_collector_process_tile(char *tile, int *tile_data, struct coastline_tile_da
}
g_list_foreach(sorted_segments,(GFunc)geom_poly_segment_destroy,NULL);
g_list_free(sorted_segments);
-#endif
-#if 0
- {
- int *end=tile_data+tile_data[0];
- int *curr=tile_data+1;
- while (curr < end) {
- struct item_bin *ib=(struct item_bin *)curr;
- // item_bin_dump(ib);
- ib->type=type_rg_segment;
- item_bin_write_to_sink(ib, out, NULL);
- curr+=ib->len+1;
-#if 0
- {
- struct coord *c[2];
- int i;
- char *s;
- c[0]=(struct coord *)(ib+1);
- c[1]=c[0]+ib->clen/2-1;
- for (i = 0 ; i < 2 ; i++) {
- s=coord_to_str(c[i]);
- item_bin_write_debug_point_to_sink(out, c[i], "%s",s);
- g_free(s);
- }
-
- }
-#endif
- }
- }
-#endif
ct->edges=edges;
g_hash_table_insert(data->tile_edges, g_strdup(tile), ct);
-#if 0
- item_bin_init(ib, type_border_country);
- item_bin_bbox(ib, &bbox);
- item_bin_add_attr_string(ib, attr_debug, tile);
- item_bin_write_to_sink(ib, out, NULL);
-#endif
-#if 0
- c.x=(bbox.l.x+bbox.h.x)/2;
- c.y=(bbox.l.y+bbox.h.y)/2;
- item_bin_write_debug_point_to_sink(out, &c, "%s %d",tile,edges);
-#endif
}
static void
@@ -377,20 +291,6 @@ ocean_tile(GHashTable *hash, char *tile, char c, osmid wayid, struct item_bin_si
ct->edges=15;
ct->wayid=wayid;
g_hash_table_insert(hash, g_strdup(tile2), ct);
-#if 0
- item_bin_init(ib, type_border_country);
- item_bin_bbox(ib, &bbox);
- item_bin_add_attr_string(ib, attr_debug, tile2);
- item_bin_write_to_sink(ib, out, NULL);
-#endif
-#if 0
- {
- struct coord co;
- co.x=(bbox.l.x+bbox.h.x)/2;
- co.y=(bbox.l.y+bbox.h.y)/2;
- item_bin_write_debug_point_to_sink(out, &co, "%s 15",tile2);
- }
-#endif
}
/* ba */
@@ -404,10 +304,6 @@ tile_collector_add_siblings(char *tile, struct coastline_tile *ct, struct coastl
struct item_bin_sink *out=data->sink->priv_data[1];
int edges=ct->edges;
int debug=0;
-#if 0
- if (!strncmp(tile,"bcacccaadbdcd",10))
- debug=1;
-#endif
if (debug)
fprintf(stderr,"%s (%c) has %d edges active\n",tile,t,edges);
if (t == 'a' && (edges & 1))
@@ -489,10 +385,6 @@ tile_collector_add_siblings2(char *tile, struct coastline_tile *ct, struct coast
char t=tile[len-1];
strcpy(tile2, tile);
tile2[len-1]='\0';
-#if 0
- if (!strncmp(tile,"bcacccaadbdcd",10))
- debug=1;
-#endif
if (debug)
fprintf(stderr,"len of %s %d vs %d\n",tile,len,data->level);
@@ -593,15 +485,6 @@ tile_collector_finish(struct item_bin_sink_func *tile_collector)
foreach_tile(&data, tile_collector_add_siblings2);
fprintf(stderr,"*\n");
}
-#if 0
- data.level=13;
- g_hash_table_foreach(data.tile_edges, tile_collector_add_siblings, &data);
- g_hash_table_foreach(data.tile_edges, tile_collector_add_siblings, &data);
- g_hash_table_foreach(data.tile_edges, tile_collector_add_siblings2, &data);
- data.level=12;
- g_hash_table_foreach(data.tile_edges, tile_collector_add_siblings, &data);
- g_hash_table_foreach(data.tile_edges, tile_collector_add_siblings, &data);
-#endif
item_bin_sink_func_destroy(tile_collector);
fprintf(stderr,"tile_collector_finish done\n");
return 0;
@@ -611,14 +494,6 @@ tile_collector_finish(struct item_bin_sink_func *tile_collector)
static int
coastline_processor_process(struct item_bin_sink_func *func, struct item_bin *ib, struct tile_data *tile_data)
{
-#if 0
- int i;
- struct coord *c=(struct coord *)(ib+1);
- for (i = 0 ; i < 19 ; i++) {
- c[i]=c[i+420];
- }
- ib->clen=(i-1)*2;
-#endif
item_bin_write_clipped(ib, func->priv_data[0], func->priv_data[1]);
return 0;
}
diff --git a/navit/maptool/itembin.c b/navit/maptool/itembin.c
index 98b0c52a6..0c62eb205 100644
--- a/navit/maptool/itembin.c
+++ b/navit/maptool/itembin.c
@@ -520,19 +520,8 @@ item_bin_sort_compare(const void *p1, const void *p2)
if(ret)
return ret;
}
-#if 0
- dbg_assert(ib1->clen==2);
- dbg_assert(ib2->clen==2);
- attr1=(struct attr_bin *)((int *)(ib1+1)+ib1->clen);
- attr2=(struct attr_bin *)((int *)(ib2+1)+ib1->clen);
-#else
attr1=item_bin_get_attr_bin_last(ib1);
attr2=item_bin_get_attr_bin_last(ib2);
-#endif
-#if 0
- dbg_assert(attr1->type == attr_town_name || attr1->type == attr_town_name_match);
- dbg_assert(attr2->type == attr_town_name || attr2->type == attr_town_name_match);
-#endif
s1=(char *)(attr1+1);
s2=(char *)(attr2+1);
if (attr1->type == attr_house_number && attr2->type == attr_house_number) {
@@ -554,9 +543,6 @@ item_bin_sort_compare(const void *p1, const void *p2)
match2=(attr2->type == attr_town_name_match || attr2->type == attr_district_name_match);
ret=match1-match2;
}
-#if 0
- fprintf(stderr,"sort_countries_compare p1=%p p2=%p %s %s\n",p1,p2,s1,s2);
-#endif
return ret;
}
diff --git a/navit/maptool/osm.c b/navit/maptool/osm.c
index 1613f2e56..c6d1fa6df 100644
--- a/navit/maptool/osm.c
+++ b/navit/maptool/osm.c
@@ -1470,10 +1470,6 @@ node_item_find_index_in_ordered_list(osmid id)
if (node_buffer_base[node_count-1].nd_id < id)
return -1;
while (node_buffer_base[search_index].nd_id != id) {
-#if 0
- fprintf(stderr,"search_index=%d node_count=%d search_step=%d id=%d node_buffer_base[search_index].id=%d\n",
- search_index, node_count, search_step, id, node_buffer_base[search_index].id);
-#endif
if (node_buffer_base[search_index].nd_id < id) {
search_index+=search_step;
if (search_step == 1) {
@@ -1721,9 +1717,6 @@ static void
relation_add_tag(char *k, char *v)
{
int add_tag=1;
-#if 0
- fprintf(stderr,"add tag %s %s\n",k,v);
-#endif
if (!strcmp(k,"type")) {
g_strlcpy(relation_type, v, sizeof(relation_type));
add_tag=0;
@@ -3201,17 +3194,9 @@ write_item_way_subsection(FILE *out, FILE *out_index, FILE *out_graph, struct it
new.len=new.clen+attr_len+2;
if (out_index)
write_item_way_subsection_index(out, out_index, out_graph, orig, last_id);
-#if 0
- fprintf(stderr,"first %d last %d type 0x%x len %d clen %d attr_len %d\n", first, last, new.type, new.len, new.clen, attr_len);
-#endif
dbg_assert(fwrite(&new, sizeof(new), 1, out)==1);
dbg_assert(fwrite(c+first, new.clen*4, 1, out)==1);
dbg_assert(fwrite(attr, attr_len*4, 1, out)==1);
-#if 0
- fwrite(&new, sizeof(new), 1, out_graph);
- fwrite(c+first, new.clen*4, 1, out_graph);
- fwrite(attr, attr_len*4, 1, out_graph);
-#endif
}
void
@@ -3302,9 +3287,6 @@ map_resolve_coords_and_split_at_intersections(FILE *in, FILE *out, FILE *out_ind
processed_nodes=processed_nodes_out=processed_ways=processed_relations=processed_tiles=0;
sig_alrm(0);
while ((ib=read_item(in))) {
-#if 0
- fprintf(stderr,"type 0x%x len %d clen %d\n", ib->type, ib->len, ib->clen);
-#endif
ccount=ib->clen/2;
if (ccount <= 1)
continue;
diff --git a/navit/maptool/osm_protobuf.c b/navit/maptool/osm_protobuf.c
index 1b4294a70..d75bca8b5 100644
--- a/navit/maptool/osm_protobuf.c
+++ b/navit/maptool/osm_protobuf.c
@@ -184,15 +184,9 @@ process_tag(OSMPBF__PrimitiveBlock *primitive_block, int key, int val)
{
char keybuff[1024];
char valbuff[1024];
-#if 0
- get_string(keybuff, sizeof(keybuff), primitive_block, key, 1);
- get_string(valbuff, sizeof(valbuff), primitive_block, val, 1);
- printf("\t\t<tag k=\"%s\" v=\"%s\" />\n",keybuff,valbuff);
-#else
get_string(keybuff, sizeof(keybuff), primitive_block, key, 0);
get_string(valbuff, sizeof(valbuff), primitive_block, val, 0);
osm_add_tag(keybuff, valbuff);
-#endif
}
@@ -216,26 +210,12 @@ process_dense(OSMPBF__PrimitiveBlock *primitive_block, OSMPBF__DenseNodes *dense
timestamp+=dense->denseinfo->timestamp[i];
has_tags=dense->keys_vals && dense->keys_vals[j];
osm_add_node(id, lat/latlon_scale,lon/latlon_scale);
-#if 0
- printf("\t<node id=\"%Ld\" lat=\"%.7f\" lon=\"%.7f\" version=\"%d\" changeset=\"%Ld\"",id,lat/latlon_scale,lon/latlon_scale,dense->denseinfo->version[i],changeset);
- process_user(primitive_block, user_sid, uid, 0);
- process_timestamp(timestamp);
-#endif
if (has_tags) {
-#if 0
- printf(">\n");
-#endif
while (dense->keys_vals[j]) {
process_tag(primitive_block, dense->keys_vals[j], dense->keys_vals[j+1]);
j+=2;
}
-#if 0
- printf("\t</node>\n");
- } else
- printf("/>\n");
-#else
}
-#endif
osm_end_node(osm);
j++;
}
@@ -258,25 +238,12 @@ process_way(OSMPBF__PrimitiveBlock *primitive_block, OSMPBF__Way *way, struct ma
long long ref=0;
osm_add_way(way->id);
-#if 0
- printf("\t<way id=\"%Ld\"",way->id);
- process_info(primitive_block, way->info);
- printf(">\n");
-#else
-#endif
for (i = 0 ; i < way->n_refs ; i++) {
ref+=way->refs[i];
osm_add_nd(ref);
-#if 0
- printf("\t\t<nd ref=\"%Ld\"/>\n",ref);
-#else
-#endif
}
for (i = 0 ; i < way->n_keys ; i++)
process_tag(primitive_block, way->keys[i], way->vals[i]);
-#if 0
- printf("\t</way>\n");
-#endif
osm_end_way(osm);
}
@@ -287,45 +254,15 @@ process_relation(OSMPBF__PrimitiveBlock *primitive_block, OSMPBF__Relation *rela
long long ref=0;
char rolebuff[1024];
-#if 0
- printf("\t<relation id=\"%Ld\"",relation->id);
- process_info(primitive_block, relation->info);
- printf(">\n");
-#endif
osm_add_relation(relation->id);
for (i = 0 ; i < relation->n_roles_sid ; i++) {
-#if 0
- printf("\t\t<member type=\"");
- switch (relation->types[i]) {
- case 0:
- printf("node");
- break;
- case 1:
- printf("way");
- break;
- case 2:
- printf("relation");
- break;
- default:
- printf("unknown");
- break;
- }
-#endif
ref+=relation->memids[i];
get_string(rolebuff, sizeof(rolebuff), primitive_block, relation->roles_sid[i], 1);
-#if 0
- printf("\" ref=\"%Ld\" role=\"%s\"/>\n",ref,rolebuff);
-#else
osm_add_member(relation->types[i]+1,ref,rolebuff);
-#endif
}
for (i = 0 ; i < relation->n_keys ; i++)
process_tag(primitive_block, relation->keys[i], relation->vals[i]);
-#if 0
- printf("\t</relation>\n");
-#else
osm_end_relation(osm);
-#endif
}
static void
@@ -341,9 +278,6 @@ process_osmdata(OSMPBF__Blob *blob, unsigned char *data, struct maptool_osm *osm
process_way(primitive_block, primitive_group->ways[j], osm);
for (j = 0 ; j < primitive_group->n_relations ; j++)
process_relation(primitive_block, primitive_group->relations[j], osm);
-#if 0
- printf("Group %p %d %d %d %d\n",primitive_group->dense,primitive_group->n_nodes,primitive_group->n_ways,primitive_group->n_relations,primitive_group->n_changesets);
-#endif
}
osmpbf__primitive_block__free_unpacked(primitive_block, &protobuf_c_system_allocator);
}
@@ -357,10 +291,6 @@ map_collect_data_osm_protobuf(FILE *in, struct maptool_osm *osm)
unsigned char *data;
unsigned char *buffer=g_malloc(MAX_BLOB_LENGTH);
-#if 0
- printf("<?xml version='1.0' encoding='UTF-8'?>\n");
- printf("<osm version=\"0.6\" generator=\"pbf2osm\">\n");
-#endif
while ((header=read_header(in))) {
blob=read_blob(header, in, buffer);
data=uncompress_blob(blob);
@@ -378,8 +308,5 @@ map_collect_data_osm_protobuf(FILE *in, struct maptool_osm *osm)
osmpbf__blob_header__free_unpacked(header, &protobuf_c_system_allocator);
}
g_free(buffer);
-#if 0
- printf("</osm>\n");
-#endif
return 1;
}
diff --git a/navit/maptool/osm_protobufdb.c b/navit/maptool/osm_protobufdb.c
index 463817037..51cdceae4 100644
--- a/navit/maptool/osm_protobufdb.c
+++ b/navit/maptool/osm_protobufdb.c
@@ -464,86 +464,13 @@ osm_protobufdb_start_file(struct osm_protobufdb_context *ctx, int type, int num)
static void
test(void)
{
-#if 0
- struct node n,o;
- long long id=1;
- long long lat=0;
- long long lon=0;
- long long timestamp=0;
- long long changeset=0;
- int version=1;
- int user_sid=0;
- int uid=0;
- int p;
- n.id=1;
-#endif
-#if 0
- OSMPBF__DenseInfo di=OSMPBF__DENSE_INFO__INIT;
- OSMPBF__DenseNodes dn=OSMPBF__DENSE_NODES__INIT;
-#endif
-
context.current_file=-1;
-
-#if 0
- context.di=g_malloc(sizeof(*context.di));
- *context.di=di;
- context.dn=g_malloc(sizeof(*context.dn));
- *context.dn=dn;
-#endif
-
-#if 0
- di.n_version=1;
- di.version=&version;
- di.n_timestamp=1;
- di.timestamp=&timestamp;
- di.n_changeset=1;
- di.changeset=&changeset;
- di.n_user_sid=1;
- di.user_sid=&user_sid;
- di.n_uid=1;
- di.uid=&uid;
-#endif
-#if 0
- n.id=1;
- n.lat=1;
- n.lon=1;
- n.timestamp=1;
- n.changeset=1;
- n.version=1;
- n.user_sid=0;
- n.uid=0;
- p=osm_protobufdb_insert_densenode(&n.id, &o, &dn);
- osm_protobufdb_modify(&n, &o, p, &dn);
- p=osm_protobufdb_insert_densenode(&n.id, &o, &dn);
- osm_protobufdb_modify(&n, &o, p, &dn);
-#endif
-
-
-#if 0
- dn.n_id=1;
- dn.id=&id;
- dn.n_lat=1;
- dn.lat=&lat;
- dn.n_lon=1;
- dn.lon=&lon;
-#endif
-#if 0
- st.n_s=1;
- data.data="Test";
- data.len=4;
- st.s=&data;
-#endif
}
static void
finish(void)
{
osm_protobufdb_finish_file(&context);
-#if 0
- osm_protobufdb_write_primitive_group(context.pg, context.pb);
- osm_protobufdb_write_primitive_block(context.pb, context.blob);
- osm_protobufdb_write_blob_to_file();
-#endif
}
static long long
@@ -632,16 +559,8 @@ static int
osm_protobufdb_end_node(struct osm_protobufdb_context *ctx)
{
int p;
-#if 0
- OSMPBF__Node *n=&ctx->n,offset;
- OSMPBF__Info *i=&ctx->i,offseti;
- osm_protobufdb_start_densenode(ctx);
- p=osm_protobufdb_insert_densenode(n->id, &offset, &offseti, context.dn);
- osm_protobufdb_modify_densenode(n, i, &offset, &offseti, p, context.dn);
-#else
p=osm_protobufdb_insert_node(ctx->n.id, ctx->pg);
osm_protobufdb_modify_node(&ctx->n, &ctx->i, p, ctx->pg);
-#endif
ctx->in_node=0;
return 1;
}
diff --git a/navit/maptool/tile.c b/navit/maptool/tile.c
index 6f61b9471..fc8f39076 100644
--- a/navit/maptool/tile.c
+++ b/navit/maptool/tile.c
@@ -424,9 +424,6 @@ add_tile_hash(struct tile_head *th)
int idx,len,maxnamelen=0;
char **data;
-#if 0
- g_hash_table_insert(tile_hash2, string_hash_lookup( th->name ), th);
-#endif
for( idx = 0; idx < th->num_subtiles; idx++ ) {
data = th_get_subtile( th, idx );
@@ -502,13 +499,7 @@ load_tilesdir(FILE *in)
th->zipnum=zipnum++;
th->zip_data=NULL;
th->name=string_hash_lookup(tile);
-#if 0
- printf("tile '%s' %d\n",tile,size);
-#endif
while (fscanf(in,":%[^:\n]",subtile) == 1) {
-#if 0
- printf("subtile '%s'\n",subtile);
-#endif
th=g_realloc(th, sizeof(struct tile_head)+(th->num_subtiles+1)*sizeof(char*));
*th_get_subtile( th, th->num_subtiles ) = string_hash_lookup(subtile);
th->num_subtiles++;
@@ -548,9 +539,6 @@ write_tilesdir(struct tile_info *info, struct zip_info *zip_info, FILE *out)
}
len=maxlen;
while (len >= 0) {
-#if 0
- fprintf(stderr,"PROGRESS: collecting tiles with len=%d\n", len);
-#endif
next=g_list_first(tiles_list);
while (next) {
if (strlen(next->data) == len) {
diff --git a/navit/navigation.c b/navit/navigation.c
index 8ddee5a9d..b8fb16e6d 100644
--- a/navit/navigation.c
+++ b/navit/navigation.c
@@ -1982,9 +1982,6 @@ maneuver_required2 (struct navigation *nav, struct navigation_itm *old, struct n
dc = m.delta;
dbg(lvl_debug,"enter %p %p %p",old, new, maneuver);
-#if 0
- dbg(lvl_debug, "old=%s %s, new=%s %s, angle old=%d, angle new=%d, d=%i ", old->way.name, old->way.name_systematic, new->way.name, new->way.name_systematic, old->angle_end, new->way.angle2, d);
-#endif
if (!new->way.next || (new->way.next && (new->way.next->angle2 == new->way.angle2) && !new->way.next->next)) {
/* No announcement necessary (with extra magic to eliminate duplicate ways) */
r="no: Only one possibility";
diff --git a/navit/route.c b/navit/route.c
index a45d2f2f7..acccf3f7c 100644
--- a/navit/route.c
+++ b/navit/route.c
@@ -43,11 +43,6 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#if 0
-#include <assert.h>
-#include <unistd.h>
-#include <sys/time.h>
-#endif
#include "navit_nls.h"
#include "glib_slice.h"
#include "config.h"
@@ -2142,9 +2137,6 @@ route_value_seg(struct vehicleprofile *profile, struct route_graph_point *from,
{
int ret;
struct route_traffic_distortion dist,*distp=NULL;
-#if 0
- dbg(lvl_debug,"flags 0x%x mask 0x%x flags 0x%x", over->flags, dir >= 0 ? profile->flags_forward_mask : profile->flags_reverse_mask, profile->flags);
-#endif
if ((over->data.flags & (dir >= 0 ? profile->flags_forward_mask : profile->flags_reverse_mask)) != profile->flags)
return INT_MAX;
if (dir > 0 && (over->start->flags & RP_TURN_RESTRICTION))
@@ -2766,9 +2758,6 @@ route_path_new(struct route_graph *this, struct route_path *oldpath, struct rout
posinfo=pos;
while (s && !dstinfo) { /* following start->seg, which indicates the least costly way to reach our destination */
segs++;
-#if 0
- printf("start->value=%d 0x%x,0x%x\n", start->value, start->c.x, start->c.y);
-#endif
if (s->start == start) {
if (item_is_equal(s->data.item, dst->street->item) && (s->end->seg == s || !posinfo))
dstinfo=dst;
@@ -3297,34 +3286,6 @@ route_info_street(struct route_info *rinf)
return rinf->street;
}
-#if 0
-struct route_crossings *
-route_crossings_get(struct route *this, struct coord *c)
-{
- struct route_point *pnt;
- struct route_segment *seg;
- int crossings=0;
- struct route_crossings *ret;
-
- pnt=route_graph_get_point(this, c);
- seg=pnt->start;
- while (seg) {
- printf("start: 0x%x 0x%x\n", seg->item.id_hi, seg->item.id_lo);
- crossings++;
- seg=seg->start_next;
- }
- seg=pnt->end;
- while (seg) {
- printf("end: 0x%x 0x%x\n", seg->item.id_hi, seg->item.id_lo);
- crossings++;
- seg=seg->end_next;
- }
- ret=g_malloc(sizeof(struct route_crossings)+crossings*sizeof(struct route_crossing));
- ret->count=crossings;
- return ret;
-}
-#endif
-
/**
* @brief Implementation-specific map rect data
@@ -3708,16 +3669,6 @@ rm_rect_new(struct map_priv *priv, struct map_selection *sel)
{
struct map_rect_priv * mr;
dbg(lvl_debug,"enter");
-#if 0
- if (! route_get_pos(priv->route))
- return NULL;
- if (! route_get_dst(priv->route))
- return NULL;
-#endif
-#if 0
- if (! priv->route->path2)
- return NULL;
-#endif
mr=g_new0(struct map_rect_priv, 1);
mr->mpriv = priv;
mr->item.priv_data = mr;
diff --git a/navit/script/download_index.html b/navit/script/download_index.html
index fed33e179..7439f4b6a 100644
--- a/navit/script/download_index.html
+++ b/navit/script/download_index.html
@@ -1,145 +1,145 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Planet Extraction</title>
- <style type="text/css">
- html, body {
- margin: 0;
- padding: 1em;
- font: 0.9em Verdana, Arial, sans serif;
- }
- input, select, textarea {
- font: 1em Verdana, Arial, sans serif;
- }
- .input {
- border: none;
- width: 100px;
- }
- .bbox {
- font-size: 12px;
- color: #000;
- background-color: #fff;
- width: 300px;
- border: 1px solid gray;
- }
- .button {
- width: 200px;
- height: 50px;
- font-weight: bold;
- }
- #map {
- float: left;
- width: 500px;
- height: 500px;
- border: 1px solid gray;
- }
- #controls {
- float: left;
-
- }
- </style>
- <script src="http://openlayers.org/dev/lib/OpenLayers.js"></script>
- <script type="text/javascript">
- var map, polygonControl, polygonLayer, bbox_set;
-
- OpenLayers.Util.onImageLoadErrorColor = "transparent";
- function init(){
- map = new OpenLayers.Map('map');
-
- var wmsLayer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
- "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'});
-
- polygonLayer = new OpenLayers.Layer.Vector("Polygon Layer");
-
- map.addLayers([wmsLayer, polygonLayer]);
- map.addControl(new OpenLayers.Control.LayerSwitcher());
- map.addControl(new OpenLayers.Control.MousePosition());
-
- polyOptions = {sides: 4, irregular: true};
- polygonControl = new OpenLayers.Control.DrawFeature(polygonLayer,
- OpenLayers.Handler.RegularPolygon,
- {handlerOptions: polyOptions});
- //alert(polygonControl);
-
- map.addControl(polygonControl);
-
- polygonControl.featureAdded=featureInsert;
-
- map.setCenter(new OpenLayers.LonLat(0, 0), 3);
-
- document.getElementById('noneToggle').checked = true;
- //document.getElementById('irregularToggle').checked = false;
-
- //var polyOptions = {sides: 4, irregular: true};
- //polygonControl.handler.setOptions(polyOptions);
- }
-
- function featureInsert(feature){
- var old=[];
- for (var i = 0; i < polygonLayer.features.length; i++) {
- if (polygonLayer.features[i] != feature) {
- old.push(polygonLayer.features[i]);
- }
- }
- polygonLayer.destroyFeatures(old);
-
- var bounds = feature.geometry.getBounds();
-
- document.form.bounds_top.value = bounds.top;
- document.form.bounds_right.value = bounds.right;
- document.form.bounds_btm.value = bounds.bottom;
- document.form.bounds_left.value = bounds.left;
- bbox_set=true;
- }
- function download() {
- var bbox = document.form.bounds_left.value + "," +
- document.form.bounds_btm.value + "," +
- document.form.bounds_right.value + "," +
- document.form.bounds_top.value;
- if (bbox_set) {
- location.href="http://maps.navit-project.org/api/map?bbox=" + bbox;
- } else {
- alert("Please select a bounding box first\n");
- }
- }
- function setOptions(options) {
- polygonControl.handler.setOptions(options);
- }
- function setSize(fraction) {
- var radius = fraction * map.getExtent().getHeight();
- polygonControl.handler.setOptions({radius: radius,
- angle: 0});
- }
- </script>
- </head>
- <body onload="init()">
- <h2>Planet extract</h2>
- <div id="map"></div>
- <div id="controls">
- <ul style="list-style:none;"><b>Map Controls</b>
- <li>
- <input type="radio" name="type"
- value="none" id="noneToggle"
- onclick="polygonControl.deactivate()"
- checked="checked" />
- <label for="noneToggle">navigate</label>
- </li>
- <li>
- <input type="radio" name="type"
- value="polygon" id="polygonToggle"
- onclick="polygonControl.activate()" />
- <label for="polygonToggle">select</label>
- </li>
- </ul>
- <ul style="list-style:none"><b>Fetch box</b>
- <form name="form">
- <li>Top Right: <input type="text" name="bounds_top" class="input">,
- <input type="text" name="bounds_right" class="input"></li>
- <li>Bottom left: <input type="text" name="bounds_btm" class="input">,
- <input type="text" name="bounds_left" class="input"></li>
- </form>
- <li>&nbsp;</li>
- <li><input type="button" class="button" value="Get map!" onclick="javascript:download()"></li>
- </ul>
- </div>
- </body>
-</html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Planet Extraction</title>
+ <style type="text/css">
+ html, body {
+ margin: 0;
+ padding: 1em;
+ font: 0.9em Verdana, Arial, sans serif;
+ }
+ input, select, textarea {
+ font: 1em Verdana, Arial, sans serif;
+ }
+ .input {
+ border: none;
+ width: 100px;
+ }
+ .bbox {
+ font-size: 12px;
+ color: #000;
+ background-color: #fff;
+ width: 300px;
+ border: 1px solid gray;
+ }
+ .button {
+ width: 200px;
+ height: 50px;
+ font-weight: bold;
+ }
+ #map {
+ float: left;
+ width: 500px;
+ height: 500px;
+ border: 1px solid gray;
+ }
+ #controls {
+ float: left;
+
+ }
+ </style>
+ <script src="http://openlayers.org/dev/lib/OpenLayers.js"></script>
+ <script type="text/javascript">
+ var map, polygonControl, polygonLayer, bbox_set;
+
+ OpenLayers.Util.onImageLoadErrorColor = "transparent";
+ function init(){
+ map = new OpenLayers.Map('map');
+
+ var wmsLayer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
+ "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'});
+
+ polygonLayer = new OpenLayers.Layer.Vector("Polygon Layer");
+
+ map.addLayers([wmsLayer, polygonLayer]);
+ map.addControl(new OpenLayers.Control.LayerSwitcher());
+ map.addControl(new OpenLayers.Control.MousePosition());
+
+ polyOptions = {sides: 4, irregular: true};
+ polygonControl = new OpenLayers.Control.DrawFeature(polygonLayer,
+ OpenLayers.Handler.RegularPolygon,
+ {handlerOptions: polyOptions});
+ //alert(polygonControl);
+
+ map.addControl(polygonControl);
+
+ polygonControl.featureAdded=featureInsert;
+
+ map.setCenter(new OpenLayers.LonLat(0, 0), 3);
+
+ document.getElementById('noneToggle').checked = true;
+ //document.getElementById('irregularToggle').checked = false;
+
+ //var polyOptions = {sides: 4, irregular: true};
+ //polygonControl.handler.setOptions(polyOptions);
+ }
+
+ function featureInsert(feature){
+ var old=[];
+ for (var i = 0; i < polygonLayer.features.length; i++) {
+ if (polygonLayer.features[i] != feature) {
+ old.push(polygonLayer.features[i]);
+ }
+ }
+ polygonLayer.destroyFeatures(old);
+
+ var bounds = feature.geometry.getBounds();
+
+ document.form.bounds_top.value = bounds.top;
+ document.form.bounds_right.value = bounds.right;
+ document.form.bounds_btm.value = bounds.bottom;
+ document.form.bounds_left.value = bounds.left;
+ bbox_set=true;
+ }
+ function download() {
+ var bbox = document.form.bounds_left.value + "," +
+ document.form.bounds_btm.value + "," +
+ document.form.bounds_right.value + "," +
+ document.form.bounds_top.value;
+ if (bbox_set) {
+ location.href="http://maps.navit-project.org/api/map?bbox=" + bbox;
+ } else {
+ alert("Please select a bounding box first\n");
+ }
+ }
+ function setOptions(options) {
+ polygonControl.handler.setOptions(options);
+ }
+ function setSize(fraction) {
+ var radius = fraction * map.getExtent().getHeight();
+ polygonControl.handler.setOptions({radius: radius,
+ angle: 0});
+ }
+ </script>
+ </head>
+ <body onload="init()">
+ <h2>Planet extract</h2>
+ <div id="map"></div>
+ <div id="controls">
+ <ul style="list-style:none;"><b>Map Controls</b>
+ <li>
+ <input type="radio" name="type"
+ value="none" id="noneToggle"
+ onclick="polygonControl.deactivate()"
+ checked="checked" />
+ <label for="noneToggle">navigate</label>
+ </li>
+ <li>
+ <input type="radio" name="type"
+ value="polygon" id="polygonToggle"
+ onclick="polygonControl.activate()" />
+ <label for="polygonToggle">select</label>
+ </li>
+ </ul>
+ <ul style="list-style:none"><b>Fetch box</b>
+ <form name="form">
+ <li>Top Right: <input type="text" name="bounds_top" class="input">,
+ <input type="text" name="bounds_right" class="input"></li>
+ <li>Bottom left: <input type="text" name="bounds_btm" class="input">,
+ <input type="text" name="bounds_left" class="input"></li>
+ </form>
+ <li>&nbsp;</li>
+ <li><input type="button" class="button" value="Get map!" onclick="javascript:download()"></li>
+ </ul>
+ </div>
+ </body>
+</html>
diff --git a/navit/script/mapextract.php b/navit/script/mapextract.php
index 004b63caf..33441ba95 100644
--- a/navit/script/mapextract.php
+++ b/navit/script/mapextract.php
@@ -1,225 +1,225 @@
-#!/usr/local/bin/php &#8211;q
-<?php
-function getmercator($sx,$sy,$ex,$ey) {
-
- $sx = $sx*6371000.0*M_PI/180;
- $sy = log(tan(M_PI_4+$sy*M_PI/360))*6371000.0;
-
- $ex = $ex*6371000.0*M_PI/180;
- $ey = log(tan(M_PI_4+$ey*M_PI/360))*6371000.0;
-
- return array(
- 'l' => array(
- 'x' => $sx,
- 'y' => $sy
- ),
- 'h' => array(
- 'x' => $ex,
- 'y' => $ey
- )
- );
-
-}
-function contains_bbox($c, &$r) {
- if ($c['l']['x'] > $r['h']['x'])
- return false;
- elseif ($c['h']['x'] < $r['l']['x'])
- return false;
- elseif ($c['l']['y'] > $r['h']['y'])
- return false;
- elseif ($c['h']['y'] < $r['l']['y'])
- return false;
- else
- return true;
-}
-
-$fetch_bbox = getmercator(11.3, 47.9, 11.4, 48.0);
-
-$files = array();
-$files['input'] = '/home/burner/carputer/navit/src/maps/osm_bbox_11.3,47.9,11.7,48.2.bin';
-$files['output'] = 'myarea.bin';
-
-$formats = array();
-$formats['ziphpack'] = "lssssslLLSS";
-$formats['zipheader'] = "l" . "ziplocsig"; # Signature (is always the same)
-$formats['zipheader'] .= "/s" . "zipver"; # zip version needed
-$formats['zipheader'] .= "/s" . "zipgenfld";# type of os that generated the file
-$formats['zipheader'] .= "/s" . "zipmthd"; #
-$formats['zipheader'] .= "/s" . "ziptime"; # time
-$formats['zipheader'] .= "/s" . "zipdate"; # date
-$formats['zipheader'] .= "/l" . "zipcrc"; # crc checksum
-$formats['zipheader'] .= "/L" . "zipsize"; # data size
-$formats['zipheader'] .= "/L" . "zipuncmp"; # uncompressed size
-$formats['zipheader'] .= "/S" . "zipfnln"; # length of filename
-$formats['zipheader'] .= "/S" . "zipxtraln";# length of extra data (always 0)
-
-$formats['zipcd'] = "".
- "i" . "zipcensig/".
- "c" . "zipcver/".
- "c" . "zipcos/".
- "c" . "zipcvxt/".
- "c" . "zipcexos/".
- "s" . "zipcflg/".
- "s" . "zipcmthd/".
- "s" . "ziptim/".
- "s" . "zipdat/".
- "i" . "zipccrc/".
- "I" . "zipcsiz/".
- "I" . "zipcunc/".
- "S" . "zipcfnl/".
- "S" . "zipcxtl/".
- "S" . "zipccml/".
- "S" . "zipdsk/".
- "S" . "zipint/".
- "I" . "zipext/".
- "I" . "zipofst/".
-$formats['zipcdpack'] = "iccccssssiIISSSSSII";
-
-$formats['zipcontent'] = "i5x/i5y/ii";
-
-$world_bbox = array();
-$world_bbox['l']['x'] = -20000000;
-$world_bbox['l']['y'] = -20000000;
-$world_bbox['h']['x'] = 20000000;
-$world_bbox['h']['y'] = 20000000;
-
-$fp = fopen($files['input'], 'r');
-$sp = fopen($files['output'], 'w');
-
-$files = array();
-$offset = 0;
-
-/**
- * Read through zipheaders
- *
- */
-while (!feof($fp)) {
-
- $buffer = fread($fp, 30);
- $tileinfo = unpack($formats['zipheader'], $buffer);
-
- if ($tileinfo['zipfnln'] <= 0)
- break;
-
- $filename = fread($fp, $tileinfo['zipfnln']);
- $x=0;
- $done=false;
-
- $r = $world_bbox;
-
- while (!$done) {
- $c['x'] = floor( ($r['l']['x'] + $r['h']['x'])/2 );
- $c['y'] = floor( ($r['l']['y'] + $r['h']['y'])/2 );
-
- switch($filename[$x]) {
- case 'a':
- $r['l']['x'] = $c['x'];
- $r['l']['y'] = $c['y'];
- break;
- case 'b':
- $r['h']['x'] = $c['x'];
- $r['l']['y'] = $c['y'];
- break;
- case 'c':
- $r['l']['x'] = $c['x'];
- $r['h']['y'] = $c['y'];
- break;
- case 'd':
- $r['h']['x'] = $c['x'];
- $r['h']['y'] = $c['y'];
- break;
- default:
- $done=true;
- }
- $x++;
- }
-
- $tilecontent = fread($fp, $tileinfo['zipsize']);
-
- /* Area inside box, save it! */
- if (contains_bbox($fetch_bbox, $r)) {
- #echo "In box. ";
- #echo $filename . " ";
- $zipheader = $buffer;
- #echo "\n";
-
- /* Area outside of box, set zipcontent=0 */
- } else {
- $tileinfo['zipmthd'] = $tileinfo['zipcrc'] = $tileinfo['zipsize'] = $tileinfo['zipuncmp'] = 0;
- #echo "Out of box";
- $zipheader = $tileinfo;
- $tilecontent = '';
- $zipheader = pack($formats['ziphpack'],
- $tileinfo['ziplocsig'],
- $tileinfo['zipver'],
- $tileinfo['zipgenfld'],
- $tileinfo['zipmthd'],
- $tileinfo['ziptime'],
- $tileinfo['zipdate'],
- $tileinfo['zipcrc'],
- $tileinfo['zipsize'],
- $tileinfo['zipuncmp'],
- $tileinfo['zipfnln'],
- $tileinfo['zipxtraln']
- );
- }
-
- $put = $zipheader.$filename.$tilecontent;
- $files[$filename]['header'] = $tileinfo;
- $files[$filename]['size'] = strlen($put);
-
- $zipcd = array();
- $zipcd['zipcensig'] = 0x02014b50;
- $zipcd['zipcver'] = $tileinfo['zipver'];
- $zipcd['zipcos'] = 0x00;
- $zipcd['zipcvxt'] = 0x0a;
- $zipcd['zipcexos'] = 0x00;
- $zipcd['zipcflg'] = 0x00;
- $zipcd['zipcmthd'] = $tileinfo['zipmthd'];
- $zipcd['ziptim'] = $tileinfo['ziptime'];
- $zipcd['zipdat'] = $tileinfo['zipdate'];
- $zipcd['zipccrc'] = $tileinfo['zipcrc'];
- $zipcd['zipcsiz'] = $tileinfo['zipsize'];
- $zipcd['zipcunc'] = $tileinfo['zipuncmp'];
- $zipcd['zipcfnl'] = $tileinfo['zipfnln'];
- $zipcd['zipcxtl'] = 0x00;
- $zipcd['zipccml'] = 0x00;
- $zipcd['zipdsk'] = 0x00;
- $zipcd['zipint'] = 0x00;
- $zipcd['zipext'] = 0x00;
- $zipcd['zipofst'] = $offset;
-
- $zipcd_data .= pack($formats['zipcdpack'],
- $zipcd['zipcensig'],
- $zipcd['zipcver'],
- $zipcd['zipcos'],
- $zipcd['zipcvxt'],
- $zipcd['zipcexos'],
- $zipcd['zipcflg'],
- $zipcd['zipcmthd'],
- $zipcd['ziptim'],
- $zipcd['zipdat'],
- $zipcd['zipccrc'],
- $zipcd['zipcsiz'],
- $zipcd['zipcunc'],
- $zipcd['zipcfnl'],
- $zipcd['zipcxtl'],
- $zipcd['zipccml'],
- $zipcd['zipdsk'],
- $zipcd['zipint'],
- $zipcd['zipext'],
- $zipcd['zipofst']
- ) . $filename;
-
-
- fwrite($sp, $put);
- $offset += strlen($put);
-
-}
-
-fwrite($sp, $zipcd_data);
-
-fclose($fp);
-fclose($sp);
-
-?>
+#!/usr/local/bin/php &#8211;q
+<?php
+function getmercator($sx,$sy,$ex,$ey) {
+
+ $sx = $sx*6371000.0*M_PI/180;
+ $sy = log(tan(M_PI_4+$sy*M_PI/360))*6371000.0;
+
+ $ex = $ex*6371000.0*M_PI/180;
+ $ey = log(tan(M_PI_4+$ey*M_PI/360))*6371000.0;
+
+ return array(
+ 'l' => array(
+ 'x' => $sx,
+ 'y' => $sy
+ ),
+ 'h' => array(
+ 'x' => $ex,
+ 'y' => $ey
+ )
+ );
+
+}
+function contains_bbox($c, &$r) {
+ if ($c['l']['x'] > $r['h']['x'])
+ return false;
+ elseif ($c['h']['x'] < $r['l']['x'])
+ return false;
+ elseif ($c['l']['y'] > $r['h']['y'])
+ return false;
+ elseif ($c['h']['y'] < $r['l']['y'])
+ return false;
+ else
+ return true;
+}
+
+$fetch_bbox = getmercator(11.3, 47.9, 11.4, 48.0);
+
+$files = array();
+$files['input'] = '/home/burner/carputer/navit/src/maps/osm_bbox_11.3,47.9,11.7,48.2.bin';
+$files['output'] = 'myarea.bin';
+
+$formats = array();
+$formats['ziphpack'] = "lssssslLLSS";
+$formats['zipheader'] = "l" . "ziplocsig"; # Signature (is always the same)
+$formats['zipheader'] .= "/s" . "zipver"; # zip version needed
+$formats['zipheader'] .= "/s" . "zipgenfld";# type of os that generated the file
+$formats['zipheader'] .= "/s" . "zipmthd"; #
+$formats['zipheader'] .= "/s" . "ziptime"; # time
+$formats['zipheader'] .= "/s" . "zipdate"; # date
+$formats['zipheader'] .= "/l" . "zipcrc"; # crc checksum
+$formats['zipheader'] .= "/L" . "zipsize"; # data size
+$formats['zipheader'] .= "/L" . "zipuncmp"; # uncompressed size
+$formats['zipheader'] .= "/S" . "zipfnln"; # length of filename
+$formats['zipheader'] .= "/S" . "zipxtraln";# length of extra data (always 0)
+
+$formats['zipcd'] = "".
+ "i" . "zipcensig/".
+ "c" . "zipcver/".
+ "c" . "zipcos/".
+ "c" . "zipcvxt/".
+ "c" . "zipcexos/".
+ "s" . "zipcflg/".
+ "s" . "zipcmthd/".
+ "s" . "ziptim/".
+ "s" . "zipdat/".
+ "i" . "zipccrc/".
+ "I" . "zipcsiz/".
+ "I" . "zipcunc/".
+ "S" . "zipcfnl/".
+ "S" . "zipcxtl/".
+ "S" . "zipccml/".
+ "S" . "zipdsk/".
+ "S" . "zipint/".
+ "I" . "zipext/".
+ "I" . "zipofst/".
+$formats['zipcdpack'] = "iccccssssiIISSSSSII";
+
+$formats['zipcontent'] = "i5x/i5y/ii";
+
+$world_bbox = array();
+$world_bbox['l']['x'] = -20000000;
+$world_bbox['l']['y'] = -20000000;
+$world_bbox['h']['x'] = 20000000;
+$world_bbox['h']['y'] = 20000000;
+
+$fp = fopen($files['input'], 'r');
+$sp = fopen($files['output'], 'w');
+
+$files = array();
+$offset = 0;
+
+/**
+ * Read through zipheaders
+ *
+ */
+while (!feof($fp)) {
+
+ $buffer = fread($fp, 30);
+ $tileinfo = unpack($formats['zipheader'], $buffer);
+
+ if ($tileinfo['zipfnln'] <= 0)
+ break;
+
+ $filename = fread($fp, $tileinfo['zipfnln']);
+ $x=0;
+ $done=false;
+
+ $r = $world_bbox;
+
+ while (!$done) {
+ $c['x'] = floor( ($r['l']['x'] + $r['h']['x'])/2 );
+ $c['y'] = floor( ($r['l']['y'] + $r['h']['y'])/2 );
+
+ switch($filename[$x]) {
+ case 'a':
+ $r['l']['x'] = $c['x'];
+ $r['l']['y'] = $c['y'];
+ break;
+ case 'b':
+ $r['h']['x'] = $c['x'];
+ $r['l']['y'] = $c['y'];
+ break;
+ case 'c':
+ $r['l']['x'] = $c['x'];
+ $r['h']['y'] = $c['y'];
+ break;
+ case 'd':
+ $r['h']['x'] = $c['x'];
+ $r['h']['y'] = $c['y'];
+ break;
+ default:
+ $done=true;
+ }
+ $x++;
+ }
+
+ $tilecontent = fread($fp, $tileinfo['zipsize']);
+
+ /* Area inside box, save it! */
+ if (contains_bbox($fetch_bbox, $r)) {
+ #echo "In box. ";
+ #echo $filename . " ";
+ $zipheader = $buffer;
+ #echo "\n";
+
+ /* Area outside of box, set zipcontent=0 */
+ } else {
+ $tileinfo['zipmthd'] = $tileinfo['zipcrc'] = $tileinfo['zipsize'] = $tileinfo['zipuncmp'] = 0;
+ #echo "Out of box";
+ $zipheader = $tileinfo;
+ $tilecontent = '';
+ $zipheader = pack($formats['ziphpack'],
+ $tileinfo['ziplocsig'],
+ $tileinfo['zipver'],
+ $tileinfo['zipgenfld'],
+ $tileinfo['zipmthd'],
+ $tileinfo['ziptime'],
+ $tileinfo['zipdate'],
+ $tileinfo['zipcrc'],
+ $tileinfo['zipsize'],
+ $tileinfo['zipuncmp'],
+ $tileinfo['zipfnln'],
+ $tileinfo['zipxtraln']
+ );
+ }
+
+ $put = $zipheader.$filename.$tilecontent;
+ $files[$filename]['header'] = $tileinfo;
+ $files[$filename]['size'] = strlen($put);
+
+ $zipcd = array();
+ $zipcd['zipcensig'] = 0x02014b50;
+ $zipcd['zipcver'] = $tileinfo['zipver'];
+ $zipcd['zipcos'] = 0x00;
+ $zipcd['zipcvxt'] = 0x0a;
+ $zipcd['zipcexos'] = 0x00;
+ $zipcd['zipcflg'] = 0x00;
+ $zipcd['zipcmthd'] = $tileinfo['zipmthd'];
+ $zipcd['ziptim'] = $tileinfo['ziptime'];
+ $zipcd['zipdat'] = $tileinfo['zipdate'];
+ $zipcd['zipccrc'] = $tileinfo['zipcrc'];
+ $zipcd['zipcsiz'] = $tileinfo['zipsize'];
+ $zipcd['zipcunc'] = $tileinfo['zipuncmp'];
+ $zipcd['zipcfnl'] = $tileinfo['zipfnln'];
+ $zipcd['zipcxtl'] = 0x00;
+ $zipcd['zipccml'] = 0x00;
+ $zipcd['zipdsk'] = 0x00;
+ $zipcd['zipint'] = 0x00;
+ $zipcd['zipext'] = 0x00;
+ $zipcd['zipofst'] = $offset;
+
+ $zipcd_data .= pack($formats['zipcdpack'],
+ $zipcd['zipcensig'],
+ $zipcd['zipcver'],
+ $zipcd['zipcos'],
+ $zipcd['zipcvxt'],
+ $zipcd['zipcexos'],
+ $zipcd['zipcflg'],
+ $zipcd['zipcmthd'],
+ $zipcd['ziptim'],
+ $zipcd['zipdat'],
+ $zipcd['zipccrc'],
+ $zipcd['zipcsiz'],
+ $zipcd['zipcunc'],
+ $zipcd['zipcfnl'],
+ $zipcd['zipcxtl'],
+ $zipcd['zipccml'],
+ $zipcd['zipdsk'],
+ $zipcd['zipint'],
+ $zipcd['zipext'],
+ $zipcd['zipofst']
+ ) . $filename;
+
+
+ fwrite($sp, $put);
+ $offset += strlen($put);
+
+}
+
+fwrite($sp, $zipcd_data);
+
+fclose($fp);
+fclose($sp);
+
+?>
diff --git a/navit/speech/cmdline/speech_cmdline.c b/navit/speech/cmdline/speech_cmdline.c
index 256fb2adf..15ba15c1a 100644
--- a/navit/speech/cmdline/speech_cmdline.c
+++ b/navit/speech/cmdline/speech_cmdline.c
@@ -102,15 +102,6 @@ speech_cmdline_search(GList *samples, int suffix_len, const char *text, int deco
}
return result;
}
-#if 0
-
- r=search(l, strlen(path)+1, suffix_len, argv[1]);
- while (r) {
- printf("%s/%s\n",path,r->data);
- r=g_list_next(r);
- }
- return 0;
-#endif
struct speech_priv {
char *cmdline;
diff --git a/navit/support/espeak/espeak-data/voices/!v/m7 b/navit/support/espeak/espeak-data/voices/!v/m7
index 9a8370622..05f5b3e86 100755
--- a/navit/support/espeak/espeak-data/voices/!v/m7
+++ b/navit/support/espeak/espeak-data/voices/!v/m7
@@ -1,18 +1,18 @@
-language variant
-gender male 35
-name male5
-
-formant 0 120 150 220
-
-formant 1 100 100 100
-formant 2 100 100 100
-formant 3 100 100 100
-
-formant 4 100 80 100
-formant 5 100 100 100
-
-formant 6 80 200 80
-formant 7 80 200 100
-
-pitch 80 118
-tone 600 150 255 50 100 100
+language variant
+gender male 35
+name male5
+
+formant 0 120 150 220
+
+formant 1 100 100 100
+formant 2 100 100 100
+formant 3 100 100 100
+
+formant 4 100 80 100
+formant 5 100 100 100
+
+formant 6 80 200 80
+formant 7 80 200 100
+
+pitch 80 118
+tone 600 150 255 50 100 100
diff --git a/navit/support/win32/X11/XF86keysym.h b/navit/support/win32/X11/XF86keysym.h
index ff4980457..ee783c2fc 100644
--- a/navit/support/win32/X11/XF86keysym.h
+++ b/navit/support/win32/X11/XF86keysym.h
@@ -1,189 +1,189 @@
-/* $XFree86: xc/include/XF86keysym.h,v 1.16 2003/02/11 02:51:10 dawes Exp $ */
-
-/*
- * XFree86 vendor specific keysyms.
- *
- * The XFree86 keysym range is 0x10080001 - 0x1008FFFF.
- *
- * When adding new entries, the xc/lib/XKeysymDB file should also be
- * updated to make the new entries visible to Xlib.
- */
-
-/*
- * ModeLock
- *
- * This one is old, and not really used any more since XKB offers this
- * functionality.
- */
-
-#define XF86XK_ModeLock 0x1008FF01 /* Mode Switch Lock */
-
-/*
- * Note, 0x1008FF02 - 0x1008FF0F are free and should be used for misc new
- * keysyms that don't fit into any of the groups below.
- *
- * 0x1008FF64, 0x1008FF6F, 0x1008FF71, 0x1008FF83 are no longer used,
- * and should be used first for new keysyms.
- *
- * Check in keysymdef.h for generic symbols before adding new XFree86-specific
- * symbols here.
- */
-
-
-/*
- * Keys found on some "Internet" keyboards.
- */
-#define XF86XK_Standby 0x1008FF10
-#define XF86XK_AudioLowerVolume 0x1008FF11
-#define XF86XK_AudioMute 0x1008FF12
-#define XF86XK_AudioRaiseVolume 0x1008FF13
-#define XF86XK_AudioPlay 0x1008FF14
-#define XF86XK_AudioStop 0x1008FF15
-#define XF86XK_AudioPrev 0x1008FF16
-#define XF86XK_AudioNext 0x1008FF17
-#define XF86XK_HomePage 0x1008FF18
-#define XF86XK_Mail 0x1008FF19
-#define XF86XK_Start 0x1008FF1A
-#define XF86XK_Search 0x1008FF1B
-#define XF86XK_AudioRecord 0x1008FF1C
-
-/* These are sometimes found on PDA's (e.g. Palm, PocketPC or elsewhere) */
-#define XF86XK_Calculator 0x1008FF1D
-#define XF86XK_Memo 0x1008FF1E
-#define XF86XK_ToDoList 0x1008FF1F
-#define XF86XK_Calendar 0x1008FF20
-#define XF86XK_PowerDown 0x1008FF21
-#define XF86XK_ContrastAdjust 0x1008FF22
-#define XF86XK_RockerUp 0x1008FF23
-#define XF86XK_RockerDown 0x1008FF24
-#define XF86XK_RockerEnter 0x1008FF25
-
-/* Some more "Internet" keyboard symbols */
-#define XF86XK_Back 0x1008FF26
-#define XF86XK_Forward 0x1008FF27
-#define XF86XK_Stop 0x1008FF28
-#define XF86XK_Refresh 0x1008FF29
-#define XF86XK_PowerOff 0x1008FF2A
-#define XF86XK_WakeUp 0x1008FF2B
-#define XF86XK_Eject 0x1008FF2C
-#define XF86XK_ScreenSaver 0x1008FF2D
-#define XF86XK_WWW 0x1008FF2E
-#define XF86XK_Sleep 0x1008FF2F
-#define XF86XK_Favorites 0x1008FF30
-#define XF86XK_AudioPause 0x1008FF31
-#define XF86XK_AudioMedia 0x1008FF32
-#define XF86XK_MyComputer 0x1008FF33
-#define XF86XK_VendorHome 0x1008FF34
-#define XF86XK_LightBulb 0x1008FF35
-#define XF86XK_Shop 0x1008FF36
-#define XF86XK_History 0x1008FF37
-#define XF86XK_OpenURL 0x1008FF38
-#define XF86XK_AddFavorite 0x1008FF39
-#define XF86XK_HotLinks 0x1008FF3A
-#define XF86XK_BrightnessAdjust 0x1008FF3B
-#define XF86XK_Finance 0x1008FF3C
-#define XF86XK_Community 0x1008FF3D
-#define XF86XK_AudioRewind 0x1008FF3E
-#define XF86XK_XF86BackForward 0x1008FF3F
-#define XF86XK_Launch0 0x1008FF40
-#define XF86XK_Launch1 0x1008FF41
-#define XF86XK_Launch2 0x1008FF42
-#define XF86XK_Launch3 0x1008FF43
-#define XF86XK_Launch4 0x1008FF44
-#define XF86XK_Launch5 0x1008FF45
-#define XF86XK_Launch6 0x1008FF46
-#define XF86XK_Launch7 0x1008FF47
-#define XF86XK_Launch8 0x1008FF48
-#define XF86XK_Launch9 0x1008FF49
-#define XF86XK_LaunchA 0x1008FF4A
-#define XF86XK_LaunchB 0x1008FF4B
-#define XF86XK_LaunchC 0x1008FF4C
-#define XF86XK_LaunchD 0x1008FF4D
-#define XF86XK_LaunchE 0x1008FF4E
-#define XF86XK_LaunchF 0x1008FF4F
-
-#define XF86XK_ApplicationLeft 0x1008FF50
-#define XF86XK_ApplicationRight 0x1008FF51
-#define XF86XK_Book 0x1008FF52
-#define XF86XK_CD 0x1008FF53
-#define XF86XK_Calculater 0x1008FF54
-#define XF86XK_Clear 0x1008FF55
-#define XF86XK_Close 0x1008FF56
-#define XF86XK_Copy 0x1008FF57
-#define XF86XK_Cut 0x1008FF58
-#define XF86XK_Display 0x1008FF59
-#define XF86XK_DOS 0x1008FF5A
-#define XF86XK_Documents 0x1008FF5B
-#define XF86XK_Excel 0x1008FF5C
-#define XF86XK_Explorer 0x1008FF5D
-#define XF86XK_Game 0x1008FF5E
-#define XF86XK_Go 0x1008FF5F
-#define XF86XK_iTouch 0x1008FF60
-#define XF86XK_LogOff 0x1008FF61
-#define XF86XK_Market 0x1008FF62
-#define XF86XK_Meeting 0x1008FF63
-#define XF86XK_MenuKB 0x1008FF65
-#define XF86XK_MenuPB 0x1008FF66
-#define XF86XK_MySites 0x1008FF67
-#define XF86XK_New 0x1008FF68
-#define XF86XK_News 0x1008FF69
-#define XF86XK_OfficeHome 0x1008FF6A
-#define XF86XK_Open 0x1008FF6B
-#define XF86XK_Option 0x1008FF6C
-#define XF86XK_Paste 0x1008FF6D
-#define XF86XK_Phone 0x1008FF6E
-#define XF86XK_Q 0x1008FF70
-#define XF86XK_Reply 0x1008FF72
-#define XF86XK_Reload 0x1008FF73
-#define XF86XK_RotateWindows 0x1008FF74
-#define XF86XK_RotationPB 0x1008FF75
-#define XF86XK_RotationKB 0x1008FF76
-#define XF86XK_Save 0x1008FF77
-#define XF86XK_ScrollUp 0x1008FF78
-#define XF86XK_ScrollDown 0x1008FF79
-#define XF86XK_ScrollClick 0x1008FF7A
-#define XF86XK_Send 0x1008FF7B
-#define XF86XK_Spell 0x1008FF7C
-#define XF86XK_SplitScreen 0x1008FF7D
-#define XF86XK_Support 0x1008FF7E
-#define XF86XK_TaskPane 0x1008FF7F
-#define XF86XK_Terminal 0x1008FF80
-#define XF86XK_Tools 0x1008FF81
-#define XF86XK_Travel 0x1008FF82
-#define XF86XK_UserPB 0x1008FF84
-#define XF86XK_User1KB 0x1008FF85
-#define XF86XK_User2KB 0x1008FF86
-#define XF86XK_Video 0x1008FF87
-#define XF86XK_WheelButton 0x1008FF88
-#define XF86XK_Word 0x1008FF89
-#define XF86XK_Xfer 0x1008FF8A
-#define XF86XK_ZoomIn 0x1008FF8B
-#define XF86XK_ZoomOut 0x1008FF8C
-
-#define XF86XK_Away 0x1008FF8D
-#define XF86XK_Messenger 0x1008FF8E
-#define XF86XK_WebCam 0x1008FF8F
-#define XF86XK_MailForward 0x1008FF90
-#define XF86XK_Pictures 0x1008FF91
-#define XF86XK_Music 0x1008FF92
-
-/* Keys for special action keys (hot keys) */
-#define XF86XK_Switch_VT_1 0x1008FE01
-#define XF86XK_Switch_VT_2 0x1008FE02
-#define XF86XK_Switch_VT_3 0x1008FE03
-#define XF86XK_Switch_VT_4 0x1008FE04
-#define XF86XK_Switch_VT_5 0x1008FE05
-#define XF86XK_Switch_VT_6 0x1008FE06
-#define XF86XK_Switch_VT_7 0x1008FE07
-#define XF86XK_Switch_VT_8 0x1008FE08
-#define XF86XK_Switch_VT_9 0x1008FE09
-#define XF86XK_Switch_VT_10 0x1008FE0A
-#define XF86XK_Switch_VT_11 0x1008FE0B
-#define XF86XK_Switch_VT_12 0x1008FE0C
-
-#define XF86XK_Ungrab 0x1008FE20
-#define XF86XK_ClearGrab 0x1008FE21
-#define XF86XK_Next_VMode 0x1008FE22
-#define XF86XK_Prev_VMode 0x1008FE23
-
-
+/* $XFree86: xc/include/XF86keysym.h,v 1.16 2003/02/11 02:51:10 dawes Exp $ */
+
+/*
+ * XFree86 vendor specific keysyms.
+ *
+ * The XFree86 keysym range is 0x10080001 - 0x1008FFFF.
+ *
+ * When adding new entries, the xc/lib/XKeysymDB file should also be
+ * updated to make the new entries visible to Xlib.
+ */
+
+/*
+ * ModeLock
+ *
+ * This one is old, and not really used any more since XKB offers this
+ * functionality.
+ */
+
+#define XF86XK_ModeLock 0x1008FF01 /* Mode Switch Lock */
+
+/*
+ * Note, 0x1008FF02 - 0x1008FF0F are free and should be used for misc new
+ * keysyms that don't fit into any of the groups below.
+ *
+ * 0x1008FF64, 0x1008FF6F, 0x1008FF71, 0x1008FF83 are no longer used,
+ * and should be used first for new keysyms.
+ *
+ * Check in keysymdef.h for generic symbols before adding new XFree86-specific
+ * symbols here.
+ */
+
+
+/*
+ * Keys found on some "Internet" keyboards.
+ */
+#define XF86XK_Standby 0x1008FF10
+#define XF86XK_AudioLowerVolume 0x1008FF11
+#define XF86XK_AudioMute 0x1008FF12
+#define XF86XK_AudioRaiseVolume 0x1008FF13
+#define XF86XK_AudioPlay 0x1008FF14
+#define XF86XK_AudioStop 0x1008FF15
+#define XF86XK_AudioPrev 0x1008FF16
+#define XF86XK_AudioNext 0x1008FF17
+#define XF86XK_HomePage 0x1008FF18
+#define XF86XK_Mail 0x1008FF19
+#define XF86XK_Start 0x1008FF1A
+#define XF86XK_Search 0x1008FF1B
+#define XF86XK_AudioRecord 0x1008FF1C
+
+/* These are sometimes found on PDA's (e.g. Palm, PocketPC or elsewhere) */
+#define XF86XK_Calculator 0x1008FF1D
+#define XF86XK_Memo 0x1008FF1E
+#define XF86XK_ToDoList 0x1008FF1F
+#define XF86XK_Calendar 0x1008FF20
+#define XF86XK_PowerDown 0x1008FF21
+#define XF86XK_ContrastAdjust 0x1008FF22
+#define XF86XK_RockerUp 0x1008FF23
+#define XF86XK_RockerDown 0x1008FF24
+#define XF86XK_RockerEnter 0x1008FF25
+
+/* Some more "Internet" keyboard symbols */
+#define XF86XK_Back 0x1008FF26
+#define XF86XK_Forward 0x1008FF27
+#define XF86XK_Stop 0x1008FF28
+#define XF86XK_Refresh 0x1008FF29
+#define XF86XK_PowerOff 0x1008FF2A
+#define XF86XK_WakeUp 0x1008FF2B
+#define XF86XK_Eject 0x1008FF2C
+#define XF86XK_ScreenSaver 0x1008FF2D
+#define XF86XK_WWW 0x1008FF2E
+#define XF86XK_Sleep 0x1008FF2F
+#define XF86XK_Favorites 0x1008FF30
+#define XF86XK_AudioPause 0x1008FF31
+#define XF86XK_AudioMedia 0x1008FF32
+#define XF86XK_MyComputer 0x1008FF33
+#define XF86XK_VendorHome 0x1008FF34
+#define XF86XK_LightBulb 0x1008FF35
+#define XF86XK_Shop 0x1008FF36
+#define XF86XK_History 0x1008FF37
+#define XF86XK_OpenURL 0x1008FF38
+#define XF86XK_AddFavorite 0x1008FF39
+#define XF86XK_HotLinks 0x1008FF3A
+#define XF86XK_BrightnessAdjust 0x1008FF3B
+#define XF86XK_Finance 0x1008FF3C
+#define XF86XK_Community 0x1008FF3D
+#define XF86XK_AudioRewind 0x1008FF3E
+#define XF86XK_XF86BackForward 0x1008FF3F
+#define XF86XK_Launch0 0x1008FF40
+#define XF86XK_Launch1 0x1008FF41
+#define XF86XK_Launch2 0x1008FF42
+#define XF86XK_Launch3 0x1008FF43
+#define XF86XK_Launch4 0x1008FF44
+#define XF86XK_Launch5 0x1008FF45
+#define XF86XK_Launch6 0x1008FF46
+#define XF86XK_Launch7 0x1008FF47
+#define XF86XK_Launch8 0x1008FF48
+#define XF86XK_Launch9 0x1008FF49
+#define XF86XK_LaunchA 0x1008FF4A
+#define XF86XK_LaunchB 0x1008FF4B
+#define XF86XK_LaunchC 0x1008FF4C
+#define XF86XK_LaunchD 0x1008FF4D
+#define XF86XK_LaunchE 0x1008FF4E
+#define XF86XK_LaunchF 0x1008FF4F
+
+#define XF86XK_ApplicationLeft 0x1008FF50
+#define XF86XK_ApplicationRight 0x1008FF51
+#define XF86XK_Book 0x1008FF52
+#define XF86XK_CD 0x1008FF53
+#define XF86XK_Calculater 0x1008FF54
+#define XF86XK_Clear 0x1008FF55
+#define XF86XK_Close 0x1008FF56
+#define XF86XK_Copy 0x1008FF57
+#define XF86XK_Cut 0x1008FF58
+#define XF86XK_Display 0x1008FF59
+#define XF86XK_DOS 0x1008FF5A
+#define XF86XK_Documents 0x1008FF5B
+#define XF86XK_Excel 0x1008FF5C
+#define XF86XK_Explorer 0x1008FF5D
+#define XF86XK_Game 0x1008FF5E
+#define XF86XK_Go 0x1008FF5F
+#define XF86XK_iTouch 0x1008FF60
+#define XF86XK_LogOff 0x1008FF61
+#define XF86XK_Market 0x1008FF62
+#define XF86XK_Meeting 0x1008FF63
+#define XF86XK_MenuKB 0x1008FF65
+#define XF86XK_MenuPB 0x1008FF66
+#define XF86XK_MySites 0x1008FF67
+#define XF86XK_New 0x1008FF68
+#define XF86XK_News 0x1008FF69
+#define XF86XK_OfficeHome 0x1008FF6A
+#define XF86XK_Open 0x1008FF6B
+#define XF86XK_Option 0x1008FF6C
+#define XF86XK_Paste 0x1008FF6D
+#define XF86XK_Phone 0x1008FF6E
+#define XF86XK_Q 0x1008FF70
+#define XF86XK_Reply 0x1008FF72
+#define XF86XK_Reload 0x1008FF73
+#define XF86XK_RotateWindows 0x1008FF74
+#define XF86XK_RotationPB 0x1008FF75
+#define XF86XK_RotationKB 0x1008FF76
+#define XF86XK_Save 0x1008FF77
+#define XF86XK_ScrollUp 0x1008FF78
+#define XF86XK_ScrollDown 0x1008FF79
+#define XF86XK_ScrollClick 0x1008FF7A
+#define XF86XK_Send 0x1008FF7B
+#define XF86XK_Spell 0x1008FF7C
+#define XF86XK_SplitScreen 0x1008FF7D
+#define XF86XK_Support 0x1008FF7E
+#define XF86XK_TaskPane 0x1008FF7F
+#define XF86XK_Terminal 0x1008FF80
+#define XF86XK_Tools 0x1008FF81
+#define XF86XK_Travel 0x1008FF82
+#define XF86XK_UserPB 0x1008FF84
+#define XF86XK_User1KB 0x1008FF85
+#define XF86XK_User2KB 0x1008FF86
+#define XF86XK_Video 0x1008FF87
+#define XF86XK_WheelButton 0x1008FF88
+#define XF86XK_Word 0x1008FF89
+#define XF86XK_Xfer 0x1008FF8A
+#define XF86XK_ZoomIn 0x1008FF8B
+#define XF86XK_ZoomOut 0x1008FF8C
+
+#define XF86XK_Away 0x1008FF8D
+#define XF86XK_Messenger 0x1008FF8E
+#define XF86XK_WebCam 0x1008FF8F
+#define XF86XK_MailForward 0x1008FF90
+#define XF86XK_Pictures 0x1008FF91
+#define XF86XK_Music 0x1008FF92
+
+/* Keys for special action keys (hot keys) */
+#define XF86XK_Switch_VT_1 0x1008FE01
+#define XF86XK_Switch_VT_2 0x1008FE02
+#define XF86XK_Switch_VT_3 0x1008FE03
+#define XF86XK_Switch_VT_4 0x1008FE04
+#define XF86XK_Switch_VT_5 0x1008FE05
+#define XF86XK_Switch_VT_6 0x1008FE06
+#define XF86XK_Switch_VT_7 0x1008FE07
+#define XF86XK_Switch_VT_8 0x1008FE08
+#define XF86XK_Switch_VT_9 0x1008FE09
+#define XF86XK_Switch_VT_10 0x1008FE0A
+#define XF86XK_Switch_VT_11 0x1008FE0B
+#define XF86XK_Switch_VT_12 0x1008FE0C
+
+#define XF86XK_Ungrab 0x1008FE20
+#define XF86XK_ClearGrab 0x1008FE21
+#define XF86XK_Next_VMode 0x1008FE22
+#define XF86XK_Prev_VMode 0x1008FE23
+
+
diff --git a/navit/support/win32/addwinsock.c b/navit/support/win32/addwinsock.c
index 63ae968d5..55f8d2167 100644
--- a/navit/support/win32/addwinsock.c
+++ b/navit/support/win32/addwinsock.c
@@ -1,8 +1,8 @@
-#include "addwinsock.h"
-
-int inet_aton(const char *cp, struct in_addr *inp)
-{
- unsigned long addr = inet_addr(cp);
- inp->S_un.S_addr = addr;
- return addr != -1;
-}
+#include "addwinsock.h"
+
+int inet_aton(const char *cp, struct in_addr *inp)
+{
+ unsigned long addr = inet_addr(cp);
+ inp->S_un.S_addr = addr;
+ return addr != -1;
+}
diff --git a/navit/support/win32/addwinsock.h b/navit/support/win32/addwinsock.h
index 49dfdc0cb..f55aceaf1 100644
--- a/navit/support/win32/addwinsock.h
+++ b/navit/support/win32/addwinsock.h
@@ -1,8 +1,8 @@
-#ifndef ADD_WINSOCK
-#define ADD_WINSOCK
-
-#include <winsock2.h>
-
-int inet_aton(const char *cp, struct in_addr *inp);
-
-#endif
+#ifndef ADD_WINSOCK
+#define ADD_WINSOCK
+
+#include <winsock2.h>
+
+int inet_aton(const char *cp, struct in_addr *inp);
+
+#endif
diff --git a/navit/support/xgetopt/XGetopt.c b/navit/support/xgetopt/XGetopt.c
index d6174d826..60bc0f474 100644
--- a/navit/support/xgetopt/XGetopt.c
+++ b/navit/support/xgetopt/XGetopt.c
@@ -1,216 +1,216 @@
-// XGetopt.cpp Version 1.2
-//
-// Author: Hans Dietrich
-// hdietrich2@hotmail.com
-//
-// Description:
-// XGetopt.cpp implements getopt(), a function to parse command lines.
-//
-// History
-// Version 1.2 - 2003 May 17
-// - Added Unicode support
-//
-// Version 1.1 - 2002 March 10
-// - Added example to XGetopt.cpp module header
-//
-// This software is released into the public domain.
-// You are free to use it in any way you like.
-//
-// This software is provided "as is" with no expressed
-// or implied warranty. I accept no liability for any
-// damage or loss of business that this software may cause.
-//
-///////////////////////////////////////////////////////////////////////////////
-
-
-
-///////////////////////////////////////////////////////////////////////////////
-// if you are not using precompiled headers then include these lines:
-#include <windows.h>
-#include <stdio.h>
-///////////////////////////////////////////////////////////////////////////////
-
-
-#include "XGetopt.h"
-
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// X G e t o p t . c p p
-//
-//
-// NAME
-// getopt -- parse command line options
-//
-// SYNOPSIS
-// int getopt(int argc, char *argv[], char *optstring)
-//
-// extern char *optarg;
-// extern int optind;
-//
-// DESCRIPTION
-// The getopt() function parses the command line arguments. Its
-// arguments argc and argv are the argument count and array as
-// passed into the application on program invocation. In the case
-// of Visual C++ programs, argc and argv are available via the
-// variables __argc and __argv (double underscores), respectively.
-// getopt returns the next option letter in argv that matches a
-// letter in optstring. (Note: Unicode programs should use
-// __targv instead of __argv. Also, all character and string
-// literals should be enclosed in _T( ) ).
-//
-// optstring is a string of recognized option letters; if a letter
-// is followed by a colon, the option is expected to have an argument
-// that may or may not be separated from it by white space. optarg
-// is set to point to the start of the option argument on return from
-// getopt.
-//
-// Option letters may be combined, e.g., "-ab" is equivalent to
-// "-a -b". Option letters are case sensitive.
-//
-// getopt places in the external variable optind the argv index
-// of the next argument to be processed. optind is initialized
-// to 0 before the first call to getopt.
-//
-// When all options have been processed (i.e., up to the first
-// non-option argument), getopt returns EOF, optarg will point
-// to the argument, and optind will be set to the argv index of
-// the argument. If there are no non-option arguments, optarg
-// will be set to NULL.
-//
-// The special option "--" may be used to delimit the end of the
-// options; EOF will be returned, and "--" (and everything after it)
-// will be skipped.
-//
-// RETURN VALUE
-// For option letters contained in the string optstring, getopt
-// will return the option letter. getopt returns a question mark (?)
-// when it encounters an option letter not included in optstring.
-// EOF is returned when processing is finished.
-//
-// BUGS
-// 1) Long options are not supported.
-// 2) The GNU double-colon extension is not supported.
-// 3) The environment variable POSIXLY_CORRECT is not supported.
-// 4) The + syntax is not supported.
-// 5) The automatic permutation of arguments is not supported.
-// 6) This implementation of getopt() returns EOF if an error is
-// encountered, instead of -1 as the latest standard requires.
-//
-// EXAMPLE
-// BOOL CMyApp::ProcessCommandLine(int argc, char *argv[])
-// {
-// int c;
-//
-// while ((c = getopt(argc, argv, "aBn:")) != EOF)
-// {
-// switch (c)
-// {
-// case 'a':
-// TRACE("option a\n");
-// //
-// // set some flag here
-// //
-// break;
-//
-// case 'B':
-// TRACE( "option B\n");
-// //
-// // set some other flag here
-// //
-// break;
-//
-// case 'n':
-// TRACE("option n: value=%d\n", atoi(optarg));
-// //
-// // do something with value here
-// //
-// break;
-//
-// case '?':
-// TRACE("ERROR: illegal option %s\n", argv[optind-1]);
-// return FALSE;
-// break;
-//
-// default:
-// TRACE("WARNING: no handler for option %c\n", c);
-// return FALSE;
-// break;
-// }
-// }
-// //
-// // check for non-option args here
-// //
-// return TRUE;
-// }
-//
-///////////////////////////////////////////////////////////////////////////////
-
-char *optarg; // global argument pointer
-int optind = 0; // global argv index
-
-int getopt(int argc, char *argv[], char *optstring)
-{
- static char *next = NULL;
- char c;
- char *cp;
-
- if (optind == 0)
- next = NULL;
-
- optarg = NULL;
-
- if (next == NULL || *next == '\0')
- {
- if (optind == 0)
- optind++;
-
- if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0')
- {
- optarg = NULL;
- if (optind < argc)
- optarg = argv[optind];
- return EOF;
- }
-
- if (strcmp(argv[optind], "--") == 0)
- {
- optind++;
- optarg = NULL;
- if (optind < argc)
- optarg = argv[optind];
- return EOF;
- }
-
- next = argv[optind];
- next++; // skip past -
- optind++;
- }
-
- c = *next++;
- cp = strchr(optstring, c);
-
- if (cp == NULL || c == ':')
- return '?';
-
- cp++;
- if (*cp == ':')
- {
- if (*next != '\0')
- {
- optarg = next;
- next = NULL;
- }
- else if (optind < argc)
- {
- optarg = argv[optind];
- optind++;
- }
- else
- {
- return '?';
- }
- }
-
- return c;
-}
+// XGetopt.cpp Version 1.2
+//
+// Author: Hans Dietrich
+// hdietrich2@hotmail.com
+//
+// Description:
+// XGetopt.cpp implements getopt(), a function to parse command lines.
+//
+// History
+// Version 1.2 - 2003 May 17
+// - Added Unicode support
+//
+// Version 1.1 - 2002 March 10
+// - Added example to XGetopt.cpp module header
+//
+// This software is released into the public domain.
+// You are free to use it in any way you like.
+//
+// This software is provided "as is" with no expressed
+// or implied warranty. I accept no liability for any
+// damage or loss of business that this software may cause.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+
+
+///////////////////////////////////////////////////////////////////////////////
+// if you are not using precompiled headers then include these lines:
+#include <windows.h>
+#include <stdio.h>
+///////////////////////////////////////////////////////////////////////////////
+
+
+#include "XGetopt.h"
+
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// X G e t o p t . c p p
+//
+//
+// NAME
+// getopt -- parse command line options
+//
+// SYNOPSIS
+// int getopt(int argc, char *argv[], char *optstring)
+//
+// extern char *optarg;
+// extern int optind;
+//
+// DESCRIPTION
+// The getopt() function parses the command line arguments. Its
+// arguments argc and argv are the argument count and array as
+// passed into the application on program invocation. In the case
+// of Visual C++ programs, argc and argv are available via the
+// variables __argc and __argv (double underscores), respectively.
+// getopt returns the next option letter in argv that matches a
+// letter in optstring. (Note: Unicode programs should use
+// __targv instead of __argv. Also, all character and string
+// literals should be enclosed in _T( ) ).
+//
+// optstring is a string of recognized option letters; if a letter
+// is followed by a colon, the option is expected to have an argument
+// that may or may not be separated from it by white space. optarg
+// is set to point to the start of the option argument on return from
+// getopt.
+//
+// Option letters may be combined, e.g., "-ab" is equivalent to
+// "-a -b". Option letters are case sensitive.
+//
+// getopt places in the external variable optind the argv index
+// of the next argument to be processed. optind is initialized
+// to 0 before the first call to getopt.
+//
+// When all options have been processed (i.e., up to the first
+// non-option argument), getopt returns EOF, optarg will point
+// to the argument, and optind will be set to the argv index of
+// the argument. If there are no non-option arguments, optarg
+// will be set to NULL.
+//
+// The special option "--" may be used to delimit the end of the
+// options; EOF will be returned, and "--" (and everything after it)
+// will be skipped.
+//
+// RETURN VALUE
+// For option letters contained in the string optstring, getopt
+// will return the option letter. getopt returns a question mark (?)
+// when it encounters an option letter not included in optstring.
+// EOF is returned when processing is finished.
+//
+// BUGS
+// 1) Long options are not supported.
+// 2) The GNU double-colon extension is not supported.
+// 3) The environment variable POSIXLY_CORRECT is not supported.
+// 4) The + syntax is not supported.
+// 5) The automatic permutation of arguments is not supported.
+// 6) This implementation of getopt() returns EOF if an error is
+// encountered, instead of -1 as the latest standard requires.
+//
+// EXAMPLE
+// BOOL CMyApp::ProcessCommandLine(int argc, char *argv[])
+// {
+// int c;
+//
+// while ((c = getopt(argc, argv, "aBn:")) != EOF)
+// {
+// switch (c)
+// {
+// case 'a':
+// TRACE("option a\n");
+// //
+// // set some flag here
+// //
+// break;
+//
+// case 'B':
+// TRACE( "option B\n");
+// //
+// // set some other flag here
+// //
+// break;
+//
+// case 'n':
+// TRACE("option n: value=%d\n", atoi(optarg));
+// //
+// // do something with value here
+// //
+// break;
+//
+// case '?':
+// TRACE("ERROR: illegal option %s\n", argv[optind-1]);
+// return FALSE;
+// break;
+//
+// default:
+// TRACE("WARNING: no handler for option %c\n", c);
+// return FALSE;
+// break;
+// }
+// }
+// //
+// // check for non-option args here
+// //
+// return TRUE;
+// }
+//
+///////////////////////////////////////////////////////////////////////////////
+
+char *optarg; // global argument pointer
+int optind = 0; // global argv index
+
+int getopt(int argc, char *argv[], char *optstring)
+{
+ static char *next = NULL;
+ char c;
+ char *cp;
+
+ if (optind == 0)
+ next = NULL;
+
+ optarg = NULL;
+
+ if (next == NULL || *next == '\0')
+ {
+ if (optind == 0)
+ optind++;
+
+ if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0')
+ {
+ optarg = NULL;
+ if (optind < argc)
+ optarg = argv[optind];
+ return EOF;
+ }
+
+ if (strcmp(argv[optind], "--") == 0)
+ {
+ optind++;
+ optarg = NULL;
+ if (optind < argc)
+ optarg = argv[optind];
+ return EOF;
+ }
+
+ next = argv[optind];
+ next++; // skip past -
+ optind++;
+ }
+
+ c = *next++;
+ cp = strchr(optstring, c);
+
+ if (cp == NULL || c == ':')
+ return '?';
+
+ cp++;
+ if (*cp == ':')
+ {
+ if (*next != '\0')
+ {
+ optarg = next;
+ next = NULL;
+ }
+ else if (optind < argc)
+ {
+ optarg = argv[optind];
+ optind++;
+ }
+ else
+ {
+ return '?';
+ }
+ }
+
+ return c;
+}
diff --git a/navit/support/xgetopt/XGetopt.h b/navit/support/xgetopt/XGetopt.h
index b975026c1..4bf8c8779 100644
--- a/navit/support/xgetopt/XGetopt.h
+++ b/navit/support/xgetopt/XGetopt.h
@@ -1,29 +1,29 @@
-// XGetopt.h Version 1.2
-//
-// Author: Hans Dietrich
-// hdietrich2@hotmail.com
-//
-// This software is released into the public domain.
-// You are free to use it in any way you like.
-//
-// This software is provided "as is" with no expressed
-// or implied warranty. I accept no liability for any
-// damage or loss of business that this software may cause.
-//
-///////////////////////////////////////////////////////////////////////////////
-
-#ifndef XGETOPT_H
-#define XGETOPT_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int optind, opterr;
-extern char *optarg;
-
-int getopt(int argc, char *argv[], char *optstring);
-#ifdef __cplusplus
-}
-#endif
-#endif //XGETOPT_H
+// XGetopt.h Version 1.2
+//
+// Author: Hans Dietrich
+// hdietrich2@hotmail.com
+//
+// This software is released into the public domain.
+// You are free to use it in any way you like.
+//
+// This software is provided "as is" with no expressed
+// or implied warranty. I accept no liability for any
+// damage or loss of business that this software may cause.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef XGETOPT_H
+#define XGETOPT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int optind, opterr;
+extern char *optarg;
+
+int getopt(int argc, char *argv[], char *optstring);
+#ifdef __cplusplus
+}
+#endif
+#endif //XGETOPT_H
diff --git a/navit/tools/latlon2bookmark/latlon2bookmark.c b/navit/tools/latlon2bookmark/latlon2bookmark.c
index 9f0eff79a..4f5fe54cb 100644
--- a/navit/tools/latlon2bookmark/latlon2bookmark.c
+++ b/navit/tools/latlon2bookmark/latlon2bookmark.c
@@ -1,140 +1,140 @@
-/**
- * Navit, a modular navigation system.
- * Copyright (C) 2005-2009 Navit Team
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-/**
- * this program is free software, please use it as you like.
- * i am not a programmer, so please have this code reviewed
- * to make sure it has nog bugs or ill side efects.
- * use at your own risk
- * compile it with: gcc -l m -o latlon2bookmark latlon2bookmark.c
- * Credits for this work goes to edje in #navit
-**/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-int main( int argc, char **argv )
-{
- char description[256];
- char lngsign[10];
- char latsign[10];
- float lat;
- float lng;
- long intlat;
- long intlng;
- int i;
- int n;
-
- if ( argc < 4 )
- {
- printf("\n");
- printf("This program converts a lat/lon coordinates pair\n");
- printf("into a bookmark you can use with navit.\n");
- printf("This program expects 3 arguments in the following order:\n");
- printf("Lat, Lon and a description\n");
- printf("and will print a bookmark.\n");
- printf("for example: latlon2bookmark 51.980344 4.358005 this is my house \n");
- printf("\n");
- return 1;
- }
-
- lat=atof(argv[1]);
- lng=atof(argv[2]);
-
- /* concatenate all parts of the description string */
- strcpy(description, argv[3]);
- n=0;
- for (i=4; i < argc; i++)
- {
- /* add spaces between the parts of the description */
- if ( i < argc )
- {
- strcat(description, " ");
- }
- strcat(description, argv[i]);
- n=n+1;
- }
-
- if ( lat < -90 )
- {
- printf("\n");
- printf("The first argument must be the lattitude\n");
- printf("and can't be smaller then -90 (southpole)\n");
- printf("\n");
- return 2;
- }
-
- if ( lat > 90 )
- {
- printf("\n");
- printf("The first argument must be the lattitude\n");
- printf("and can't be bigger then 90 (northpole)\n");
- printf("\n");
- return 3;
- }
-
- if ( lng < -180 )
- {
- printf("\n");
- printf("The second argument must be the longitude\n");
- printf("and can't be smaller then -180 (oposite the 0 meridian)\n");
- printf("\n");
- return 4;
- }
-
- if ( lng > 180 )
- {
- printf("\n");
- printf("The first argument must be the longitude\n");
- printf("and can't be bigger then 180 (oposite the 0 meridian)\n");
- printf("\n");
- return 5;
- }
-
- /* convert the longitude to an integer */
- intlng=lng*6371000.0*M_PI/180;
-
- /* aparently if inlng < 0 , inlng needs to be inverted and a - sign used in the output */
- strcpy(lngsign, "0x");
- if ( intlng < 0)
- {
- intlng=(intlng ^ 0xffffffff);
- strcpy(lngsign, "-0x");
- }
-
- /* and the same for the latitude */
- intlat=log(tan(M_PI_4+lat*M_PI/360))*6371000.0;
-
- /* aparently if inlat < 0 , inlat needs to be inverted and a - sign used in the output */
- strcpy(latsign, "0x");
- if ( intlat < 0)
- {
- intlat=(intlat ^ 0xffffffff);
- strcpy(latsign, "-0x");
- }
-
- /* print the bookmark */
- fprintf(stderr,"\n");
- fprintf(stdout,"mg:%s%x %s%x type=bookmark label=\"%s\"\n",lngsign,intlng,latsign,intlat,description);
- fprintf(stderr,"\n");
-
- return 0;
-}
+/**
+ * Navit, a modular navigation system.
+ * Copyright (C) 2005-2009 Navit Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * this program is free software, please use it as you like.
+ * i am not a programmer, so please have this code reviewed
+ * to make sure it has nog bugs or ill side efects.
+ * use at your own risk
+ * compile it with: gcc -l m -o latlon2bookmark latlon2bookmark.c
+ * Credits for this work goes to edje in #navit
+**/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+int main( int argc, char **argv )
+{
+ char description[256];
+ char lngsign[10];
+ char latsign[10];
+ float lat;
+ float lng;
+ long intlat;
+ long intlng;
+ int i;
+ int n;
+
+ if ( argc < 4 )
+ {
+ printf("\n");
+ printf("This program converts a lat/lon coordinates pair\n");
+ printf("into a bookmark you can use with navit.\n");
+ printf("This program expects 3 arguments in the following order:\n");
+ printf("Lat, Lon and a description\n");
+ printf("and will print a bookmark.\n");
+ printf("for example: latlon2bookmark 51.980344 4.358005 this is my house \n");
+ printf("\n");
+ return 1;
+ }
+
+ lat=atof(argv[1]);
+ lng=atof(argv[2]);
+
+ /* concatenate all parts of the description string */
+ strcpy(description, argv[3]);
+ n=0;
+ for (i=4; i < argc; i++)
+ {
+ /* add spaces between the parts of the description */
+ if ( i < argc )
+ {
+ strcat(description, " ");
+ }
+ strcat(description, argv[i]);
+ n=n+1;
+ }
+
+ if ( lat < -90 )
+ {
+ printf("\n");
+ printf("The first argument must be the lattitude\n");
+ printf("and can't be smaller then -90 (southpole)\n");
+ printf("\n");
+ return 2;
+ }
+
+ if ( lat > 90 )
+ {
+ printf("\n");
+ printf("The first argument must be the lattitude\n");
+ printf("and can't be bigger then 90 (northpole)\n");
+ printf("\n");
+ return 3;
+ }
+
+ if ( lng < -180 )
+ {
+ printf("\n");
+ printf("The second argument must be the longitude\n");
+ printf("and can't be smaller then -180 (oposite the 0 meridian)\n");
+ printf("\n");
+ return 4;
+ }
+
+ if ( lng > 180 )
+ {
+ printf("\n");
+ printf("The first argument must be the longitude\n");
+ printf("and can't be bigger then 180 (oposite the 0 meridian)\n");
+ printf("\n");
+ return 5;
+ }
+
+ /* convert the longitude to an integer */
+ intlng=lng*6371000.0*M_PI/180;
+
+ /* aparently if inlng < 0 , inlng needs to be inverted and a - sign used in the output */
+ strcpy(lngsign, "0x");
+ if ( intlng < 0)
+ {
+ intlng=(intlng ^ 0xffffffff);
+ strcpy(lngsign, "-0x");
+ }
+
+ /* and the same for the latitude */
+ intlat=log(tan(M_PI_4+lat*M_PI/360))*6371000.0;
+
+ /* aparently if inlat < 0 , inlat needs to be inverted and a - sign used in the output */
+ strcpy(latsign, "0x");
+ if ( intlat < 0)
+ {
+ intlat=(intlat ^ 0xffffffff);
+ strcpy(latsign, "-0x");
+ }
+
+ /* print the bookmark */
+ fprintf(stderr,"\n");
+ fprintf(stdout,"mg:%s%x %s%x type=bookmark label=\"%s\"\n",lngsign,intlng,latsign,intlat,description);
+ fprintf(stderr,"\n");
+
+ return 0;
+}
diff --git a/navit/track.c b/navit/track.c
index 146972f46..bf0d22d3f 100644
--- a/navit/track.c
+++ b/navit/track.c
@@ -733,10 +733,6 @@ tracking_update(struct tracking *tr, struct vehicle *v, struct vehicleprofile *v
dbg(lvl_debug,"new 0x%x,0x%x",tr->curr_in.x, tr->curr_in.y);
}
tr->pro=pro;
-#if 0
-
- tracking_process_cdf(&tr->cdf, pc, &pcf, angle, &anglef, speed, fixtime);
-#endif
tr->curr_angle=tr->direction=direction;
tr->speed=speed;
tr->last_in=tr->curr_in;
diff --git a/navit/vehicle/android/vehicle_android.c b/navit/vehicle/android/vehicle_android.c
index 14e9d0f8a..722943294 100644
--- a/navit/vehicle/android/vehicle_android.c
+++ b/navit/vehicle/android/vehicle_android.c
@@ -34,7 +34,7 @@
/**
* @defgroup vehicle-android Vehicle Android
* @ingroup vehicle-plugins
- * @brief The Vehicle to gain position data from android. Android uses dbus signals
+ * @brief The Vehicle to gain position data from android.
* @author Tim Niemeyer <reddog@mastersword.de>
* @date 2008-2009
*
diff --git a/navit/vehicle/null/vehicle_null.c b/navit/vehicle/null/vehicle_null.c
index 1005328f6..ea990a31e 100644
--- a/navit/vehicle/null/vehicle_null.c
+++ b/navit/vehicle/null/vehicle_null.c
@@ -85,11 +85,6 @@ vehicle_null_position_attr_get(struct vehicle_priv *priv,
{
dbg(lvl_debug,"enter %s",attr_to_name(type));
switch (type) {
-#if 0
- case attr_position_fix_type:
- attr->u.num = priv->fix_type;
- break;
-#endif
case attr_position_height:
attr->u.numd = &priv->height;
break;
@@ -102,15 +97,6 @@ vehicle_null_position_attr_get(struct vehicle_priv *priv,
case attr_position_radius:
attr->u.numd = &priv->radius;
break;
-
-#if 0
- case attr_position_qual:
- attr->u.num = priv->sats;
- break;
- case attr_position_sats_used:
- attr->u.num = priv->sats_used;
- break;
-#endif
case attr_position_coord_geo:
attr->u.coord_geo = &priv->geo;
if (!priv->have_coords)
diff --git a/navit/vehicle/webos/bluetooth.c b/navit/vehicle/webos/bluetooth.c
index 31e3a575e..906a42b07 100644
--- a/navit/vehicle/webos/bluetooth.c
+++ b/navit/vehicle/webos/bluetooth.c
@@ -252,14 +252,6 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer)
g_free(priv->nmea_data);
priv->nmea_data=priv->nmea_data_buf;
priv->nmea_data_buf=NULL;
-#if 0
- if (priv->file_type == file_type_file) {
- if (priv->watch) {
- vehicle_file_disable_watch(priv);
- event_add_timeout(priv->time, 0, priv->cbt);
- }
- }
-#endif
ret = 1;
}
if (!strncmp(&buffer[3], "VTG", 3)) {
@@ -302,13 +294,6 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer)
strptime(time,"%H%M%S%d%m%y",&tm);
priv->fix_time = mktime(&tm);
-#if 0
- sscanf(item[9], "%02d%02d%02d",
- &priv->fixday,
- &priv->fixmonth,
- &priv->fixyear);
- priv->fixyear += 2000;
-#endif
}
ret = 1;
}
@@ -329,46 +314,7 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer)
if (item[3]) {
sscanf(item[3], "%d", &priv->sats_visible);
}
-#if 0
- j=4;
- while (j+4 <= i && priv->current_count < 24) {
- struct gps_sat *sat=&priv->next[priv->next_count++];
- sat->prn=atoi(item[j]);
- sat->elevation=atoi(item[j+1]);
- sat->azimuth=atoi(item[j+2]);
- sat->snr=atoi(item[j+3]);
- j+=4;
- }
- if (!strcmp(item[1], item[2])) {
- priv->sats_signal=0;
- for (i = 0 ; i < priv->next_count ; i++) {
- priv->current[i]=priv->next[i];
- if (priv->current[i].snr)
- priv->sats_signal++;
- }
- priv->current_count=priv->next_count;
- priv->next_count=0;
- }
-#endif
- }
-#if 0
- if (!strncmp(&buffer[3], "ZDA", 3)) {
- /*
- 0 1 2 3 4 5 6
- $GPZDA,hhmmss.ss,dd,mm,yyyy,xx,yy*CC
- hhmmss HrMinSec(UTC)
- dd,mm,yyy Day,Month,Year
- xx local zone hours -13..13
- yy local zone minutes 0..59
- */
- if (item[1] && item[2] && item[3] && item[4]) {
- strncpy(priv->fixtime, item[1], strlen(priv->fixtime));
- priv->fixday = atoi(item[2]);
- priv->fixmonth = atoi(item[3]);
- priv->fixyear = atoi(item[4]);
- }
}
-#endif
if (!strncmp(buffer, "$IISMD", 6)) {
/*
0 1 2 3 4
@@ -464,13 +410,6 @@ vehicle_webos_spp_init_read(struct vehicle_priv *priv, unsigned int length)
priv,
PDL_FALSE
);
-#if 0
- if (err != PDL_NOERROR) {
- dbg(lvl_error,"PDL_ServiceCall failed with (%d): (%s)", err, PDL_GetError());
- vehicle_webos_close(priv);
- return;
- }
-#endif
}
static void
@@ -569,23 +508,9 @@ vehicle_webos_init_bt_gps(struct vehicle_priv *priv, char *addr)
(PDL_ServiceCallbackFunc)vehicle_webos_spp_notify,
priv,
PDL_FALSE);
-#if 0
- if (err != PDL_NOERROR) {
- dbg(lvl_error,"PDL_ServiceCallWithCallback failed with (%d): (%s)", err, PDL_GetError());
- vehicle_webos_close(priv);
- return;
- }
-#endif
snprintf(parameters, sizeof(parameters), "{\"address\":\"%s\"}", addr);
mlPDL_ServiceCall("palm://com.palm.bluetooth/spp/connect", parameters);
-#if 0
- if (err != PDL_NOERROR) {
- dbg(lvl_error,"PDL_ServiceCall failed with (%d): (%s)", err, PDL_GetError());
- vehicle_webos_close(priv);
- return;
- }
-#endif
priv->spp_address = addr;
}
diff --git a/navit/vehicle/wince/vehicle_wince.c b/navit/vehicle/wince/vehicle_wince.c
index 8ab59fdce..da77c5b6f 100644
--- a/navit/vehicle/wince/vehicle_wince.c
+++ b/navit/vehicle/wince/vehicle_wince.c
@@ -42,7 +42,6 @@
#include <winioctl.h>
#include <winbase.h>
#include <wchar.h>
-#include "support/win32/ConvertUTF.h"
/**
* @defgroup vehicle-wince Vehicle WinCE
diff --git a/navit/xmlconfig.c b/navit/xmlconfig.c
index 0af3551b4..56df4c7fa 100644
--- a/navit/xmlconfig.c
+++ b/navit/xmlconfig.c
@@ -783,13 +783,6 @@ static int
strncmp_len(const char *s1, int s1len, const char *s2)
{
int ret;
-#if 0
- char c[s1len+1];
- strncpy(c, s1, s1len);
- c[s1len]='\0';
- dbg(lvl_debug,"'%s' vs '%s'", c, s2);
-#endif
-
ret=strncmp(s1, s2, s1len);
if (ret)
return ret;
@@ -827,13 +820,6 @@ xpointer_test(const char *test, int len, struct xistate *elem)
int eq,i,count,vlen,cond_req=1,cond=0;
char c;
const char *tmp[16];
-#if 0
- char test2[len+1];
-
- strncpy(test2, test, len);
- test2[len]='\0';
- dbg(lvl_debug,"%s", test2);
-#endif
if (!len)
return 0;
c=test[len-1];
@@ -1019,16 +1005,14 @@ xi_text (xml_context *context,
struct xmldocument *doc=user_data;
struct xmlstate *curr, **state = doc->user_data;
struct attr attr;
- char *text_dup = malloc(text_len+1);
curr=*state;
- strncpy(text_dup, text, text_len);
- text_dup[text_len]='\0';
+ char *text_dup = g_strndup(text, text_len);
attr.type=attr_xml_text;
attr.u.str=text_dup;
if (curr->object_func && curr->object_func->add_attr && curr->element_attr.u.data)
curr->object_func->add_attr(curr->element_attr.u.data, &attr);
- free(text_dup);
+ g_free(text_dup);
return;
}
}
diff --git a/po/af.po.in b/po/af.po.in
index 04af45fca..9e8ed0ff7 100644
--- a/po/af.po.in
+++ b/po/af.po.in
@@ -1670,7 +1670,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/ar.po.in b/po/ar.po.in
index b1f8011b4..8768d21f6 100644
--- a/po/ar.po.in
+++ b/po/ar.po.in
@@ -1695,7 +1695,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/ast.po.in b/po/ast.po.in
index 02fe9cb07..1a8c7d738 100644
--- a/po/ast.po.in
+++ b/po/ast.po.in
@@ -1664,7 +1664,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/be.po.in b/po/be.po.in
index 561f630f7..71326297c 100644
--- a/po/be.po.in
+++ b/po/be.po.in
@@ -1667,7 +1667,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/bg.po.in b/po/bg.po.in
index 9da4a8820..c744854d0 100644
--- a/po/bg.po.in
+++ b/po/bg.po.in
@@ -1668,7 +1668,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/bs.po.in b/po/bs.po.in
index c6c8e8506..5ee1a68f7 100644
--- a/po/bs.po.in
+++ b/po/bs.po.in
@@ -1668,7 +1668,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/ca.po.in b/po/ca.po.in
index 4c41bcd79..0bbb0c966 100644
--- a/po/ca.po.in
+++ b/po/ca.po.in
@@ -1675,7 +1675,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/ckb.po.in b/po/ckb.po.in
index ab8a5a1eb..258d101cc 100644
--- a/po/ckb.po.in
+++ b/po/ckb.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/cs.po.in b/po/cs.po.in
index 28a3ec959..ad79fcf33 100644
--- a/po/cs.po.in
+++ b/po/cs.po.in
@@ -1685,8 +1685,8 @@ msgstr "Taxi"
msgid "Shopping"
msgstr "Nakupování"
-msgid "Distance from screen center (km)"
-msgstr "Vzdálenost od středu mapy (km)"
+msgid "Select a search radius from screen center"
+msgstr "Vzdálenost od středu mapy"
#, c-format
msgid "POI %s. %s"
diff --git a/po/cy.po.in b/po/cy.po.in
index 9171574a7..92251c27c 100644
--- a/po/cy.po.in
+++ b/po/cy.po.in
@@ -1668,7 +1668,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/da.po.in b/po/da.po.in
index 2bd2cee87..570b72a9c 100644
--- a/po/da.po.in
+++ b/po/da.po.in
@@ -1674,7 +1674,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/de.po.in b/po/de.po.in
index 7ff0ba0e6..a01949d76 100644
--- a/po/de.po.in
+++ b/po/de.po.in
@@ -1,18 +1,15 @@
# German translations for navit
-# Copyright (C) 2006-2017 The Navit Team
+# Copyright (C) 2006-2018 The Navit Team
# This file is distributed under the same license as the navit package.
# Many thanks to the contributors of this translation:
# Achim Behrens https://launchpad.net/~k1l
# Artem Anufrij https://launchpad.net/~artem-anufrij
# Bernhard Reiter https://launchpad.net/~ockham-razor
# Christian Moll https://launchpad.net/~christian-chrmoll
-# Clemens Kiener https://launchpad.net/~clemens-kiener
# Dennis Gohert https://launchpad.net/~info-degoist
-# Ettore Atalan https://launchpad.net/~atalanttore
# Fred https://launchpad.net/~jelk
# Fume https://launchpad.net/~fume
# KaZeR https://launchpad.net/~kazer
-# Kamikaaze https://launchpad.net/~kamikaazewiesel
# Keruskerfuerst https://launchpad.net/~arminmohring
# Konsti K. https://launchpad.net/~konstantin-koehring
# Lars Hennig https://launchpad.net/~elhennig
@@ -35,13 +32,13 @@
# metehyi https://launchpad.net/~metehyi
# singesang https://launchpad.net/~singesang
# spaetz https://launchpad.net/~spaetz
-# vsandre https://launchpad.net/~riedel-andre
+# vsandre https://launchpad.net/~vsandre
msgid ""
msgstr ""
-"Project-Id-Version: navit 0.5.0\n"
+"Project-Id-Version: navit 0.5.1\n"
"Report-Msgid-Bugs-To: \n"
-"PO-Revision-Date: 2017-01-12 18:37+0000\n"
+"PO-Revision-Date: 2018-05-01 17:39+0000\n"
"Last-Translator: Steffen <zintor@lycos.com>\n"
"Language-Team: Martin Schaller <martin-s@sourceforge.net>\n"
"MIME-Version: 1.0\n"
@@ -414,9 +411,15 @@ msgstr "Anweisung"
msgid "Length"
msgstr "Länge"
+msgid "mi"
+msgstr ""
+
msgid "km"
msgstr "km"
+msgid "feet"
+msgstr "Fuß"
+
msgid "m"
msgstr "m"
@@ -1484,26 +1487,24 @@ msgstr ""
"\t-v: zeige die Version und beende.\n"
#. We have not found an existing config file from all possibilities
-msgid "No config file navit.xml, navit.xml.local found\n"
-msgstr "Keine Konfigurations-Datei navit.xml oder navit.xml.local gefunden\n"
+msgid "No config file navit.xml, navit.xml.local found"
+msgstr ""
#, c-format
-msgid "Error parsing config file '%s': %s\n"
-msgstr "Fehler beim Parsen der Konfigurations-Datei '%s': %s\n"
+msgid "Error parsing config file '%s': %s"
+msgstr ""
#, c-format
-msgid "Using config file '%s'\n"
-msgstr "Benutze Konfigurations-Datei '%s'\n"
+msgid "Using config file '%s'"
+msgstr ""
#, c-format
-msgid "Error: No configuration found in config file '%s'\n"
-msgstr "Fehler: Keine Konfiguration in der Datei '%s' gefunden\n"
+msgid "Error: No configuration found in config file '%s'"
+msgstr ""
msgid ""
-"Internal initialization failed, exiting. Check previous error messages.\n"
+"Internal initialization failed, exiting. Check previous error messages."
msgstr ""
-"Interne Initialisierung fehlgeschlagen, Programm wird beendet. Frühere "
-"Fehler beachten.\n"
msgid "unknown street"
msgstr "unbekannte Straße"
@@ -1644,6 +1645,9 @@ msgstr "Positions_marke zeigen"
msgid "_Lock on Road"
msgstr "Auf Straße _zeigen"
+msgid "_Follow Vehicle"
+msgstr "_Folge Fahrzeug"
+
msgid "_Keep orientation to the North"
msgstr "_Nordorientierung"
@@ -1714,24 +1718,24 @@ msgstr "Taxi"
msgid "Shopping"
msgstr "Einkaufen"
-msgid "Distance from screen center (km)"
-msgstr "Entfernung vom Bildschirmmittelpunkt (km)"
+msgid "Select a search radius from screen center"
+msgstr "Entfernung vom Bildschirmmittelpunkt"
#, c-format
msgid "POI %s. %s"
msgstr "POI %s. %s"
#, c-format
-msgid "Set destination to %ld, %ld \n"
-msgstr "Setze Ziel auf %ld, %ld \n"
+msgid "Set destination to %ld, %ld "
+msgstr ""
#, c-format
-msgid "Set map to %ld, %ld \n"
-msgstr "Setze Karte auf %ld, %ld \n"
+msgid "Set map to %ld, %ld "
+msgstr ""
#, c-format
-msgid "Set next visit to %ld, %ld \n"
-msgstr "Setze nächsten Besuch auf %ld, %ld \n"
+msgid "Set next visit to %ld, %ld "
+msgstr ""
msgid "POI search"
msgstr "POI Suche"
@@ -1801,8 +1805,8 @@ msgid "OT"
msgstr "OT"
#, c-format
-msgid "Route %4.0fkm %02d:%02d ETA"
-msgstr "Route %4.0fkm %02d:%02d ETA"
+msgid "Route %4.1f%s %02d:%02d ETA"
+msgstr ""
msgid "Route 0000km 0+00:00 ETA"
msgstr "Route 0000km 0+00:00 ETA"
@@ -2025,6 +2029,9 @@ msgstr "Wegbeschreibung"
msgid "Show Locale"
msgstr "Lokalisierung anzeigen"
+msgid "Network info"
+msgstr "Netzwerkinfo"
+
msgid "Former Destinations"
msgstr "Vorherige Ziele"
@@ -2063,451 +2070,9 @@ msgstr "Achtung Blitzer!"
msgid "Please decrease your speed"
msgstr "Bitte Geschwindigkeit verringern"
-msgid "partial match"
-msgstr "ungefähr"
-
-#. Android resource: @strings/address_search_button
-msgid "Search"
-msgstr "Suche"
-
-#. Android resource: @strings/address_search_towns
-msgid "Towns"
-msgstr "Städte"
-
-msgid "Map data (c) OpenStreetMap contributors, ODBL"
-msgstr "Kartendaten (c) von OpenStreetMap unter ODbL"
-
-msgid ""
-"Current map location %s is not available\n"
-"Please restart Navit after you attach an SD card or select a different map "
-"location."
-msgstr ""
-"Der Speicherpfad für die Karte ist nicht verfügbar.\n"
-"Setzen Sie eine SD Karte ein und starten Sie Navit erneut\n"
-"oder wählen Sie einen anderen Pfad aus."
-
-msgid "Downloaded maps"
-msgstr "Heruntergeladene Karten"
-
-msgid ""
-"Sorry, we currently do not support maps above 3.8G on Android, please select "
-"a smaller one."
-msgstr ""
-"Entschuldigung. Derzeit untestützen wir auf Android keine Karten die größer "
-"als 3,8Gigabyte sind. Bitte wählen Sie eine kleinere Karte aus."
-
-#. Android resource: @strings/position_popup_drive_here
-msgid "Route to here"
-msgstr "Ziel setzen"
-
-msgid "Cancel"
-msgstr "Abbrechen"
-
msgid "filenamePath"
msgstr "Dateipfad"
-msgid ""
-"New location set to %s\n"
-"Restart Navit to apply the changes."
-msgstr ""
-"Karten-Speicherort ist %s\n"
-"Starten Sie Navit erneut."
-
-msgid "Whole Planet"
-msgstr "Ganze Welt"
-
-msgid "Africa"
-msgstr "Afrika"
-
-msgid "Canary Islands"
-msgstr "Kanarische Inseln"
-
-msgid "Asia"
-msgstr "Asien"
-
-msgid "Korea"
-msgstr "Korea"
-
-msgid "Taiwan"
-msgstr "Taiwan"
-
-msgid "UAE+Other"
-msgstr "Vereinigte Arabische Emirate+weitere"
-
-msgid "Oceania"
-msgstr "Ozeanien"
-
-msgid "Tasmania"
-msgstr "Tasmanien"
-
-msgid "Victoria"
-msgstr "Victoria"
-
-msgid "New South Wales"
-msgstr "New South Wales"
-
-msgid "Europe"
-msgstr "Europa"
-
-msgid "Western Europe"
-msgstr "West-Europa"
-
-msgid "Azores"
-msgstr "Azoren"
-
-msgid "BeNeLux"
-msgstr "Beneluxländer"
-
-msgid "Alsace"
-msgstr "Elsass"
-
-msgid "Aquitaine"
-msgstr "Aquitanien"
-
-msgid "Auvergne"
-msgstr "Auvergne"
-
-msgid "Basse-Normandie"
-msgstr "Basse-Normandie"
-
-msgid "Bourgogne"
-msgstr "Burgund"
-
-msgid "Bretagne"
-msgstr "Bretagne"
-
-msgid "Centre"
-msgstr "Centre"
-
-msgid "Champagne-Ardenne"
-msgstr "Champagne-Ardenne"
-
-msgid "Corse"
-msgstr "Korsika"
-
-msgid "Franche-Comte"
-msgstr "Freie Grafschaft"
-
-msgid "Haute-Normandie"
-msgstr "Haute Normandie"
-
-msgid "Ile-de-France"
-msgstr "Ile-de-France"
-
-msgid "Languedoc-Roussillon"
-msgstr "Languedoc-Roussillon"
-
-msgid "Limousin"
-msgstr "Limousin"
-
-msgid "Lorraine"
-msgstr "Lothringen"
-
-msgid "Midi-Pyrenees"
-msgstr "Midi-Pyrenäen"
-
-msgid "Nord-pas-de-Calais"
-msgstr "Nord-pas-de-Calais"
-
-msgid "Pays-de-la-Loire"
-msgstr "Pays-de-la-Loire"
-
-msgid "Picardie"
-msgstr "Picardie"
-
-msgid "Poitou-Charentes"
-msgstr "Poitou-Charentes"
-
-msgid "Provence-Alpes-Cote-d-Azur"
-msgstr "Provence-Alpes-Cote-d-Azur"
-
-msgid "Rhone-Alpes"
-msgstr "Rhone-Alpen"
-
-msgid "Baden-Wuerttemberg"
-msgstr "Baden-Württemberg"
-
-msgid "Bayern"
-msgstr "Bayern"
-
-msgid "Mittelfranken"
-msgstr "Mittelfranken"
-
-msgid "Niederbayern"
-msgstr "Niederbayern"
-
-msgid "Oberbayern"
-msgstr "Oberbayern"
-
-msgid "Oberfranken"
-msgstr "Oberfranken"
-
-msgid "Oberpfalz"
-msgstr "Oberpfalz"
-
-msgid "Schwaben"
-msgstr "Schwaben"
-
-msgid "Unterfranken"
-msgstr "Unterfranken"
-
-msgid "Berlin"
-msgstr "Berlin"
-
-msgid "Brandenburg"
-msgstr "Brandenburg"
-
-msgid "Bremen"
-msgstr "Bremen"
-
-msgid "Hamburg"
-msgstr "Hamburg"
-
-msgid "Hessen"
-msgstr "Hessen"
-
-msgid "Mecklenburg-Vorpommern"
-msgstr "Mecklenburg-Vorpommern"
-
-msgid "Niedersachsen"
-msgstr "Niedersachsen"
-
-msgid "Nordrhein-westfalen"
-msgstr "Nordrhein-Westfalen"
-
-msgid "Rheinland-Pfalz"
-msgstr "Rheinland-Pfalz"
-
-msgid "Saarland"
-msgstr "Saarland"
-
-msgid "Sachsen-Anhalt"
-msgstr "Sachsen-Anhalt"
-
-msgid "Sachsen"
-msgstr "Sachsen"
-
-msgid "Schleswig-Holstein"
-msgstr "Schleswig-Holstein"
-
-msgid "Thueringen"
-msgstr "Thüringen"
-
-msgid "Mallorca"
-msgstr "Mallorca"
-
-msgid "Galicia"
-msgstr "Galicien"
-
-msgid "Scandinavia"
-msgstr "Skandinavien"
-
-msgid "England"
-msgstr "England"
-
-msgid "Buckinghamshire"
-msgstr "Buckinghamshire"
-
-msgid "Cambridgeshire"
-msgstr "Cambridgeshire"
-
-msgid "Cumbria"
-msgstr "Cumbria"
-
-msgid "East yorkshire with hull"
-msgstr "East Yorkshire und Hull"
-
-msgid "Essex"
-msgstr "Essex"
-
-msgid "Herefordshire"
-msgstr "Herefordshire"
-
-msgid "Kent"
-msgstr "Kent"
-
-msgid "Lancashire"
-msgstr "Lancashire"
-
-msgid "Leicestershire"
-msgstr "Leicestershire"
-
-msgid "Norfolk"
-msgstr "Norfolk"
-
-msgid "Nottinghamshire"
-msgstr "Nottinghamshire"
-
-msgid "Oxfordshire"
-msgstr "Oxfordshire"
-
-msgid "Shropshire"
-msgstr "Shropshire"
-
-msgid "Somerset"
-msgstr "Somerset"
-
-msgid "South yorkshire"
-msgstr "South yorkshire"
-
-msgid "Suffolk"
-msgstr "Suffolk"
-
-msgid "Surrey"
-msgstr "Surrey"
-
-msgid "Wiltshire"
-msgstr "Wiltshire"
-
-msgid "Scotland"
-msgstr "Schottland"
-
-msgid "Wales"
-msgstr "Wales"
-
-msgid "Crete"
-msgstr "Kreta"
-
-msgid "North America"
-msgstr "Nordamerika"
-
-msgid "Alaska"
-msgstr "Alaska"
-
-msgid "Hawaii"
-msgstr "Hawaii"
-
-msgid "USA"
-msgstr "USA"
-
-msgid " (except Alaska and Hawaii)"
-msgstr " (außer Alaska und Hawaii)"
-
-msgid "Midwest"
-msgstr "Mittlerer Westen"
-
-msgid "Michigan"
-msgstr "Michigan"
-
-msgid "Ohio"
-msgstr "Ohio"
-
-msgid "Northeast"
-msgstr "Nordosten"
-
-msgid "Massachusetts"
-msgstr "Massachusetts"
-
-msgid "Vermont"
-msgstr "Vermont"
-
-msgid "Pacific"
-msgstr "Pazifik"
-
-msgid "South"
-msgstr "Süd"
-
-msgid "Arkansas"
-msgstr "Arkansas"
-
-msgid "District of Columbia"
-msgstr "District of Columbia"
-
-msgid "Florida"
-msgstr "Florida"
-
-msgid "Louisiana"
-msgstr "Louisiana"
-
-msgid "Maryland"
-msgstr "Maryland"
-
-msgid "Mississippi"
-msgstr "Mississippi"
-
-msgid "Oklahoma"
-msgstr "Oklahoma"
-
-msgid "Texas"
-msgstr "Texas"
-
-msgid "Virginia"
-msgstr "Virginia"
-
-msgid "West Virginia"
-msgstr "West Virginia"
-
-msgid "West"
-msgstr "West"
-
-msgid "Arizona"
-msgstr "Arizona"
-
-msgid "California"
-msgstr "Kalifornien"
-
-msgid "Colorado"
-msgstr "Colorado"
-
-msgid "Idaho"
-msgstr "Idaho"
-
-msgid "Montana"
-msgstr "Montana"
-
-msgid "New Mexico"
-msgstr "New Mexico"
-
-msgid "Nevada"
-msgstr "Nevada"
-
-msgid "Oregon"
-msgstr "Oregon"
-
-msgid "Utah"
-msgstr "Utah"
-
-msgid "Washington State"
-msgstr "Washington State"
-
-msgid "South+Middle America"
-msgstr "Süd+Mittel-Amerika"
-
-msgid "Guyane Francaise"
-msgstr "Französisch-Guayana"
-
-msgid "downloading"
-msgstr "wird heruntergeladen"
-
-#. Android resource: @strings/map_download_ready
-msgid "ready"
-msgstr "Fertig in"
-
-msgid "Media selected for map storage is not available"
-msgstr ""
-"Der eingestellte Speicherort für das Kartenmaterial ist nicht verfügbar."
-
-#. Android resource: @strings/map_download_not_enough_free_space
-msgid "Not enough free space"
-msgstr "Nicht genug freier Speicher"
-
-msgid "Error downloading map!"
-msgstr "Fehler beim Kartendownload"
-
-msgid "Error writing map!"
-msgstr "Fehler beim speichern der Karte!"
-
-msgid "Map download aborted!"
-msgstr "Kartendownload abgebrochen!"
-
-#. Android resource: @strings/map_download_eta
-msgid "ETA"
-msgstr "Fertig in"
-
-#. Android resource: @strings/map_download_title
-msgid "Map download"
-msgstr "Kartendownload"
-
msgid "Vehicle Position"
msgstr "Fahrzeugposition"
@@ -2565,9 +2130,18 @@ msgstr "Vollbildmodus"
msgid "Window Mode"
msgstr "Fenstermodus"
+msgid "Auto zoom"
+msgstr "Automatischer Zoom"
+
+msgid "Manual zoom"
+msgstr "Manuelle Vergrößerung"
+
msgid "Layers"
msgstr "Ebenen"
+msgid "Zoom to route"
+msgstr ""
+
msgid "Description"
msgstr "Beschreibung"
@@ -2680,14 +2254,30 @@ msgstr "Sichern / Wiederherstellen"
msgid "Set map location"
msgstr "Kartenort festlegen"
+#. Android resource: @strings/position_popup_drive_here
+msgid "Route to here"
+msgstr "Ziel setzen"
+
#. Android resource: @strings/map_delete
msgid "Delete this map?"
msgstr "Diese Karte löschen?"
+#. Android resource: @strings/map_download_title
+msgid "Map download"
+msgstr "Kartendownload"
+
#. Android resource: @strings/map_download_downloading
msgid "Downloading:"
msgstr "Laden:"
+#. Android resource: @strings/map_download_eta
+msgid "ETA"
+msgstr "Fertig in"
+
+#. Android resource: @strings/map_download_ready
+msgid "ready"
+msgstr "Fertig in"
+
#. Android resource: @strings/map_download_download_error
msgid "Error downloading map."
msgstr "Fehler beim Kartendownload"
@@ -2696,6 +2286,10 @@ msgstr "Fehler beim Kartendownload"
msgid "Map download aborted"
msgstr "Download der Karte abgebrochen"
+#. Android resource: @strings/map_download_not_enough_free_space
+msgid "Not enough free space"
+msgstr "Nicht genug freier Speicher"
+
#. Android resource: @strings/map_no_fix
msgid "No location. Reopen after location fix."
msgstr "Position noch nicht bekannt."
@@ -2716,6 +2310,10 @@ msgstr "Ziel eingeben"
msgid "Match partial address"
msgstr "Ungefähr"
+#. Android resource: @strings/address_search_button
+msgid "Search"
+msgstr "Suche"
+
#. Android resource: @strings/address_search_searching
msgid "Searching..."
msgstr "Suche läuft..."
@@ -2744,6 +2342,10 @@ msgstr "Keine Eingabe"
msgid "Setting destination to:"
msgstr "Neues Fahrziel:"
+#. Android resource: @strings/address_search_towns
+msgid "Towns"
+msgstr "Städte"
+
#. Android resource: @strings/choose_an_action
msgid "Choose an action"
msgstr "Bitte auswählen"
@@ -2827,15 +2429,468 @@ msgid ""
"Navit needs permission to access GPS and read the map.\n"
"If you change your mind please restart Navit and grant the permissions"
msgstr ""
+"Navit benötigt die Berechtigung, um GPS zu nutzen und die Karte zu zeigen.\n"
+"Wenn Du dies erlauben möchtest, starte Navit bitte neu und erlaube die "
+"Berechtigung"
#. Android resource: @strings/permissions_info_box_title
msgid "One or more ungranted permissions"
-msgstr ""
+msgstr "Eine oder mehrere nicht gewährte Berechtigungen"
+
+#, c-format
+#~ msgid "Route %4.0fkm %02d:%02d ETA"
+#~ msgstr "Route %4.0fkm %02d:%02d ETA"
+
+#~ msgid "No config file navit.xml, navit.xml.local found\n"
+#~ msgstr "Keine Konfigurations-Datei navit.xml oder navit.xml.local gefunden\n"
+
+#, c-format
+#~ msgid "Error parsing config file '%s': %s\n"
+#~ msgstr "Fehler beim Parsen der Konfigurations-Datei '%s': %s\n"
+
+#, c-format
+#~ msgid "Using config file '%s'\n"
+#~ msgstr "Benutze Konfigurations-Datei '%s'\n"
+
+#~ msgid ""
+#~ "Internal initialization failed, exiting. Check previous error messages.\n"
+#~ msgstr ""
+#~ "Interne Initialisierung fehlgeschlagen, Programm wird beendet. Frühere "
+#~ "Fehler beachten.\n"
+
+#~ msgid "partial match"
+#~ msgstr "ungefähr"
+
+#~ msgid "Downloaded maps"
+#~ msgstr "Heruntergeladene Karten"
+
+#~ msgid "Error downloading map!"
+#~ msgstr "Fehler beim Kartendownload"
+
+#~ msgid "Taiwan"
+#~ msgstr "Taiwan"
+
+#~ msgid "Asia"
+#~ msgstr "Asien"
+
+#~ msgid "Canary Islands"
+#~ msgstr "Kanarische Inseln"
+
+#~ msgid "Whole Planet"
+#~ msgstr "Ganze Welt"
+
+#~ msgid "Map data (c) OpenStreetMap contributors, ODBL"
+#~ msgstr "Kartendaten (c) von OpenStreetMap unter ODbL"
+
+#~ msgid "Korea"
+#~ msgstr "Korea"
+
+#~ msgid "Tasmania"
+#~ msgstr "Tasmanien"
+
+#~ msgid "Oceania"
+#~ msgstr "Ozeanien"
+
+#~ msgid "Alsace"
+#~ msgstr "Elsass"
+
+#~ msgid "BeNeLux"
+#~ msgstr "Beneluxländer"
+
+#~ msgid "Victoria"
+#~ msgstr "Victoria"
+
+#~ msgid "Western Europe"
+#~ msgstr "West-Europa"
+
+#~ msgid "New South Wales"
+#~ msgstr "New South Wales"
+
+#~ msgid "Europe"
+#~ msgstr "Europa"
+
+#~ msgid "Aquitaine"
+#~ msgstr "Aquitanien"
+
+#~ msgid "Auvergne"
+#~ msgstr "Auvergne"
+
+#~ msgid "Basse-Normandie"
+#~ msgstr "Basse-Normandie"
+
+#~ msgid "Languedoc-Roussillon"
+#~ msgstr "Languedoc-Roussillon"
+
+#~ msgid "Limousin"
+#~ msgstr "Limousin"
+
+#~ msgid "Haute-Normandie"
+#~ msgstr "Haute Normandie"
+
+#~ msgid "Bretagne"
+#~ msgstr "Bretagne"
+
+#~ msgid "Corse"
+#~ msgstr "Korsika"
+
+#~ msgid "Champagne-Ardenne"
+#~ msgstr "Champagne-Ardenne"
+
+#~ msgid "Baden-Wuerttemberg"
+#~ msgstr "Baden-Württemberg"
+
+#~ msgid "Bayern"
+#~ msgstr "Bayern"
+
+#~ msgid "Lorraine"
+#~ msgstr "Lothringen"
+
+#~ msgid "Poitou-Charentes"
+#~ msgstr "Poitou-Charentes"
+
+#~ msgid "Picardie"
+#~ msgstr "Picardie"
+
+#~ msgid "Mittelfranken"
+#~ msgstr "Mittelfranken"
+
+#~ msgid "Oberpfalz"
+#~ msgstr "Oberpfalz"
+
+#~ msgid "Oberfranken"
+#~ msgstr "Oberfranken"
+
+#~ msgid "Oberbayern"
+#~ msgstr "Oberbayern"
+
+#~ msgid "Unterfranken"
+#~ msgstr "Unterfranken"
+
+#~ msgid "Schwaben"
+#~ msgstr "Schwaben"
+
+#~ msgid "Niederbayern"
+#~ msgstr "Niederbayern"
+
+#~ msgid "Bremen"
+#~ msgstr "Bremen"
+
+#~ msgid "Berlin"
+#~ msgstr "Berlin"
+
+#~ msgid "Brandenburg"
+#~ msgstr "Brandenburg"
+
+#~ msgid "Rheinland-Pfalz"
+#~ msgstr "Rheinland-Pfalz"
+
+#~ msgid "Saarland"
+#~ msgstr "Saarland"
+
+#~ msgid "Niedersachsen"
+#~ msgstr "Niedersachsen"
+
+#~ msgid "Hessen"
+#~ msgstr "Hessen"
+
+#~ msgid "Mecklenburg-Vorpommern"
+#~ msgstr "Mecklenburg-Vorpommern"
+
+#~ msgid "Hamburg"
+#~ msgstr "Hamburg"
+
+#~ msgid "Sachsen"
+#~ msgstr "Sachsen"
+
+#~ msgid "Sachsen-Anhalt"
+#~ msgstr "Sachsen-Anhalt"
+
+#~ msgid "Schleswig-Holstein"
+#~ msgstr "Schleswig-Holstein"
+
+#~ msgid "Galicia"
+#~ msgstr "Galicien"
+
+#~ msgid "Essex"
+#~ msgstr "Essex"
+
+#~ msgid "Cumbria"
+#~ msgstr "Cumbria"
+
+#~ msgid "Thueringen"
+#~ msgstr "Thüringen"
+
+#~ msgid "Mallorca"
+#~ msgstr "Mallorca"
+
+#~ msgid "England"
+#~ msgstr "England"
+
+#~ msgid "Scandinavia"
+#~ msgstr "Skandinavien"
+
+#~ msgid "Cambridgeshire"
+#~ msgstr "Cambridgeshire"
+
+#~ msgid "Buckinghamshire"
+#~ msgstr "Buckinghamshire"
+
+#~ msgid "Oxfordshire"
+#~ msgstr "Oxfordshire"
+
+#~ msgid "Nottinghamshire"
+#~ msgstr "Nottinghamshire"
+
+#~ msgid "Lancashire"
+#~ msgstr "Lancashire"
+
+#~ msgid "Kent"
+#~ msgstr "Kent"
+
+#~ msgid "Norfolk"
+#~ msgstr "Norfolk"
+
+#~ msgid "Leicestershire"
+#~ msgstr "Leicestershire"
+
+#~ msgid "Herefordshire"
+#~ msgstr "Herefordshire"
+
+#~ msgid "South yorkshire"
+#~ msgstr "South yorkshire"
+
+#~ msgid "Shropshire"
+#~ msgstr "Shropshire"
+
+#~ msgid "Somerset"
+#~ msgstr "Somerset"
+
+#~ msgid "Alaska"
+#~ msgstr "Alaska"
+
+#~ msgid "North America"
+#~ msgstr "Nordamerika"
+
+#~ msgid "USA"
+#~ msgstr "USA"
+
+#~ msgid "Hawaii"
+#~ msgstr "Hawaii"
+
+#~ msgid "Crete"
+#~ msgstr "Kreta"
+
+#~ msgid "Suffolk"
+#~ msgstr "Suffolk"
+
+#~ msgid "Scotland"
+#~ msgstr "Schottland"
+
+#~ msgid "Wales"
+#~ msgstr "Wales"
+
+#~ msgid "Surrey"
+#~ msgstr "Surrey"
+
+#~ msgid "Wiltshire"
+#~ msgstr "Wiltshire"
+
+#~ msgid "Pacific"
+#~ msgstr "Pazifik"
+
+#~ msgid "South"
+#~ msgstr "Süd"
+
+#~ msgid "Arkansas"
+#~ msgstr "Arkansas"
+
+#~ msgid " (except Alaska and Hawaii)"
+#~ msgstr " (außer Alaska und Hawaii)"
+
+#~ msgid "Northeast"
+#~ msgstr "Nordosten"
+
+#~ msgid "Ohio"
+#~ msgstr "Ohio"
+
+#~ msgid "Michigan"
+#~ msgstr "Michigan"
+
+#~ msgid "Midwest"
+#~ msgstr "Mittlerer Westen"
+
+#~ msgid "Vermont"
+#~ msgstr "Vermont"
+
+#~ msgid "Massachusetts"
+#~ msgstr "Massachusetts"
+
+#~ msgid "District of Columbia"
+#~ msgstr "District of Columbia"
+
+#~ msgid "Florida"
+#~ msgstr "Florida"
+
+#~ msgid "Louisiana"
+#~ msgstr "Louisiana"
+
+#~ msgid "Maryland"
+#~ msgstr "Maryland"
+
+#~ msgid "Oklahoma"
+#~ msgstr "Oklahoma"
+
+#~ msgid "Texas"
+#~ msgstr "Texas"
+
+#~ msgid "Mississippi"
+#~ msgstr "Mississippi"
+
+#~ msgid "West Virginia"
+#~ msgstr "West Virginia"
+
+#~ msgid "Virginia"
+#~ msgstr "Virginia"
+
+#~ msgid "West"
+#~ msgstr "West"
+
+#~ msgid "Washington State"
+#~ msgstr "Washington State"
+
+#~ msgid "Oregon"
+#~ msgstr "Oregon"
+
+#~ msgid "New Mexico"
+#~ msgstr "New Mexico"
+
+#~ msgid "Nevada"
+#~ msgstr "Nevada"
+
+#~ msgid "Arizona"
+#~ msgstr "Arizona"
+
+#~ msgid "Colorado"
+#~ msgstr "Colorado"
+
+#~ msgid "California"
+#~ msgstr "Kalifornien"
+
+#~ msgid "Montana"
+#~ msgstr "Montana"
+
+#~ msgid "Idaho"
+#~ msgstr "Idaho"
+
+#~ msgid "Utah"
+#~ msgstr "Utah"
+
+#~ msgid "Africa"
+#~ msgstr "Afrika"
+
+#~ msgid "UAE+Other"
+#~ msgstr "Vereinigte Arabische Emirate+weitere"
+
+#~ msgid "Azores"
+#~ msgstr "Azoren"
+
+#~ msgid "Bourgogne"
+#~ msgstr "Burgund"
+
+#~ msgid "South+Middle America"
+#~ msgstr "Süd+Mittel-Amerika"
+
+#~ msgid "Error writing map!"
+#~ msgstr "Fehler beim speichern der Karte!"
+
+#~ msgid "downloading"
+#~ msgstr "wird heruntergeladen"
+
+#~ msgid "Nordrhein-westfalen"
+#~ msgstr "Nordrhein-Westfalen"
+
+#~ msgid "Map download aborted!"
+#~ msgstr "Kartendownload abgebrochen!"
+
+#~ msgid "Centre"
+#~ msgstr "Centre"
+
+#~ msgid "Ile-de-France"
+#~ msgstr "Ile-de-France"
+
+#~ msgid "Nord-pas-de-Calais"
+#~ msgstr "Nord-pas-de-Calais"
+
+#~ msgid "Pays-de-la-Loire"
+#~ msgstr "Pays-de-la-Loire"
+
+#~ msgid "Midi-Pyrenees"
+#~ msgstr "Midi-Pyrenäen"
+
+#~ msgid "Guyane Francaise"
+#~ msgstr "Französisch-Guayana"
+
+#~ msgid "Franche-Comte"
+#~ msgstr "Freie Grafschaft"
+
+#~ msgid "Cancel"
+#~ msgstr "Abbrechen"
+
+#~ msgid "Rhone-Alpes"
+#~ msgstr "Rhone-Alpen"
+
+#, c-format
+#~ msgid "Error: No configuration found in config file '%s'\n"
+#~ msgstr "Fehler: Keine Konfiguration in der Datei '%s' gefunden\n"
+
+#~ msgid "Provence-Alpes-Cote-d-Azur"
+#~ msgstr "Provence-Alpes-Cote-d-Azur"
+
+#~ msgid "Media selected for map storage is not available"
+#~ msgstr ""
+#~ "Der eingestellte Speicherort für das Kartenmaterial ist nicht verfügbar."
+
+#~ msgid ""
+#~ "Sorry, we currently do not support maps above 3.8G on Android, please select "
+#~ "a smaller one."
+#~ msgstr ""
+#~ "Entschuldigung. Derzeit untestützen wir auf Android keine Karten die größer "
+#~ "als 3,8Gigabyte sind. Bitte wählen Sie eine kleinere Karte aus."
+
+#, c-format
+#~ msgid "Set destination to %ld, %ld \n"
+#~ msgstr "Setze Ziel auf %ld, %ld \n"
+
+#~ msgid "Distance from screen center (km)"
+#~ msgstr "Entfernung vom Bildschirmmittelpunkt (km)"
+
+#, c-format
+#~ msgid "Set map to %ld, %ld \n"
+#~ msgstr "Setze Karte auf %ld, %ld \n"
+
+#~ msgid ""
+#~ "New location set to %s\n"
+#~ "Restart Navit to apply the changes."
+#~ msgstr ""
+#~ "Karten-Speicherort ist %s\n"
+#~ "Starten Sie Navit erneut."
+
+#~ msgid ""
+#~ "Current map location %s is not available\n"
+#~ "Please restart Navit after you attach an SD card or select a different map "
+#~ "location."
+#~ msgstr ""
+#~ "Der Speicherpfad für die Karte ist nicht verfügbar.\n"
+#~ "Setzen Sie eine SD Karte ein und starten Sie Navit erneut\n"
+#~ "oder wählen Sie einen anderen Pfad aus."
#, c-format
#~ msgid "then leave the roundabout at the %1$s %2$s"
#~ msgstr "anschließend verlassen Sie den Kreisverkehr an der %1$s %2$s"
+#~ msgid "East yorkshire with hull"
+#~ msgstr "East Yorkshire und Hull"
+
#, c-format
#~ msgid "in %d m"
#~ msgstr "in %d m"
@@ -2843,3 +2898,7 @@ msgstr ""
#, c-format
#~ msgid "%d m"
#~ msgstr "%d m"
+
+#, c-format
+#~ msgid "Set next visit to %ld, %ld \n"
+#~ msgstr "Setze nächsten Besuch auf %ld, %ld \n"
diff --git a/po/de_CH.po.in b/po/de_CH.po.in
index d30c18584..309047f4d 100644
--- a/po/de_CH.po.in
+++ b/po/de_CH.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/el.po.in b/po/el.po.in
index 9da1b8087..a1c63d17a 100644
--- a/po/el.po.in
+++ b/po/el.po.in
@@ -1670,7 +1670,7 @@ msgstr "Ταξί"
msgid "Shopping"
msgstr "Αγορές"
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/en.po.in b/po/en.po.in
index ca337896c..a3937cb80 100644
--- a/po/en.po.in
+++ b/po/en.po.in
@@ -1669,7 +1669,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
@@ -1695,7 +1695,7 @@ msgid "Select a category"
msgstr ""
msgid "Select a distance to look for (km)"
-msgstr ""
+msgstr "Select a search radius from screen center"
msgid "Select a POI"
msgstr ""
@@ -1709,8 +1709,9 @@ msgstr ""
msgid "Direction"
msgstr ""
+# TRANSLATORS: This is the distance to a Point of Interest (POI) in the POI window. It will be feet (imperial) or, meters (metric), depending on the user's preference.
msgid "Distance(m)"
-msgstr ""
+msgstr "Distance"
msgid "Name"
msgstr ""
diff --git a/po/en_AU.po.in b/po/en_AU.po.in
index 50842f620..bf7d7a65d 100644
--- a/po/en_AU.po.in
+++ b/po/en_AU.po.in
@@ -1666,7 +1666,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
@@ -1692,7 +1692,7 @@ msgid "Select a category"
msgstr ""
msgid "Select a distance to look for (km)"
-msgstr ""
+msgstr "Select a search radius from screen center"
msgid "Select a POI"
msgstr ""
@@ -1706,8 +1706,9 @@ msgstr ""
msgid "Direction"
msgstr ""
+# TRANSLATORS: This is the distance to a Point of Interest (POI) in the POI window. It will be feet (imperial) or, meters (metric), depending on the user's preference.
msgid "Distance(m)"
-msgstr ""
+msgstr "Distance"
msgid "Name"
msgstr ""
diff --git a/po/en_CA.po.in b/po/en_CA.po.in
index fa624bc71..b0ee764cd 100644
--- a/po/en_CA.po.in
+++ b/po/en_CA.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
@@ -1689,7 +1689,7 @@ msgid "Select a category"
msgstr ""
msgid "Select a distance to look for (km)"
-msgstr ""
+msgstr "Select a search radius from screen center"
msgid "Select a POI"
msgstr ""
@@ -1703,8 +1703,9 @@ msgstr ""
msgid "Direction"
msgstr ""
+# TRANSLATORS: This is the distance to a Point of Interest (POI) in the POI window. It will be feet (imperial) or, meters (metric), depending on the user's preference.
msgid "Distance(m)"
-msgstr ""
+msgstr "Distance"
msgid "Name"
msgstr ""
diff --git a/po/en_GB.po.in b/po/en_GB.po.in
index fec19d509..81ca21295 100644
--- a/po/en_GB.po.in
+++ b/po/en_GB.po.in
@@ -1682,8 +1682,8 @@ msgstr "Taxi"
msgid "Shopping"
msgstr "Shopping"
-msgid "Distance from screen center (km)"
-msgstr "Distance from screen centre (km)"
+msgid "Select a search radius from screen center"
+msgstr ""
#, c-format
msgid "POI %s. %s"
@@ -1708,7 +1708,7 @@ msgid "Select a category"
msgstr "Select a category"
msgid "Select a distance to look for (km)"
-msgstr "Select a distance to look for (km)"
+msgstr "Select a search radius from screen center"
msgid "Select a POI"
msgstr "Select a POI"
@@ -1722,8 +1722,9 @@ msgstr "Category"
msgid "Direction"
msgstr "Direction"
+# TRANSLATORS: This is the distance to a Point of Interest (POI) in the POI window. It will be feet (imperial) or, meters (metric), depending on the user's preference.
msgid "Distance(m)"
-msgstr "Distance(m)"
+msgstr "Distance"
msgid "Name"
msgstr "Name"
diff --git a/po/eo.po.in b/po/eo.po.in
index 62a0a7128..8ac6d2526 100644
--- a/po/eo.po.in
+++ b/po/eo.po.in
@@ -1668,7 +1668,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/es.po.in b/po/es.po.in
index bbd11a961..fc43a6a87 100644
--- a/po/es.po.in
+++ b/po/es.po.in
@@ -1,5 +1,5 @@
# Spanish translations for navit
-# Copyright (C) 2006-2017 The Navit Team
+# Copyright (C) 2006-2018 The Navit Team
# This file is distributed under the same license as the navit package.
# Many thanks to the contributors of this translation:
# Benjamín Valero Espinosa https://launchpad.net/~benjavalero
@@ -25,10 +25,10 @@
msgid ""
msgstr ""
-"Project-Id-Version: navit 0.5.0\n"
+"Project-Id-Version: navit 0.5.1\n"
"Report-Msgid-Bugs-To: \n"
-"PO-Revision-Date: 2017-09-26 07:01+0000\n"
-"Last-Translator: Iñigo Huguet <inigohuguet@hotmail.com>\n"
+"PO-Revision-Date: 2018-05-01 17:39+0000\n"
+"Last-Translator: iceman75 <Unknown>\n"
"Language-Team: Chris Eubank <cteubank@gmail.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -398,9 +398,15 @@ msgstr "Orden"
msgid "Length"
msgstr "Longitud"
+msgid "mi"
+msgstr "mi"
+
msgid "km"
msgstr "km"
+msgid "feet"
+msgstr "pies"
+
msgid "m"
msgstr "m"
@@ -1466,28 +1472,24 @@ msgstr ""
"\t-v: muestra la versión y termina.\n"
#. We have not found an existing config file from all possibilities
-msgid "No config file navit.xml, navit.xml.local found\n"
+msgid "No config file navit.xml, navit.xml.local found"
msgstr ""
-"No hay fichero de configuración navit.xml, encontrado navit.xml.local\n"
#, c-format
-msgid "Error parsing config file '%s': %s\n"
-msgstr "Error cargando el fichero de configuración '%s': %s\n"
+msgid "Error parsing config file '%s': %s"
+msgstr ""
#, c-format
-msgid "Using config file '%s'\n"
-msgstr "Usando el fichero de configuración '%s'\n"
+msgid "Using config file '%s'"
+msgstr ""
#, c-format
-msgid "Error: No configuration found in config file '%s'\n"
+msgid "Error: No configuration found in config file '%s'"
msgstr ""
-"Error: No se encontró la configuración en el archivo de configuración '%s'\n"
msgid ""
-"Internal initialization failed, exiting. Check previous error messages.\n"
+"Internal initialization failed, exiting. Check previous error messages."
msgstr ""
-"Inicialización interna fallida, saliendo. Compruebe mensajes previos de "
-"error\n"
msgid "unknown street"
msgstr "calle desconocida"
@@ -1627,6 +1629,9 @@ msgstr "_Mostrar posición del cursor"
msgid "_Lock on Road"
msgstr "_Bloqueo en la ruta"
+msgid "_Follow Vehicle"
+msgstr ""
+
msgid "_Keep orientation to the North"
msgstr "Mantener _orientación al Norte"
@@ -1696,24 +1701,24 @@ msgstr "Taxi"
msgid "Shopping"
msgstr "Shopping"
-msgid "Distance from screen center (km)"
-msgstr "Distancia del centro de la pantalla (km)"
+msgid "Select a search radius from screen center"
+msgstr "Distancia del centro de la pantalla"
#, c-format
msgid "POI %s. %s"
msgstr "POI %s. %s"
#, c-format
-msgid "Set destination to %ld, %ld \n"
-msgstr "Cambiar destino a %ld, %ld \n"
+msgid "Set destination to %ld, %ld "
+msgstr ""
#, c-format
-msgid "Set map to %ld, %ld \n"
-msgstr "Cambiar mapa a % ld, %ld \n"
+msgid "Set map to %ld, %ld "
+msgstr ""
#, c-format
-msgid "Set next visit to %ld, %ld \n"
-msgstr "Conjunto siguiente visita a %ld, %ld \n"
+msgid "Set next visit to %ld, %ld "
+msgstr ""
msgid "POI search"
msgstr "Búsqueda de puntos de interés"
@@ -1783,8 +1788,8 @@ msgid "OT"
msgstr "OT"
#, c-format
-msgid "Route %4.0fkm %02d:%02d ETA"
-msgstr "Ruta %4.0fkm %02d:%02d TEL"
+msgid "Route %4.1f%s %02d:%02d ETA"
+msgstr ""
msgid "Route 0000km 0+00:00 ETA"
msgstr "Ruta 0000km 0+00:00 TEL"
@@ -2049,452 +2054,9 @@ msgstr "¡Atención! Radar"
msgid "Please decrease your speed"
msgstr "Por favor, disminuya su velocidad"
-msgid "partial match"
-msgstr "Coincidencia parcial"
-
-#. Android resource: @strings/address_search_button
-msgid "Search"
-msgstr "Búsqueda"
-
-#. Android resource: @strings/address_search_towns
-msgid "Towns"
-msgstr "Ciudades"
-
-msgid "Map data (c) OpenStreetMap contributors, ODBL"
-msgstr "Datos de Mapa (c) contribuyentes de OpenStreetMap, ODBL"
-
-msgid ""
-"Current map location %s is not available\n"
-"Please restart Navit after you attach an SD card or select a different map "
-"location."
-msgstr ""
-"Ubicación actual del mapa %s no se encuentra disponible\n"
-"Por favor reiniciar Navit después de conectar una tarjeta SD o seleccione "
-"una ubicación del mapa diferente."
-
-msgid "Downloaded maps"
-msgstr "Mapas descargados"
-
-msgid ""
-"Sorry, we currently do not support maps above 3.8G on Android, please select "
-"a smaller one."
-msgstr ""
-"Lo sentimos, actualmente no permitimos mapas por encima de 3,8 G en Android, "
-"por favor, seleccione una versión más pequeña."
-
-#. Android resource: @strings/position_popup_drive_here
-msgid "Route to here"
-msgstr "Ruta hasta aquí"
-
-msgid "Cancel"
-msgstr "Cancelar"
-
msgid "filenamePath"
msgstr ""
-msgid ""
-"New location set to %s\n"
-"Restart Navit to apply the changes."
-msgstr ""
-"Nueva ubicación cambiada a %s\n"
-"Reinicie Navit para aplicar los cambios."
-
-msgid "Whole Planet"
-msgstr "Todo el Planeta"
-
-msgid "Africa"
-msgstr "África"
-
-msgid "Canary Islands"
-msgstr "Islas Canarias"
-
-msgid "Asia"
-msgstr "Asia"
-
-msgid "Korea"
-msgstr "Corea"
-
-msgid "Taiwan"
-msgstr "Taiwán"
-
-msgid "UAE+Other"
-msgstr "Emiratos Árabes Unidos + Otros"
-
-msgid "Oceania"
-msgstr "Oceanía"
-
-msgid "Tasmania"
-msgstr "Tasmania"
-
-msgid "Victoria"
-msgstr "Victoria"
-
-msgid "New South Wales"
-msgstr "Nueva Gales del Sur"
-
-msgid "Europe"
-msgstr "Europa"
-
-msgid "Western Europe"
-msgstr "Europa Occidental"
-
-msgid "Azores"
-msgstr "Azores"
-
-msgid "BeNeLux"
-msgstr "Benelux"
-
-msgid "Alsace"
-msgstr "Alsacia"
-
-msgid "Aquitaine"
-msgstr "Aquitania"
-
-msgid "Auvergne"
-msgstr "Auvernia"
-
-msgid "Basse-Normandie"
-msgstr "Baja Normandía"
-
-msgid "Bourgogne"
-msgstr "Borgoña"
-
-msgid "Bretagne"
-msgstr "Bretaña"
-
-msgid "Centre"
-msgstr "Centro"
-
-msgid "Champagne-Ardenne"
-msgstr "Champaña - Ardenas"
-
-msgid "Corse"
-msgstr "Córcega"
-
-msgid "Franche-Comte"
-msgstr "Franco Condado"
-
-msgid "Haute-Normandie"
-msgstr "Alta Normandía"
-
-msgid "Ile-de-France"
-msgstr "Isla de Francia"
-
-msgid "Languedoc-Roussillon"
-msgstr "Languedoc - Rosellón"
-
-msgid "Limousin"
-msgstr "Limusina"
-
-msgid "Lorraine"
-msgstr "Lorena"
-
-msgid "Midi-Pyrenees"
-msgstr "Midi - Pirineos"
-
-msgid "Nord-pas-de-Calais"
-msgstr "Paso Norte de Calais"
-
-msgid "Pays-de-la-Loire"
-msgstr "Países del Loira"
-
-msgid "Picardie"
-msgstr "Paradía"
-
-msgid "Poitou-Charentes"
-msgstr "Poitou-Charentes"
-
-msgid "Provence-Alpes-Cote-d-Azur"
-msgstr "Alpes - Costa Azul"
-
-msgid "Rhone-Alpes"
-msgstr "Rhone - Alpes"
-
-msgid "Baden-Wuerttemberg"
-msgstr "Baden-Wuerttemberg"
-
-msgid "Bayern"
-msgstr "Baviera"
-
-msgid "Mittelfranken"
-msgstr "Franconia Media"
-
-msgid "Niederbayern"
-msgstr "Baja Baviera"
-
-msgid "Oberbayern"
-msgstr "Alta Baviera"
-
-msgid "Oberfranken"
-msgstr "Alta Franconia"
-
-msgid "Oberpfalz"
-msgstr "Alto Palatinado"
-
-msgid "Schwaben"
-msgstr "Schawben"
-
-msgid "Unterfranken"
-msgstr "Baja Franconia"
-
-msgid "Berlin"
-msgstr "Berlín"
-
-msgid "Brandenburg"
-msgstr "Brandenburgo"
-
-msgid "Bremen"
-msgstr "Bremen"
-
-msgid "Hamburg"
-msgstr "Hamburgo"
-
-msgid "Hessen"
-msgstr "Hessen"
-
-msgid "Mecklenburg-Vorpommern"
-msgstr "Mecklemburgo-Pomerania"
-
-msgid "Niedersachsen"
-msgstr "Niedersachsen"
-
-msgid "Nordrhein-westfalen"
-msgstr "Renania del Norte-Westfalia"
-
-msgid "Rheinland-Pfalz"
-msgstr "Renania del Norte-Westfalia"
-
-msgid "Saarland"
-msgstr "Sarre"
-
-msgid "Sachsen-Anhalt"
-msgstr "Sajonia-Anhalt"
-
-msgid "Sachsen"
-msgstr "Sachsen"
-
-msgid "Schleswig-Holstein"
-msgstr "Schleswig-Holstein"
-
-msgid "Thueringen"
-msgstr "Turingia"
-
-msgid "Mallorca"
-msgstr "Mallorca"
-
-msgid "Galicia"
-msgstr "Galicia"
-
-msgid "Scandinavia"
-msgstr "Escandinavia"
-
-msgid "England"
-msgstr "Inglaterra"
-
-msgid "Buckinghamshire"
-msgstr "Buckinghamshire"
-
-msgid "Cambridgeshire"
-msgstr "Cambridgeshire"
-
-msgid "Cumbria"
-msgstr "Cumbria"
-
-msgid "East yorkshire with hull"
-msgstr "Yorkshire Este con Hull"
-
-msgid "Essex"
-msgstr "Essex"
-
-msgid "Herefordshire"
-msgstr "Herefordshire"
-
-msgid "Kent"
-msgstr "Kent"
-
-msgid "Lancashire"
-msgstr "Lancashire"
-
-msgid "Leicestershire"
-msgstr "Leicestershire"
-
-msgid "Norfolk"
-msgstr "Norfolk"
-
-msgid "Nottinghamshire"
-msgstr "Nottinghamshire"
-
-msgid "Oxfordshire"
-msgstr "Oxfordshire"
-
-msgid "Shropshire"
-msgstr "Shropshire"
-
-msgid "Somerset"
-msgstr "Somerset"
-
-msgid "South yorkshire"
-msgstr "Yorkshire Sur"
-
-msgid "Suffolk"
-msgstr "Suffolk"
-
-msgid "Surrey"
-msgstr "Surrey"
-
-msgid "Wiltshire"
-msgstr "Wiltshire"
-
-msgid "Scotland"
-msgstr "Escocia"
-
-msgid "Wales"
-msgstr "Gales"
-
-msgid "Crete"
-msgstr "Creta"
-
-msgid "North America"
-msgstr "Norteamérica"
-
-msgid "Alaska"
-msgstr "Alaska"
-
-msgid "Hawaii"
-msgstr "Hawái"
-
-msgid "USA"
-msgstr "Estados Unidos de Norteamérica"
-
-msgid " (except Alaska and Hawaii)"
-msgstr " (excepto Alaska y Hawái)"
-
-msgid "Midwest"
-msgstr "Medio-Oeste"
-
-msgid "Michigan"
-msgstr "Michigan"
-
-msgid "Ohio"
-msgstr "Ohio"
-
-msgid "Northeast"
-msgstr "Noreste"
-
-msgid "Massachusetts"
-msgstr "Massachusetts"
-
-msgid "Vermont"
-msgstr "Vermont"
-
-msgid "Pacific"
-msgstr "Pacífico"
-
-msgid "South"
-msgstr "Sur"
-
-msgid "Arkansas"
-msgstr "Arkansas"
-
-msgid "District of Columbia"
-msgstr "Distrito de Columbia"
-
-msgid "Florida"
-msgstr "Florida"
-
-msgid "Louisiana"
-msgstr "Luisiana"
-
-msgid "Maryland"
-msgstr "Maryland"
-
-msgid "Mississippi"
-msgstr "Mississippi"
-
-msgid "Oklahoma"
-msgstr "Oklahoma"
-
-msgid "Texas"
-msgstr "Tejas"
-
-msgid "Virginia"
-msgstr "Virginia"
-
-msgid "West Virginia"
-msgstr "Virginia Occidental"
-
-msgid "West"
-msgstr "Oeste"
-
-msgid "Arizona"
-msgstr "Arizona"
-
-msgid "California"
-msgstr "California"
-
-msgid "Colorado"
-msgstr "Colorado"
-
-msgid "Idaho"
-msgstr "Idaho"
-
-msgid "Montana"
-msgstr "Montana"
-
-msgid "New Mexico"
-msgstr "Nuevo Méjico"
-
-msgid "Nevada"
-msgstr "Nevada"
-
-msgid "Oregon"
-msgstr "Oregón"
-
-msgid "Utah"
-msgstr "Utah"
-
-msgid "Washington State"
-msgstr "Estado de Washington"
-
-msgid "South+Middle America"
-msgstr "Suramérica + Centroamérica"
-
-msgid "Guyane Francaise"
-msgstr "Guayana Francesa"
-
-msgid "downloading"
-msgstr "descargando"
-
-#. Android resource: @strings/map_download_ready
-msgid "ready"
-msgstr "listo"
-
-msgid "Media selected for map storage is not available"
-msgstr ""
-"Los medios de comunicación seleccionados para el almacenamiento del mapa no "
-"está disponible"
-
-#. Android resource: @strings/map_download_not_enough_free_space
-msgid "Not enough free space"
-msgstr "No hay suficiente espacio libre"
-
-msgid "Error downloading map!"
-msgstr "Error al descargar el mapa"
-
-msgid "Error writing map!"
-msgstr "Error al guardar el mapa"
-
-msgid "Map download aborted!"
-msgstr "Descarga del mapa interrumpida"
-
-#. Android resource: @strings/map_download_eta
-msgid "ETA"
-msgstr "Tiempo estimado"
-
-#. Android resource: @strings/map_download_title
-msgid "Map download"
-msgstr "Mapa descargado"
-
msgid "Vehicle Position"
msgstr "Posición del vehículo"
@@ -2559,7 +2121,7 @@ msgid "Manual zoom"
msgstr "Zoom manual"
msgid "Layers"
-msgstr ""
+msgstr "Capas"
msgid "Zoom to route"
msgstr "Zoom a ruta"
@@ -2676,14 +2238,30 @@ msgstr "Respaldar / Restaurar"
msgid "Set map location"
msgstr "Establecer ubicación en mapa"
+#. Android resource: @strings/position_popup_drive_here
+msgid "Route to here"
+msgstr "Ruta hasta aquí"
+
#. Android resource: @strings/map_delete
msgid "Delete this map?"
msgstr "¿Borrar este mapa?"
+#. Android resource: @strings/map_download_title
+msgid "Map download"
+msgstr "Mapa descargado"
+
#. Android resource: @strings/map_download_downloading
msgid "Downloading:"
msgstr "Descargando:"
+#. Android resource: @strings/map_download_eta
+msgid "ETA"
+msgstr "Tiempo estimado"
+
+#. Android resource: @strings/map_download_ready
+msgid "ready"
+msgstr "listo"
+
#. Android resource: @strings/map_download_download_error
msgid "Error downloading map."
msgstr "Error descargando mapa"
@@ -2692,6 +2270,10 @@ msgstr "Error descargando mapa"
msgid "Map download aborted"
msgstr "Descarga de mapa interrumpida"
+#. Android resource: @strings/map_download_not_enough_free_space
+msgid "Not enough free space"
+msgstr "No hay suficiente espacio libre"
+
#. Android resource: @strings/map_no_fix
msgid "No location. Reopen after location fix."
msgstr "Sin localización. Reabra tras fijar localización."
@@ -2712,6 +2294,10 @@ msgstr "Introduzca destino"
msgid "Match partial address"
msgstr "Coincidencia parcial en la dirección"
+#. Android resource: @strings/address_search_button
+msgid "Search"
+msgstr "Búsqueda"
+
#. Android resource: @strings/address_search_searching
msgid "Searching..."
msgstr "Buscando…"
@@ -2740,6 +2326,10 @@ msgstr "No se introdujo texto"
msgid "Setting destination to:"
msgstr "Configurando destino a:"
+#. Android resource: @strings/address_search_towns
+msgid "Towns"
+msgstr "Ciudades"
+
#. Android resource: @strings/choose_an_action
msgid "Choose an action"
msgstr "Elija una acción"
@@ -2806,7 +2396,7 @@ msgstr "Restaurar"
#. Android resource: @strings/TTS_title_data_missing
msgid "System text to speech engine data is missing"
-msgstr ""
+msgstr "No hay datos de síntesis de voz del sistema"
#. Android resource: @strings/TTS_qery_install_data
msgid ""
@@ -2814,6 +2404,9 @@ msgid ""
"currently selected engine reports it is unable to speak in your language. "
"Should we ask the system to show voice download dialog?"
msgstr ""
+"Navit puede usar cualquier sintetizador de voz instalado en el dispositivo. "
+"El sintetizador seleccionado actualmente informa de que no puede hablar en "
+"su idioma. ¿Desea ver el diálogo de descarga de voces del sistema?"
#. Android resource: @strings/permissions_not_granted
msgid ""
@@ -2828,5 +2421,462 @@ msgid "One or more ungranted permissions"
msgstr "Uno o más permisos rechazados"
#, c-format
+#~ msgid "Route %4.0fkm %02d:%02d ETA"
+#~ msgstr "Ruta %4.0fkm %02d:%02d TEL"
+
+#~ msgid "No config file navit.xml, navit.xml.local found\n"
+#~ msgstr ""
+#~ "No hay fichero de configuración navit.xml, encontrado navit.xml.local\n"
+
+#, c-format
+#~ msgid "Error parsing config file '%s': %s\n"
+#~ msgstr "Error cargando el fichero de configuración '%s': %s\n"
+
+#, c-format
+#~ msgid "Using config file '%s'\n"
+#~ msgstr "Usando el fichero de configuración '%s'\n"
+
+#~ msgid ""
+#~ "Internal initialization failed, exiting. Check previous error messages.\n"
+#~ msgstr ""
+#~ "Inicialización interna fallida, saliendo. Compruebe mensajes previos de "
+#~ "error\n"
+
+#~ msgid "Cancel"
+#~ msgstr "Cancelar"
+
+#~ msgid "Downloaded maps"
+#~ msgstr "Mapas descargados"
+
+#~ msgid "partial match"
+#~ msgstr "Coincidencia parcial"
+
+#~ msgid "Taiwan"
+#~ msgstr "Taiwán"
+
+#~ msgid "Asia"
+#~ msgstr "Asia"
+
+#~ msgid "Canary Islands"
+#~ msgstr "Islas Canarias"
+
+#~ msgid "Whole Planet"
+#~ msgstr "Todo el Planeta"
+
+#~ msgid "Korea"
+#~ msgstr "Corea"
+
+#~ msgid "Tasmania"
+#~ msgstr "Tasmania"
+
+#~ msgid "Victoria"
+#~ msgstr "Victoria"
+
+#~ msgid "Oceania"
+#~ msgstr "Oceanía"
+
+#~ msgid "UAE+Other"
+#~ msgstr "Emiratos Árabes Unidos + Otros"
+
+#~ msgid "BeNeLux"
+#~ msgstr "Benelux"
+
+#~ msgid "Alsace"
+#~ msgstr "Alsacia"
+
+#~ msgid "Western Europe"
+#~ msgstr "Europa Occidental"
+
+#~ msgid "Azores"
+#~ msgstr "Azores"
+
+#~ msgid "New South Wales"
+#~ msgstr "Nueva Gales del Sur"
+
+#~ msgid "Europe"
+#~ msgstr "Europa"
+
+#~ msgid "Bourgogne"
+#~ msgstr "Borgoña"
+
+#~ msgid "Auvergne"
+#~ msgstr "Auvernia"
+
+#~ msgid "Aquitaine"
+#~ msgstr "Aquitania"
+
+#~ msgid "Basse-Normandie"
+#~ msgstr "Baja Normandía"
+
+#~ msgid "Lorraine"
+#~ msgstr "Lorena"
+
+#~ msgid "Languedoc-Roussillon"
+#~ msgstr "Languedoc - Rosellón"
+
+#~ msgid "Bretagne"
+#~ msgstr "Bretaña"
+
+#~ msgid "Haute-Normandie"
+#~ msgstr "Alta Normandía"
+
+#~ msgid "Centre"
+#~ msgstr "Centro"
+
+#~ msgid "Corse"
+#~ msgstr "Córcega"
+
+#~ msgid "Champagne-Ardenne"
+#~ msgstr "Champaña - Ardenas"
+
+#~ msgid "Baden-Wuerttemberg"
+#~ msgstr "Baden-Wuerttemberg"
+
+#~ msgid "Rhone-Alpes"
+#~ msgstr "Rhone - Alpes"
+
+#~ msgid "Provence-Alpes-Cote-d-Azur"
+#~ msgstr "Alpes - Costa Azul"
+
+#~ msgid "Midi-Pyrenees"
+#~ msgstr "Midi - Pirineos"
+
+#~ msgid "Nord-pas-de-Calais"
+#~ msgstr "Paso Norte de Calais"
+
+#~ msgid "Picardie"
+#~ msgstr "Paradía"
+
+#~ msgid "Schwaben"
+#~ msgstr "Schawben"
+
+#~ msgid "Hamburg"
+#~ msgstr "Hamburgo"
+
+#~ msgid "Bremen"
+#~ msgstr "Bremen"
+
+#~ msgid "Berlin"
+#~ msgstr "Berlín"
+
+#~ msgid "Brandenburg"
+#~ msgstr "Brandenburgo"
+
+#~ msgid "Saarland"
+#~ msgstr "Sarre"
+
+#~ msgid "Niedersachsen"
+#~ msgstr "Niedersachsen"
+
+#~ msgid "Hessen"
+#~ msgstr "Hessen"
+
+#~ msgid "Sachsen"
+#~ msgstr "Sachsen"
+
+#~ msgid "Thueringen"
+#~ msgstr "Turingia"
+
+#~ msgid "Schleswig-Holstein"
+#~ msgstr "Schleswig-Holstein"
+
+#~ msgid "Cumbria"
+#~ msgstr "Cumbria"
+
+#~ msgid "Herefordshire"
+#~ msgstr "Herefordshire"
+
+#~ msgid "Essex"
+#~ msgstr "Essex"
+
+#~ msgid "Buckinghamshire"
+#~ msgstr "Buckinghamshire"
+
+#~ msgid "Galicia"
+#~ msgstr "Galicia"
+
+#~ msgid "Mallorca"
+#~ msgstr "Mallorca"
+
+#~ msgid "England"
+#~ msgstr "Inglaterra"
+
+#~ msgid "Scandinavia"
+#~ msgstr "Escandinavia"
+
+#~ msgid "Cambridgeshire"
+#~ msgstr "Cambridgeshire"
+
+#~ msgid "Oxfordshire"
+#~ msgstr "Oxfordshire"
+
+#~ msgid "Nottinghamshire"
+#~ msgstr "Nottinghamshire"
+
+#~ msgid "Lancashire"
+#~ msgstr "Lancashire"
+
+#~ msgid "Kent"
+#~ msgstr "Kent"
+
+#~ msgid "Norfolk"
+#~ msgstr "Norfolk"
+
+#~ msgid "Leicestershire"
+#~ msgstr "Leicestershire"
+
+#~ msgid "Suffolk"
+#~ msgstr "Suffolk"
+
+#~ msgid "Somerset"
+#~ msgstr "Somerset"
+
+#~ msgid " (except Alaska and Hawaii)"
+#~ msgstr " (excepto Alaska y Hawái)"
+
+#~ msgid "USA"
+#~ msgstr "Estados Unidos de Norteamérica"
+
+#~ msgid "Hawaii"
+#~ msgstr "Hawái"
+
+#~ msgid "Alaska"
+#~ msgstr "Alaska"
+
+#~ msgid "Crete"
+#~ msgstr "Creta"
+
+#~ msgid "North America"
+#~ msgstr "Norteamérica"
+
+#~ msgid "Scotland"
+#~ msgstr "Escocia"
+
+#~ msgid "Wales"
+#~ msgstr "Gales"
+
+#~ msgid "Surrey"
+#~ msgstr "Surrey"
+
+#~ msgid "Wiltshire"
+#~ msgstr "Wiltshire"
+
+#~ msgid "Pacific"
+#~ msgstr "Pacífico"
+
+#~ msgid "South"
+#~ msgstr "Sur"
+
+#~ msgid "Arkansas"
+#~ msgstr "Arkansas"
+
+#~ msgid "District of Columbia"
+#~ msgstr "Distrito de Columbia"
+
+#~ msgid "Ohio"
+#~ msgstr "Ohio"
+
+#~ msgid "Michigan"
+#~ msgstr "Michigan"
+
+#~ msgid "Vermont"
+#~ msgstr "Vermont"
+
+#~ msgid "Massachusetts"
+#~ msgstr "Massachusetts"
+
+#~ msgid "Florida"
+#~ msgstr "Florida"
+
+#~ msgid "Louisiana"
+#~ msgstr "Luisiana"
+
+#~ msgid "Maryland"
+#~ msgstr "Maryland"
+
+#~ msgid "Oklahoma"
+#~ msgstr "Oklahoma"
+
+#~ msgid "Mississippi"
+#~ msgstr "Mississippi"
+
+#~ msgid "Texas"
+#~ msgstr "Tejas"
+
+#~ msgid "West Virginia"
+#~ msgstr "Virginia Occidental"
+
+#~ msgid "Virginia"
+#~ msgstr "Virginia"
+
+#~ msgid "Arizona"
+#~ msgstr "Arizona"
+
+#~ msgid "West"
+#~ msgstr "Oeste"
+
+#~ msgid "Washington State"
+#~ msgstr "Estado de Washington"
+
+#~ msgid "South+Middle America"
+#~ msgstr "Suramérica + Centroamérica"
+
+#~ msgid "Oregon"
+#~ msgstr "Oregón"
+
+#~ msgid "Utah"
+#~ msgstr "Utah"
+
+#~ msgid "Nevada"
+#~ msgstr "Nevada"
+
+#~ msgid "New Mexico"
+#~ msgstr "Nuevo Méjico"
+
+#~ msgid "Colorado"
+#~ msgstr "Colorado"
+
+#~ msgid "California"
+#~ msgstr "California"
+
+#~ msgid "Montana"
+#~ msgstr "Montana"
+
+#~ msgid "Idaho"
+#~ msgstr "Idaho"
+
+#~ msgid "Error downloading map!"
+#~ msgstr "Error al descargar el mapa"
+
+#~ msgid "Guyane Francaise"
+#~ msgstr "Guayana Francesa"
+
+#~ msgid "downloading"
+#~ msgstr "descargando"
+
+#~ msgid "Map download aborted!"
+#~ msgstr "Descarga del mapa interrumpida"
+
+#~ msgid "Error writing map!"
+#~ msgstr "Error al guardar el mapa"
+
+#~ msgid "Mittelfranken"
+#~ msgstr "Franconia Media"
+
+#~ msgid "Africa"
+#~ msgstr "África"
+
+#~ msgid "Map data (c) OpenStreetMap contributors, ODBL"
+#~ msgstr "Datos de Mapa (c) contribuyentes de OpenStreetMap, ODBL"
+
+#~ msgid "Ile-de-France"
+#~ msgstr "Isla de Francia"
+
+#~ msgid "Limousin"
+#~ msgstr "Limusina"
+
+#~ msgid "Pays-de-la-Loire"
+#~ msgstr "Países del Loira"
+
+#~ msgid "Poitou-Charentes"
+#~ msgstr "Poitou-Charentes"
+
+#~ msgid "Franche-Comte"
+#~ msgstr "Franco Condado"
+
+#~ msgid "Northeast"
+#~ msgstr "Noreste"
+
+#~ msgid "Midwest"
+#~ msgstr "Medio-Oeste"
+
+#~ msgid "Oberpfalz"
+#~ msgstr "Alto Palatinado"
+
+#~ msgid "Oberfranken"
+#~ msgstr "Alta Franconia"
+
+#~ msgid "Unterfranken"
+#~ msgstr "Baja Franconia"
+
+#~ msgid "Rheinland-Pfalz"
+#~ msgstr "Renania del Norte-Westfalia"
+
+#~ msgid "Mecklenburg-Vorpommern"
+#~ msgstr "Mecklemburgo-Pomerania"
+
+#~ msgid "Sachsen-Anhalt"
+#~ msgstr "Sajonia-Anhalt"
+
+#~ msgid "Nordrhein-westfalen"
+#~ msgstr "Renania del Norte-Westfalia"
+
+#~ msgid "South yorkshire"
+#~ msgstr "Yorkshire Sur"
+
+#~ msgid "Shropshire"
+#~ msgstr "Shropshire"
+
+#~ msgid "East yorkshire with hull"
+#~ msgstr "Yorkshire Este con Hull"
+
+#, c-format
#~ msgid "then leave the roundabout at the %1$s %2$s"
#~ msgstr "después salga de la rotonda por la %1$s %2$s"
+
+#~ msgid "Bayern"
+#~ msgstr "Baviera"
+
+#~ msgid "Niederbayern"
+#~ msgstr "Baja Baviera"
+
+#~ msgid "Oberbayern"
+#~ msgstr "Alta Baviera"
+
+#~ msgid "Distance from screen center (km)"
+#~ msgstr "Distancia del centro de la pantalla (km)"
+
+#, c-format
+#~ msgid "Set destination to %ld, %ld \n"
+#~ msgstr "Cambiar destino a %ld, %ld \n"
+
+#, c-format
+#~ msgid "Set map to %ld, %ld \n"
+#~ msgstr "Cambiar mapa a % ld, %ld \n"
+
+#, c-format
+#~ msgid "Set next visit to %ld, %ld \n"
+#~ msgstr "Conjunto siguiente visita a %ld, %ld \n"
+
+#~ msgid ""
+#~ "Current map location %s is not available\n"
+#~ "Please restart Navit after you attach an SD card or select a different map "
+#~ "location."
+#~ msgstr ""
+#~ "Ubicación actual del mapa %s no se encuentra disponible\n"
+#~ "Por favor reiniciar Navit después de conectar una tarjeta SD o seleccione "
+#~ "una ubicación del mapa diferente."
+
+#~ msgid ""
+#~ "Sorry, we currently do not support maps above 3.8G on Android, please select "
+#~ "a smaller one."
+#~ msgstr ""
+#~ "Lo sentimos, actualmente no permitimos mapas por encima de 3,8 G en Android, "
+#~ "por favor, seleccione una versión más pequeña."
+
+#~ msgid ""
+#~ "New location set to %s\n"
+#~ "Restart Navit to apply the changes."
+#~ msgstr ""
+#~ "Nueva ubicación cambiada a %s\n"
+#~ "Reinicie Navit para aplicar los cambios."
+
+#~ msgid "Media selected for map storage is not available"
+#~ msgstr ""
+#~ "Los medios de comunicación seleccionados para el almacenamiento del mapa no "
+#~ "está disponible"
+
+#, c-format
+#~ msgid "Error: No configuration found in config file '%s'\n"
+#~ msgstr ""
+#~ "Error: No se encontró la configuración en el archivo de configuración '%s'\n"
diff --git a/po/et.po.in b/po/et.po.in
index 23781e008..52fa1f929 100644
--- a/po/et.po.in
+++ b/po/et.po.in
@@ -1670,7 +1670,7 @@ msgstr "Takso"
msgid "Shopping"
msgstr "kauplus"
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/eu.po.in b/po/eu.po.in
index d0de74d5d..71158c04b 100644
--- a/po/eu.po.in
+++ b/po/eu.po.in
@@ -1665,7 +1665,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/fa.po.in b/po/fa.po.in
index 96767686f..0492353c8 100644
--- a/po/fa.po.in
+++ b/po/fa.po.in
@@ -1665,7 +1665,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/fi.po.in b/po/fi.po.in
index 5662696a4..d318c22ee 100644
--- a/po/fi.po.in
+++ b/po/fi.po.in
@@ -1675,7 +1675,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/fil.po.in b/po/fil.po.in
index a882e9f6d..ccf4cb877 100644
--- a/po/fil.po.in
+++ b/po/fil.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/fo.po.in b/po/fo.po.in
index f713a82aa..8c71ca69b 100644
--- a/po/fo.po.in
+++ b/po/fo.po.in
@@ -1665,7 +1665,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/fr.po.in b/po/fr.po.in
index 7ef62db68..0a561a1fe 100644
--- a/po/fr.po.in
+++ b/po/fr.po.in
@@ -1712,8 +1712,8 @@ msgstr "Taxi"
msgid "Shopping"
msgstr "Achats"
-msgid "Distance from screen center (km)"
-msgstr "Distance du centre de l'écran (km)"
+msgid "Select a search radius from screen center"
+msgstr "Distance du centre de l'écran"
#, c-format
msgid "POI %s. %s"
diff --git a/po/fr_CH.po.in b/po/fr_CH.po.in
index 68d798ee5..a32aa6ed6 100644
--- a/po/fr_CH.po.in
+++ b/po/fr_CH.po.in
@@ -1668,7 +1668,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/fy.po.in b/po/fy.po.in
index 5b3e798cb..9f13fe11a 100644
--- a/po/fy.po.in
+++ b/po/fy.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/gl.po.in b/po/gl.po.in
index e4cb41cd6..75a724aa7 100644
--- a/po/gl.po.in
+++ b/po/gl.po.in
@@ -1667,7 +1667,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/he.po.in b/po/he.po.in
index 2fb3df1eb..199ae7044 100644
--- a/po/he.po.in
+++ b/po/he.po.in
@@ -1668,7 +1668,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/hi.po.in b/po/hi.po.in
index ba0d20e10..2e5fa87f3 100644
--- a/po/hi.po.in
+++ b/po/hi.po.in
@@ -1665,7 +1665,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/hr.po.in b/po/hr.po.in
index c39cad97e..3f4a63f55 100644
--- a/po/hr.po.in
+++ b/po/hr.po.in
@@ -1670,7 +1670,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/hu.po.in b/po/hu.po.in
index c4ec926a7..6aa19c503 100644
--- a/po/hu.po.in
+++ b/po/hu.po.in
@@ -1682,7 +1682,7 @@ msgstr "Taxi"
msgid "Shopping"
msgstr "Bevásárlás"
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/id.po.in b/po/id.po.in
index 302b11212..45c74dc0d 100644
--- a/po/id.po.in
+++ b/po/id.po.in
@@ -1667,7 +1667,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/it.po.in b/po/it.po.in
index c2c557d7e..b3073d7b1 100644
--- a/po/it.po.in
+++ b/po/it.po.in
@@ -1684,8 +1684,8 @@ msgstr "Taxi"
msgid "Shopping"
msgstr "Negozi"
-msgid "Distance from screen center (km)"
-msgstr "Distanza dal centro dello schermo (km)"
+msgid "Select a search radius from screen center"
+msgstr "Distanza dal centro dello schermo"
#, c-format
msgid "POI %s. %s"
diff --git a/po/ja.po.in b/po/ja.po.in
index 66ce52328..5761862d0 100644
--- a/po/ja.po.in
+++ b/po/ja.po.in
@@ -1665,7 +1665,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/jv.po.in b/po/jv.po.in
index 500c5c750..56ae5c2a2 100644
--- a/po/jv.po.in
+++ b/po/jv.po.in
@@ -1665,7 +1665,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/kk.po.in b/po/kk.po.in
index 7f48773a4..65f250701 100644
--- a/po/kk.po.in
+++ b/po/kk.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/kn.po.in b/po/kn.po.in
index 7a1b13a20..6a2adc742 100644
--- a/po/kn.po.in
+++ b/po/kn.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/ko.po.in b/po/ko.po.in
index 4c908aa68..f65870083 100644
--- a/po/ko.po.in
+++ b/po/ko.po.in
@@ -1660,7 +1660,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/ku.po.in b/po/ku.po.in
index 22f79bbea..8073de5d7 100644
--- a/po/ku.po.in
+++ b/po/ku.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/lb.po.in b/po/lb.po.in
index a8e5450db..143cc2543 100644
--- a/po/lb.po.in
+++ b/po/lb.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/lt.po.in b/po/lt.po.in
index b1c4a4e68..626cb5bd4 100644
--- a/po/lt.po.in
+++ b/po/lt.po.in
@@ -1676,8 +1676,8 @@ msgstr "Taksi"
msgid "Shopping"
msgstr "Parduotuvė"
-msgid "Distance from screen center (km)"
-msgstr "Atstumas nuo ekrano vidaus (km)"
+msgid "Select a search radius from screen center"
+msgstr "Atstumas nuo ekrano vidaus"
#, c-format
msgid "POI %s. %s"
diff --git a/po/lv.po.in b/po/lv.po.in
index 8f729a8ca..d947bf182 100644
--- a/po/lv.po.in
+++ b/po/lv.po.in
@@ -1674,8 +1674,8 @@ msgstr "Taksometrs"
msgid "Shopping"
msgstr "Iepirkšanās"
-msgid "Distance from screen center (km)"
-msgstr "Attālums no ekrāna centra (km)"
+msgid "Select a search radius from screen center"
+msgstr "Attālums no ekrāna centra"
#, c-format
msgid "POI %s. %s"
diff --git a/po/mk.po.in b/po/mk.po.in
index d51a99fb3..4e5f164f1 100644
--- a/po/mk.po.in
+++ b/po/mk.po.in
@@ -1671,7 +1671,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/ml.po.in b/po/ml.po.in
index 3658437a3..27320e951 100644
--- a/po/ml.po.in
+++ b/po/ml.po.in
@@ -1666,7 +1666,7 @@ msgstr "ടാക്സി സ്റ്റാന്റ്"
msgid "Shopping"
msgstr "കച്ചവടസ്ഥാപനം"
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr "സ്ക്രീനിന്റെ നടുവില്‍ നിന്നുള്ള ദൂരം (കി. മി. )"
#, c-format
diff --git a/po/mn.po.in b/po/mn.po.in
index d9c7c7fff..8fa8def8e 100644
--- a/po/mn.po.in
+++ b/po/mn.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/mr.po.in b/po/mr.po.in
index 69acbd449..9fca9a747 100644
--- a/po/mr.po.in
+++ b/po/mr.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/nb.po.in b/po/nb.po.in
index 04b4436e0..7537c06b0 100644
--- a/po/nb.po.in
+++ b/po/nb.po.in
@@ -1672,7 +1672,7 @@ msgstr "Drosje"
msgid "Shopping"
msgstr "Handleområde"
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/nds.po.in b/po/nds.po.in
index 76b176302..4d6ea6993 100644
--- a/po/nds.po.in
+++ b/po/nds.po.in
@@ -1672,7 +1672,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/nl.po.in b/po/nl.po.in
index 92f587b6d..5e796b6b5 100644
--- a/po/nl.po.in
+++ b/po/nl.po.in
@@ -1686,8 +1686,8 @@ msgstr "Taxi"
msgid "Shopping"
msgstr "Winkelen"
-msgid "Distance from screen center (km)"
-msgstr "Afstand vanaf schem midden (km)"
+msgid "Select a search radius from screen center"
+msgstr "Afstand vanaf schem midden"
#, c-format
msgid "POI %s. %s"
diff --git a/po/nn.po.in b/po/nn.po.in
index b4d4c66e5..8c0a2514d 100644
--- a/po/nn.po.in
+++ b/po/nn.po.in
@@ -1666,7 +1666,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/pl.po.in b/po/pl.po.in
index cd4bf9dd5..e6d950141 100644
--- a/po/pl.po.in
+++ b/po/pl.po.in
@@ -1684,7 +1684,7 @@ msgstr "Postój taksówek"
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/pms.po.in b/po/pms.po.in
index e52ac59fb..971d5381b 100644
--- a/po/pms.po.in
+++ b/po/pms.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/pt.po.in b/po/pt.po.in
index 418c05136..58f2a7302 100644
--- a/po/pt.po.in
+++ b/po/pt.po.in
@@ -1689,8 +1689,8 @@ msgstr "Táxi"
msgid "Shopping"
msgstr "Compras"
-msgid "Distance from screen center (km)"
-msgstr "Distância ao centro do ecrã (km)"
+msgid "Select a search radius from screen center"
+msgstr "Distância ao centro do ecrã"
#, c-format
msgid "POI %s. %s"
diff --git a/po/pt_BR.po.in b/po/pt_BR.po.in
index 3c4d5c6d7..7248d436d 100644
--- a/po/pt_BR.po.in
+++ b/po/pt_BR.po.in
@@ -1693,8 +1693,8 @@ msgstr "Táxi"
msgid "Shopping"
msgstr "Comprando"
-msgid "Distance from screen center (km)"
-msgstr "Distância do centro da tela (km)"
+msgid "Select a search radius from screen center"
+msgstr "Distância do centro da tela"
#, c-format
msgid "POI %s. %s"
diff --git a/po/ro.po.in b/po/ro.po.in
index 28ac5f311..af94e5c83 100644
--- a/po/ro.po.in
+++ b/po/ro.po.in
@@ -1676,7 +1676,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/ru.po.in b/po/ru.po.in
index 0f1944e1d..2e140b8f2 100644
--- a/po/ru.po.in
+++ b/po/ru.po.in
@@ -1692,7 +1692,7 @@ msgstr "Такси"
msgid "Shopping"
msgstr "Магазин"
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr "Расстояние от центра экрана (км)"
#, c-format
diff --git a/po/sc.po.in b/po/sc.po.in
index 4c3fffbe6..12a7f7477 100644
--- a/po/sc.po.in
+++ b/po/sc.po.in
@@ -1664,7 +1664,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/si.po.in b/po/si.po.in
index 890eb0644..32a6d1db1 100644
--- a/po/si.po.in
+++ b/po/si.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/sk.po.in b/po/sk.po.in
index b11a80e2e..e8a6be27d 100644
--- a/po/sk.po.in
+++ b/po/sk.po.in
@@ -1678,7 +1678,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/sl.po.in b/po/sl.po.in
index 703178d83..803222366 100644
--- a/po/sl.po.in
+++ b/po/sl.po.in
@@ -1672,7 +1672,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/sq.po.in b/po/sq.po.in
index 58850e77b..1cb93ac25 100644
--- a/po/sq.po.in
+++ b/po/sq.po.in
@@ -1662,7 +1662,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/sr.po.in b/po/sr.po.in
index 00ec61b1d..9bc8414fa 100644
--- a/po/sr.po.in
+++ b/po/sr.po.in
@@ -1678,8 +1678,8 @@ msgstr "Такси"
msgid "Shopping"
msgstr "Куповина"
-msgid "Distance from screen center (km)"
-msgstr "Растојање од средишта екрана (km)"
+msgid "Select a search radius from screen center"
+msgstr "Растојање од средишта екрана"
#, c-format
msgid "POI %s. %s"
diff --git a/po/sv.po.in b/po/sv.po.in
index 8a4a292c4..752757fc6 100644
--- a/po/sv.po.in
+++ b/po/sv.po.in
@@ -1671,7 +1671,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/sw.po.in b/po/sw.po.in
index d1fe07e31..207f2a08f 100644
--- a/po/sw.po.in
+++ b/po/sw.po.in
@@ -1665,7 +1665,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/ta.po.in b/po/ta.po.in
index 74ba7a104..ff176435f 100644
--- a/po/ta.po.in
+++ b/po/ta.po.in
@@ -1665,7 +1665,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/te.po.in b/po/te.po.in
index eb412a536..240168138 100644
--- a/po/te.po.in
+++ b/po/te.po.in
@@ -1665,7 +1665,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/th.po.in b/po/th.po.in
index 58ac0335d..daf3a8093 100644
--- a/po/th.po.in
+++ b/po/th.po.in
@@ -1662,7 +1662,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/tr.po.in b/po/tr.po.in
index 1802c15a9..19ad72810 100644
--- a/po/tr.po.in
+++ b/po/tr.po.in
@@ -1685,7 +1685,7 @@ msgstr "Taksi"
msgid "Shopping"
msgstr "Alışveriş"
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/uk.po.in b/po/uk.po.in
index 787e71327..10422f902 100644
--- a/po/uk.po.in
+++ b/po/uk.po.in
@@ -1672,7 +1672,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/ur.po.in b/po/ur.po.in
index e1ffb4b51..cd9a0e884 100644
--- a/po/ur.po.in
+++ b/po/ur.po.in
@@ -1677,7 +1677,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/vi.po.in b/po/vi.po.in
index 54ec62618..91f5dbcf0 100644
--- a/po/vi.po.in
+++ b/po/vi.po.in
@@ -1664,7 +1664,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/zh_CN.po.in b/po/zh_CN.po.in
index 44f5e1cc3..27186f960 100644
--- a/po/zh_CN.po.in
+++ b/po/zh_CN.po.in
@@ -1668,7 +1668,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/zh_HK.po.in b/po/zh_HK.po.in
index 49fb73c01..9fe382c65 100644
--- a/po/zh_HK.po.in
+++ b/po/zh_HK.po.in
@@ -1666,7 +1666,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/zh_TW.po.in b/po/zh_TW.po.in
index bd136f1e8..6511c9154 100644
--- a/po/zh_TW.po.in
+++ b/po/zh_TW.po.in
@@ -1665,7 +1665,7 @@ msgstr "計程車"
msgid "Shopping"
msgstr "購物處"
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr "距螢幕中心的距離 (公里)"
#, c-format
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 000000000..5cac9edd2
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1 @@
+include 'navit:android'