Compare commits
178 Commits
Author | SHA1 | Date | |
---|---|---|---|
083dd39bef | |||
bd64ca4f57 | |||
b382a5e674 | |||
20687a1df7 | |||
bb82750e9b | |||
51e6058960 | |||
db3f111815 | |||
219311577f | |||
26d4770f47 | |||
db0d9ceffb | |||
fc9b01480c | |||
cd8f415615 | |||
824393879b | |||
f79f555d6f | |||
13e9a50d59 | |||
f1667e70b5 | |||
1ce347230b | |||
d4f3e293df | |||
7492b74aed | |||
71dbb176bb | |||
301107add1 | |||
60ae4c0268 | |||
bd76e508ae | |||
e9f7642cde | |||
5c73cb55cb | |||
c39298000d | |||
e17d7d4a8f | |||
65b74b146d | |||
b937b9f2cb | |||
d7fe0fa9bf | |||
9657104f50 | |||
5a692c71a8 | |||
e8ede272ae | |||
39a8a144dd | |||
02700a485d | |||
99ea19e35a | |||
a6bb0f1520 | |||
0a74684713 | |||
332a4d9393 | |||
db98f381b5 | |||
31a600638f | |||
2ff18bc373 | |||
c2e301f4e8 | |||
a25303fe98 | |||
2bee8656a4 | |||
4a31f6f76d | |||
eaef588443 | |||
87a808265e | |||
a39cef2abd | |||
960827e92b | |||
7de1b84f77 | |||
4b1fa13429 | |||
f10857eddc | |||
781fc22113 | |||
9ced0fd3a7 | |||
3e71d1b785 | |||
491bf5614b | |||
fc873719e1 | |||
99c3edddfd | |||
fde8ad620b | |||
7855c69729 | |||
8749be9103 | |||
7432459c93 | |||
6f9f49a435 | |||
eda5046518 | |||
b867ce9a7f | |||
cfdb12c4ae | |||
9436f98023 | |||
c89137204e | |||
905f80b1ce | |||
e707cc30ad | |||
4ef1fa77f8 | |||
df104b16c6 | |||
8f9049a8d4 | |||
d483cd35cd | |||
c2b09df118 | |||
9957e1834e | |||
7e537d819a | |||
8d1be76043 | |||
b68567f000 | |||
09a5f57109 | |||
ca8ff6c7ee | |||
e9c15ef956 | |||
e39f0881ab | |||
6f05d38d31 | |||
9cb91a35ef | |||
bb0073d7e7 | |||
3291ea86ef | |||
97d646bb19 | |||
672df4255e | |||
3fcf04daf7 | |||
3daab92b84 | |||
89f384feed | |||
fc555fd7d0 | |||
d58322b412 | |||
70222f4ae2 | |||
fe1aaa73a0 | |||
57741f8c2d | |||
6eb3a4f7de | |||
295a89b3cc | |||
dc3fdc4c3b | |||
3867b723a9 | |||
d7fc400d73 | |||
f8f6859e7d | |||
2501f834c8 | |||
3f4b70ee48 | |||
384d20b1a5 | |||
b4a06057f8 | |||
9f14eb7e70 | |||
dcf1c686e5 | |||
a8d183639e | |||
d9e025a18c | |||
0a9077545b | |||
bbc1d43290 | |||
524d72ce3c | |||
9f74bbb27a | |||
ce34d449c2 | |||
21dbd3958d | |||
92ac7c0c10 | |||
1f71b3a3b2 | |||
27886ea96a | |||
3176271955 | |||
d4b46a4bb6 | |||
3b2d4dcd31 | |||
de196e8281 | |||
f376f7139b | |||
9fe10f10b8 | |||
cdc9e51696 | |||
975d9816f4 | |||
187a909b4f | |||
1e6a49673e | |||
3b7905fe8c | |||
f70a4536b2 | |||
b989d0e086 | |||
c3deab5369 | |||
f49e0223b2 | |||
96940c28d4 | |||
e9ebc999fd | |||
c724bf134c | |||
203f44b75a | |||
d0edd825cf | |||
e3013bf815 | |||
d4fd60b1d8 | |||
ba2347f363 | |||
93a912a34a | |||
fb779840ce | |||
dd183edd8d | |||
679bae0d67 | |||
8fb4acc4c2 | |||
6194519b18 | |||
3ce3de119b | |||
872ecdfa58 | |||
121a262ea1 | |||
06c9fbd849 | |||
aa928d96e0 | |||
004e9bfef3 | |||
34de55cf0c | |||
c0e458a437 | |||
33739acafe | |||
fe4eed8aa2 | |||
f5ca757348 | |||
476f26752f | |||
588859ca3a | |||
cc8d237786 | |||
5dde297210 | |||
d1469290cf | |||
51d4284ebe | |||
531eb256f1 | |||
79388aa753 | |||
2980299a2a | |||
796e61ada4 | |||
90473300e0 | |||
5706cdcfa1 | |||
d794ee4b22 | |||
262ee5bb5f | |||
5547cf668e | |||
dd9e42ad27 | |||
e192116191 |
@ -1,14 +1,14 @@
|
||||
version: 5.15.{build}
|
||||
version: 6.0.{build}
|
||||
configuration: Release
|
||||
platform: Any CPU
|
||||
environment:
|
||||
NSISDIR: C:\Program Files (x86)\NSIS
|
||||
matrix:
|
||||
- QTDIR: C:\Qt\5.9\msvc2015
|
||||
- QTDIR: C:\Qt\5.11\msvc2015
|
||||
PLATFORM: x86
|
||||
NSI: gpxsee.nsi
|
||||
OPENSSLDIR: C:\OpenSSL-Win32\bin
|
||||
- QTDIR: C:\Qt\5.9\msvc2015_64
|
||||
- QTDIR: C:\Qt\5.11\msvc2015_64
|
||||
PLATFORM: x86_amd64
|
||||
NSI: gpxsee64.nsi
|
||||
OPENSSLDIR: C:\OpenSSL-Win64\bin
|
||||
|
20
README.md
@ -1,25 +1,31 @@
|
||||
# GPXSee
|
||||
GPXSee is a Qt-based GPS log file viewer and analyzer that supports GPX, TCX,
|
||||
KML, FIT, IGC, NMEA and OziExplorer files.
|
||||
KML, FIT, IGC, NMEA, SLF, LOC and OziExplorer files.
|
||||
|
||||
## Features
|
||||
* User-definable online maps (OSM/Google tiles, WMTS, WMS).
|
||||
* Offline maps (OziExplorer maps, TrekBuddy maps/atlases, Garmin JNX maps, GeoTIFF images).
|
||||
* Elevation, speed, heart rate, cadence, power and temperature graphs.
|
||||
* Elevation, speed, heart rate, cadence, power, temperature and gear ratio/shifts graphs.
|
||||
* Support for multiple tracks in one view.
|
||||
* Support for POI files.
|
||||
* Print/export to PDF.
|
||||
* Full-screen mode.
|
||||
* HiDPI/Retina displays & maps support.
|
||||
* Native GUI for Windows, Mac OS X and Linux.
|
||||
* Opens GPX, TCX, FIT, KML, IGC, NMEA, OziExplorer (PLT, RTE, WPT) and Garmin CSV files.
|
||||
* Opens GPX, TCX, FIT, KML, IGC, NMEA, SLF, LOC, OziExplorer (PLT, RTE, WPT) and Garmin CSV files.
|
||||
|
||||

|
||||
|
||||
## Build
|
||||
Build requirements:
|
||||
* Qt 4.8 or QT 5.x (Qt >= 5.10.1 recommended for all features)
|
||||
* C++03 compiler (tested: msvc2015, gcc >= 4.8, clang/Apple LLVM version 8.1.0)
|
||||
|
||||
Build steps:
|
||||
```shell
|
||||
lrelease gpxsee.pro
|
||||
qmake gpxsee.pro
|
||||
make
|
||||
make # nmake on windows
|
||||
```
|
||||
|
||||
## Download
|
||||
@ -31,3 +37,9 @@ make
|
||||
|
||||
## Homepage
|
||||
http://www.gpxsee.org
|
||||
|
||||
## Maps
|
||||
[GPXSee maps repository](https://github.com/tumic0/GPXSee-maps)
|
||||
|
||||
## Translations
|
||||
GPXSee uses [Weblate](https://hosted.weblate.org/projects/gpxsee) for translations.
|
||||
|
58
gpxsee.pro
@ -1,12 +1,17 @@
|
||||
TARGET = GPXSee
|
||||
VERSION = 5.15
|
||||
VERSION = 6.0
|
||||
|
||||
QT += core \
|
||||
gui \
|
||||
network
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += printsupport
|
||||
lessThan(QT_VERSION, 5.4): QT += opengl
|
||||
macx: QT += opengl
|
||||
network \
|
||||
sql
|
||||
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||
QT += widgets
|
||||
QT += printsupport
|
||||
}
|
||||
lessThan(QT_MAJOR_VERSION, 5) {QT += opengl}
|
||||
equals(QT_MAJOR_VERSION, 5) : lessThan(QT_MINOR_VERSION, 4) {QT += opengl}
|
||||
|
||||
INCLUDEPATH += ./src
|
||||
HEADERS += src/config.h \
|
||||
src/common/staticassert.h \
|
||||
@ -85,7 +90,7 @@ HEADERS += src/config.h \
|
||||
src/map/downloader.h \
|
||||
src/map/tile.h \
|
||||
src/map/emptymap.h \
|
||||
src/map/offlinemap.h \
|
||||
src/map/ozimap.h \
|
||||
src/map/tar.h \
|
||||
src/map/ozf.h \
|
||||
src/map/atlas.h \
|
||||
@ -132,7 +137,15 @@ HEADERS += src/config.h \
|
||||
src/map/geocentric.h \
|
||||
src/map/mercator.h \
|
||||
src/map/jnxmap.h \
|
||||
src/map/krovak.h
|
||||
src/map/krovak.h \
|
||||
src/GUI/kv.h \
|
||||
src/data/locparser.h \
|
||||
src/data/slfparser.h \
|
||||
src/map/geotiffmap.h \
|
||||
src/map/image.h \
|
||||
src/common/greatcircle.h \
|
||||
src/map/mbtilesmap.h \
|
||||
src/map/osm.h
|
||||
SOURCES += src/main.cpp \
|
||||
src/common/coordinates.cpp \
|
||||
src/common/rectc.cpp \
|
||||
@ -185,7 +198,7 @@ SOURCES += src/main.cpp \
|
||||
src/map/onlinemap.cpp \
|
||||
src/map/downloader.cpp \
|
||||
src/map/emptymap.cpp \
|
||||
src/map/offlinemap.cpp \
|
||||
src/map/ozimap.cpp \
|
||||
src/map/tar.cpp \
|
||||
src/map/atlas.cpp \
|
||||
src/map/ozf.cpp \
|
||||
@ -233,20 +246,31 @@ SOURCES += src/main.cpp \
|
||||
src/map/mercator.cpp \
|
||||
src/map/jnxmap.cpp \
|
||||
src/map/krovak.cpp \
|
||||
src/map/map.cpp
|
||||
src/map/map.cpp \
|
||||
src/data/locparser.cpp \
|
||||
src/data/slfparser.cpp \
|
||||
src/map/geotiffmap.cpp \
|
||||
src/map/image.cpp \
|
||||
src/common/greatcircle.cpp \
|
||||
src/map/mbtilesmap.cpp \
|
||||
src/map/osm.cpp
|
||||
|
||||
RESOURCES += gpxsee.qrc
|
||||
TRANSLATIONS = lang/gpxsee_cs.ts \
|
||||
TRANSLATIONS = lang/gpxsee_en.ts \
|
||||
lang/gpxsee_cs.ts \
|
||||
lang/gpxsee_sv.ts \
|
||||
lang/gpxsee_de.ts \
|
||||
lang/gpxsee_ru.ts \
|
||||
lang/gpxsee_fi.ts \
|
||||
lang/gpxsee_fr.ts \
|
||||
lang/gpxsee_pl.ts
|
||||
|
||||
macx {
|
||||
ICON = icons/gpxsee.icns
|
||||
QMAKE_INFO_PLIST = pkg/Info.plist
|
||||
LOCALE.path = Contents/Resources/translations
|
||||
LOCALE.files = lang/gpxsee_cs.qm \
|
||||
LOCALE.files = lang/gpxsee_en.qm \
|
||||
lang/gpxsee_cs.qm \
|
||||
lang/gpxsee_de.qm \
|
||||
lang/gpxsee_fi.qm \
|
||||
lang/gpxsee_fr.qm \
|
||||
@ -266,7 +290,9 @@ macx {
|
||||
icons/nmea.icns \
|
||||
icons/plt.icns \
|
||||
icons/rte.icns \
|
||||
icons/wpt.icns
|
||||
icons/wpt.icns \
|
||||
icons/loc.icns \
|
||||
icons/slf.icns
|
||||
QMAKE_BUNDLE_DATA += LOCALE MAPS ICONS CSV
|
||||
}
|
||||
win32 {
|
||||
@ -279,7 +305,11 @@ win32 {
|
||||
icons/nmea.ico \
|
||||
icons/plt.ico \
|
||||
icons/rte.ico \
|
||||
icons/wpt.ico
|
||||
icons/wpt.ico \
|
||||
icons/loc.ico \
|
||||
icons/slf.ico
|
||||
DEFINES += _USE_MATH_DEFINES
|
||||
}
|
||||
|
||||
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
|
||||
DEFINES *= QT_USE_QSTRINGBUILDER
|
||||
|
66
gpxsee.qrc
@ -1,24 +1,46 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>icons/dialog-close.png</file>
|
||||
<file>icons/document-open.png</file>
|
||||
<file>icons/document-print.png</file>
|
||||
<file>icons/document-export.png</file>
|
||||
<file>icons/flag.png</file>
|
||||
<file>icons/gpxsee.png</file>
|
||||
<file>icons/application-exit.png</file>
|
||||
<file>icons/applications-internet.png</file>
|
||||
<file>icons/view-refresh.png</file>
|
||||
<file>icons/arrow-left.png</file>
|
||||
<file>icons/arrow-right.png</file>
|
||||
<file>icons/arrow-left-double.png</file>
|
||||
<file>icons/arrow-right-double.png</file>
|
||||
<file>icons/view-fullscreen.png</file>
|
||||
<file>icons/office-chart-line.png</file>
|
||||
<file>icons/preferences-desktop-display.png</file>
|
||||
<file>icons/flag_48.png</file>
|
||||
<file>icons/system-run.png</file>
|
||||
<file>icons/document-print-preview.png</file>
|
||||
<file>icons/view-filter.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/">
|
||||
<file>icons/dialog-close.png</file>
|
||||
<file>icons/dialog-close@2x.png</file>
|
||||
<file>icons/document-open.png</file>
|
||||
<file>icons/document-open@2x.png</file>
|
||||
<file>icons/document-print.png</file>
|
||||
<file>icons/document-print@2x.png</file>
|
||||
<file>icons/document-export.png</file>
|
||||
<file>icons/document-export@2x.png</file>
|
||||
<file>icons/flag.png</file>
|
||||
<file>icons/flag@2x.png</file>
|
||||
<file>icons/gpxsee.png</file>
|
||||
<file>icons/gpxsee@2x.png</file>
|
||||
<file>icons/application-exit.png</file>
|
||||
<file>icons/application-exit@2x.png</file>
|
||||
<file>icons/applications-internet.png</file>
|
||||
<file>icons/applications-internet@2x.png</file>
|
||||
<file>icons/view-refresh.png</file>
|
||||
<file>icons/view-refresh@2x.png</file>
|
||||
<file>icons/arrow-left.png</file>
|
||||
<file>icons/arrow-left@2x.png</file>
|
||||
<file>icons/arrow-right.png</file>
|
||||
<file>icons/arrow-right@2x.png</file>
|
||||
<file>icons/arrow-left-double.png</file>
|
||||
<file>icons/arrow-left-double@2x.png</file>
|
||||
<file>icons/arrow-right-double.png</file>
|
||||
<file>icons/arrow-right-double@2x.png</file>
|
||||
<file>icons/view-fullscreen.png</file>
|
||||
<file>icons/view-fullscreen@2x.png</file>
|
||||
<file>icons/office-chart-line.png</file>
|
||||
<file>icons/office-chart-line@2x.png</file>
|
||||
<file>icons/format-stroke-color.png</file>
|
||||
<file>icons/format-stroke-color@2x.png</file>
|
||||
<file>icons/flag_32.png</file>
|
||||
<file>icons/flag_32@2x.png</file>
|
||||
<file>icons/preferences-system.png</file>
|
||||
<file>icons/preferences-system@2x.png</file>
|
||||
<file>icons/document-print_32.png</file>
|
||||
<file>icons/document-print_32@2x.png</file>
|
||||
<file>icons/view-filter.png</file>
|
||||
<file>icons/view-filter@2x.png</file>
|
||||
<file>icons/applications-internet_32.png</file>
|
||||
<file>icons/applications-internet_32@2x.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
BIN
icons/application-exit@2x.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
icons/applications-internet@2x.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
icons/applications-internet_32.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
icons/applications-internet_32@2x.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
icons/arrow-left-double@2x.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
icons/arrow-left@2x.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
icons/arrow-right-double@2x.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
icons/arrow-right@2x.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
icons/dialog-close@2x.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
icons/document-export@2x.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 796 B After Width: | Height: | Size: 1.1 KiB |
BIN
icons/document-open@2x.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 3.3 KiB |
BIN
icons/document-print@2x.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
icons/document-print_32.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
icons/document-print_32@2x.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
icons/fit.icns
BIN
icons/fit.ico
Before Width: | Height: | Size: 302 KiB After Width: | Height: | Size: 302 KiB |
BIN
icons/flag@2x.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
icons/flag_32.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
icons/flag_32@2x.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 7.1 KiB |
BIN
icons/format-stroke-color.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
icons/format-stroke-color@2x.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
icons/gpx.icns
BIN
icons/gpx.ico
Before Width: | Height: | Size: 305 KiB After Width: | Height: | Size: 305 KiB |
BIN
icons/gpxsee@2x.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
icons/igc.icns
BIN
icons/igc.ico
Before Width: | Height: | Size: 304 KiB After Width: | Height: | Size: 304 KiB |
BIN
icons/kml.icns
BIN
icons/kml.ico
Before Width: | Height: | Size: 304 KiB After Width: | Height: | Size: 304 KiB |
BIN
icons/loc.icns
Normal file
BIN
icons/loc.ico
Normal file
After Width: | Height: | Size: 305 KiB |
BIN
icons/nmea.icns
BIN
icons/nmea.ico
Before Width: | Height: | Size: 304 KiB After Width: | Height: | Size: 305 KiB |
BIN
icons/office-chart-line@2x.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
icons/plt.icns
BIN
icons/plt.ico
Before Width: | Height: | Size: 302 KiB After Width: | Height: | Size: 302 KiB |
Before Width: | Height: | Size: 3.3 KiB |
BIN
icons/preferences-system.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
icons/preferences-system@2x.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
icons/rte.icns
BIN
icons/rte.ico
Before Width: | Height: | Size: 303 KiB After Width: | Height: | Size: 302 KiB |
11
icons/scripts/extensions
Normal file
@ -0,0 +1,11 @@
|
||||
fit:#006600
|
||||
gpx:#003399
|
||||
igc:#ff3300
|
||||
kml:#990000
|
||||
nmea:#0083d7
|
||||
plt:#66ff00
|
||||
rte:#66ff00
|
||||
tcx:#ffcc00
|
||||
wpt:#66ff00
|
||||
loc:#556677
|
||||
slf:#881199
|
@ -1,9 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
EXTENSIONS="fit:#006600 gpx:#003399 igc:#ff3300 kml:#990000 nmea:#0083d7 \
|
||||
plt:#66ff00 rte:#66ff00 tcx:#ffcc00 wpt:#66ff00"
|
||||
|
||||
for e in $EXTENSIONS; do
|
||||
while read e; do
|
||||
IFS=":"; set $e
|
||||
|
||||
EXT=`echo $1 | tr /a-z/ /A-Z/`
|
||||
@ -25,4 +22,4 @@ for e in $EXTENSIONS; do
|
||||
|
||||
iconutil -c icns -o $1.icns "$ICONSET"
|
||||
rm -R "$ICONSET" $1.svg
|
||||
done
|
||||
done < extensions
|
||||
|
@ -1,13 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
EXTENSIONS="fit:#006600 gpx:#003399 igc:#ff3300 kml:#990000 nmea:#0083d7 \
|
||||
plt:#66ff00 rte:#66ff00 tcx:#ffcc00 wpt:#66ff00"
|
||||
|
||||
for e in $EXTENSIONS; do
|
||||
while read e; do
|
||||
IFS=":"; set $e
|
||||
|
||||
EXT=`echo $1 | tr /a-z/ /A-Z/`
|
||||
sed -e "s/\$EXTENSION/$EXT/" -e "s/\$COLOR/$2/" icon-template.svg > $1.svg
|
||||
convert -density 400 $1.svg -define icon:auto-resize $1.ico
|
||||
rm $1.svg
|
||||
done
|
||||
done < extensions
|
||||
|
@ -12,6 +12,9 @@
|
||||
</g>
|
||||
<g transform="translate(16.573463,124.9782)">
|
||||
<rect y="0" x="0" id="textrect" height="50" width="120" style="fill:$COLOR;fill-opacity:1;stroke:none;"/>
|
||||
<text y="28" x="60" dominant-baseline="central" text-anchor="middle" style="fill:#FFFFFF;font-size:39px;font-family:sans-serif;font-weight:bold;">$EXTENSION</text>
|
||||
<!--
|
||||
<text y="28" x="60" dominant-baseline="central" text-anchor="middle" style="fill:#FFFFFF;font-size:39px;font-family:Helvetica;font-weight:bold;">$EXTENSION</text>
|
||||
-->
|
||||
<text y="25" x="60" dy="0.36em" text-anchor="middle" style="fill:#FFFFFF;font-size:39px;font-family:Helvetica;font-weight:bold;">$EXTENSION</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.5 KiB |
BIN
icons/slf.icns
Normal file
BIN
icons/slf.ico
Normal file
After Width: | Height: | Size: 304 KiB |
Before Width: | Height: | Size: 3.1 KiB |
BIN
icons/tcx.icns
BIN
icons/tcx.ico
Before Width: | Height: | Size: 304 KiB After Width: | Height: | Size: 304 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 885 B |
BIN
icons/view-filter@2x.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
icons/view-fullscreen@2x.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
icons/view-refresh@2x.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
icons/wpt.icns
BIN
icons/wpt.ico
Before Width: | Height: | Size: 304 KiB After Width: | Height: | Size: 304 KiB |
1747
lang/gpxsee_da.ts
Normal file
14
lang/gpxsee_en.ts
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="en_US">
|
||||
<context>
|
||||
<name>GUI</name>
|
||||
<message numerus="yes">
|
||||
<source>%n files</source>
|
||||
<translation>
|
||||
<numerusform>%n file</numerusform>
|
||||
<numerusform>%n files</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
1747
lang/gpxsee_no.ts
Normal file
@ -67,6 +67,38 @@
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>loc</string>
|
||||
</array>
|
||||
<key>CFBundleTypeMIMETypes</key>
|
||||
<array>
|
||||
<string>application/loc+xml</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>icons/loc.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Geocaching.com Waypoint File</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>slf</string>
|
||||
</array>
|
||||
<key>CFBundleTypeMIMETypes</key>
|
||||
<array>
|
||||
<string>application/slf+xml</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>icons/slf.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Sigma Log Format</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
@ -230,6 +262,48 @@
|
||||
<string>application/vnd.google-earth.kml+xml</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.geocaching.loc</string>
|
||||
<key>UTTypeReferenceURL</key>
|
||||
<string>https://www.geocaching.com</string>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Geocaching.com Waypoint File</string>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.xml</string>
|
||||
</array>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>loc</string>
|
||||
</array>
|
||||
<key>public.mime-type</key>
|
||||
<string>application/loc+xml</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.sigmasport.slf</string>
|
||||
<key>UTTypeReferenceURL</key>
|
||||
<string>https://www.sigmasport.com</string>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Sigma Log Format</string>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.xml</string>
|
||||
</array>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>slf</string>
|
||||
</array>
|
||||
<key>public.mime-type</key>
|
||||
<string>application/slf+xml</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.thisisant.fit</string>
|
||||
|
@ -1847,6 +1847,7 @@ RSRGD2000 / PCLC2000,5481,4764,5477,9001,9802,4500,8821,-71.3,9110,8822,166,9110
|
||||
RGAF09 / UTM zone 20N,5490,5489,16020,9001,9807,4400,8801,0,9102,8802,-63,9102,8805,0.9996,9201,8806,500000,9001,8807,0,9001,,,,,,
|
||||
S-JTSK / Krovak,5513,4156,5509,9001,9819,6501,1036,30.1717303,9110,8806,0,9001,8807,0,9001,8811,49.3,9110,8818,78.3,9110,8819,0.9999,9201,8833,24.5,9110
|
||||
S-JTSK / Krovak East North,5514,4156,5510,9001,1041,4499,1036,30.1717303,9110,8806,0,9001,8807,0,9001,8811,49.3,9110,8818,78.3,9110,8819,0.9999,9201,8833,24.5,9110
|
||||
S-JTSK / Krovak East North,102067,4156,5510,9001,1041,4499,1036,30.1717303,9110,8806,0,9001,8807,0,9001,8811,49.3,9110,8818,78.3,9110,8819,0.9999,9201,8833,24.5,9110
|
||||
CI1971 / Chatham Islands Map Grid,5518,4672,5517,9001,9807,4500,8801,-44,9110,8802,-176.3,9110,8805,1,9201,8806,350000,9001,8807,650000,9001,,,,,,
|
||||
CI1979 / Chatham Islands Map Grid,5519,4673,5517,9001,9807,4500,8801,-44,9110,8802,-176.3,9110,8805,1,9201,8806,350000,9001,8807,650000,9001,,,,,,
|
||||
DHDN / 3-degree Gauss-Kruger zone 1,5520,4314,16261,9001,9807,4530,8801,0,9102,8802,3,9102,8805,1,9201,8806,1500000,9001,8807,0,9001,,,,,,
|
||||
|
Can't render this file because it is too large.
|
@ -11,4 +11,4 @@ Icon=gpxsee
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Graphics;Viewer;Maps;Qt;
|
||||
MimeType=application/gpx+xml;application/tcx+xml;application/vnd.ant.fit;application/vnd.google-earth.kml+xml;application/vnd.fai.igc;application/vnd.nmea.nmea;application/vnd.oziexplorer.plt;application/vnd.oziexplorer.rte;application/vnd.oziexplorer.wpt;
|
||||
MimeType=application/gpx+xml;application/tcx+xml;application/vnd.ant.fit;application/vnd.google-earth.kml+xml;application/vnd.fai.igc;application/vnd.nmea.nmea;application/vnd.oziexplorer.plt;application/vnd.oziexplorer.rte;application/vnd.oziexplorer.wpt;application/loc+xml;application/slf+xml;
|
||||
|
158
pkg/gpxsee.nsi
@ -2,10 +2,35 @@
|
||||
!include "x64.nsh"
|
||||
!include "WinVer.nsh"
|
||||
|
||||
|
||||
; Macros
|
||||
!macro FILE_ASSOCIATION_ADD EXT DESC ICON
|
||||
WriteRegStr HKCR ".${EXT}" "" "GPXSee.${EXT}"
|
||||
WriteRegStr HKCR "GPXSee.${EXT}" "" "${DESC}"
|
||||
WriteRegStr HKCR "GPXSee.${EXT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,${ICON}"
|
||||
WriteRegStr HKCR "GPXSee.${EXT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
!macroend
|
||||
|
||||
!macro FILE_ASSOCIATION_REMOVE EXT
|
||||
DeleteRegKey HKCR "GPXSee.${EXT}"
|
||||
DeleteRegKey HKCR ".${EXT}"
|
||||
!macroend
|
||||
|
||||
!macro LOCALIZATION LANG CODE
|
||||
Section "${LANG}"
|
||||
CreateDirectory "$INSTDIR\translations"
|
||||
File /oname=translations\gpxsee_${CODE}.qm translations\gpxsee_${CODE}.qm
|
||||
!if /FileExists translations\qt_${CODE}.qm
|
||||
File /oname=translations\qt_${CODE}.qm translations\qt_${CODE}.qm
|
||||
!endif
|
||||
SectionEnd
|
||||
!macroend
|
||||
|
||||
|
||||
; The name of the installer
|
||||
Name "GPXSee"
|
||||
; Program version
|
||||
!define VERSION "5.15"
|
||||
!define VERSION "6.0"
|
||||
|
||||
; The file to write
|
||||
OutFile "GPXSee-${VERSION}.exe"
|
||||
@ -32,16 +57,6 @@ InstallDirRegKey HKLM "Software\GPXSee" "Install_Dir"
|
||||
|
||||
; Registry key for uninstaller
|
||||
!define REGENTRY "Software\Microsoft\Windows\CurrentVersion\Uninstall\GPXSee"
|
||||
; File types registry entries
|
||||
!define REGGPX "GPXSee.gpx"
|
||||
!define REGTCX "GPXSee.tcx"
|
||||
!define REGKML "GPXSee.kml"
|
||||
!define REGFIT "GPXSee.fit"
|
||||
!define REGIGC "GPXSee.igc"
|
||||
!define REGNMEA "GPXSee.nmea"
|
||||
!define REGPLT "GPXSee.plt"
|
||||
!define REGRTE "GPXSee.rte"
|
||||
!define REGWPT "GPXSee.wpt"
|
||||
|
||||
; Start menu page configuration
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
|
||||
@ -114,43 +129,17 @@ Section "GPXSee" SEC_APP
|
||||
|
||||
; Associate file formats
|
||||
DetailPrint "Associating file types..."
|
||||
WriteRegStr HKCR ".gpx" "" "${REGGPX}"
|
||||
WriteRegStr HKCR "${REGGPX}" "" "GPS Exchange Format"
|
||||
WriteRegStr HKCR "${REGGPX}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,2"
|
||||
WriteRegStr HKCR "${REGGPX}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".tcx" "" "${REGTCX}"
|
||||
WriteRegStr HKCR "${REGTCX}" "" "Training Center XML"
|
||||
WriteRegStr HKCR "${REGTCX}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,3"
|
||||
WriteRegStr HKCR "${REGTCX}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".kml" "" "${REGKML}"
|
||||
WriteRegStr HKCR "${REGKML}" "" "Keyhole Markup Language"
|
||||
WriteRegStr HKCR "${REGKML}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,4"
|
||||
WriteRegStr HKCR "${REGKML}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".fit" "" "${REGFIT}"
|
||||
WriteRegStr HKCR "${REGFIT}" "" "Flexible and Interoperable Data Transfer"
|
||||
WriteRegStr HKCR "${REGFIT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,5"
|
||||
WriteRegStr HKCR "${REGFIT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".igc" "" "${REGIGC}"
|
||||
WriteRegStr HKCR "${REGIGC}" "" "Flight Recorder Data Format"
|
||||
WriteRegStr HKCR "${REGIGC}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,6"
|
||||
WriteRegStr HKCR "${REGIGC}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".nmea" "" "${REGNMEA}"
|
||||
WriteRegStr HKCR "${REGNMEA}" "" "NMEA 0183 data"
|
||||
WriteRegStr HKCR "${REGNMEA}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,7"
|
||||
WriteRegStr HKCR "${REGNMEA}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".plt" "" "${REGPLT}"
|
||||
WriteRegStr HKCR "${REGPLT}" "" "OziExplorer Track Point File"
|
||||
WriteRegStr HKCR "${REGPLT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,8"
|
||||
WriteRegStr HKCR "${REGPLT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".rte" "" "${REGRTE}"
|
||||
WriteRegStr HKCR "${REGRTE}" "" "OziExplorer Route File"
|
||||
WriteRegStr HKCR "${REGRTE}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,9"
|
||||
WriteRegStr HKCR "${REGRTE}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".wpt" "" "${REGWPT}"
|
||||
WriteRegStr HKCR "${REGWPT}" "" "OziExplorer Waypoint File"
|
||||
WriteRegStr HKCR "${REGWPT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,1"
|
||||
WriteRegStr HKCR "${REGWPT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
|
||||
!insertmacro FILE_ASSOCIATION_ADD "gpx" "GPS Exchange Format" 4
|
||||
!insertmacro FILE_ASSOCIATION_ADD "tcx" "Training Center XML" 5
|
||||
!insertmacro FILE_ASSOCIATION_ADD "kml" "Keyhole Markup Language" 6
|
||||
!insertmacro FILE_ASSOCIATION_ADD "fit" "Flexible and Interoperable Data Transfer" 7
|
||||
!insertmacro FILE_ASSOCIATION_ADD "igc" "Flight Recorder Data Format" 8
|
||||
!insertmacro FILE_ASSOCIATION_ADD "nmea" "NMEA 0183 data" 9
|
||||
!insertmacro FILE_ASSOCIATION_ADD "plt" "OziExplorer Track Point File" 10
|
||||
!insertmacro FILE_ASSOCIATION_ADD "rte" "OziExplorer Route File" 11
|
||||
!insertmacro FILE_ASSOCIATION_ADD "wpt" "OziExplorer Waypoint File" 1
|
||||
!insertmacro FILE_ASSOCIATION_ADD "loc" "Geocaching.com Waypoint File" 2
|
||||
!insertmacro FILE_ASSOCIATION_ADD "slf" "Sigma Log File" 3
|
||||
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
|
||||
|
||||
SectionEnd
|
||||
@ -164,9 +153,12 @@ Section "QT framework" SEC_QT
|
||||
File "Qt5Widgets.dll"
|
||||
File "Qt5PrintSupport.dll"
|
||||
File "Qt5Network.dll"
|
||||
File "Qt5Sql.dll"
|
||||
File /r "platforms"
|
||||
File /r "imageformats"
|
||||
File /r "printsupport"
|
||||
File /r "styles"
|
||||
File /r "sqldrivers"
|
||||
|
||||
SectionEnd
|
||||
|
||||
@ -210,40 +202,13 @@ Section "ANGLE" SEC_ANGLE
|
||||
SectionEnd
|
||||
|
||||
SectionGroup "Localization" SEC_LOCALIZATION
|
||||
Section "Czech"
|
||||
CreateDirectory "$INSTDIR\translations"
|
||||
File /oname=translations\gpxsee_cs.qm translations\gpxsee_cs.qm
|
||||
File /oname=translations\qt_cs.qm translations\qt_cs.qm
|
||||
SectionEnd
|
||||
Section "Finnish"
|
||||
CreateDirectory "$INSTDIR\translations"
|
||||
File /oname=translations\gpxsee_fi.qm translations\gpxsee_fi.qm
|
||||
File /oname=translations\qt_fi.qm translations\qt_fi.qm
|
||||
SectionEnd
|
||||
Section "French"
|
||||
CreateDirectory "$INSTDIR\translations"
|
||||
File /oname=translations\gpxsee_fr.qm translations\gpxsee_fr.qm
|
||||
File /oname=translations\qt_fr.qm translations\qt_fr.qm
|
||||
SectionEnd
|
||||
Section "German"
|
||||
CreateDirectory "$INSTDIR\translations"
|
||||
File /oname=translations\gpxsee_de.qm translations\gpxsee_de.qm
|
||||
File /oname=translations\qt_de.qm translations\qt_de.qm
|
||||
SectionEnd
|
||||
Section "Polish"
|
||||
CreateDirectory "$INSTDIR\translations"
|
||||
File /oname=translations\gpxsee_pl.qm translations\gpxsee_pl.qm
|
||||
File /oname=translations\qt_pl.qm translations\qt_pl.qm
|
||||
SectionEnd
|
||||
Section "Russian"
|
||||
CreateDirectory "$INSTDIR\translations"
|
||||
File /oname=translations\gpxsee_ru.qm translations\gpxsee_ru.qm
|
||||
File /oname=translations\qt_ru.qm translations\qt_ru.qm
|
||||
SectionEnd
|
||||
Section "Swedish"
|
||||
CreateDirectory "$INSTDIR\translations"
|
||||
File /oname=translations\gpxsee_sv.qm translations\gpxsee_sv.qm
|
||||
SectionEnd
|
||||
!insertmacro LOCALIZATION "Czech" "cs"
|
||||
!insertmacro LOCALIZATION "Finnish" "fi"
|
||||
!insertmacro LOCALIZATION "French" "fr"
|
||||
!insertmacro LOCALIZATION "German" "de"
|
||||
!insertmacro LOCALIZATION "Polish" "pl"
|
||||
!insertmacro LOCALIZATION "Russian" "ru"
|
||||
!insertmacro LOCALIZATION "Swedish" "sv"
|
||||
SectionGroupEnd
|
||||
|
||||
;--------------------------------
|
||||
@ -266,24 +231,17 @@ Section "Uninstall"
|
||||
RMDir "$SMPROGRAMS\$StartMenuFolder"
|
||||
|
||||
; Remove GPX file association
|
||||
DeleteRegKey HKCR "${REGGPX}"
|
||||
DeleteRegKey HKCR ".gpx"
|
||||
DeleteRegKey HKCR "${REGTCX}"
|
||||
DeleteRegKey HKCR ".tcx"
|
||||
DeleteRegKey HKCR "${REGKML}"
|
||||
DeleteRegKey HKCR ".kml"
|
||||
DeleteRegKey HKCR "${REGFIT}"
|
||||
DeleteRegKey HKCR ".fit"
|
||||
DeleteRegKey HKCR "${REGIGC}"
|
||||
DeleteRegKey HKCR ".igc"
|
||||
DeleteRegKey HKCR "${REGNMEA}"
|
||||
DeleteRegKey HKCR ".nmea"
|
||||
DeleteRegKey HKCR "${REGPLT}"
|
||||
DeleteRegKey HKCR ".plt"
|
||||
DeleteRegKey HKCR "${REGRTE}"
|
||||
DeleteRegKey HKCR ".rte"
|
||||
DeleteRegKey HKCR "${REGWPT}"
|
||||
DeleteRegKey HKCR ".wpt"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "gpx"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "tcx"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "kml"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "fit"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "igc"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "nmea"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "plt"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "rte"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "wpt"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "loc"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "slf"
|
||||
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
|
||||
|
||||
SectionEnd
|
||||
|
@ -22,6 +22,20 @@
|
||||
<glob pattern="*.kml"/>
|
||||
</mime-type>
|
||||
|
||||
<mime-type type="application/loc+xml">
|
||||
<comment>Geocaching.com Waypoint File</comment>
|
||||
<sub-class-of type="application/xml"/>
|
||||
<generic-icon name="application-xml"/>
|
||||
<glob pattern="*.loc"/>
|
||||
</mime-type>
|
||||
|
||||
<mime-type type="application/slf+xml">
|
||||
<comment>Sigma Log Format</comment>
|
||||
<sub-class-of type="application/xml"/>
|
||||
<generic-icon name="application-xml"/>
|
||||
<glob pattern="*.slf"/>
|
||||
</mime-type>
|
||||
|
||||
<mime-type type="application/vnd.ant.fit">
|
||||
<comment>Flexible and Interoperable Data Transfer</comment>
|
||||
<sub-class-of type="application/octet-stream"/>
|
||||
|
158
pkg/gpxsee64.nsi
@ -2,10 +2,35 @@
|
||||
!include "x64.nsh"
|
||||
!include "WinVer.nsh"
|
||||
|
||||
|
||||
; Macros
|
||||
!macro FILE_ASSOCIATION_ADD EXT DESC ICON
|
||||
WriteRegStr HKCR ".${EXT}" "" "GPXSee.${EXT}"
|
||||
WriteRegStr HKCR "GPXSee.${EXT}" "" "${DESC}"
|
||||
WriteRegStr HKCR "GPXSee.${EXT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,${ICON}"
|
||||
WriteRegStr HKCR "GPXSee.${EXT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
!macroend
|
||||
|
||||
!macro FILE_ASSOCIATION_REMOVE EXT
|
||||
DeleteRegKey HKCR "GPXSee.${EXT}"
|
||||
DeleteRegKey HKCR ".${EXT}"
|
||||
!macroend
|
||||
|
||||
!macro LOCALIZATION LANG CODE
|
||||
Section "${LANG}"
|
||||
CreateDirectory "$INSTDIR\translations"
|
||||
File /oname=translations\gpxsee_${CODE}.qm translations\gpxsee_${CODE}.qm
|
||||
!if /FileExists translations\qt_${CODE}.qm
|
||||
File /oname=translations\qt_${CODE}.qm translations\qt_${CODE}.qm
|
||||
!endif
|
||||
SectionEnd
|
||||
!macroend
|
||||
|
||||
|
||||
; The name of the installer
|
||||
Name "GPXSee"
|
||||
; Program version
|
||||
!define VERSION "5.15"
|
||||
!define VERSION "6.0"
|
||||
|
||||
; The file to write
|
||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||
@ -32,16 +57,6 @@ InstallDirRegKey HKLM "Software\GPXSee" "Install_Dir"
|
||||
|
||||
; Registry key for uninstaller
|
||||
!define REGENTRY "Software\Microsoft\Windows\CurrentVersion\Uninstall\GPXSee"
|
||||
; File types registry entries
|
||||
!define REGGPX "GPXSee.gpx"
|
||||
!define REGTCX "GPXSee.tcx"
|
||||
!define REGKML "GPXSee.kml"
|
||||
!define REGFIT "GPXSee.fit"
|
||||
!define REGIGC "GPXSee.igc"
|
||||
!define REGNMEA "GPXSee.nmea"
|
||||
!define REGPLT "GPXSee.plt"
|
||||
!define REGRTE "GPXSee.rte"
|
||||
!define REGWPT "GPXSee.wpt"
|
||||
|
||||
; Start menu page configuration
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
|
||||
@ -121,43 +136,17 @@ Section "GPXSee" SEC_APP
|
||||
|
||||
; Associate file formats
|
||||
DetailPrint "Associating file types..."
|
||||
WriteRegStr HKCR ".gpx" "" "${REGGPX}"
|
||||
WriteRegStr HKCR "${REGGPX}" "" "GPS Exchange Format"
|
||||
WriteRegStr HKCR "${REGGPX}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,2"
|
||||
WriteRegStr HKCR "${REGGPX}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".tcx" "" "${REGTCX}"
|
||||
WriteRegStr HKCR "${REGTCX}" "" "Training Center XML"
|
||||
WriteRegStr HKCR "${REGTCX}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,3"
|
||||
WriteRegStr HKCR "${REGTCX}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".kml" "" "${REGKML}"
|
||||
WriteRegStr HKCR "${REGKML}" "" "Keyhole Markup Language"
|
||||
WriteRegStr HKCR "${REGKML}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,4"
|
||||
WriteRegStr HKCR "${REGKML}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".fit" "" "${REGFIT}"
|
||||
WriteRegStr HKCR "${REGFIT}" "" "Flexible and Interoperable Data Transfer"
|
||||
WriteRegStr HKCR "${REGFIT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,5"
|
||||
WriteRegStr HKCR "${REGFIT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".igc" "" "${REGIGC}"
|
||||
WriteRegStr HKCR "${REGIGC}" "" "Flight Recorder Data Format"
|
||||
WriteRegStr HKCR "${REGIGC}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,6"
|
||||
WriteRegStr HKCR "${REGIGC}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".nmea" "" "${REGNMEA}"
|
||||
WriteRegStr HKCR "${REGNMEA}" "" "NMEA 0183 data"
|
||||
WriteRegStr HKCR "${REGNMEA}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,7"
|
||||
WriteRegStr HKCR "${REGNMEA}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".plt" "" "${REGPLT}"
|
||||
WriteRegStr HKCR "${REGPLT}" "" "OziExplorer Track Point File"
|
||||
WriteRegStr HKCR "${REGPLT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,8"
|
||||
WriteRegStr HKCR "${REGPLT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".rte" "" "${REGRTE}"
|
||||
WriteRegStr HKCR "${REGRTE}" "" "OziExplorer Route File"
|
||||
WriteRegStr HKCR "${REGRTE}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,9"
|
||||
WriteRegStr HKCR "${REGRTE}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".wpt" "" "${REGWPT}"
|
||||
WriteRegStr HKCR "${REGWPT}" "" "OziExplorer Waypoint File"
|
||||
WriteRegStr HKCR "${REGWPT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,1"
|
||||
WriteRegStr HKCR "${REGWPT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
|
||||
!insertmacro FILE_ASSOCIATION_ADD "gpx" "GPS Exchange Format" 4
|
||||
!insertmacro FILE_ASSOCIATION_ADD "tcx" "Training Center XML" 5
|
||||
!insertmacro FILE_ASSOCIATION_ADD "kml" "Keyhole Markup Language" 6
|
||||
!insertmacro FILE_ASSOCIATION_ADD "fit" "Flexible and Interoperable Data Transfer" 7
|
||||
!insertmacro FILE_ASSOCIATION_ADD "igc" "Flight Recorder Data Format" 8
|
||||
!insertmacro FILE_ASSOCIATION_ADD "nmea" "NMEA 0183 data" 9
|
||||
!insertmacro FILE_ASSOCIATION_ADD "plt" "OziExplorer Track Point File" 10
|
||||
!insertmacro FILE_ASSOCIATION_ADD "rte" "OziExplorer Route File" 11
|
||||
!insertmacro FILE_ASSOCIATION_ADD "wpt" "OziExplorer Waypoint File" 1
|
||||
!insertmacro FILE_ASSOCIATION_ADD "loc" "Geocaching.com Waypoint File" 2
|
||||
!insertmacro FILE_ASSOCIATION_ADD "slf" "Sigma Log File" 3
|
||||
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
|
||||
|
||||
SectionEnd
|
||||
@ -171,9 +160,12 @@ Section "QT framework" SEC_QT
|
||||
File "Qt5Widgets.dll"
|
||||
File "Qt5PrintSupport.dll"
|
||||
File "Qt5Network.dll"
|
||||
File "Qt5Sql.dll"
|
||||
File /r "platforms"
|
||||
File /r "imageformats"
|
||||
File /r "printsupport"
|
||||
File /r "styles"
|
||||
File /r "sqldrivers"
|
||||
|
||||
SectionEnd
|
||||
|
||||
@ -212,40 +204,13 @@ Section "ANGLE" SEC_ANGLE
|
||||
SectionEnd
|
||||
|
||||
SectionGroup "Localization" SEC_LOCALIZATION
|
||||
Section "Czech"
|
||||
CreateDirectory "$INSTDIR\translations"
|
||||
File /oname=translations\gpxsee_cs.qm translations\gpxsee_cs.qm
|
||||
File /oname=translations\qt_cs.qm translations\qt_cs.qm
|
||||
SectionEnd
|
||||
Section "Finnish"
|
||||
CreateDirectory "$INSTDIR\translations"
|
||||
File /oname=translations\gpxsee_fi.qm translations\gpxsee_fi.qm
|
||||
File /oname=translations\qt_fi.qm translations\qt_fi.qm
|
||||
SectionEnd
|
||||
Section "French"
|
||||
CreateDirectory "$INSTDIR\translations"
|
||||
File /oname=translations\gpxsee_fr.qm translations\gpxsee_fr.qm
|
||||
File /oname=translations\qt_fr.qm translations\qt_fr.qm
|
||||
SectionEnd
|
||||
Section "German"
|
||||
CreateDirectory "$INSTDIR\translations"
|
||||
File /oname=translations\gpxsee_de.qm translations\gpxsee_de.qm
|
||||
File /oname=translations\qt_de.qm translations\qt_de.qm
|
||||
SectionEnd
|
||||
Section "Polish"
|
||||
CreateDirectory "$INSTDIR\translations"
|
||||
File /oname=translations\gpxsee_pl.qm translations\gpxsee_pl.qm
|
||||
File /oname=translations\qt_pl.qm translations\qt_pl.qm
|
||||
SectionEnd
|
||||
Section "Russian"
|
||||
CreateDirectory "$INSTDIR\translations"
|
||||
File /oname=translations\gpxsee_ru.qm translations\gpxsee_ru.qm
|
||||
File /oname=translations\qt_ru.qm translations\qt_ru.qm
|
||||
SectionEnd
|
||||
Section "Swedish"
|
||||
CreateDirectory "$INSTDIR\translations"
|
||||
File /oname=translations\gpxsee_sv.qm translations\gpxsee_sv.qm
|
||||
SectionEnd
|
||||
!insertmacro LOCALIZATION "Czech" "cs"
|
||||
!insertmacro LOCALIZATION "Finnish" "fi"
|
||||
!insertmacro LOCALIZATION "French" "fr"
|
||||
!insertmacro LOCALIZATION "German" "de"
|
||||
!insertmacro LOCALIZATION "Polish" "pl"
|
||||
!insertmacro LOCALIZATION "Russian" "ru"
|
||||
!insertmacro LOCALIZATION "Swedish" "sv"
|
||||
SectionGroupEnd
|
||||
|
||||
;--------------------------------
|
||||
@ -269,24 +234,17 @@ Section "Uninstall"
|
||||
RMDir "$SMPROGRAMS\$StartMenuFolder"
|
||||
|
||||
; Remove File associations
|
||||
DeleteRegKey HKCR "${REGGPX}"
|
||||
DeleteRegKey HKCR ".gpx"
|
||||
DeleteRegKey HKCR "${REGTCX}"
|
||||
DeleteRegKey HKCR ".tcx"
|
||||
DeleteRegKey HKCR "${REGKML}"
|
||||
DeleteRegKey HKCR ".kml"
|
||||
DeleteRegKey HKCR "${REGFIT}"
|
||||
DeleteRegKey HKCR ".fit"
|
||||
DeleteRegKey HKCR "${REGIGC}"
|
||||
DeleteRegKey HKCR ".igc"
|
||||
DeleteRegKey HKCR "${REGNMEA}"
|
||||
DeleteRegKey HKCR ".nmea"
|
||||
DeleteRegKey HKCR "${REGPLT}"
|
||||
DeleteRegKey HKCR ".plt"
|
||||
DeleteRegKey HKCR "${REGRTE}"
|
||||
DeleteRegKey HKCR ".rte"
|
||||
DeleteRegKey HKCR "${REGWPT}"
|
||||
DeleteRegKey HKCR ".wpt"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "gpx"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "tcx"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "kml"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "fit"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "igc"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "nmea"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "plt"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "rte"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "wpt"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "loc"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "slf"
|
||||
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
|
||||
|
||||
SectionEnd
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map xmlns="http://www.gpxsee.org/map/1">
|
||||
<name>4UMaps</name>
|
||||
<url>http://4umaps.eu/$z/$x/$y.png</url>
|
||||
<url>https://4umaps.com/$z/$x/$y.png</url>
|
||||
<copyright>Map data: © OpenStreetMap contributors (ODbL) | Rendering: © 4UMaps.eu</copyright>
|
||||
<zoom min="2" max="15"/>
|
||||
<bounds bottom="-65"/>
|
||||
|
@ -36,17 +36,14 @@ Ticks::Ticks(double minValue, double maxValue, int maxCount)
|
||||
}
|
||||
|
||||
|
||||
AxisItem::AxisItem(Type type, QGraphicsItem *parent) : QGraphicsItem(parent)
|
||||
AxisItem::AxisItem(Type type, QGraphicsItem *parent)
|
||||
: QGraphicsItem(parent), _locale(QLocale::system())
|
||||
{
|
||||
_type = type;
|
||||
_size = 0;
|
||||
|
||||
_font.setPixelSize(FONT_SIZE);
|
||||
_font.setFamily(FONT_FAMILY);
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
setCacheMode(QGraphicsItem::DeviceCoordinateCache);
|
||||
#endif // Q_OS_MAC
|
||||
}
|
||||
|
||||
void AxisItem::setRange(const RangeF &range)
|
||||
@ -60,7 +57,7 @@ void AxisItem::setRange(const RangeF &range)
|
||||
for (int i = 0; i < ticks.count(); i++) {
|
||||
Tick &t = _ticks[i];
|
||||
t.value = ticks.val(i);
|
||||
t.boundingBox = fm.tightBoundingRect(QString::number(t.value));
|
||||
t.boundingBox = fm.tightBoundingRect(_locale.toString(t.value));
|
||||
}
|
||||
|
||||
updateBoundingRect();
|
||||
@ -130,7 +127,7 @@ void AxisItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||
TICK/2, (_size/_range.size()) * (val - _range.min()), -TICK/2);
|
||||
painter->drawText(((_size/_range.size()) * (val - _range.min()))
|
||||
- (ts.width()/2), ts.height() + TICK/2 + PADDING,
|
||||
QString::number(val));
|
||||
_locale.toString(val));
|
||||
}
|
||||
|
||||
painter->drawText(_size/2 - _labelBB.width()/2, _labelBB.height()
|
||||
@ -149,7 +146,7 @@ void AxisItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||
* (val - _range.min())));
|
||||
painter->drawText(-(ts.width() + PADDING + TICK/2),
|
||||
-((_size/_range.size()) * (val - _range.min())) + (ts.height()/2),
|
||||
QString::number(val));
|
||||
_locale.toString(val));
|
||||
}
|
||||
|
||||
painter->rotate(-90);
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include <QGraphicsItem>
|
||||
#include <QVector>
|
||||
#include <QLocale>
|
||||
#include "common/range.h"
|
||||
|
||||
class AxisItem : public QGraphicsItem
|
||||
@ -39,6 +40,7 @@ private:
|
||||
QVector<Tick> _ticks;
|
||||
QRectF _boundingRect;
|
||||
QFont _font;
|
||||
QLocale _locale;
|
||||
};
|
||||
|
||||
#endif // AXISITEM_H
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include <QLocale>
|
||||
#include "data/data.h"
|
||||
#include "cadencegraphitem.h"
|
||||
#include "cadencegraph.h"
|
||||
@ -7,7 +8,7 @@ CadenceGraph::CadenceGraph(QWidget *parent) : GraphTab(parent)
|
||||
{
|
||||
_showTracks = true;
|
||||
|
||||
GraphView::setYUnits(tr("1/min"));
|
||||
GraphView::setYUnits(tr("rpm"));
|
||||
setYLabel(tr("Cadence"));
|
||||
|
||||
setSliderPrecision(1);
|
||||
@ -16,9 +17,11 @@ CadenceGraph::CadenceGraph(QWidget *parent) : GraphTab(parent)
|
||||
void CadenceGraph::setInfo()
|
||||
{
|
||||
if (_showTracks) {
|
||||
GraphView::addInfo(tr("Average"), QString::number(avg() * yScale()
|
||||
QLocale l(QLocale::system());
|
||||
|
||||
GraphView::addInfo(tr("Average"), l.toString(avg() * yScale()
|
||||
+ yOffset(), 'f', 1) + UNIT_SPACE + yUnits());
|
||||
GraphView::addInfo(tr("Maximum"), QString::number(max() * yScale()
|
||||
GraphView::addInfo(tr("Maximum"), l.toString(max() * yScale()
|
||||
+ yOffset(), 'f', 1) + UNIT_SPACE + yUnits());
|
||||
} else
|
||||
clearInfo();
|
||||
|
@ -1,6 +1,8 @@
|
||||
#include <QLocale>
|
||||
#include "tooltip.h"
|
||||
#include "cadencegraphitem.h"
|
||||
|
||||
|
||||
CadenceGraphItem::CadenceGraphItem(const Graph &graph, GraphType type,
|
||||
QGraphicsItem *parent) : GraphItem(graph, type, parent)
|
||||
{
|
||||
@ -16,11 +18,12 @@ CadenceGraphItem::CadenceGraphItem(const Graph &graph, GraphType type,
|
||||
QString CadenceGraphItem::toolTip() const
|
||||
{
|
||||
ToolTip tt;
|
||||
QLocale l(QLocale::system());
|
||||
|
||||
tt.insert(tr("Maximum"), QString::number(max(), 'f', 1)
|
||||
+ UNIT_SPACE + tr("1/min"));
|
||||
tt.insert(tr("Average"), QString::number(avg(), 'f', 1)
|
||||
+ UNIT_SPACE + tr("1/min"));
|
||||
tt.insert(tr("Maximum"), l.toString(max(), 'f', 1)
|
||||
+ UNIT_SPACE + tr("rpm"));
|
||||
tt.insert(tr("Average"), l.toString(avg(), 'f', 1)
|
||||
+ UNIT_SPACE + tr("rpm"));
|
||||
|
||||
return tt.toString();
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <cmath>
|
||||
#include <QLocale>
|
||||
#include "data/data.h"
|
||||
#include "config.h"
|
||||
#include "tooltip.h"
|
||||
@ -54,13 +55,15 @@ void ElevationGraph::setInfo()
|
||||
if (std::isnan(max()) || std::isnan(min()))
|
||||
clearInfo();
|
||||
else {
|
||||
GraphView::addInfo(tr("Ascent"), QString::number(ascent() * yScale(),
|
||||
QLocale l(QLocale::system());
|
||||
|
||||
GraphView::addInfo(tr("Ascent"), l.toString(ascent() * yScale(),
|
||||
'f', 0) + UNIT_SPACE + yUnits());
|
||||
GraphView::addInfo(tr("Descent"), QString::number(descent() * yScale(),
|
||||
GraphView::addInfo(tr("Descent"), l.toString(descent() * yScale(),
|
||||
'f', 0) + UNIT_SPACE + yUnits());
|
||||
GraphView::addInfo(tr("Maximum"), QString::number(max() * yScale(), 'f',
|
||||
GraphView::addInfo(tr("Maximum"), l.toString(max() * yScale(), 'f',
|
||||
0) + UNIT_SPACE + yUnits());
|
||||
GraphView::addInfo(tr("Minimum"), QString::number(min() * yScale(), 'f',
|
||||
GraphView::addInfo(tr("Minimum"), l.toString(min() * yScale(), 'f',
|
||||
0) + UNIT_SPACE + yUnits());
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
#include <QLocale>
|
||||
#include "tooltip.h"
|
||||
#include "elevationgraphitem.h"
|
||||
|
||||
|
||||
ElevationGraphItem::ElevationGraphItem(const Graph &graph, GraphType type,
|
||||
QGraphicsItem *parent) : GraphItem(graph, type, parent)
|
||||
{
|
||||
@ -24,14 +26,15 @@ QString ElevationGraphItem::toolTip(Units units) const
|
||||
ToolTip tt;
|
||||
qreal scale = (units == Metric) ? 1.0 : M2FT;
|
||||
QString su = (units == Metric) ? tr("m") : tr("ft");
|
||||
QLocale l(QLocale::system());
|
||||
|
||||
tt.insert(tr("Ascent"), QString::number(ascent() * scale, 'f', 0)
|
||||
tt.insert(tr("Ascent"), l.toString(ascent() * scale, 'f', 0)
|
||||
+ UNIT_SPACE + su);
|
||||
tt.insert(tr("Descent"), QString::number(descent() * scale, 'f', 0)
|
||||
tt.insert(tr("Descent"), l.toString(descent() * scale, 'f', 0)
|
||||
+ UNIT_SPACE + su);
|
||||
tt.insert(tr("Maximum"), QString::number(max() * scale, 'f', 0)
|
||||
tt.insert(tr("Maximum"), l.toString(max() * scale, 'f', 0)
|
||||
+ UNIT_SPACE + su);
|
||||
tt.insert(tr("Minimum"), QString::number(min() * scale, 'f', 0)
|
||||
tt.insert(tr("Minimum"), l.toString(min() * scale, 'f', 0)
|
||||
+ UNIT_SPACE + su);
|
||||
|
||||
return tt.toString();
|
||||
|
@ -46,37 +46,41 @@ QString Format::timeSpan(qreal time, bool full)
|
||||
|
||||
QString Format::distance(qreal value, Units units)
|
||||
{
|
||||
QLocale l(QLocale::system());
|
||||
|
||||
if (units == Imperial) {
|
||||
if (value < MIINM)
|
||||
return QString::number(value * M2FT, 'f', 0) + UNIT_SPACE
|
||||
return l.toString(value * M2FT, 'f', 0) + UNIT_SPACE
|
||||
+ qApp->translate("Format", "ft");
|
||||
else
|
||||
return QString::number(value * M2MI, 'f', 1) + UNIT_SPACE
|
||||
return l.toString(value * M2MI, 'f', 1) + UNIT_SPACE
|
||||
+ qApp->translate("Format", "mi");
|
||||
} else if (units == Nautical) {
|
||||
if (value < NMIINM)
|
||||
return QString::number(value * M2FT, 'f', 0) + UNIT_SPACE
|
||||
return l.toString(value * M2FT, 'f', 0) + UNIT_SPACE
|
||||
+ qApp->translate("Format", "ft");
|
||||
else
|
||||
return QString::number(value * M2NMI, 'f', 1) + UNIT_SPACE
|
||||
return l.toString(value * M2NMI, 'f', 1) + UNIT_SPACE
|
||||
+ qApp->translate("Format", "nmi");
|
||||
} else {
|
||||
if (value < KMINM)
|
||||
return QString::number(value, 'f', 0) + UNIT_SPACE
|
||||
return l.toString(value, 'f', 0) + UNIT_SPACE
|
||||
+ qApp->translate("Format", "m");
|
||||
else
|
||||
return QString::number(value * M2KM, 'f', 1) + UNIT_SPACE
|
||||
return l.toString(value * M2KM, 'f', 1) + UNIT_SPACE
|
||||
+ qApp->translate("Format", "km");
|
||||
}
|
||||
}
|
||||
|
||||
QString Format::elevation(qreal value, Units units)
|
||||
{
|
||||
QLocale l(QLocale::system());
|
||||
|
||||
if (units == Metric)
|
||||
return QString::number(qRound(value)) + UNIT_SPACE
|
||||
return l.toString(qRound(value)) + UNIT_SPACE
|
||||
+ qApp->translate("Format", "m");
|
||||
else
|
||||
return QString::number(qRound(value * M2FT)) + UNIT_SPACE
|
||||
return l.toString(qRound(value * M2FT)) + UNIT_SPACE
|
||||
+ qApp->translate("Format", "ft");
|
||||
}
|
||||
|
||||
@ -95,7 +99,8 @@ QString Format::coordinates(const Coordinates &value, CoordinatesFormat type)
|
||||
+ deg2DMS(qAbs(value.lon())) + xH;
|
||||
break;
|
||||
default:
|
||||
return QString::number(qAbs(value.lat()), 'f', 5) + yH + ","
|
||||
+ QChar(0x00A0) + QString::number(qAbs(value.lon()), 'f', 5) + xH;
|
||||
QLocale l(QLocale::system());
|
||||
return l.toString(qAbs(value.lat()), 'f', 5) + yH + ","
|
||||
+ QChar(0x00A0) + l.toString(qAbs(value.lon()), 'f', 5) + xH;
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include <QLocale>
|
||||
#include "data/data.h"
|
||||
#include "gearratiographitem.h"
|
||||
#include "gearratiograph.h"
|
||||
@ -16,11 +17,13 @@ GearRatioGraph::GearRatioGraph(QWidget *parent) : GraphTab(parent)
|
||||
void GearRatioGraph::setInfo()
|
||||
{
|
||||
if (_showTracks) {
|
||||
GraphView::addInfo(tr("Most used"), QString::number(top() * yScale(),
|
||||
QLocale l(QLocale::system());
|
||||
|
||||
GraphView::addInfo(tr("Most used"), l.toString(top() * yScale(),
|
||||
'f', 2) + UNIT_SPACE + yUnits());
|
||||
GraphView::addInfo(tr("Minimum"), QString::number(min() * yScale(), 'f',
|
||||
GraphView::addInfo(tr("Minimum"), l.toString(min() * yScale(), 'f',
|
||||
2) + UNIT_SPACE + yUnits());
|
||||
GraphView::addInfo(tr("Maximum"), QString::number(max() * yScale(), 'f',
|
||||
GraphView::addInfo(tr("Maximum"), l.toString(max() * yScale(), 'f',
|
||||
2) + UNIT_SPACE + yUnits());
|
||||
} else
|
||||
clearInfo();
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include <QMap>
|
||||
#include <QLocale>
|
||||
#include "tooltip.h"
|
||||
#include "gearratiographitem.h"
|
||||
|
||||
|
||||
GearRatioGraphItem::GearRatioGraphItem(const Graph &graph, GraphType type,
|
||||
QGraphicsItem *parent) : GraphItem(graph, type, parent)
|
||||
QGraphicsItem *parent) : GraphItem(graph, type, parent), _top(NAN)
|
||||
{
|
||||
qreal val = NAN;
|
||||
|
||||
@ -30,10 +32,11 @@ GearRatioGraphItem::GearRatioGraphItem(const Graph &graph, GraphType type,
|
||||
QString GearRatioGraphItem::toolTip() const
|
||||
{
|
||||
ToolTip tt;
|
||||
QLocale l(QLocale::system());
|
||||
|
||||
tt.insert(tr("Minimum"), QString::number(min(), 'f', 2));
|
||||
tt.insert(tr("Maximum"), QString::number(max(), 'f', 2));
|
||||
tt.insert(tr("Most used"), QString::number(top(), 'f', 2));
|
||||
tt.insert(tr("Minimum"), l.toString(min(), 'f', 2));
|
||||
tt.insert(tr("Maximum"), l.toString(max(), 'f', 2));
|
||||
tt.insert(tr("Most used"), l.toString(top(), 'f', 2));
|
||||
|
||||
return tt.toString();
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <QPaintDevice>
|
||||
#include <QGraphicsSimpleTextItem>
|
||||
#include <QPalette>
|
||||
#include <QLocale>
|
||||
#include "data/graph.h"
|
||||
#include "opengl.h"
|
||||
#include "config.h"
|
||||
@ -413,8 +414,10 @@ void GraphView::updateSliderPosition()
|
||||
|
||||
void GraphView::updateSliderInfo()
|
||||
{
|
||||
QLocale l(QLocale::system());
|
||||
qreal r, y;
|
||||
|
||||
|
||||
if (_visible.count() > 1) {
|
||||
r = 0;
|
||||
y = 0;
|
||||
@ -435,9 +438,9 @@ void GraphView::updateSliderInfo()
|
||||
_sliderInfo->setSide(s);
|
||||
_sliderInfo->setPos(QPointF(0, _slider->boundingRect().height() * r));
|
||||
_sliderInfo->setText(_graphType == Time ? Format::timeSpan(_sliderPos,
|
||||
bounds().width() > 3600) : QString::number(_sliderPos * _xScale, 'f', 1)
|
||||
bounds().width() > 3600) : l.toString(_sliderPos * _xScale, 'f', 1)
|
||||
+ UNIT_SPACE + _xUnits, (_visible.count() > 1) ? QString()
|
||||
: QString::number(-y * _yScale + _yOffset, 'f', _precision) + UNIT_SPACE
|
||||
: l.toString(-y * _yScale + _yOffset, 'f', _precision) + UNIT_SPACE
|
||||
+ _yUnits);
|
||||
}
|
||||
|
||||
|
@ -7,12 +7,12 @@
|
||||
#include "data/graph.h"
|
||||
#include "palette.h"
|
||||
#include "units.h"
|
||||
#include "infoitem.h"
|
||||
|
||||
|
||||
class AxisItem;
|
||||
class SliderItem;
|
||||
class SliderInfoItem;
|
||||
class InfoItem;
|
||||
class GraphItem;
|
||||
class PathItem;
|
||||
class GridItem;
|
||||
@ -27,6 +27,7 @@ public:
|
||||
~GraphView();
|
||||
|
||||
bool isEmpty() const {return _graphs.isEmpty();}
|
||||
const QList<KV> &info() const {return _info->info();}
|
||||
void clear();
|
||||
|
||||
void plot(QPainter *painter, const QRectF &target, qreal scale);
|
||||
|
312
src/GUI/gui.cpp
@ -1,3 +1,4 @@
|
||||
#include "config.h"
|
||||
#include <QApplication>
|
||||
#include <QSplitter>
|
||||
#include <QVBoxLayout>
|
||||
@ -22,12 +23,16 @@
|
||||
#include <QMimeData>
|
||||
#include <QUrl>
|
||||
#include <QPixmapCache>
|
||||
#ifdef ENABLE_HIDPI
|
||||
#include <QWindow>
|
||||
#include <QScreen>
|
||||
#endif // ENABLE_HIDPI
|
||||
#include <QStyle>
|
||||
#include "data/data.h"
|
||||
#include "data/poi.h"
|
||||
#include "map/maplist.h"
|
||||
#include "map/emptymap.h"
|
||||
#include "map/downloader.h"
|
||||
#include "config.h"
|
||||
#include "icons.h"
|
||||
#include "keys.h"
|
||||
#include "settings.h"
|
||||
@ -48,6 +53,8 @@
|
||||
#include "gui.h"
|
||||
|
||||
|
||||
#define TOOLBAR_ICON_SIZE 22
|
||||
|
||||
GUI::GUI()
|
||||
{
|
||||
loadMaps();
|
||||
@ -72,7 +79,7 @@ GUI::GUI()
|
||||
_splitter->setStretchFactor(1, 1);
|
||||
setCentralWidget(_splitter);
|
||||
|
||||
setWindowIcon(QIcon(QPixmap(APP_ICON)));
|
||||
setWindowIcon(QIcon(APP_ICON));
|
||||
setWindowTitle(APP_NAME);
|
||||
setUnifiedTitleAndToolBarOnMac(true);
|
||||
setAcceptDrops(true);
|
||||
@ -142,6 +149,7 @@ void GUI::createMapActions()
|
||||
|
||||
for (int i = 0; i < _ml->maps().count(); i++) {
|
||||
QAction *a = new QAction(_ml->maps().at(i)->name(), this);
|
||||
a->setMenuRole(QAction::NoRole);
|
||||
a->setCheckable(true);
|
||||
a->setActionGroup(_mapsActionGroup);
|
||||
|
||||
@ -170,6 +178,7 @@ QAction *GUI::createPOIFileAction(int index)
|
||||
{
|
||||
QAction *a = new QAction(QFileInfo(_poi->files().at(index)).fileName(),
|
||||
this);
|
||||
a->setMenuRole(QAction::NoRole);
|
||||
a->setCheckable(true);
|
||||
|
||||
_poiFilesSignalMapper->setMapping(a, index);
|
||||
@ -193,7 +202,7 @@ void GUI::createActions()
|
||||
_navigationActionGroup->setEnabled(false);
|
||||
|
||||
// General actions
|
||||
_exitAction = new QAction(QIcon(QPixmap(QUIT_ICON)), tr("Quit"), this);
|
||||
_exitAction = new QAction(QIcon(QUIT_ICON), tr("Quit"), this);
|
||||
_exitAction->setShortcut(QUIT_SHORTCUT);
|
||||
_exitAction->setMenuRole(QAction::QuitRole);
|
||||
connect(_exitAction, SIGNAL(triggered()), this, SLOT(close()));
|
||||
@ -201,61 +210,75 @@ void GUI::createActions()
|
||||
|
||||
// Help & About
|
||||
_pathsAction = new QAction(tr("Paths"), this);
|
||||
_pathsAction->setMenuRole(QAction::NoRole);
|
||||
connect(_pathsAction, SIGNAL(triggered()), this, SLOT(paths()));
|
||||
_keysAction = new QAction(tr("Keyboard controls"), this);
|
||||
_keysAction->setMenuRole(QAction::NoRole);
|
||||
connect(_keysAction, SIGNAL(triggered()), this, SLOT(keys()));
|
||||
_aboutAction = new QAction(QIcon(QPixmap(APP_ICON)),
|
||||
tr("About GPXSee"), this);
|
||||
_aboutAction = new QAction(QIcon(APP_ICON), tr("About GPXSee"), this);
|
||||
_aboutAction->setMenuRole(QAction::AboutRole);
|
||||
connect(_aboutAction, SIGNAL(triggered()), this, SLOT(about()));
|
||||
|
||||
// File actions
|
||||
_openFileAction = new QAction(QIcon(QPixmap(OPEN_FILE_ICON)),
|
||||
tr("Open..."), this);
|
||||
_openFileAction = new QAction(QIcon(OPEN_FILE_ICON), tr("Open..."), this);
|
||||
_openFileAction->setMenuRole(QAction::NoRole);
|
||||
_openFileAction->setShortcut(OPEN_SHORTCUT);
|
||||
connect(_openFileAction, SIGNAL(triggered()), this, SLOT(openFile()));
|
||||
addAction(_openFileAction);
|
||||
_printFileAction = new QAction(QIcon(QPixmap(PRINT_FILE_ICON)),
|
||||
tr("Print..."), this);
|
||||
_printFileAction = new QAction(QIcon(PRINT_FILE_ICON), tr("Print..."),
|
||||
this);
|
||||
_printFileAction->setMenuRole(QAction::NoRole);
|
||||
_printFileAction->setActionGroup(_fileActionGroup);
|
||||
connect(_printFileAction, SIGNAL(triggered()), this, SLOT(printFile()));
|
||||
addAction(_printFileAction);
|
||||
_exportFileAction = new QAction(QIcon(QPixmap(EXPORT_FILE_ICON)),
|
||||
_exportFileAction = new QAction(QIcon(EXPORT_FILE_ICON),
|
||||
tr("Export to PDF..."), this);
|
||||
_exportFileAction->setMenuRole(QAction::NoRole);
|
||||
_exportFileAction->setShortcut(EXPORT_SHORTCUT);
|
||||
_exportFileAction->setActionGroup(_fileActionGroup);
|
||||
connect(_exportFileAction, SIGNAL(triggered()), this, SLOT(exportFile()));
|
||||
addAction(_exportFileAction);
|
||||
_closeFileAction = new QAction(QIcon(QPixmap(CLOSE_FILE_ICON)),
|
||||
tr("Close"), this);
|
||||
_closeFileAction = new QAction(QIcon(CLOSE_FILE_ICON), tr("Close"), this);
|
||||
_closeFileAction->setMenuRole(QAction::NoRole);
|
||||
_closeFileAction->setShortcut(CLOSE_SHORTCUT);
|
||||
_closeFileAction->setActionGroup(_fileActionGroup);
|
||||
connect(_closeFileAction, SIGNAL(triggered()), this, SLOT(closeAll()));
|
||||
addAction(_closeFileAction);
|
||||
_reloadFileAction = new QAction(QIcon(QPixmap(RELOAD_FILE_ICON)),
|
||||
tr("Reload"), this);
|
||||
_reloadFileAction = new QAction(QIcon(RELOAD_FILE_ICON), tr("Reload"),
|
||||
this);
|
||||
_reloadFileAction->setMenuRole(QAction::NoRole);
|
||||
_reloadFileAction->setShortcut(RELOAD_SHORTCUT);
|
||||
_reloadFileAction->setActionGroup(_fileActionGroup);
|
||||
connect(_reloadFileAction, SIGNAL(triggered()), this, SLOT(reloadFile()));
|
||||
addAction(_reloadFileAction);
|
||||
_statisticsAction = new QAction(tr("Statistics..."), this);
|
||||
_statisticsAction->setMenuRole(QAction::NoRole);
|
||||
_statisticsAction->setShortcut(STATISTICS_SHORTCUT);
|
||||
_statisticsAction->setActionGroup(_fileActionGroup);
|
||||
connect(_statisticsAction, SIGNAL(triggered()), this, SLOT(statistics()));
|
||||
addAction(_statisticsAction);
|
||||
|
||||
// POI actions
|
||||
_openPOIAction = new QAction(QIcon(QPixmap(OPEN_FILE_ICON)),
|
||||
tr("Load POI file..."), this);
|
||||
_openPOIAction = new QAction(QIcon(OPEN_FILE_ICON), tr("Load POI file..."),
|
||||
this);
|
||||
_openPOIAction->setMenuRole(QAction::NoRole);
|
||||
connect(_openPOIAction, SIGNAL(triggered()), this, SLOT(openPOIFile()));
|
||||
_closePOIAction = new QAction(QIcon(QPixmap(CLOSE_FILE_ICON)),
|
||||
tr("Close POI files"), this);
|
||||
_closePOIAction = new QAction(QIcon(CLOSE_FILE_ICON), tr("Close POI files"),
|
||||
this);
|
||||
_closePOIAction->setMenuRole(QAction::NoRole);
|
||||
connect(_closePOIAction, SIGNAL(triggered()), this, SLOT(closePOIFiles()));
|
||||
_overlapPOIAction = new QAction(tr("Overlap POIs"), this);
|
||||
_overlapPOIAction->setMenuRole(QAction::NoRole);
|
||||
_overlapPOIAction->setCheckable(true);
|
||||
connect(_overlapPOIAction, SIGNAL(triggered(bool)), _mapView,
|
||||
SLOT(setPOIOverlap(bool)));
|
||||
_showPOILabelsAction = new QAction(tr("Show POI labels"), this);
|
||||
_showPOILabelsAction->setMenuRole(QAction::NoRole);
|
||||
_showPOILabelsAction->setCheckable(true);
|
||||
connect(_showPOILabelsAction, SIGNAL(triggered(bool)), _mapView,
|
||||
SLOT(showPOILabels(bool)));
|
||||
_showPOIAction = new QAction(QIcon(QPixmap(SHOW_POI_ICON)),
|
||||
tr("Show POIs"), this);
|
||||
_showPOIAction = new QAction(QIcon(SHOW_POI_ICON), tr("Show POIs"), this);
|
||||
_showPOIAction->setMenuRole(QAction::NoRole);
|
||||
_showPOIAction->setCheckable(true);
|
||||
_showPOIAction->setShortcut(SHOW_POI_SHORTCUT);
|
||||
connect(_showPOIAction, SIGNAL(triggered(bool)), _mapView,
|
||||
@ -264,25 +287,30 @@ void GUI::createActions()
|
||||
createPOIFilesActions();
|
||||
|
||||
// Map actions
|
||||
_showMapAction = new QAction(QIcon(QPixmap(SHOW_MAP_ICON)), tr("Show map"),
|
||||
_showMapAction = new QAction(QIcon(SHOW_MAP_ICON), tr("Show map"),
|
||||
this);
|
||||
_showMapAction->setMenuRole(QAction::NoRole);
|
||||
_showMapAction->setCheckable(true);
|
||||
_showMapAction->setShortcut(SHOW_MAP_SHORTCUT);
|
||||
connect(_showMapAction, SIGNAL(triggered(bool)), _mapView,
|
||||
SLOT(showMap(bool)));
|
||||
addAction(_showMapAction);
|
||||
_loadMapAction = new QAction(QIcon(QPixmap(OPEN_FILE_ICON)),
|
||||
tr("Load map..."), this);
|
||||
_loadMapAction = new QAction(QIcon(OPEN_FILE_ICON), tr("Load map..."),
|
||||
this);
|
||||
_loadMapAction->setMenuRole(QAction::NoRole);
|
||||
connect(_loadMapAction, SIGNAL(triggered()), this, SLOT(loadMap()));
|
||||
_clearMapCacheAction = new QAction(tr("Clear tile cache"), this);
|
||||
_clearMapCacheAction->setMenuRole(QAction::NoRole);
|
||||
connect(_clearMapCacheAction, SIGNAL(triggered()), _mapView,
|
||||
SLOT(clearMapCache()));
|
||||
createMapActions();
|
||||
_nextMapAction = new QAction(tr("Next map"), this);
|
||||
_nextMapAction->setMenuRole(QAction::NoRole);
|
||||
_nextMapAction->setShortcut(NEXT_MAP_SHORTCUT);
|
||||
connect(_nextMapAction, SIGNAL(triggered()), this, SLOT(nextMap()));
|
||||
addAction(_nextMapAction);
|
||||
_prevMapAction = new QAction(tr("Next map"), this);
|
||||
_prevMapAction->setMenuRole(QAction::NoRole);
|
||||
_prevMapAction->setShortcut(PREV_MAP_SHORTCUT);
|
||||
connect(_prevMapAction, SIGNAL(triggered()), this, SLOT(prevMap()));
|
||||
addAction(_prevMapAction);
|
||||
@ -293,29 +321,35 @@ void GUI::createActions()
|
||||
|
||||
// Data actions
|
||||
_showTracksAction = new QAction(tr("Show tracks"), this);
|
||||
_showTracksAction->setMenuRole(QAction::NoRole);
|
||||
_showTracksAction->setCheckable(true);
|
||||
connect(_showTracksAction, SIGNAL(triggered(bool)), this,
|
||||
SLOT(showTracks(bool)));
|
||||
_showRoutesAction = new QAction(tr("Show routes"), this);
|
||||
_showRoutesAction->setMenuRole(QAction::NoRole);
|
||||
_showRoutesAction->setCheckable(true);
|
||||
connect(_showRoutesAction, SIGNAL(triggered(bool)), this,
|
||||
SLOT(showRoutes(bool)));
|
||||
_showWaypointsAction = new QAction(tr("Show waypoints"), this);
|
||||
_showWaypointsAction->setMenuRole(QAction::NoRole);
|
||||
_showWaypointsAction->setCheckable(true);
|
||||
connect(_showWaypointsAction, SIGNAL(triggered(bool)), _mapView,
|
||||
SLOT(showWaypoints(bool)));
|
||||
_showWaypointLabelsAction = new QAction(tr("Waypoint labels"), this);
|
||||
_showWaypointLabelsAction->setMenuRole(QAction::NoRole);
|
||||
_showWaypointLabelsAction->setCheckable(true);
|
||||
connect(_showWaypointLabelsAction, SIGNAL(triggered(bool)), _mapView,
|
||||
SLOT(showWaypointLabels(bool)));
|
||||
_showRouteWaypointsAction = new QAction(tr("Route waypoints"), this);
|
||||
_showRouteWaypointsAction->setMenuRole(QAction::NoRole);
|
||||
_showRouteWaypointsAction->setCheckable(true);
|
||||
connect(_showRouteWaypointsAction, SIGNAL(triggered(bool)), _mapView,
|
||||
SLOT(showRouteWaypoints(bool)));
|
||||
|
||||
// Graph actions
|
||||
_showGraphsAction = new QAction(QIcon(QPixmap(SHOW_GRAPHS_ICON)),
|
||||
tr("Show graphs"), this);
|
||||
_showGraphsAction = new QAction(QIcon(SHOW_GRAPHS_ICON), tr("Show graphs"),
|
||||
this);
|
||||
_showGraphsAction->setMenuRole(QAction::NoRole);
|
||||
_showGraphsAction->setCheckable(true);
|
||||
_showGraphsAction->setShortcut(SHOW_GRAPHS_SHORTCUT);
|
||||
connect(_showGraphsAction, SIGNAL(triggered(bool)), this,
|
||||
@ -324,39 +358,46 @@ void GUI::createActions()
|
||||
ag = new QActionGroup(this);
|
||||
ag->setExclusive(true);
|
||||
_distanceGraphAction = new QAction(tr("Distance"), this);
|
||||
_distanceGraphAction->setMenuRole(QAction::NoRole);
|
||||
_distanceGraphAction->setCheckable(true);
|
||||
_distanceGraphAction->setActionGroup(ag);
|
||||
connect(_distanceGraphAction, SIGNAL(triggered()), this,
|
||||
SLOT(setDistanceGraph()));
|
||||
addAction(_distanceGraphAction);
|
||||
_timeGraphAction = new QAction(tr("Time"), this);
|
||||
_timeGraphAction->setMenuRole(QAction::NoRole);
|
||||
_timeGraphAction->setCheckable(true);
|
||||
_timeGraphAction->setActionGroup(ag);
|
||||
connect(_timeGraphAction, SIGNAL(triggered()), this,
|
||||
SLOT(setTimeGraph()));
|
||||
addAction(_timeGraphAction);
|
||||
_showGraphGridAction = new QAction(tr("Show grid"), this);
|
||||
_showGraphGridAction->setMenuRole(QAction::NoRole);
|
||||
_showGraphGridAction->setCheckable(true);
|
||||
connect(_showGraphGridAction, SIGNAL(triggered(bool)), this,
|
||||
SLOT(showGraphGrids(bool)));
|
||||
_showGraphSliderInfoAction = new QAction(tr("Show slider info"), this);
|
||||
_showGraphSliderInfoAction->setMenuRole(QAction::NoRole);
|
||||
_showGraphSliderInfoAction->setCheckable(true);
|
||||
connect(_showGraphSliderInfoAction, SIGNAL(triggered(bool)), this,
|
||||
SLOT(showGraphSliderInfo(bool)));
|
||||
|
||||
// Settings actions
|
||||
_showToolbarsAction = new QAction(tr("Show toolbars"), this);
|
||||
_showToolbarsAction->setMenuRole(QAction::NoRole);
|
||||
_showToolbarsAction->setCheckable(true);
|
||||
connect(_showToolbarsAction, SIGNAL(triggered(bool)), this,
|
||||
SLOT(showToolbars(bool)));
|
||||
ag = new QActionGroup(this);
|
||||
ag->setExclusive(true);
|
||||
_totalTimeAction = new QAction(tr("Total time"), this);
|
||||
_totalTimeAction->setMenuRole(QAction::NoRole);
|
||||
_totalTimeAction->setCheckable(true);
|
||||
_totalTimeAction->setActionGroup(ag);
|
||||
connect(_totalTimeAction, SIGNAL(triggered()), this,
|
||||
SLOT(setTotalTime()));
|
||||
_movingTimeAction = new QAction(tr("Moving time"), this);
|
||||
_movingTimeAction->setMenuRole(QAction::NoRole);
|
||||
_movingTimeAction->setCheckable(true);
|
||||
_movingTimeAction->setActionGroup(ag);
|
||||
connect(_movingTimeAction, SIGNAL(triggered()), this,
|
||||
@ -364,16 +405,19 @@ void GUI::createActions()
|
||||
ag = new QActionGroup(this);
|
||||
ag->setExclusive(true);
|
||||
_metricUnitsAction = new QAction(tr("Metric"), this);
|
||||
_metricUnitsAction->setMenuRole(QAction::NoRole);
|
||||
_metricUnitsAction->setCheckable(true);
|
||||
_metricUnitsAction->setActionGroup(ag);
|
||||
connect(_metricUnitsAction, SIGNAL(triggered()), this,
|
||||
SLOT(setMetricUnits()));
|
||||
_imperialUnitsAction = new QAction(tr("Imperial"), this);
|
||||
_imperialUnitsAction->setMenuRole(QAction::NoRole);
|
||||
_imperialUnitsAction->setCheckable(true);
|
||||
_imperialUnitsAction->setActionGroup(ag);
|
||||
connect(_imperialUnitsAction, SIGNAL(triggered()), this,
|
||||
SLOT(setImperialUnits()));
|
||||
_nauticalUnitsAction = new QAction(tr("Nautical"), this);
|
||||
_nauticalUnitsAction->setMenuRole(QAction::NoRole);
|
||||
_nauticalUnitsAction->setCheckable(true);
|
||||
_nauticalUnitsAction->setActionGroup(ag);
|
||||
connect(_nauticalUnitsAction, SIGNAL(triggered()), this,
|
||||
@ -381,22 +425,26 @@ void GUI::createActions()
|
||||
ag = new QActionGroup(this);
|
||||
ag->setExclusive(true);
|
||||
_decimalDegreesAction = new QAction(tr("Decimal degrees (DD)"), this);
|
||||
_decimalDegreesAction->setMenuRole(QAction::NoRole);
|
||||
_decimalDegreesAction->setCheckable(true);
|
||||
_decimalDegreesAction->setActionGroup(ag);
|
||||
connect(_decimalDegreesAction, SIGNAL(triggered()), this,
|
||||
SLOT(setDecimalDegrees()));
|
||||
_degreesMinutesAction = new QAction(tr("Degrees and decimal minutes (DMM)"),
|
||||
this);
|
||||
_degreesMinutesAction->setMenuRole(QAction::NoRole);
|
||||
_degreesMinutesAction->setCheckable(true);
|
||||
_degreesMinutesAction->setActionGroup(ag);
|
||||
connect(_degreesMinutesAction, SIGNAL(triggered()), this,
|
||||
SLOT(setDegreesMinutes()));
|
||||
_DMSAction = new QAction(tr("Degrees, minutes, seconds (DMS)"), this);
|
||||
_DMSAction->setMenuRole(QAction::NoRole);
|
||||
_DMSAction->setCheckable(true);
|
||||
_DMSAction->setActionGroup(ag);
|
||||
connect(_DMSAction, SIGNAL(triggered()), this, SLOT(setDMS()));
|
||||
_fullscreenAction = new QAction(QIcon(QPixmap(FULLSCREEN_ICON)),
|
||||
_fullscreenAction = new QAction(QIcon(FULLSCREEN_ICON),
|
||||
tr("Fullscreen mode"), this);
|
||||
_fullscreenAction->setMenuRole(QAction::NoRole);
|
||||
_fullscreenAction->setCheckable(true);
|
||||
_fullscreenAction->setShortcut(FULLSCREEN_SHORTCUT);
|
||||
connect(_fullscreenAction, SIGNAL(triggered(bool)), this,
|
||||
@ -408,18 +456,20 @@ void GUI::createActions()
|
||||
SLOT(openOptions()));
|
||||
|
||||
// Navigation actions
|
||||
_nextAction = new QAction(QIcon(QPixmap(NEXT_FILE_ICON)), tr("Next"), this);
|
||||
_nextAction = new QAction(QIcon(NEXT_FILE_ICON), tr("Next"), this);
|
||||
_nextAction->setActionGroup(_navigationActionGroup);
|
||||
_nextAction->setMenuRole(QAction::NoRole);
|
||||
connect(_nextAction, SIGNAL(triggered()), this, SLOT(next()));
|
||||
_prevAction = new QAction(QIcon(QPixmap(PREV_FILE_ICON)), tr("Previous"),
|
||||
this);
|
||||
_prevAction = new QAction(QIcon(PREV_FILE_ICON), tr("Previous"), this);
|
||||
_prevAction->setMenuRole(QAction::NoRole);
|
||||
_prevAction->setActionGroup(_navigationActionGroup);
|
||||
connect(_prevAction, SIGNAL(triggered()), this, SLOT(prev()));
|
||||
_lastAction = new QAction(QIcon(QPixmap(LAST_FILE_ICON)), tr("Last"), this);
|
||||
_lastAction = new QAction(QIcon(LAST_FILE_ICON), tr("Last"), this);
|
||||
_lastAction->setMenuRole(QAction::NoRole);
|
||||
_lastAction->setActionGroup(_navigationActionGroup);
|
||||
connect(_lastAction, SIGNAL(triggered()), this, SLOT(last()));
|
||||
_firstAction = new QAction(QIcon(QPixmap(FIRST_FILE_ICON)), tr("First"),
|
||||
this);
|
||||
_firstAction = new QAction(QIcon(FIRST_FILE_ICON), tr("First"), this);
|
||||
_firstAction->setMenuRole(QAction::NoRole);
|
||||
_firstAction->setActionGroup(_navigationActionGroup);
|
||||
connect(_firstAction, SIGNAL(triggered()), this, SLOT(first()));
|
||||
}
|
||||
@ -432,8 +482,9 @@ void GUI::createMenus()
|
||||
fileMenu->addAction(_printFileAction);
|
||||
fileMenu->addAction(_exportFileAction);
|
||||
fileMenu->addSeparator();
|
||||
fileMenu->addAction(_reloadFileAction);
|
||||
fileMenu->addAction(_statisticsAction);
|
||||
fileMenu->addSeparator();
|
||||
fileMenu->addAction(_reloadFileAction);
|
||||
fileMenu->addAction(_closeFileAction);
|
||||
#ifndef Q_OS_MAC
|
||||
fileMenu->addSeparator();
|
||||
@ -505,22 +556,28 @@ void GUI::createMenus()
|
||||
|
||||
void GUI::createToolBars()
|
||||
{
|
||||
int is = style()->pixelMetric(QStyle::PM_ToolBarIconSize);
|
||||
QSize iconSize(qMin(is, TOOLBAR_ICON_SIZE), qMin(is, TOOLBAR_ICON_SIZE));
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
|
||||
#endif // Q_OS_MAC
|
||||
|
||||
_fileToolBar = addToolBar(tr("File"));
|
||||
_fileToolBar->setIconSize(iconSize);
|
||||
_fileToolBar->addAction(_openFileAction);
|
||||
_fileToolBar->addAction(_reloadFileAction);
|
||||
_fileToolBar->addAction(_closeFileAction);
|
||||
_fileToolBar->addAction(_printFileAction);
|
||||
|
||||
_showToolBar = addToolBar(tr("Show"));
|
||||
_showToolBar->setIconSize(iconSize);
|
||||
_showToolBar->addAction(_showPOIAction);
|
||||
_showToolBar->addAction(_showMapAction);
|
||||
_showToolBar->addAction(_showGraphsAction);
|
||||
|
||||
_navigationToolBar = addToolBar(tr("Navigation"));
|
||||
_navigationToolBar->setIconSize(iconSize);
|
||||
_navigationToolBar->addAction(_firstAction);
|
||||
_navigationToolBar->addAction(_prevAction);
|
||||
_navigationToolBar->addAction(_nextAction);
|
||||
@ -641,19 +698,19 @@ void GUI::paths()
|
||||
msgBox.setWindowTitle(tr("Paths"));
|
||||
msgBox.setText("<h3>" + tr("Paths") + "</h3>");
|
||||
msgBox.setInformativeText(
|
||||
"<style>td {white-space: pre; padding-right: 1em;}</style>"
|
||||
"<div><table><tr><td>" + tr("Map directory:") + "</td><td><code>"
|
||||
+ QDir::cleanPath(GLOBAL_MAP_DIR) + "</code></td></tr><tr><td>"
|
||||
+ tr("POI directory:") + "</td><td><code>"
|
||||
"<style>td {white-space: pre; padding-right: 1em;}</style><h4>"
|
||||
+ tr("Global") + "</h4><table><tr><td>" + tr("Map directory:")
|
||||
+ "</td><td><code>" + QDir::cleanPath(GLOBAL_MAP_DIR)
|
||||
+ "</code></td></tr><tr><td>" + tr("POI directory:") + "</td><td><code>"
|
||||
+ QDir::cleanPath(GLOBAL_POI_DIR) + "</code></td></tr><tr><td>"
|
||||
+ tr("GCS file:") + "</td><td><code>" + QDir::cleanPath(GLOBAL_GCS_FILE)
|
||||
+ "</code></td></tr><tr><td>" + tr("PCS file:") + "</td><td><code>"
|
||||
+ QDir::cleanPath(GLOBAL_PCS_FILE) + "</code></td></tr><tr><td>"
|
||||
+ tr("Ellipsoids file:") + "</td><td><code>"
|
||||
+ QDir::cleanPath(GLOBAL_ELLIPSOID_FILE) + "</code></td></tr>"
|
||||
+ "<tr><td></td><td></td></tr></table></div><div><table><tr><td>"
|
||||
+ tr("User override directory:") + "</td><td><code>"
|
||||
+ QDir::cleanPath(USER_DIR) + "</td></tr></table></div>"
|
||||
+ tr("GCS/PCS directory:") + "</td><td><code>"
|
||||
+ QDir::cleanPath(GLOBAL_CSV_DIR) + "</code></td></tr></table>"
|
||||
+ "<h4>" + tr("User-specific") + "</h4><table><tr><td>"
|
||||
+ tr("Map directory:") + "</td><td><code>" + QDir::cleanPath(USER_MAP_DIR)
|
||||
+ "</code></td></tr><tr><td>" + tr("POI directory:") + "</td><td><code>"
|
||||
+ QDir::cleanPath(USER_POI_DIR) + "</code></td></tr><tr><td>"
|
||||
+ tr("GCS/PCS directory:") + "</td><td><code>"
|
||||
+ QDir::cleanPath(USER_CSV_DIR) + "</code></td></tr></table>"
|
||||
);
|
||||
|
||||
msgBox.exec();
|
||||
@ -870,6 +927,15 @@ void GUI::openOptions()
|
||||
QPixmapCache::setCacheLimit(options.pixmapCache * 1024);
|
||||
if (options.connectionTimeout != _options.connectionTimeout)
|
||||
Downloader::setTimeout(options.connectionTimeout);
|
||||
#ifdef ENABLE_HTTP2
|
||||
if (options.enableHTTP2 != _options.enableHTTP2)
|
||||
Downloader::enableHTTP2(options.enableHTTP2);
|
||||
#endif // ENABLE_HTTP2
|
||||
#ifdef ENABLE_HIDPI
|
||||
if (options.hidpiMap != _options.hidpiMap)
|
||||
_mapView->setDevicePixelRatio(options.hidpiMap ? devicePixelRatioF()
|
||||
: 1.0);
|
||||
#endif // ENABLE_HIDPI
|
||||
|
||||
if (reload)
|
||||
reloadFile();
|
||||
@ -908,45 +974,112 @@ void GUI::exportFile()
|
||||
plot(&printer);
|
||||
}
|
||||
|
||||
void GUI::statistics()
|
||||
{
|
||||
QLocale l(QLocale::system());
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
QString text = "<style>td {white-space: pre; padding-right: 4em;}"
|
||||
"th {text-align: left; padding-top: 0.5em;}</style><table>";
|
||||
#else // Q_OS_WIN32
|
||||
QString text = "<style>td {white-space: pre; padding-right: 2em;}"
|
||||
"th {text-align: left; padding-top: 0.5em;}</style><table>";
|
||||
#endif // Q_OS_WIN32
|
||||
|
||||
if (_showTracksAction->isChecked() && _trackCount > 1)
|
||||
text.append("<tr><td>" + tr("Tracks") + ":</td><td>"
|
||||
+ l.toString(_trackCount) + "</td></tr>");
|
||||
if (_showRoutesAction->isChecked() && _routeCount > 1)
|
||||
text.append("<tr><td>" + tr("Routes") + ":</td><td>"
|
||||
+ l.toString(_routeCount) + "</td></tr>");
|
||||
if (_showWaypointsAction->isChecked() && _waypointCount > 1)
|
||||
text.append("<tr><td>" + tr("Waypoints") + ":</td><td>"
|
||||
+ l.toString(_waypointCount) + "</td></tr>");
|
||||
|
||||
if (_dateRange.first.isValid()) {
|
||||
if (_dateRange.first == _dateRange.second) {
|
||||
QString format = l.dateFormat(QLocale::LongFormat);
|
||||
text.append("<tr><td>" + tr("Date") + ":</td><td>"
|
||||
+ _dateRange.first.toString(format) + "</td></tr>");
|
||||
} else {
|
||||
QString format = l.dateFormat(QLocale::ShortFormat);
|
||||
text.append("<tr><td>" + tr("Date") + ":</td><td>"
|
||||
+ QString("%1 - %2").arg(_dateRange.first.toString(format),
|
||||
_dateRange.second.toString(format)) + "</td></tr>");
|
||||
}
|
||||
}
|
||||
|
||||
if (distance() > 0)
|
||||
text.append("<tr><td>" + tr("Distance") + ":</td><td>"
|
||||
+ Format::distance(distance(), units()) + "</td></tr>");
|
||||
if (time() > 0) {
|
||||
text.append("<tr><td>" + tr("Time") + ":</td><td>"
|
||||
+ Format::timeSpan(time()) + "</td></tr>");
|
||||
text.append("<tr><td>" + tr("Moving time") + ":</td><td>"
|
||||
+ Format::timeSpan(movingTime()) + "</td></tr>");
|
||||
}
|
||||
|
||||
for (int i = 0; i < _tabs.count(); i++) {
|
||||
const GraphTab *tab = _tabs.at(i);
|
||||
if (tab->isEmpty())
|
||||
continue;
|
||||
|
||||
text.append("<tr><th colspan=\"2\">" + tab->label() + "</th></tr>");
|
||||
for (int j = 0; j < tab->info().size(); j++) {
|
||||
const KV &kv = tab->info().at(j);
|
||||
text.append("<tr><td>" + kv.key() + ":</td><td>" + kv.value()
|
||||
+ "</td></tr>");
|
||||
}
|
||||
}
|
||||
|
||||
text.append("</table>");
|
||||
|
||||
|
||||
QMessageBox msgBox(this);
|
||||
msgBox.setWindowTitle(tr("Statistics"));
|
||||
msgBox.setText("<h3>" + tr("Statistics") + "</h3>");
|
||||
msgBox.setInformativeText(text);
|
||||
msgBox.exec();
|
||||
}
|
||||
|
||||
void GUI::plot(QPrinter *printer)
|
||||
{
|
||||
QLocale l(QLocale::system());
|
||||
QPainter p(printer);
|
||||
TrackInfo info;
|
||||
qreal ih, gh, mh, ratio;
|
||||
qreal d = distance();
|
||||
qreal t = time();
|
||||
qreal tm = movingTime();
|
||||
|
||||
|
||||
if (!_pathName.isNull() && _options.printName)
|
||||
info.insert(tr("Name"), _pathName);
|
||||
|
||||
if (_options.printItemCount) {
|
||||
if (_showTracksAction->isChecked() && _trackCount > 1)
|
||||
info.insert(tr("Tracks"), QString::number(_trackCount));
|
||||
info.insert(tr("Tracks"), l.toString(_trackCount));
|
||||
if (_showRoutesAction->isChecked() && _routeCount > 1)
|
||||
info.insert(tr("Routes"), QString::number(_routeCount));
|
||||
if (_showWaypointsAction->isChecked() && _waypointCount > 2)
|
||||
info.insert(tr("Waypoints"), QString::number(_waypointCount));
|
||||
info.insert(tr("Routes"), l.toString(_routeCount));
|
||||
if (_showWaypointsAction->isChecked() && _waypointCount > 1)
|
||||
info.insert(tr("Waypoints"), l.toString(_waypointCount));
|
||||
}
|
||||
|
||||
if (_dateRange.first.isValid() && _options.printDate) {
|
||||
if (_dateRange.first == _dateRange.second) {
|
||||
QString format = QLocale::system().dateFormat(QLocale::LongFormat);
|
||||
QString format = l.dateFormat(QLocale::LongFormat);
|
||||
info.insert(tr("Date"), _dateRange.first.toString(format));
|
||||
} else {
|
||||
QString format = QLocale::system().dateFormat(QLocale::ShortFormat);
|
||||
QString format = l.dateFormat(QLocale::ShortFormat);
|
||||
info.insert(tr("Date"), QString("%1 - %2")
|
||||
.arg(_dateRange.first.toString(format),
|
||||
_dateRange.second.toString(format)));
|
||||
}
|
||||
}
|
||||
|
||||
if (d > 0 && _options.printDistance)
|
||||
info.insert(tr("Distance"), Format::distance(d, units()));
|
||||
if (t > 0 && _options.printTime)
|
||||
info.insert(tr("Time"), Format::timeSpan(t));
|
||||
if (tm > 0 && _options.printMovingTime)
|
||||
info.insert(tr("Moving time"), Format::timeSpan(tm));
|
||||
if (distance() > 0 && _options.printDistance)
|
||||
info.insert(tr("Distance"), Format::distance(distance(), units()));
|
||||
if (time() > 0 && _options.printTime)
|
||||
info.insert(tr("Time"), Format::timeSpan(time()));
|
||||
if (movingTime() > 0 && _options.printMovingTime)
|
||||
info.insert(tr("Moving time"), Format::timeSpan(movingTime()));
|
||||
|
||||
qreal fsr = 1085.0 / (qMax(printer->width(), printer->height())
|
||||
/ (qreal)printer->resolution());
|
||||
@ -1162,6 +1295,7 @@ bool GUI::loadMap(const QString &fileName)
|
||||
|
||||
if (_ml->loadFile(fileName)) {
|
||||
QAction *a = new QAction(_ml->maps().last()->name(), this);
|
||||
a->setMenuRole(QAction::NoRole);
|
||||
a->setCheckable(true);
|
||||
a->setActionGroup(_mapsActionGroup);
|
||||
_mapsSignalMapper->setMapping(a, _ml->maps().size() - 1);
|
||||
@ -1640,6 +1774,10 @@ void GUI::writeSettings()
|
||||
settings.setValue(POI_RADIUS_SETTING, _options.poiRadius);
|
||||
if (_options.useOpenGL != USE_OPENGL_DEFAULT)
|
||||
settings.setValue(USE_OPENGL_SETTING, _options.useOpenGL);
|
||||
#ifdef ENABLE_HTTP2
|
||||
if (_options.enableHTTP2 != ENABLE_HTTP2_DEFAULT)
|
||||
settings.setValue(ENABLE_HTTP2_SETTING, _options.enableHTTP2);
|
||||
#endif // ENABLE_HTTP2
|
||||
if (_options.pixmapCache != PIXMAP_CACHE_DEFAULT)
|
||||
settings.setValue(PIXMAP_CACHE_SETTING, _options.pixmapCache);
|
||||
if (_options.connectionTimeout != CONNECTION_TIMEOUT_DEFAULT)
|
||||
@ -1665,6 +1803,10 @@ void GUI::writeSettings()
|
||||
settings.setValue(SLIDER_COLOR_SETTING, _options.sliderColor);
|
||||
if (_options.alwaysShowMap != ALWAYS_SHOW_MAP_DEFAULT)
|
||||
settings.setValue(ALWAYS_SHOW_MAP_SETTING, _options.alwaysShowMap);
|
||||
#ifdef ENABLE_HIDPI
|
||||
if (_options.hidpiMap != HIDPI_MAP_DEFAULT)
|
||||
settings.setValue(HIDPI_MAP_SETTING, _options.hidpiMap);
|
||||
#endif // ENABLE_HIDPI
|
||||
settings.endGroup();
|
||||
}
|
||||
|
||||
@ -1872,6 +2014,10 @@ void GUI::readSettings()
|
||||
.toInt();
|
||||
_options.useOpenGL = settings.value(USE_OPENGL_SETTING, USE_OPENGL_DEFAULT)
|
||||
.toBool();
|
||||
#ifdef ENABLE_HTTP2
|
||||
_options.enableHTTP2 = settings.value(ENABLE_HTTP2_SETTING,
|
||||
ENABLE_HTTP2_DEFAULT).toBool();
|
||||
#endif // ENABLE_HTTP2
|
||||
_options.pixmapCache = settings.value(PIXMAP_CACHE_SETTING,
|
||||
PIXMAP_CACHE_DEFAULT).toInt();
|
||||
_options.connectionTimeout = settings.value(CONNECTION_TIMEOUT_SETTING,
|
||||
@ -1896,6 +2042,10 @@ void GUI::readSettings()
|
||||
SLIDER_COLOR_DEFAULT).value<QColor>();
|
||||
_options.alwaysShowMap = settings.value(ALWAYS_SHOW_MAP_SETTING,
|
||||
ALWAYS_SHOW_MAP_DEFAULT).toBool();
|
||||
#ifdef ENABLE_HIDPI
|
||||
_options.hidpiMap = settings.value(HIDPI_MAP_SETTING, HIDPI_MAP_SETTING)
|
||||
.toBool();
|
||||
#endif // ENABLE_HIDPI
|
||||
|
||||
_mapView->setPalette(_options.palette);
|
||||
_mapView->setMapOpacity(_options.mapOpacity);
|
||||
@ -1912,6 +2062,9 @@ void GUI::readSettings()
|
||||
_mapView->setMarkerColor(_options.sliderColor);
|
||||
if (_options.useOpenGL)
|
||||
_mapView->useOpenGL(true);
|
||||
#ifdef ENABLE_HIDPI
|
||||
_mapView->setDevicePixelRatio(_options.hidpiMap ? devicePixelRatioF() : 1.0);
|
||||
#endif // ENABLE_HIDPI
|
||||
|
||||
for (int i = 0; i < _tabs.count(); i++) {
|
||||
_tabs.at(i)->setPalette(_options.palette);
|
||||
@ -1937,6 +2090,9 @@ void GUI::readSettings()
|
||||
|
||||
QPixmapCache::setCacheLimit(_options.pixmapCache * 1024);
|
||||
Downloader::setTimeout(_options.connectionTimeout);
|
||||
#ifdef ENABLE_HTTP2
|
||||
Downloader::enableHTTP2(_options.enableHTTP2);
|
||||
#endif // ENABLE_HTTP2
|
||||
|
||||
settings.endGroup();
|
||||
}
|
||||
@ -1977,3 +2133,39 @@ qreal GUI::movingTime() const
|
||||
{
|
||||
return (_showTracksAction->isChecked()) ? _movingTime : 0;
|
||||
}
|
||||
|
||||
void GUI::show()
|
||||
{
|
||||
QMainWindow::show();
|
||||
|
||||
#ifdef ENABLE_HIDPI
|
||||
QWindow *w = windowHandle();
|
||||
connect(w->screen(), SIGNAL(logicalDotsPerInchChanged(qreal)), this,
|
||||
SLOT(logicalDotsPerInchChanged(qreal)));
|
||||
connect(w, SIGNAL(screenChanged(QScreen*)), this,
|
||||
SLOT(screenChanged(QScreen*)));
|
||||
#endif // ENABLE_HIDPI
|
||||
}
|
||||
|
||||
void GUI::screenChanged(QScreen *screen)
|
||||
{
|
||||
#ifdef ENABLE_HIDPI
|
||||
_mapView->setDevicePixelRatio(_options.hidpiMap ? devicePixelRatioF() : 1.0);
|
||||
|
||||
disconnect(SIGNAL(logicalDotsPerInchChanged(qreal)), this,
|
||||
SLOT(logicalDotsPerInchChanged(qreal)));
|
||||
connect(screen, SIGNAL(logicalDotsPerInchChanged(qreal)), this,
|
||||
SLOT(logicalDotsPerInchChanged(qreal)));
|
||||
#else // ENABLE_HIDPI
|
||||
Q_UNUSED(screen);
|
||||
#endif // ENABLE_HIDPI
|
||||
}
|
||||
|
||||
void GUI::logicalDotsPerInchChanged(qreal dpi)
|
||||
{
|
||||
Q_UNUSED(dpi)
|
||||
|
||||
#ifdef ENABLE_HIDPI
|
||||
_mapView->setDevicePixelRatio(_options.hidpiMap ? devicePixelRatioF() : 1.0);
|
||||
#endif // ENBLE_HIDPI
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ class MapView;
|
||||
class Map;
|
||||
class MapList;
|
||||
class POI;
|
||||
class QScreen;
|
||||
|
||||
class GUI : public QMainWindow
|
||||
{
|
||||
@ -37,6 +38,7 @@ public:
|
||||
GUI();
|
||||
|
||||
bool openFile(const QString &fileName);
|
||||
void show();
|
||||
|
||||
private slots:
|
||||
void about();
|
||||
@ -47,6 +49,7 @@ private slots:
|
||||
void openFile();
|
||||
void closeAll();
|
||||
void reloadFile();
|
||||
void statistics();
|
||||
void openPOIFile();
|
||||
void closePOIFiles();
|
||||
void showGraphs(bool show);
|
||||
@ -82,6 +85,8 @@ private slots:
|
||||
void setDMS() {setCoordinatesFormat(DMS);}
|
||||
|
||||
void sliderPositionChanged(qreal pos);
|
||||
void screenChanged(QScreen *screen);
|
||||
void logicalDotsPerInchChanged(qreal dpi);
|
||||
|
||||
private:
|
||||
typedef QPair<QDate, QDate> DateRange;
|
||||
@ -150,6 +155,7 @@ private:
|
||||
QAction *_openFileAction;
|
||||
QAction *_closeFileAction;
|
||||
QAction *_reloadFileAction;
|
||||
QAction *_statisticsAction;
|
||||
QAction *_openPOIAction;
|
||||
QAction *_closePOIAction;
|
||||
QAction *_showPOIAction;
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include <QLocale>
|
||||
#include "data/data.h"
|
||||
#include "heartrategraphitem.h"
|
||||
#include "heartrategraph.h"
|
||||
@ -7,7 +8,7 @@ HeartRateGraph::HeartRateGraph(QWidget *parent) : GraphTab(parent)
|
||||
{
|
||||
_showTracks = true;
|
||||
|
||||
GraphView::setYUnits(tr("1/min"));
|
||||
GraphView::setYUnits(tr("bpm"));
|
||||
setYLabel(tr("Heart rate"));
|
||||
|
||||
setSliderPrecision(0);
|
||||
@ -16,9 +17,11 @@ HeartRateGraph::HeartRateGraph(QWidget *parent) : GraphTab(parent)
|
||||
void HeartRateGraph::setInfo()
|
||||
{
|
||||
if (_showTracks) {
|
||||
GraphView::addInfo(tr("Average"), QString::number(avg() * yScale(), 'f',
|
||||
QLocale l(QLocale::system());
|
||||
|
||||
GraphView::addInfo(tr("Average"), l.toString(avg() * yScale(), 'f',
|
||||
0) + UNIT_SPACE + yUnits());
|
||||
GraphView::addInfo(tr("Maximum"), QString::number(max() * yScale(), 'f',
|
||||
GraphView::addInfo(tr("Maximum"), l.toString(max() * yScale(), 'f',
|
||||
0) + UNIT_SPACE + yUnits());
|
||||
} else
|
||||
clearInfo();
|
||||
|
@ -1,6 +1,8 @@
|
||||
#include <QLocale>
|
||||
#include "tooltip.h"
|
||||
#include "heartrategraphitem.h"
|
||||
|
||||
|
||||
HeartRateGraphItem::HeartRateGraphItem(const Graph &graph, GraphType type,
|
||||
QGraphicsItem *parent) : GraphItem(graph, type, parent)
|
||||
{
|
||||
@ -16,11 +18,12 @@ HeartRateGraphItem::HeartRateGraphItem(const Graph &graph, GraphType type,
|
||||
QString HeartRateGraphItem::toolTip() const
|
||||
{
|
||||
ToolTip tt;
|
||||
QLocale l(QLocale::system());
|
||||
|
||||
tt.insert(tr("Maximum"), QString::number(max(), 'f', 0)
|
||||
+ UNIT_SPACE + tr("1/min"));
|
||||
tt.insert(tr("Average"), QString::number(avg(), 'f', 0)
|
||||
+ UNIT_SPACE + tr("1/min"));
|
||||
tt.insert(tr("Maximum"), l.toString(max(), 'f', 0)
|
||||
+ UNIT_SPACE + tr("bpm"));
|
||||
tt.insert(tr("Average"), l.toString(avg(), 'f', 0)
|
||||
+ UNIT_SPACE + tr("bpm"));
|
||||
|
||||
return tt.toString();
|
||||
}
|
||||
|
@ -20,10 +20,11 @@
|
||||
#define FULLSCREEN_ICON ":/icons/view-fullscreen.png"
|
||||
|
||||
// Options dialog icons
|
||||
#define APPEARANCE_ICON ":/icons/preferences-desktop-display.png"
|
||||
#define POI_ICON ":/icons/flag_48.png"
|
||||
#define SYSTEM_ICON ":/icons/system-run.png"
|
||||
#define PRINT_EXPORT_ICON ":/icons/document-print-preview.png"
|
||||
#define APPEARANCE_ICON ":/icons/format-stroke-color.png"
|
||||
#define POI_ICON ":/icons/flag_32.png"
|
||||
#define SYSTEM_ICON ":/icons/preferences-system.png"
|
||||
#define PRINT_EXPORT_ICON ":/icons/document-print_32.png"
|
||||
#define DATA_ICON ":/icons/view-filter.png"
|
||||
#define MAPS_ICON ":/icons/applications-internet_32.png"
|
||||
|
||||
#endif /* ICONS_H */
|
||||
|
@ -9,10 +9,6 @@ InfoItem::InfoItem(QGraphicsItem *parent) : QGraphicsItem(parent)
|
||||
{
|
||||
_font.setPixelSize(FONT_SIZE);
|
||||
_font.setFamily(FONT_FAMILY);
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
setCacheMode(QGraphicsItem::DeviceCoordinateCache);
|
||||
#endif // Q_OS_MAC
|
||||
}
|
||||
|
||||
void InfoItem::updateBoundingRect()
|
||||
@ -22,8 +18,8 @@ void InfoItem::updateBoundingRect()
|
||||
|
||||
for (QList<KV>::const_iterator i = _list.constBegin();
|
||||
i != _list.constEnd(); i++) {
|
||||
width += fm.width(i->key + ": ");
|
||||
width += fm.width(i->value) + ((i == _list.constEnd() - 1)
|
||||
width += fm.width(i->key() + ": ");
|
||||
width += fm.width(i->value()) + ((i == _list.constEnd() - 1)
|
||||
? 0 : PADDING);
|
||||
}
|
||||
|
||||
@ -43,10 +39,10 @@ void InfoItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||
|
||||
for (QList<KV>::const_iterator i = _list.constBegin();
|
||||
i != _list.constEnd(); i++) {
|
||||
painter->drawText(width, fm.height() - fm.descent(), i->key + ": ");
|
||||
width += fm.width(i->key + ": ");
|
||||
painter->drawText(width, fm.height() - fm.descent(), i->value);
|
||||
width += fm.width(i->value) + ((i == _list.constEnd() - 1)
|
||||
painter->drawText(width, fm.height() - fm.descent(), i->key() + ": ");
|
||||
width += fm.width(i->key() + ": ");
|
||||
painter->drawText(width, fm.height() - fm.descent(), i->value());
|
||||
width += fm.width(i->value()) + ((i == _list.constEnd() - 1)
|
||||
? 0 : PADDING);
|
||||
if (i != _list.constEnd() - 1) {
|
||||
painter->save();
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include <QGraphicsItem>
|
||||
#include <QList>
|
||||
#include "kv.h"
|
||||
|
||||
class InfoItem : public QGraphicsItem
|
||||
{
|
||||
@ -13,6 +14,8 @@ public:
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||
QWidget *widget);
|
||||
|
||||
const QList<KV> &info() const {return _list;}
|
||||
|
||||
void insert(const QString &key, const QString &value);
|
||||
void clear();
|
||||
bool isEmpty() {return _list.isEmpty();}
|
||||
@ -20,17 +23,6 @@ public:
|
||||
private:
|
||||
void updateBoundingRect();
|
||||
|
||||
class KV {
|
||||
public:
|
||||
QString key;
|
||||
QString value;
|
||||
|
||||
KV(const QString &k, const QString &v)
|
||||
{key = k; value = v;}
|
||||
bool operator==(const KV &other) const
|
||||
{return this->key == other.key;}
|
||||
};
|
||||
|
||||
QList<KV> _list;
|
||||
QRectF _boundingRect;
|
||||
QFont _font;
|
||||
|
@ -24,6 +24,7 @@
|
||||
#define NEXT_MAP_SHORTCUT QKeySequence(QKeySequence::Forward)
|
||||
#define PREV_MAP_SHORTCUT QKeySequence(QKeySequence::Back)
|
||||
#define SHOW_GRAPHS_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_G)
|
||||
#define STATISTICS_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_S)
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#define FULLSCREEN_SHORTCUT QKeySequence(Qt::META + Qt::CTRL + Qt::Key_F)
|
||||
|
21
src/GUI/kv.h
Normal file
@ -0,0 +1,21 @@
|
||||
#ifndef KV_H
|
||||
#define KV_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
class KV {
|
||||
public:
|
||||
KV(const QString &key, const QString &value) : _key(key), _value(value) {}
|
||||
|
||||
const QString &key() const {return _key;}
|
||||
const QString &value() const {return _value;}
|
||||
|
||||
bool operator==(const KV &other) const
|
||||
{return this->key() == other.key();}
|
||||
|
||||
private:
|
||||
QString _key;
|
||||
QString _value;
|
||||
};
|
||||
|
||||
#endif // KV_H
|
@ -29,7 +29,6 @@ MapView::MapView(Map *map, POI *poi, QWidget *parent)
|
||||
|
||||
_scene = new QGraphicsScene(this);
|
||||
setScene(_scene);
|
||||
setCacheMode(QGraphicsView::CacheBackground);
|
||||
setDragMode(QGraphicsView::ScrollHandDrag);
|
||||
setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
|
||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
@ -72,6 +71,10 @@ MapView::MapView(Map *map, POI *poi, QWidget *parent)
|
||||
_poiSize = 8;
|
||||
_poiColor = Qt::black;
|
||||
|
||||
#ifdef ENABLE_HIDPI
|
||||
_ratio = 1.0;
|
||||
#endif // ENABLE_HIDPI
|
||||
_opengl = false;
|
||||
_plot = false;
|
||||
_digitalZoom = 0;
|
||||
|
||||
@ -228,7 +231,7 @@ void MapView::updatePOIVisibility()
|
||||
void MapView::rescale()
|
||||
{
|
||||
_scene->setSceneRect(_map->bounds());
|
||||
resetCachedContent();
|
||||
reloadMap();
|
||||
|
||||
for (int i = 0; i < _tracks.size(); i++)
|
||||
_tracks.at(i)->setMap(_map);
|
||||
@ -266,6 +269,9 @@ void MapView::setMap(Map *map)
|
||||
|
||||
_map = map;
|
||||
_map->load();
|
||||
#ifdef ENABLE_HIDPI
|
||||
_map->setDevicePixelRatio(_ratio);
|
||||
#endif // ENABLE_HIDPI
|
||||
connect(_map, SIGNAL(loaded()), this, SLOT(reloadMap()));
|
||||
|
||||
digitalZoom(0);
|
||||
@ -289,7 +295,7 @@ void MapView::setMap(Map *map)
|
||||
_map->ll2xy(cr.bottomRight())).center();
|
||||
centerOn(nc);
|
||||
|
||||
resetCachedContent();
|
||||
reloadMap();
|
||||
QPixmapCache::clear();
|
||||
}
|
||||
|
||||
@ -498,6 +504,9 @@ void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
|
||||
// Enter plot mode
|
||||
setUpdatesEnabled(false);
|
||||
_plot = true;
|
||||
#ifdef ENABLE_HIDPI
|
||||
_map->setDevicePixelRatio(1.0);
|
||||
#endif // ENABLE_HIDPI
|
||||
|
||||
// Compute sizes & ratios
|
||||
orig = viewport()->rect();
|
||||
@ -556,6 +565,9 @@ void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
|
||||
_mapScale->setPos(origPos);
|
||||
|
||||
// Exit plot mode
|
||||
#ifdef ENABLE_HIDPI
|
||||
_map->setDevicePixelRatio(_ratio);
|
||||
#endif // ENABLE_HIDPI
|
||||
_plot = false;
|
||||
setUpdatesEnabled(true);
|
||||
}
|
||||
@ -635,7 +647,7 @@ void MapView::showRouteWaypoints(bool show)
|
||||
void MapView::showMap(bool show)
|
||||
{
|
||||
_showMap = show;
|
||||
resetCachedContent();
|
||||
reloadMap();
|
||||
}
|
||||
|
||||
void MapView::showPOI(bool show)
|
||||
@ -738,13 +750,13 @@ void MapView::setPOIColor(const QColor &color)
|
||||
void MapView::setMapOpacity(int opacity)
|
||||
{
|
||||
_opacity = opacity / 100.0;
|
||||
resetCachedContent();
|
||||
reloadMap();
|
||||
}
|
||||
|
||||
void MapView::setBackgroundColor(const QColor &color)
|
||||
{
|
||||
_backgroundColor = color;
|
||||
resetCachedContent();
|
||||
reloadMap();
|
||||
}
|
||||
|
||||
void MapView::drawBackground(QPainter *painter, const QRectF &rect)
|
||||
@ -753,9 +765,17 @@ void MapView::drawBackground(QPainter *painter, const QRectF &rect)
|
||||
|
||||
if (_showMap) {
|
||||
QRectF ir = rect.intersected(_map->bounds());
|
||||
Map::Flags flags = Map::NoFlags;
|
||||
|
||||
if (_opacity < 1.0)
|
||||
painter->setOpacity(_opacity);
|
||||
_map->draw(painter, ir, _plot);
|
||||
|
||||
if (_plot)
|
||||
flags = Map::Block;
|
||||
else if (_opengl)
|
||||
flags = Map::OpenGL;
|
||||
|
||||
_map->draw(painter, ir, flags);
|
||||
}
|
||||
}
|
||||
|
||||
@ -796,6 +816,8 @@ void MapView::scrollContentsBy(int dx, int dy)
|
||||
|
||||
void MapView::useOpenGL(bool use)
|
||||
{
|
||||
_opengl = use;
|
||||
|
||||
if (use)
|
||||
setViewport(new OPENGL_WIDGET);
|
||||
else
|
||||
@ -819,5 +841,42 @@ void MapView::setMarkerColor(const QColor &color)
|
||||
|
||||
void MapView::reloadMap()
|
||||
{
|
||||
resetCachedContent();
|
||||
_scene->invalidate();
|
||||
}
|
||||
|
||||
void MapView::setDevicePixelRatio(qreal ratio)
|
||||
{
|
||||
#ifdef ENABLE_HIDPI
|
||||
if (_ratio == ratio)
|
||||
return;
|
||||
|
||||
_ratio = ratio;
|
||||
|
||||
QRectF vr(mapToScene(viewport()->rect()).boundingRect()
|
||||
.intersected(_map->bounds()));
|
||||
RectC cr(_map->xy2ll(vr.topLeft()), _map->xy2ll(vr.bottomRight()));
|
||||
|
||||
_map->setDevicePixelRatio(_ratio);
|
||||
_scene->setSceneRect(_map->bounds());
|
||||
|
||||
for (int i = 0; i < _tracks.size(); i++)
|
||||
_tracks.at(i)->setMap(_map);
|
||||
for (int i = 0; i < _routes.size(); i++)
|
||||
_routes.at(i)->setMap(_map);
|
||||
for (int i = 0; i < _waypoints.size(); i++)
|
||||
_waypoints.at(i)->setMap(_map);
|
||||
|
||||
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it;
|
||||
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
||||
it.value()->setMap(_map);
|
||||
updatePOIVisibility();
|
||||
|
||||
QPointF nc = QRectF(_map->ll2xy(cr.topLeft()),
|
||||
_map->ll2xy(cr.bottomRight())).center();
|
||||
centerOn(nc);
|
||||
|
||||
reloadMap();
|
||||
#else // ENABLE_HIDPI
|
||||
Q_UNUSED(ratio);
|
||||
#endif // ENABLE_HIDPI
|
||||
}
|
||||
|