1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-07 08:02:50 +02:00

Compare commits

..

81 Commits
5.13 ... 5.17

Author SHA1 Message Date
cdc9e51696 Added HiDPI displays/maps support 2018-08-18 21:06:36 +02:00
975d9816f4 Added maps repo link 2018-08-16 07:17:30 +02:00
187a909b4f Now using macros for the translations sections 2018-08-16 06:57:26 +02:00
1e6a49673e Added SLF info 2018-08-12 17:56:46 +02:00
3b7905fe8c Version++ 2018-08-12 14:23:02 +02:00
f70a4536b2 Translations update 2018-08-12 14:21:02 +02:00
b989d0e086 Added EPSG:102067 PCS (EPSG:5514 alias) 2018-08-12 14:10:26 +02:00
c3deab5369 Added SLF files association 2018-08-12 13:30:20 +02:00
f49e0223b2 Added SLF icns icon 2018-08-10 23:06:39 +02:00
96940c28d4 Added SLF ico file 2018-08-10 22:57:50 +02:00
e9ebc999fd Added SLF icon definition 2018-08-10 22:55:31 +02:00
c724bf134c Added support for Sigma SLF files 2018-08-10 22:46:04 +02:00
203f44b75a Update gpxsee_sv.ts (#145)
new strings translated
2018-08-10 19:10:26 +02:00
d0edd825cf Translations update 2018-08-10 00:25:11 +02:00
e3013bf815 Translations update (#144) 2018-08-10 00:19:56 +02:00
d4fd60b1d8 Fixed file association icons indexes 2018-08-10 00:14:31 +02:00
ba2347f363 Added LOC file association stuff 2018-08-09 22:48:44 +02:00
93a912a34a Updated ico icons 2018-08-09 22:47:17 +02:00
fb779840ce Broken SVG rendering workaround 2018-08-09 22:46:27 +02:00
dd183edd8d Updated icns icons 2018-08-09 22:32:52 +02:00
679bae0d67 Merge branch 'master' of https://github.com/tumic0/GPXSee 2018-08-09 22:31:44 +02:00
8fb4acc4c2 Added LOC icons generation
Broken SVG rendering workaround + code cleanup
2018-08-09 22:29:16 +02:00
6194519b18 Added support for geocaching.com LOC files 2018-08-08 20:18:08 +02:00
3ce3de119b Updated 4Umaps URL 2018-08-08 00:22:59 +02:00
872ecdfa58 Now building the windows version using Qt 5.11 2018-08-05 23:23:53 +02:00
121a262ea1 Remaining WGS84 deduplication 2018-07-26 23:51:11 +02:00
06c9fbd849 Properly unified the qmake/macros versions 2018-07-24 18:02:36 +02:00
aa928d96e0 Fixed OS X build 2018-07-24 18:00:40 +02:00
004e9bfef3 Fixed QT version handling in build process 2018-07-24 17:23:14 +02:00
34de55cf0c Do the comma substitution only on ASCII files 2018-07-24 17:21:45 +02:00
c0e458a437 Added support for HTTP/2 2018-07-23 23:53:58 +02:00
33739acafe Merge branch 'master' of https://github.com/tumic0/GPXSee 2018-07-23 21:56:29 +02:00
fe4eed8aa2 Fixed error reporting 2018-07-23 21:55:43 +02:00
f5ca757348 Update gpxsee_sv.ts (#139)
new strings translated
2018-07-22 10:19:22 +02:00
476f26752f Added explicit actions menu roles (broken qt heuristics workaround) 2018-07-21 23:25:24 +02:00
588859ca3a Code cleanup 2018-07-21 21:11:37 +02:00
cc8d237786 Translations update (#138) 2018-07-21 19:17:35 +02:00
5dde297210 Version++ 2018-07-21 18:20:48 +02:00
d1469290cf Translations update 2018-07-21 18:19:31 +02:00
51d4284ebe Layout adjustment 2018-07-21 18:11:19 +02:00
531eb256f1 Added statistics window 2018-07-21 16:13:18 +02:00
79388aa753 Improved paths dialogue formating 2018-07-21 14:24:13 +02:00
2980299a2a A better (shorter) directory description 2018-07-21 12:52:52 +02:00
796e61ada4 Improved path info dialogue 2018-07-21 12:24:08 +02:00
90473300e0 Added missing projection parameter handling 2018-07-21 10:08:26 +02:00
5706cdcfa1 Added workaround for broken nakarte.tk maps 2018-07-13 10:10:44 +02:00
d794ee4b22 Includes cleanup 2018-07-13 09:55:36 +02:00
262ee5bb5f Map API cleanup 2018-07-13 09:51:41 +02:00
5547cf668e Make Coverity happy 2018-07-10 08:58:37 +02:00
dd9e42ad27 Update gpxsee_sv.ts (#136)
new strings translated
2018-07-04 08:18:24 +02:00
e192116191 Update README.md 2018-07-03 23:53:05 +02:00
67c8602efd Code cleanup 2018-07-03 20:52:13 +02:00
a324698a67 Localization update 2018-07-03 19:29:28 +02:00
23bf3397b8 Translations update (#134) 2018-07-03 19:26:27 +02:00
db2d0b63e8 Version++ 2018-07-03 19:19:56 +02:00
e7cfeb0d1a Dismiss warnings 2018-07-03 19:16:51 +02:00
366e84c9fc Proper fix for Bryton Rider FIT files
Refactoring
2018-07-03 19:08:46 +02:00
3424b3e265 Added support for gear ratio graphs
Added support for FIT files from Bryton Rider devices
2018-07-03 01:29:14 +02:00
cb80389d74 Merge branch 'master' of https://github.com/tumic0/GPXSee 2018-07-02 18:51:47 +02:00
40276e8b95 Fixed broken path highlighting when digital zoom is set 2018-07-02 18:50:41 +02:00
106904a763 Fixed FIT parser crash 2018-07-02 18:50:13 +02:00
e21d89e998 Update gpxsee_de.ts (#133)
Improved Translation
2018-07-01 23:29:31 +02:00
a432ff3461 Now using a strict horizontal map scale
Code cleanup
2018-06-30 12:14:58 +02:00
201256d882 Fixed loading of OziExplorer maps with missing (default) projection parameters 2018-06-30 12:12:12 +02:00
b2a34bd10f Hardcode web mercator (EPSG 3857) support 2018-06-28 22:12:16 +02:00
63cf4c039a Update gpxsee_sv.ts (#130)
new strings translated
2018-06-28 08:37:24 +02:00
ca97ca392e Merge branch 'master' of https://github.com/tumic0/GPXSee 2018-06-28 08:36:44 +02:00
ec5ad67a3e Added missing cleanup 2018-06-28 08:36:11 +02:00
569ded1e25 Translations update (#129) 2018-06-24 17:29:53 +02:00
8e713a1f06 Retina app icon 2018-06-23 15:53:39 +02:00
f07173ab22 Localization update 2018-06-22 17:41:24 +02:00
cf6d27b1f5 Fixed "zero distance" graph crash
Improved "no graph data" reporting
2018-06-22 17:29:05 +02:00
fc18283172 Added speed data source setting 2018-06-21 20:54:24 +02:00
1cd726691e Fixed broken speed calculation
Optimization
2018-06-20 22:13:56 +02:00
24835db090 Version++ 2018-06-20 20:17:39 +02:00
2352827d9b Fixed broken distance computation 2018-06-20 20:15:22 +02:00
c5a060ed6b Outlier detection is now based on acceleration instead of speed 2018-06-19 23:56:36 +02:00
026cc68bf2 Includes cleanup 2018-06-04 23:40:42 +02:00
ec247d5d1d Added support for OziExplorer files with UTF8 BOMs 2018-06-02 16:41:27 +02:00
815cb6cb91 Code cleanup 2018-06-01 19:07:21 +02:00
ca7016176f Added missing pixmap caching 2018-05-30 22:10:35 +02:00
143 changed files with 4184 additions and 2564 deletions

View File

@ -1,14 +1,14 @@
version: 5.13.{build} version: 5.17.{build}
configuration: Release configuration: Release
platform: Any CPU platform: Any CPU
environment: environment:
NSISDIR: C:\Program Files (x86)\NSIS NSISDIR: C:\Program Files (x86)\NSIS
matrix: matrix:
- QTDIR: C:\Qt\5.9\msvc2015 - QTDIR: C:\Qt\5.11\msvc2015
PLATFORM: x86 PLATFORM: x86
NSI: gpxsee.nsi NSI: gpxsee.nsi
OPENSSLDIR: C:\OpenSSL-Win32\bin OPENSSLDIR: C:\OpenSSL-Win32\bin
- QTDIR: C:\Qt\5.9\msvc2015_64 - QTDIR: C:\Qt\5.11\msvc2015_64
PLATFORM: x86_amd64 PLATFORM: x86_amd64
NSI: gpxsee64.nsi NSI: gpxsee64.nsi
OPENSSLDIR: C:\OpenSSL-Win64\bin OPENSSLDIR: C:\OpenSSL-Win64\bin

View File

@ -1,17 +1,17 @@
# GPXSee # GPXSee
GPXSee is a Qt-based GPS log file viewer and analyzer that supports GPX, TCX, 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 ## Features
* User-definable online maps (OSM/Google tiles, WMTS, WMS). * [User-definable online maps](https://github.com/tumic0/GPXSee-maps) (OSM/Google tiles, WMTS, WMS).
* Offline maps (OziExplorer maps, TrekBuddy maps/atlases, Garmin JNX maps, GeoTIFF images). * 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 multiple tracks in one view.
* Support for POI files. * Support for POI files.
* Print/export to PDF. * Print/export to PDF.
* Full-screen mode. * Full-screen mode.
* Native GUI for Windows, Mac OS X and Linux. * 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.
![GPXSee - Linux](https://a.fsdn.com/con/app/proj/gpxsee/screenshots/linux2.png) ![GPXSee - Linux](https://a.fsdn.com/con/app/proj/gpxsee/screenshots/linux2.png)

View File

@ -1,12 +1,16 @@
TARGET = GPXSee TARGET = GPXSee
VERSION = 5.13 VERSION = 5.17
QT += core \ QT += core \
gui \ gui \
network network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets greaterThan(QT_MAJOR_VERSION, 4) {
greaterThan(QT_MAJOR_VERSION, 4): QT += printsupport QT += widgets
lessThan(QT_VERSION, 5.4): QT += opengl QT += printsupport
macx: QT += opengl }
lessThan(QT_MAJOR_VERSION, 5) {QT += opengl}
equals(QT_MAJOR_VERSION, 5) : lessThan(QT_MINOR_VERSION, 4) {QT += opengl}
INCLUDEPATH += ./src INCLUDEPATH += ./src
HEADERS += src/config.h \ HEADERS += src/config.h \
src/common/staticassert.h \ src/common/staticassert.h \
@ -49,6 +53,7 @@ HEADERS += src/config.h \
src/GUI/format.h \ src/GUI/format.h \
src/GUI/cadencegraph.h \ src/GUI/cadencegraph.h \
src/GUI/powergraph.h \ src/GUI/powergraph.h \
src/GUI/gearratiograph.h \
src/GUI/optionsdialog.h \ src/GUI/optionsdialog.h \
src/GUI/colorbox.h \ src/GUI/colorbox.h \
src/GUI/stylecombobox.h \ src/GUI/stylecombobox.h \
@ -61,6 +66,7 @@ HEADERS += src/config.h \
src/GUI/temperaturegraphitem.h \ src/GUI/temperaturegraphitem.h \
src/GUI/cadencegraphitem.h \ src/GUI/cadencegraphitem.h \
src/GUI/powergraphitem.h \ src/GUI/powergraphitem.h \
src/GUI/gearratiographitem.h \
src/GUI/oddspinbox.h \ src/GUI/oddspinbox.h \
src/GUI/settings.h \ src/GUI/settings.h \
src/GUI/nicenum.h \ src/GUI/nicenum.h \
@ -130,7 +136,10 @@ HEADERS += src/config.h \
src/map/geocentric.h \ src/map/geocentric.h \
src/map/mercator.h \ src/map/mercator.h \
src/map/jnxmap.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
SOURCES += src/main.cpp \ SOURCES += src/main.cpp \
src/common/coordinates.cpp \ src/common/coordinates.cpp \
src/common/rectc.cpp \ src/common/rectc.cpp \
@ -164,6 +173,7 @@ SOURCES += src/main.cpp \
src/GUI/format.cpp \ src/GUI/format.cpp \
src/GUI/cadencegraph.cpp \ src/GUI/cadencegraph.cpp \
src/GUI/powergraph.cpp \ src/GUI/powergraph.cpp \
src/GUI/gearratiograph.cpp \
src/GUI/optionsdialog.cpp \ src/GUI/optionsdialog.cpp \
src/GUI/colorbox.cpp \ src/GUI/colorbox.cpp \
src/GUI/stylecombobox.cpp \ src/GUI/stylecombobox.cpp \
@ -175,6 +185,7 @@ SOURCES += src/main.cpp \
src/GUI/temperaturegraphitem.cpp \ src/GUI/temperaturegraphitem.cpp \
src/GUI/cadencegraphitem.cpp \ src/GUI/cadencegraphitem.cpp \
src/GUI/powergraphitem.cpp \ src/GUI/powergraphitem.cpp \
src/GUI/gearratiographitem.cpp \
src/GUI/nicenum.cpp \ src/GUI/nicenum.cpp \
src/GUI/mapview.cpp \ src/GUI/mapview.cpp \
src/map/maplist.cpp \ src/map/maplist.cpp \
@ -228,7 +239,11 @@ SOURCES += src/main.cpp \
src/map/geocentric.cpp \ src/map/geocentric.cpp \
src/map/mercator.cpp \ src/map/mercator.cpp \
src/map/jnxmap.cpp \ src/map/jnxmap.cpp \
src/map/krovak.cpp src/map/krovak.cpp \
src/map/map.cpp \
src/data/locparser.cpp \
src/data/slfparser.cpp
RESOURCES += gpxsee.qrc RESOURCES += gpxsee.qrc
TRANSLATIONS = lang/gpxsee_cs.ts \ TRANSLATIONS = lang/gpxsee_cs.ts \
lang/gpxsee_sv.ts \ lang/gpxsee_sv.ts \
@ -237,6 +252,7 @@ TRANSLATIONS = lang/gpxsee_cs.ts \
lang/gpxsee_fi.ts \ lang/gpxsee_fi.ts \
lang/gpxsee_fr.ts \ lang/gpxsee_fr.ts \
lang/gpxsee_pl.ts lang/gpxsee_pl.ts
macx { macx {
ICON = icons/gpxsee.icns ICON = icons/gpxsee.icns
QMAKE_INFO_PLIST = pkg/Info.plist QMAKE_INFO_PLIST = pkg/Info.plist
@ -261,7 +277,9 @@ macx {
icons/nmea.icns \ icons/nmea.icns \
icons/plt.icns \ icons/plt.icns \
icons/rte.icns \ icons/rte.icns \
icons/wpt.icns icons/wpt.icns \
icons/loc.icns \
icons/slf.icns
QMAKE_BUNDLE_DATA += LOCALE MAPS ICONS CSV QMAKE_BUNDLE_DATA += LOCALE MAPS ICONS CSV
} }
win32 { win32 {
@ -274,7 +292,10 @@ win32 {
icons/nmea.ico \ icons/nmea.ico \
icons/plt.ico \ icons/plt.ico \
icons/rte.ico \ icons/rte.ico \
icons/wpt.ico icons/wpt.ico \
icons/loc.ico \
icons/slf.ico
DEFINES += _USE_MATH_DEFINES DEFINES += _USE_MATH_DEFINES
} }
DEFINES += APP_VERSION=\\\"$$VERSION\\\" DEFINES += APP_VERSION=\\\"$$VERSION\\\"

View File

@ -1,24 +1,44 @@
<RCC> <RCC>
<qresource prefix="/"> <qresource prefix="/">
<file>icons/dialog-close.png</file> <file>icons/dialog-close.png</file>
<file>icons/document-open.png</file> <file>icons/dialog-close@2x.png</file>
<file>icons/document-print.png</file> <file>icons/document-open.png</file>
<file>icons/document-export.png</file> <file>icons/document-open@2x.png</file>
<file>icons/flag.png</file> <file>icons/document-print.png</file>
<file>icons/gpxsee.png</file> <file>icons/document-print@2x.png</file>
<file>icons/application-exit.png</file> <file>icons/document-export.png</file>
<file>icons/applications-internet.png</file> <file>icons/document-export@2x.png</file>
<file>icons/view-refresh.png</file> <file>icons/flag.png</file>
<file>icons/arrow-left.png</file> <file>icons/flag@2x.png</file>
<file>icons/arrow-right.png</file> <file>icons/gpxsee.png</file>
<file>icons/arrow-left-double.png</file> <file>icons/gpxsee@2x.png</file>
<file>icons/arrow-right-double.png</file> <file>icons/application-exit.png</file>
<file>icons/view-fullscreen.png</file> <file>icons/application-exit@2x.png</file>
<file>icons/office-chart-line.png</file> <file>icons/applications-internet.png</file>
<file>icons/preferences-desktop-display.png</file> <file>icons/applications-internet@2x.png</file>
<file>icons/flag_48.png</file> <file>icons/view-refresh.png</file>
<file>icons/system-run.png</file> <file>icons/view-refresh@2x.png</file>
<file>icons/document-print-preview.png</file> <file>icons/arrow-left.png</file>
<file>icons/view-filter.png</file> <file>icons/arrow-left@2x.png</file>
</qresource> <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>
</qresource>
</RCC> </RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
icons/arrow-left@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
icons/arrow-right@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
icons/dialog-close@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 796 B

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
icons/document-open@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

BIN
icons/document-print@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
icons/document-print_32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 KiB

After

Width:  |  Height:  |  Size: 302 KiB

BIN
icons/flag@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
icons/flag_32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
icons/flag_32@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 305 KiB

After

Width:  |  Height:  |  Size: 305 KiB

Binary file not shown.

BIN
icons/gpxsee@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 KiB

After

Width:  |  Height:  |  Size: 304 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 KiB

After

Width:  |  Height:  |  Size: 304 KiB

BIN
icons/loc.icns Normal file

Binary file not shown.

BIN
icons/loc.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 KiB

After

Width:  |  Height:  |  Size: 305 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 KiB

After

Width:  |  Height:  |  Size: 302 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 303 KiB

After

Width:  |  Height:  |  Size: 302 KiB

11
icons/scripts/extensions Normal file
View 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

View File

@ -1,9 +1,6 @@
#!/bin/bash #!/bin/bash
EXTENSIONS="fit:#006600 gpx:#003399 igc:#ff3300 kml:#990000 nmea:#0083d7 \ while read e; do
plt:#66ff00 rte:#66ff00 tcx:#ffcc00 wpt:#66ff00"
for e in $EXTENSIONS; do
IFS=":"; set $e IFS=":"; set $e
EXT=`echo $1 | tr /a-z/ /A-Z/` EXT=`echo $1 | tr /a-z/ /A-Z/`
@ -25,4 +22,4 @@ for e in $EXTENSIONS; do
iconutil -c icns -o $1.icns "$ICONSET" iconutil -c icns -o $1.icns "$ICONSET"
rm -R "$ICONSET" $1.svg rm -R "$ICONSET" $1.svg
done done < extensions

View File

@ -1,13 +1,10 @@
#!/bin/bash #!/bin/bash
EXTENSIONS="fit:#006600 gpx:#003399 igc:#ff3300 kml:#990000 nmea:#0083d7 \ while read e; do
plt:#66ff00 rte:#66ff00 tcx:#ffcc00 wpt:#66ff00"
for e in $EXTENSIONS; do
IFS=":"; set $e IFS=":"; set $e
EXT=`echo $1 | tr /a-z/ /A-Z/` EXT=`echo $1 | tr /a-z/ /A-Z/`
sed -e "s/\$EXTENSION/$EXT/" -e "s/\$COLOR/$2/" icon-template.svg > $1.svg 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 convert -density 400 $1.svg -define icon:auto-resize $1.ico
rm $1.svg rm $1.svg
done done < extensions

View File

@ -12,6 +12,9 @@
</g> </g>
<g transform="translate(16.573463,124.9782)"> <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;"/> <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> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
icons/slf.icns Normal file

Binary file not shown.

BIN
icons/slf.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 KiB

After

Width:  |  Height:  |  Size: 304 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 885 B

BIN
icons/view-filter@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
icons/view-refresh@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 KiB

After

Width:  |  Height:  |  Size: 304 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -67,6 +67,38 @@
<key>CFBundleTypeRole</key> <key>CFBundleTypeRole</key>
<string>Viewer</string> <string>Viewer</string>
</dict> </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> <dict>
<key>CFBundleTypeExtensions</key> <key>CFBundleTypeExtensions</key>
<array> <array>
@ -230,6 +262,48 @@
<string>application/vnd.google-earth.kml+xml</string> <string>application/vnd.google-earth.kml+xml</string>
</dict> </dict>
</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> <dict>
<key>UTTypeIdentifier</key> <key>UTTypeIdentifier</key>
<string>com.thisisant.fit</string> <string>com.thisisant.fit</string>

View File

@ -1572,7 +1572,6 @@ SWEREF99 / RT90 5 gon O emulation,3850,4619,17344,9001,9807,4530,8801,0,9110,880
NZGD2000 / NZCS2000,3851,4167,17964,9001,9802,4500,8821,-41,9110,8822,173,9110,8823,-37.3,9110,8824,-44.3,9110,8826,3000000,9001,8827,7000000,9001,,, NZGD2000 / NZCS2000,3851,4167,17964,9001,9802,4500,8821,-41,9110,8822,173,9110,8823,-37.3,9110,8824,-44.3,9110,8826,3000000,9001,8827,7000000,9001,,,
RSRGD2000 / DGLC2000,3852,4764,17966,9001,9802,4500,8821,-90,9110,8822,157,9110,8823,-76.4,9110,8824,-79.2,9110,8826,500000,9001,8827,0,9001,,, RSRGD2000 / DGLC2000,3852,4764,17966,9001,9802,4500,8821,-90,9110,8822,157,9110,8823,-76.4,9110,8824,-79.2,9110,8826,500000,9001,8827,0,9001,,,
County ST74,3854,4619,3853,9001,9807,4531,8801,0,9110,8802,18.0328332,9110,8805,0.99999506,9201,8806,100182.7406,9001,8807,-6500620.1207,9001,,,,,, County ST74,3854,4619,3853,9001,9807,4531,8801,0,9110,8802,18.0328332,9110,8805,0.99999506,9201,8806,100182.7406,9001,8807,-6500620.1207,9001,,,,,,
WGS 84 / Pseudo-Mercator,3857,4326,3856,9001,1024,4499,8801,0,9102,8802,0,9102,8806,0,9001,8807,0,9001,,,,,,,,,
ETRS89 / GK19FIN,3873,4258,3860,9001,9807,4500,8801,0,9102,8802,19,9102,8805,1,9201,8806,19500000,9001,8807,0,9001,,,,,, ETRS89 / GK19FIN,3873,4258,3860,9001,9807,4500,8801,0,9102,8802,19,9102,8805,1,9201,8806,19500000,9001,8807,0,9001,,,,,,
ETRS89 / GK20FIN,3874,4258,3861,9001,9807,4500,8801,0,9102,8802,20,9102,8805,1,9201,8806,20500000,9001,8807,0,9001,,,,,, ETRS89 / GK20FIN,3874,4258,3861,9001,9807,4500,8801,0,9102,8802,20,9102,8805,1,9201,8806,20500000,9001,8807,0,9001,,,,,,
ETRS89 / GK21FIN,3875,4258,3862,9001,9807,4500,8801,0,9102,8802,21,9102,8805,1,9201,8806,21500000,9001,8807,0,9001,,,,,, ETRS89 / GK21FIN,3875,4258,3862,9001,9807,4500,8801,0,9102,8802,21,9102,8805,1,9201,8806,21500000,9001,8807,0,9001,,,,,,
@ -1848,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,,,,,, 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,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,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,,,,,, 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,,,,,, 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,,,,,, 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.

View File

@ -11,4 +11,4 @@ Icon=gpxsee
Terminal=false Terminal=false
Type=Application Type=Application
Categories=Graphics;Viewer;Maps;Qt; 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;

View File

@ -2,10 +2,35 @@
!include "x64.nsh" !include "x64.nsh"
!include "WinVer.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 ; The name of the installer
Name "GPXSee" Name "GPXSee"
; Program version ; Program version
!define VERSION "5.13" !define VERSION "5.17"
; The file to write ; The file to write
OutFile "GPXSee-${VERSION}.exe" OutFile "GPXSee-${VERSION}.exe"
@ -32,16 +57,6 @@ InstallDirRegKey HKLM "Software\GPXSee" "Install_Dir"
; Registry key for uninstaller ; Registry key for uninstaller
!define REGENTRY "Software\Microsoft\Windows\CurrentVersion\Uninstall\GPXSee" !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 ; Start menu page configuration
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM" !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
@ -114,43 +129,17 @@ Section "GPXSee" SEC_APP
; Associate file formats ; Associate file formats
DetailPrint "Associating file types..." DetailPrint "Associating file types..."
WriteRegStr HKCR ".gpx" "" "${REGGPX}" !insertmacro FILE_ASSOCIATION_ADD "gpx" "GPS Exchange Format" 4
WriteRegStr HKCR "${REGGPX}" "" "GPS Exchange Format" !insertmacro FILE_ASSOCIATION_ADD "tcx" "Training Center XML" 5
WriteRegStr HKCR "${REGGPX}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,2" !insertmacro FILE_ASSOCIATION_ADD "kml" "Keyhole Markup Language" 6
WriteRegStr HKCR "${REGGPX}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\"" !insertmacro FILE_ASSOCIATION_ADD "fit" "Flexible and Interoperable Data Transfer" 7
WriteRegStr HKCR ".tcx" "" "${REGTCX}" !insertmacro FILE_ASSOCIATION_ADD "igc" "Flight Recorder Data Format" 8
WriteRegStr HKCR "${REGTCX}" "" "Training Center XML" !insertmacro FILE_ASSOCIATION_ADD "nmea" "NMEA 0183 data" 9
WriteRegStr HKCR "${REGTCX}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,3" !insertmacro FILE_ASSOCIATION_ADD "plt" "OziExplorer Track Point File" 10
WriteRegStr HKCR "${REGTCX}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\"" !insertmacro FILE_ASSOCIATION_ADD "rte" "OziExplorer Route File" 11
WriteRegStr HKCR ".kml" "" "${REGKML}" !insertmacro FILE_ASSOCIATION_ADD "wpt" "OziExplorer Waypoint File" 1
WriteRegStr HKCR "${REGKML}" "" "Keyhole Markup Language" !insertmacro FILE_ASSOCIATION_ADD "loc" "Geocaching.com Waypoint File" 2
WriteRegStr HKCR "${REGKML}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,4" !insertmacro FILE_ASSOCIATION_ADD "slf" "Sigma Log File" 3
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$\""
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
SectionEnd SectionEnd
@ -167,6 +156,7 @@ Section "QT framework" SEC_QT
File /r "platforms" File /r "platforms"
File /r "imageformats" File /r "imageformats"
File /r "printsupport" File /r "printsupport"
File /r "styles"
SectionEnd SectionEnd
@ -210,40 +200,13 @@ Section "ANGLE" SEC_ANGLE
SectionEnd SectionEnd
SectionGroup "Localization" SEC_LOCALIZATION SectionGroup "Localization" SEC_LOCALIZATION
Section "Czech" !insertmacro LOCALIZATION "Czech" "cs"
CreateDirectory "$INSTDIR\translations" !insertmacro LOCALIZATION "Finnish" "fi"
File /oname=translations\gpxsee_cs.qm translations\gpxsee_cs.qm !insertmacro LOCALIZATION "French" "fr"
File /oname=translations\qt_cs.qm translations\qt_cs.qm !insertmacro LOCALIZATION "German" "de"
SectionEnd !insertmacro LOCALIZATION "Polish" "pl"
Section "Finnish" !insertmacro LOCALIZATION "Russian" "ru"
CreateDirectory "$INSTDIR\translations" !insertmacro LOCALIZATION "Swedish" "sv"
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
SectionGroupEnd SectionGroupEnd
;-------------------------------- ;--------------------------------
@ -266,24 +229,17 @@ Section "Uninstall"
RMDir "$SMPROGRAMS\$StartMenuFolder" RMDir "$SMPROGRAMS\$StartMenuFolder"
; Remove GPX file association ; Remove GPX file association
DeleteRegKey HKCR "${REGGPX}" !insertmacro FILE_ASSOCIATION_REMOVE "gpx"
DeleteRegKey HKCR ".gpx" !insertmacro FILE_ASSOCIATION_REMOVE "tcx"
DeleteRegKey HKCR "${REGTCX}" !insertmacro FILE_ASSOCIATION_REMOVE "kml"
DeleteRegKey HKCR ".tcx" !insertmacro FILE_ASSOCIATION_REMOVE "fit"
DeleteRegKey HKCR "${REGKML}" !insertmacro FILE_ASSOCIATION_REMOVE "igc"
DeleteRegKey HKCR ".kml" !insertmacro FILE_ASSOCIATION_REMOVE "nmea"
DeleteRegKey HKCR "${REGFIT}" !insertmacro FILE_ASSOCIATION_REMOVE "plt"
DeleteRegKey HKCR ".fit" !insertmacro FILE_ASSOCIATION_REMOVE "rte"
DeleteRegKey HKCR "${REGIGC}" !insertmacro FILE_ASSOCIATION_REMOVE "wpt"
DeleteRegKey HKCR ".igc" !insertmacro FILE_ASSOCIATION_REMOVE "loc"
DeleteRegKey HKCR "${REGNMEA}" !insertmacro FILE_ASSOCIATION_REMOVE "slf"
DeleteRegKey HKCR ".nmea"
DeleteRegKey HKCR "${REGPLT}"
DeleteRegKey HKCR ".plt"
DeleteRegKey HKCR "${REGRTE}"
DeleteRegKey HKCR ".rte"
DeleteRegKey HKCR "${REGWPT}"
DeleteRegKey HKCR ".wpt"
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
SectionEnd SectionEnd
@ -314,4 +270,4 @@ LangString DESC_LOCALIZATION ${LANG_ENGLISH} \
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_LOCALIZATION} $(DESC_LOCALIZATION) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_LOCALIZATION} $(DESC_LOCALIZATION)
!insertmacro MUI_FUNCTION_DESCRIPTION_END !insertmacro MUI_FUNCTION_DESCRIPTION_END

View File

@ -22,6 +22,20 @@
<glob pattern="*.kml"/> <glob pattern="*.kml"/>
</mime-type> </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"> <mime-type type="application/vnd.ant.fit">
<comment>Flexible and Interoperable Data Transfer</comment> <comment>Flexible and Interoperable Data Transfer</comment>
<sub-class-of type="application/octet-stream"/> <sub-class-of type="application/octet-stream"/>

View File

@ -2,10 +2,35 @@
!include "x64.nsh" !include "x64.nsh"
!include "WinVer.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 ; The name of the installer
Name "GPXSee" Name "GPXSee"
; Program version ; Program version
!define VERSION "5.13" !define VERSION "5.17"
; The file to write ; The file to write
OutFile "GPXSee-${VERSION}_x64.exe" OutFile "GPXSee-${VERSION}_x64.exe"
@ -32,16 +57,6 @@ InstallDirRegKey HKLM "Software\GPXSee" "Install_Dir"
; Registry key for uninstaller ; Registry key for uninstaller
!define REGENTRY "Software\Microsoft\Windows\CurrentVersion\Uninstall\GPXSee" !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 ; Start menu page configuration
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM" !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
@ -121,43 +136,17 @@ Section "GPXSee" SEC_APP
; Associate file formats ; Associate file formats
DetailPrint "Associating file types..." DetailPrint "Associating file types..."
WriteRegStr HKCR ".gpx" "" "${REGGPX}" !insertmacro FILE_ASSOCIATION_ADD "gpx" "GPS Exchange Format" 4
WriteRegStr HKCR "${REGGPX}" "" "GPS Exchange Format" !insertmacro FILE_ASSOCIATION_ADD "tcx" "Training Center XML" 5
WriteRegStr HKCR "${REGGPX}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,2" !insertmacro FILE_ASSOCIATION_ADD "kml" "Keyhole Markup Language" 6
WriteRegStr HKCR "${REGGPX}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\"" !insertmacro FILE_ASSOCIATION_ADD "fit" "Flexible and Interoperable Data Transfer" 7
WriteRegStr HKCR ".tcx" "" "${REGTCX}" !insertmacro FILE_ASSOCIATION_ADD "igc" "Flight Recorder Data Format" 8
WriteRegStr HKCR "${REGTCX}" "" "Training Center XML" !insertmacro FILE_ASSOCIATION_ADD "nmea" "NMEA 0183 data" 9
WriteRegStr HKCR "${REGTCX}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,3" !insertmacro FILE_ASSOCIATION_ADD "plt" "OziExplorer Track Point File" 10
WriteRegStr HKCR "${REGTCX}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\"" !insertmacro FILE_ASSOCIATION_ADD "rte" "OziExplorer Route File" 11
WriteRegStr HKCR ".kml" "" "${REGKML}" !insertmacro FILE_ASSOCIATION_ADD "wpt" "OziExplorer Waypoint File" 1
WriteRegStr HKCR "${REGKML}" "" "Keyhole Markup Language" !insertmacro FILE_ASSOCIATION_ADD "loc" "Geocaching.com Waypoint File" 2
WriteRegStr HKCR "${REGKML}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,4" !insertmacro FILE_ASSOCIATION_ADD "slf" "Sigma Log File" 3
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$\""
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
SectionEnd SectionEnd
@ -174,6 +163,7 @@ Section "QT framework" SEC_QT
File /r "platforms" File /r "platforms"
File /r "imageformats" File /r "imageformats"
File /r "printsupport" File /r "printsupport"
File /r "styles"
SectionEnd SectionEnd
@ -212,40 +202,13 @@ Section "ANGLE" SEC_ANGLE
SectionEnd SectionEnd
SectionGroup "Localization" SEC_LOCALIZATION SectionGroup "Localization" SEC_LOCALIZATION
Section "Czech" !insertmacro LOCALIZATION "Czech" "cs"
CreateDirectory "$INSTDIR\translations" !insertmacro LOCALIZATION "Finnish" "fi"
File /oname=translations\gpxsee_cs.qm translations\gpxsee_cs.qm !insertmacro LOCALIZATION "French" "fr"
File /oname=translations\qt_cs.qm translations\qt_cs.qm !insertmacro LOCALIZATION "German" "de"
SectionEnd !insertmacro LOCALIZATION "Polish" "pl"
Section "Finnish" !insertmacro LOCALIZATION "Russian" "ru"
CreateDirectory "$INSTDIR\translations" !insertmacro LOCALIZATION "Swedish" "sv"
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
SectionGroupEnd SectionGroupEnd
;-------------------------------- ;--------------------------------
@ -269,24 +232,17 @@ Section "Uninstall"
RMDir "$SMPROGRAMS\$StartMenuFolder" RMDir "$SMPROGRAMS\$StartMenuFolder"
; Remove File associations ; Remove File associations
DeleteRegKey HKCR "${REGGPX}" !insertmacro FILE_ASSOCIATION_REMOVE "gpx"
DeleteRegKey HKCR ".gpx" !insertmacro FILE_ASSOCIATION_REMOVE "tcx"
DeleteRegKey HKCR "${REGTCX}" !insertmacro FILE_ASSOCIATION_REMOVE "kml"
DeleteRegKey HKCR ".tcx" !insertmacro FILE_ASSOCIATION_REMOVE "fit"
DeleteRegKey HKCR "${REGKML}" !insertmacro FILE_ASSOCIATION_REMOVE "igc"
DeleteRegKey HKCR ".kml" !insertmacro FILE_ASSOCIATION_REMOVE "nmea"
DeleteRegKey HKCR "${REGFIT}" !insertmacro FILE_ASSOCIATION_REMOVE "plt"
DeleteRegKey HKCR ".fit" !insertmacro FILE_ASSOCIATION_REMOVE "rte"
DeleteRegKey HKCR "${REGIGC}" !insertmacro FILE_ASSOCIATION_REMOVE "wpt"
DeleteRegKey HKCR ".igc" !insertmacro FILE_ASSOCIATION_REMOVE "loc"
DeleteRegKey HKCR "${REGNMEA}" !insertmacro FILE_ASSOCIATION_REMOVE "slf"
DeleteRegKey HKCR ".nmea"
DeleteRegKey HKCR "${REGPLT}"
DeleteRegKey HKCR ".plt"
DeleteRegKey HKCR "${REGRTE}"
DeleteRegKey HKCR ".rte"
DeleteRegKey HKCR "${REGWPT}"
DeleteRegKey HKCR ".wpt"
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
SectionEnd SectionEnd
@ -317,4 +273,4 @@ LangString DESC_LOCALIZATION ${LANG_ENGLISH} \
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_LOCALIZATION} $(DESC_LOCALIZATION) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_LOCALIZATION} $(DESC_LOCALIZATION)
!insertmacro MUI_FUNCTION_DESCRIPTION_END !insertmacro MUI_FUNCTION_DESCRIPTION_END

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<map xmlns="http://www.gpxsee.org/map/1"> <map xmlns="http://www.gpxsee.org/map/1">
<name>4UMaps</name> <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> <copyright>Map data: © OpenStreetMap contributors (ODbL) | Rendering: © 4UMaps.eu</copyright>
<zoom min="2" max="15"/> <zoom min="2" max="15"/>
<bounds bottom="-65"/> <bounds bottom="-65"/>

View File

@ -43,10 +43,6 @@ AxisItem::AxisItem(Type type, QGraphicsItem *parent) : QGraphicsItem(parent)
_font.setPixelSize(FONT_SIZE); _font.setPixelSize(FONT_SIZE);
_font.setFamily(FONT_FAMILY); _font.setFamily(FONT_FAMILY);
#ifndef Q_OS_MAC
setCacheMode(QGraphicsItem::DeviceCoordinateCache);
#endif // Q_OS_MAC
} }
void AxisItem::setRange(const RangeF &range) void AxisItem::setRange(const RangeF &range)

View File

@ -13,11 +13,6 @@ FileBrowser::FileBrowser(QObject *parent) : QObject(parent)
_index = -1; _index = -1;
} }
FileBrowser::~FileBrowser()
{
delete _watcher;
}
void FileBrowser::setCurrent(const QString &path) void FileBrowser::setCurrent(const QString &path)
{ {
QFileInfo file(path); QFileInfo file(path);

View File

@ -13,7 +13,6 @@ class FileBrowser : public QObject
public: public:
FileBrowser(QObject *parent = 0); FileBrowser(QObject *parent = 0);
~FileBrowser();
void setFilter(const QStringList &filter); void setFilter(const QStringList &filter);
void setCurrent(const QString &path); void setCurrent(const QString &path);

View File

@ -0,0 +1,94 @@
#include "data/data.h"
#include "gearratiographitem.h"
#include "gearratiograph.h"
GearRatioGraph::GearRatioGraph(QWidget *parent) : GraphTab(parent)
{
_showTracks = true;
GraphView::setYUnits("");
setYLabel(tr("Gear ratio"));
setSliderPrecision(2);
}
void GearRatioGraph::setInfo()
{
if (_showTracks) {
GraphView::addInfo(tr("Most used"), QString::number(top() * yScale(),
'f', 2) + UNIT_SPACE + yUnits());
GraphView::addInfo(tr("Minimum"), QString::number(min() * yScale(), 'f',
2) + UNIT_SPACE + yUnits());
GraphView::addInfo(tr("Maximum"), QString::number(max() * yScale(), 'f',
2) + UNIT_SPACE + yUnits());
} else
clearInfo();
}
QList<GraphItem*> GearRatioGraph::loadData(const Data &data)
{
QList<GraphItem*> graphs;
for (int i = 0; i < data.tracks().count(); i++) {
const Graph &graph = data.tracks().at(i)->ratio();
if (graph.size() < 2) {
skipColor();
graphs.append(0);
} else {
GearRatioGraphItem *gi = new GearRatioGraphItem(graph, _graphType);
GraphView::addGraph(gi);
for (QMap<qreal, qreal>::const_iterator it = gi->map().constBegin();
it != gi->map().constEnd(); ++it)
_map.insert(it.key(), _map.value(it.key()) + it.value());
graphs.append(gi);
}
}
for (int i = 0; i < data.routes().count(); i++) {
skipColor();
graphs.append(0);
}
setInfo();
redraw();
return graphs;
}
qreal GearRatioGraph::top() const
{
qreal key = NAN, val = NAN;
for (QMap<qreal, qreal>::const_iterator it = _map.constBegin();
it != _map.constEnd(); ++it) {
if (it == _map.constBegin()) {
val = it.value();
key = it.key();
} else if (it.value() > val) {
val = it.value();
key = it.key();
}
}
return key;
}
void GearRatioGraph::clear()
{
_map.clear();
GraphView::clear();
}
void GearRatioGraph::showTracks(bool show)
{
_showTracks = show;
showGraph(show);
setInfo();
redraw();
}

30
src/GUI/gearratiograph.h Normal file
View File

@ -0,0 +1,30 @@
#ifndef GEARRATIOGRAPH_H
#define GEARRATIOGRAPH_H
#include <QMap>
#include "graphtab.h"
class GearRatioGraph : public GraphTab
{
Q_OBJECT
public:
GearRatioGraph(QWidget *parent = 0);
QString label() const {return tr("Gear ratio");}
QList<GraphItem*> loadData(const Data &data);
void clear();
void showTracks(bool show);
private:
qreal top() const;
qreal min() const {return bounds().top();}
qreal max() const {return bounds().bottom();}
void setInfo();
QMap<qreal, qreal> _map;
bool _showTracks;
};
#endif // GEARRATIOGRAPH_H

View File

@ -0,0 +1,39 @@
#include <QMap>
#include "tooltip.h"
#include "gearratiographitem.h"
GearRatioGraphItem::GearRatioGraphItem(const Graph &graph, GraphType type,
QGraphicsItem *parent) : GraphItem(graph, type, parent), _top(NAN)
{
qreal val = NAN;
for (int j = 1; j < graph.size(); j++) {
const GraphPoint &p = graph.at(j);
qreal val = _map.value(p.y());
_map.insert(p.y(), val + (p.s() - graph.at(j-1).s()));
}
for (QMap<qreal, qreal>::const_iterator it = _map.constBegin();
it != _map.constEnd(); ++it) {
if (it == _map.constBegin()) {
val = it.value();
_top = it.key();
} else if (it.value() > val) {
val = it.value();
_top = it.key();
}
}
setToolTip(toolTip());
}
QString GearRatioGraphItem::toolTip() const
{
ToolTip tt;
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));
return tt.toString();
}

View File

@ -0,0 +1,28 @@
#ifndef GEARRATIOGRAPHITEM_H
#define GEARRATIOGRAPHITEM_H
#include <QMap>
#include "graphitem.h"
class GearRatioGraphItem : public GraphItem
{
Q_OBJECT
public:
GearRatioGraphItem(const Graph &graph, GraphType type,
QGraphicsItem *parent = 0);
qreal min() const {return -bounds().bottom();}
qreal max() const {return -bounds().top();}
qreal top() const {return _top;}
const QMap<qreal, qreal> &map() const {return _map;}
private:
QString toolTip() const;
QMap<qreal, qreal> _map;
qreal _top;
};
#endif // GEARRATIOGRAPHITEM_H

View File

@ -3,6 +3,8 @@
#include <QMouseEvent> #include <QMouseEvent>
#include <QPaintEngine> #include <QPaintEngine>
#include <QPaintDevice> #include <QPaintDevice>
#include <QGraphicsSimpleTextItem>
#include <QPalette>
#include "data/graph.h" #include "data/graph.h"
#include "opengl.h" #include "opengl.h"
#include "config.h" #include "config.h"
@ -41,6 +43,9 @@ GraphView::GraphView(QWidget *parent)
_sliderInfo->setZValue(3.0); _sliderInfo->setZValue(3.0);
_info = new InfoItem(); _info = new InfoItem();
_grid = new GridItem(); _grid = new GridItem();
_message = new QGraphicsSimpleTextItem(tr("Data not available"));
_message->setBrush(QPalette().brush(QPalette::Disabled,
QPalette::WindowText));
connect(_slider, SIGNAL(positionChanged(const QPointF&)), this, connect(_slider, SIGNAL(positionChanged(const QPointF&)), this,
SLOT(emitSliderPositionChanged(const QPointF&))); SLOT(emitSliderPositionChanged(const QPointF&)));
@ -63,30 +68,27 @@ GraphView::GraphView(QWidget *parent)
GraphView::~GraphView() GraphView::~GraphView()
{ {
if (_xAxis->scene() != _scene) delete _xAxis;
delete _xAxis; delete _yAxis;
if (_yAxis->scene() != _scene) delete _slider;
delete _yAxis; delete _info;
if (_slider->scene() != _scene) delete _grid;
delete _slider; delete _message;
if (_info->scene() != _scene)
delete _info;
if (_grid->scene() != _scene)
delete _grid;
for (int i = 0; i < _graphs.count(); i++) for (int i = 0; i < _graphs.count(); i++)
if (_graphs.at(i)->scene() != _scene) delete _graphs[i];
delete _graphs[i];
} }
void GraphView::createXLabel() void GraphView::createXLabel()
{ {
_xAxis->setLabel(QString("%1 [%2]").arg(_xLabel, _xUnits)); _xAxis->setLabel(QString("%1 [%2]").arg(_xLabel,
_xUnits.isEmpty() ? "-" : _xUnits));
} }
void GraphView::createYLabel() void GraphView::createYLabel()
{ {
_yAxis->setLabel(QString("%1 [%2]").arg(_yLabel, _yUnits)); _yAxis->setLabel(QString("%1 [%2]").arg(_yLabel,
_yUnits.isEmpty() ? "-" : _yUnits));
} }
void GraphView::setYLabel(const QString &label) void GraphView::setYLabel(const QString &label)
@ -163,9 +165,16 @@ void GraphView::setGraphType(GraphType type)
_bounds = QRectF(); _bounds = QRectF();
for (int i = 0; i < _graphs.count(); i++) { for (int i = 0; i < _graphs.count(); i++) {
_graphs.at(i)->setGraphType(type); GraphItem *gi = _graphs.at(i);
if (_graphs.at(i)->scene() == _scene) gi->setGraphType(type);
_bounds |= _graphs.at(i)->bounds(); if (!_hide.contains(gi->id())) {
if (gi->bounds().width() > 0)
addItem(gi);
else
removeItem(gi);
}
if (gi->scene() == _scene)
_bounds |= gi->bounds();
} }
if (type == Distance) if (type == Distance)
@ -204,8 +213,10 @@ void GraphView::addGraph(GraphItem *graph, int id)
if (!_hide.contains(id)) { if (!_hide.contains(id)) {
_visible.append(graph); _visible.append(graph);
_scene->addItem(graph); if (graph->bounds().width() > 0) {
_bounds |= graph->bounds(); _scene->addItem(graph);
_bounds |= graph->bounds();
}
setXUnits(); setXUnits();
} }
} }
@ -232,13 +243,15 @@ void GraphView::showGraph(bool show, int id)
_visible.clear(); _visible.clear();
_bounds = QRectF(); _bounds = QRectF();
for (int i = 0; i < _graphs.count(); i++) { for (int i = 0; i < _graphs.count(); i++) {
GraphItem* gi = _graphs.at(i); GraphItem *gi = _graphs.at(i);
if (_hide.contains(gi->id())) if (_hide.contains(gi->id()))
removeItem(gi); removeItem(gi);
else { else {
addItem(gi);
_visible.append(gi); _visible.append(gi);
_bounds |= gi->bounds(); if (gi->bounds().width() > 0) {
addItem(gi);
_bounds |= gi->bounds();
}
} }
} }
} }
@ -252,7 +265,8 @@ QRectF GraphView::bounds() const
void GraphView::redraw() void GraphView::redraw()
{ {
redraw(viewport()->size() - QSizeF(MARGIN, MARGIN)); if (!_graphs.isEmpty())
redraw(viewport()->size() - QSizeF(MARGIN, MARGIN));
} }
void GraphView::redraw(const QSizeF &size) void GraphView::redraw(const QSizeF &size)
@ -263,16 +277,18 @@ void GraphView::redraw(const QSizeF &size)
qreal sx, sy; qreal sx, sy;
if (_visible.isEmpty() || _bounds.isNull()) { if (_bounds.isNull()) {
removeItem(_xAxis); removeItem(_xAxis);
removeItem(_yAxis); removeItem(_yAxis);
removeItem(_slider); removeItem(_slider);
removeItem(_info); removeItem(_info);
removeItem(_grid); removeItem(_grid);
_scene->setSceneRect(QRectF()); addItem(_message);
_scene->setSceneRect(_scene->itemsBoundingRect());
return; return;
} }
removeItem(_message);
addItem(_xAxis); addItem(_xAxis);
addItem(_yAxis); addItem(_yAxis);
addItem(_slider); addItem(_slider);
@ -330,9 +346,11 @@ void GraphView::redraw(const QSizeF &size)
_scene->setSceneRect(_scene->itemsBoundingRect()); _scene->setSceneRect(_scene->itemsBoundingRect());
} }
void GraphView::resizeEvent(QResizeEvent *) void GraphView::resizeEvent(QResizeEvent *e)
{ {
redraw(); redraw(e->size() - QSizeF(MARGIN, MARGIN));
QGraphicsView::resizeEvent(e);
} }
void GraphView::mousePressEvent(QMouseEvent *e) void GraphView::mousePressEvent(QMouseEvent *e)

View File

@ -7,15 +7,16 @@
#include "data/graph.h" #include "data/graph.h"
#include "palette.h" #include "palette.h"
#include "units.h" #include "units.h"
#include "infoitem.h"
class AxisItem; class AxisItem;
class SliderItem; class SliderItem;
class SliderInfoItem; class SliderInfoItem;
class InfoItem;
class GraphItem; class GraphItem;
class PathItem; class PathItem;
class GridItem; class GridItem;
class QGraphicsSimpleTextItem;
class GraphView : public QGraphicsView class GraphView : public QGraphicsView
{ {
@ -26,6 +27,7 @@ public:
~GraphView(); ~GraphView();
bool isEmpty() const {return _graphs.isEmpty();} bool isEmpty() const {return _graphs.isEmpty();}
const QList<KV> &info() const {return _info->info();}
void clear(); void clear();
void plot(QPainter *painter, const QRectF &target, qreal scale); void plot(QPainter *painter, const QRectF &target, qreal scale);
@ -64,7 +66,6 @@ protected:
QRectF bounds() const; QRectF bounds() const;
void redraw(); void redraw();
void redraw(const QSizeF &size);
void addInfo(const QString &key, const QString &value); void addInfo(const QString &key, const QString &value);
void clearInfo(); void clearInfo();
void skipColor() {_palette.nextColor();} void skipColor() {_palette.nextColor();}
@ -77,6 +78,7 @@ private slots:
void newSliderPosition(const QPointF &pos); void newSliderPosition(const QPointF &pos);
private: private:
void redraw(const QSizeF &size);
void setXUnits(); void setXUnits();
void createXLabel(); void createXLabel();
void createYLabel(); void createYLabel();
@ -85,8 +87,8 @@ private:
void removeItem(QGraphicsItem *item); void removeItem(QGraphicsItem *item);
void addItem(QGraphicsItem *item); void addItem(QGraphicsItem *item);
void resizeEvent(QResizeEvent *); void resizeEvent(QResizeEvent *e);
void mousePressEvent(QMouseEvent *); void mousePressEvent(QMouseEvent *e);
Units _units; Units _units;
qreal _xScale, _yScale; qreal _xScale, _yScale;
@ -104,6 +106,7 @@ private:
SliderInfoItem *_sliderInfo; SliderInfoItem *_sliderInfo;
InfoItem *_info; InfoItem *_info;
GridItem *_grid; GridItem *_grid;
QGraphicsSimpleTextItem *_message;
QList<GraphItem*> _visible; QList<GraphItem*> _visible;
QSet<int> _hide; QSet<int> _hide;

View File

@ -1,3 +1,4 @@
#include "config.h"
#include <QApplication> #include <QApplication>
#include <QSplitter> #include <QSplitter>
#include <QVBoxLayout> #include <QVBoxLayout>
@ -22,11 +23,16 @@
#include <QMimeData> #include <QMimeData>
#include <QUrl> #include <QUrl>
#include <QPixmapCache> #include <QPixmapCache>
#ifdef ENABLE_HIDPI
#include <QWindow>
#include <QScreen>
#endif // ENABLE_HIDPI
#include <QStyle>
#include "data/data.h" #include "data/data.h"
#include "data/poi.h"
#include "map/maplist.h" #include "map/maplist.h"
#include "map/emptymap.h" #include "map/emptymap.h"
#include "map/downloader.h" #include "map/downloader.h"
#include "config.h"
#include "icons.h" #include "icons.h"
#include "keys.h" #include "keys.h"
#include "settings.h" #include "settings.h"
@ -36,6 +42,7 @@
#include "temperaturegraph.h" #include "temperaturegraph.h"
#include "cadencegraph.h" #include "cadencegraph.h"
#include "powergraph.h" #include "powergraph.h"
#include "gearratiograph.h"
#include "mapview.h" #include "mapview.h"
#include "trackinfo.h" #include "trackinfo.h"
#include "filebrowser.h" #include "filebrowser.h"
@ -46,6 +53,8 @@
#include "gui.h" #include "gui.h"
#define TOOLBAR_ICON_SIZE 22
GUI::GUI() GUI::GUI()
{ {
loadMaps(); loadMaps();
@ -70,7 +79,7 @@ GUI::GUI()
_splitter->setStretchFactor(1, 1); _splitter->setStretchFactor(1, 1);
setCentralWidget(_splitter); setCentralWidget(_splitter);
setWindowIcon(QIcon(QPixmap(APP_ICON))); setWindowIcon(QIcon(APP_ICON));
setWindowTitle(APP_NAME); setWindowTitle(APP_NAME);
setUnifiedTitleAndToolBarOnMac(true); setUnifiedTitleAndToolBarOnMac(true);
setAcceptDrops(true); setAcceptDrops(true);
@ -96,14 +105,6 @@ GUI::GUI()
updateStatusBarInfo(); updateStatusBarInfo();
} }
GUI::~GUI()
{
for (int i = 0; i < _tabs.size(); i++) {
if (_graphTabWidget->indexOf(_tabs.at(i)) < 0)
delete _tabs.at(i);
}
}
void GUI::loadMaps() void GUI::loadMaps()
{ {
_ml = new MapList(this); _ml = new MapList(this);
@ -148,6 +149,7 @@ void GUI::createMapActions()
for (int i = 0; i < _ml->maps().count(); i++) { for (int i = 0; i < _ml->maps().count(); i++) {
QAction *a = new QAction(_ml->maps().at(i)->name(), this); QAction *a = new QAction(_ml->maps().at(i)->name(), this);
a->setMenuRole(QAction::NoRole);
a->setCheckable(true); a->setCheckable(true);
a->setActionGroup(_mapsActionGroup); a->setActionGroup(_mapsActionGroup);
@ -176,6 +178,7 @@ QAction *GUI::createPOIFileAction(int index)
{ {
QAction *a = new QAction(QFileInfo(_poi->files().at(index)).fileName(), QAction *a = new QAction(QFileInfo(_poi->files().at(index)).fileName(),
this); this);
a->setMenuRole(QAction::NoRole);
a->setCheckable(true); a->setCheckable(true);
_poiFilesSignalMapper->setMapping(a, index); _poiFilesSignalMapper->setMapping(a, index);
@ -199,7 +202,7 @@ void GUI::createActions()
_navigationActionGroup->setEnabled(false); _navigationActionGroup->setEnabled(false);
// General actions // 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->setShortcut(QUIT_SHORTCUT);
_exitAction->setMenuRole(QAction::QuitRole); _exitAction->setMenuRole(QAction::QuitRole);
connect(_exitAction, SIGNAL(triggered()), this, SLOT(close())); connect(_exitAction, SIGNAL(triggered()), this, SLOT(close()));
@ -207,61 +210,75 @@ void GUI::createActions()
// Help & About // Help & About
_pathsAction = new QAction(tr("Paths"), this); _pathsAction = new QAction(tr("Paths"), this);
_pathsAction->setMenuRole(QAction::NoRole);
connect(_pathsAction, SIGNAL(triggered()), this, SLOT(paths())); connect(_pathsAction, SIGNAL(triggered()), this, SLOT(paths()));
_keysAction = new QAction(tr("Keyboard controls"), this); _keysAction = new QAction(tr("Keyboard controls"), this);
_keysAction->setMenuRole(QAction::NoRole);
connect(_keysAction, SIGNAL(triggered()), this, SLOT(keys())); connect(_keysAction, SIGNAL(triggered()), this, SLOT(keys()));
_aboutAction = new QAction(QIcon(QPixmap(APP_ICON)), _aboutAction = new QAction(QIcon(APP_ICON), tr("About GPXSee"), this);
tr("About GPXSee"), this);
_aboutAction->setMenuRole(QAction::AboutRole); _aboutAction->setMenuRole(QAction::AboutRole);
connect(_aboutAction, SIGNAL(triggered()), this, SLOT(about())); connect(_aboutAction, SIGNAL(triggered()), this, SLOT(about()));
// File actions // File actions
_openFileAction = new QAction(QIcon(QPixmap(OPEN_FILE_ICON)), _openFileAction = new QAction(QIcon(OPEN_FILE_ICON), tr("Open..."), this);
tr("Open..."), this); _openFileAction->setMenuRole(QAction::NoRole);
_openFileAction->setShortcut(OPEN_SHORTCUT); _openFileAction->setShortcut(OPEN_SHORTCUT);
connect(_openFileAction, SIGNAL(triggered()), this, SLOT(openFile())); connect(_openFileAction, SIGNAL(triggered()), this, SLOT(openFile()));
addAction(_openFileAction); addAction(_openFileAction);
_printFileAction = new QAction(QIcon(QPixmap(PRINT_FILE_ICON)), _printFileAction = new QAction(QIcon(PRINT_FILE_ICON), tr("Print..."),
tr("Print..."), this); this);
_printFileAction->setMenuRole(QAction::NoRole);
_printFileAction->setActionGroup(_fileActionGroup); _printFileAction->setActionGroup(_fileActionGroup);
connect(_printFileAction, SIGNAL(triggered()), this, SLOT(printFile())); connect(_printFileAction, SIGNAL(triggered()), this, SLOT(printFile()));
addAction(_printFileAction); addAction(_printFileAction);
_exportFileAction = new QAction(QIcon(QPixmap(EXPORT_FILE_ICON)), _exportFileAction = new QAction(QIcon(EXPORT_FILE_ICON),
tr("Export to PDF..."), this); tr("Export to PDF..."), this);
_exportFileAction->setMenuRole(QAction::NoRole);
_exportFileAction->setShortcut(EXPORT_SHORTCUT); _exportFileAction->setShortcut(EXPORT_SHORTCUT);
_exportFileAction->setActionGroup(_fileActionGroup); _exportFileAction->setActionGroup(_fileActionGroup);
connect(_exportFileAction, SIGNAL(triggered()), this, SLOT(exportFile())); connect(_exportFileAction, SIGNAL(triggered()), this, SLOT(exportFile()));
addAction(_exportFileAction); addAction(_exportFileAction);
_closeFileAction = new QAction(QIcon(QPixmap(CLOSE_FILE_ICON)), _closeFileAction = new QAction(QIcon(CLOSE_FILE_ICON), tr("Close"), this);
tr("Close"), this); _closeFileAction->setMenuRole(QAction::NoRole);
_closeFileAction->setShortcut(CLOSE_SHORTCUT); _closeFileAction->setShortcut(CLOSE_SHORTCUT);
_closeFileAction->setActionGroup(_fileActionGroup); _closeFileAction->setActionGroup(_fileActionGroup);
connect(_closeFileAction, SIGNAL(triggered()), this, SLOT(closeAll())); connect(_closeFileAction, SIGNAL(triggered()), this, SLOT(closeAll()));
addAction(_closeFileAction); addAction(_closeFileAction);
_reloadFileAction = new QAction(QIcon(QPixmap(RELOAD_FILE_ICON)), _reloadFileAction = new QAction(QIcon(RELOAD_FILE_ICON), tr("Reload"),
tr("Reload"), this); this);
_reloadFileAction->setMenuRole(QAction::NoRole);
_reloadFileAction->setShortcut(RELOAD_SHORTCUT); _reloadFileAction->setShortcut(RELOAD_SHORTCUT);
_reloadFileAction->setActionGroup(_fileActionGroup); _reloadFileAction->setActionGroup(_fileActionGroup);
connect(_reloadFileAction, SIGNAL(triggered()), this, SLOT(reloadFile())); connect(_reloadFileAction, SIGNAL(triggered()), this, SLOT(reloadFile()));
addAction(_reloadFileAction); 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 // POI actions
_openPOIAction = new QAction(QIcon(QPixmap(OPEN_FILE_ICON)), _openPOIAction = new QAction(QIcon(OPEN_FILE_ICON), tr("Load POI file..."),
tr("Load POI file..."), this); this);
_openPOIAction->setMenuRole(QAction::NoRole);
connect(_openPOIAction, SIGNAL(triggered()), this, SLOT(openPOIFile())); connect(_openPOIAction, SIGNAL(triggered()), this, SLOT(openPOIFile()));
_closePOIAction = new QAction(QIcon(QPixmap(CLOSE_FILE_ICON)), _closePOIAction = new QAction(QIcon(CLOSE_FILE_ICON), tr("Close POI files"),
tr("Close POI files"), this); this);
_closePOIAction->setMenuRole(QAction::NoRole);
connect(_closePOIAction, SIGNAL(triggered()), this, SLOT(closePOIFiles())); connect(_closePOIAction, SIGNAL(triggered()), this, SLOT(closePOIFiles()));
_overlapPOIAction = new QAction(tr("Overlap POIs"), this); _overlapPOIAction = new QAction(tr("Overlap POIs"), this);
_overlapPOIAction->setMenuRole(QAction::NoRole);
_overlapPOIAction->setCheckable(true); _overlapPOIAction->setCheckable(true);
connect(_overlapPOIAction, SIGNAL(triggered(bool)), _mapView, connect(_overlapPOIAction, SIGNAL(triggered(bool)), _mapView,
SLOT(setPOIOverlap(bool))); SLOT(setPOIOverlap(bool)));
_showPOILabelsAction = new QAction(tr("Show POI labels"), this); _showPOILabelsAction = new QAction(tr("Show POI labels"), this);
_showPOILabelsAction->setMenuRole(QAction::NoRole);
_showPOILabelsAction->setCheckable(true); _showPOILabelsAction->setCheckable(true);
connect(_showPOILabelsAction, SIGNAL(triggered(bool)), _mapView, connect(_showPOILabelsAction, SIGNAL(triggered(bool)), _mapView,
SLOT(showPOILabels(bool))); SLOT(showPOILabels(bool)));
_showPOIAction = new QAction(QIcon(QPixmap(SHOW_POI_ICON)), _showPOIAction = new QAction(QIcon(SHOW_POI_ICON), tr("Show POIs"), this);
tr("Show POIs"), this); _showPOIAction->setMenuRole(QAction::NoRole);
_showPOIAction->setCheckable(true); _showPOIAction->setCheckable(true);
_showPOIAction->setShortcut(SHOW_POI_SHORTCUT); _showPOIAction->setShortcut(SHOW_POI_SHORTCUT);
connect(_showPOIAction, SIGNAL(triggered(bool)), _mapView, connect(_showPOIAction, SIGNAL(triggered(bool)), _mapView,
@ -270,25 +287,30 @@ void GUI::createActions()
createPOIFilesActions(); createPOIFilesActions();
// Map actions // Map actions
_showMapAction = new QAction(QIcon(QPixmap(SHOW_MAP_ICON)), tr("Show map"), _showMapAction = new QAction(QIcon(SHOW_MAP_ICON), tr("Show map"),
this); this);
_showMapAction->setMenuRole(QAction::NoRole);
_showMapAction->setCheckable(true); _showMapAction->setCheckable(true);
_showMapAction->setShortcut(SHOW_MAP_SHORTCUT); _showMapAction->setShortcut(SHOW_MAP_SHORTCUT);
connect(_showMapAction, SIGNAL(triggered(bool)), _mapView, connect(_showMapAction, SIGNAL(triggered(bool)), _mapView,
SLOT(showMap(bool))); SLOT(showMap(bool)));
addAction(_showMapAction); addAction(_showMapAction);
_loadMapAction = new QAction(QIcon(QPixmap(OPEN_FILE_ICON)), _loadMapAction = new QAction(QIcon(OPEN_FILE_ICON), tr("Load map..."),
tr("Load map..."), this); this);
_loadMapAction->setMenuRole(QAction::NoRole);
connect(_loadMapAction, SIGNAL(triggered()), this, SLOT(loadMap())); connect(_loadMapAction, SIGNAL(triggered()), this, SLOT(loadMap()));
_clearMapCacheAction = new QAction(tr("Clear tile cache"), this); _clearMapCacheAction = new QAction(tr("Clear tile cache"), this);
_clearMapCacheAction->setMenuRole(QAction::NoRole);
connect(_clearMapCacheAction, SIGNAL(triggered()), _mapView, connect(_clearMapCacheAction, SIGNAL(triggered()), _mapView,
SLOT(clearMapCache())); SLOT(clearMapCache()));
createMapActions(); createMapActions();
_nextMapAction = new QAction(tr("Next map"), this); _nextMapAction = new QAction(tr("Next map"), this);
_nextMapAction->setMenuRole(QAction::NoRole);
_nextMapAction->setShortcut(NEXT_MAP_SHORTCUT); _nextMapAction->setShortcut(NEXT_MAP_SHORTCUT);
connect(_nextMapAction, SIGNAL(triggered()), this, SLOT(nextMap())); connect(_nextMapAction, SIGNAL(triggered()), this, SLOT(nextMap()));
addAction(_nextMapAction); addAction(_nextMapAction);
_prevMapAction = new QAction(tr("Next map"), this); _prevMapAction = new QAction(tr("Next map"), this);
_prevMapAction->setMenuRole(QAction::NoRole);
_prevMapAction->setShortcut(PREV_MAP_SHORTCUT); _prevMapAction->setShortcut(PREV_MAP_SHORTCUT);
connect(_prevMapAction, SIGNAL(triggered()), this, SLOT(prevMap())); connect(_prevMapAction, SIGNAL(triggered()), this, SLOT(prevMap()));
addAction(_prevMapAction); addAction(_prevMapAction);
@ -299,29 +321,35 @@ void GUI::createActions()
// Data actions // Data actions
_showTracksAction = new QAction(tr("Show tracks"), this); _showTracksAction = new QAction(tr("Show tracks"), this);
_showTracksAction->setMenuRole(QAction::NoRole);
_showTracksAction->setCheckable(true); _showTracksAction->setCheckable(true);
connect(_showTracksAction, SIGNAL(triggered(bool)), this, connect(_showTracksAction, SIGNAL(triggered(bool)), this,
SLOT(showTracks(bool))); SLOT(showTracks(bool)));
_showRoutesAction = new QAction(tr("Show routes"), this); _showRoutesAction = new QAction(tr("Show routes"), this);
_showRoutesAction->setMenuRole(QAction::NoRole);
_showRoutesAction->setCheckable(true); _showRoutesAction->setCheckable(true);
connect(_showRoutesAction, SIGNAL(triggered(bool)), this, connect(_showRoutesAction, SIGNAL(triggered(bool)), this,
SLOT(showRoutes(bool))); SLOT(showRoutes(bool)));
_showWaypointsAction = new QAction(tr("Show waypoints"), this); _showWaypointsAction = new QAction(tr("Show waypoints"), this);
_showWaypointsAction->setMenuRole(QAction::NoRole);
_showWaypointsAction->setCheckable(true); _showWaypointsAction->setCheckable(true);
connect(_showWaypointsAction, SIGNAL(triggered(bool)), _mapView, connect(_showWaypointsAction, SIGNAL(triggered(bool)), _mapView,
SLOT(showWaypoints(bool))); SLOT(showWaypoints(bool)));
_showWaypointLabelsAction = new QAction(tr("Waypoint labels"), this); _showWaypointLabelsAction = new QAction(tr("Waypoint labels"), this);
_showWaypointLabelsAction->setMenuRole(QAction::NoRole);
_showWaypointLabelsAction->setCheckable(true); _showWaypointLabelsAction->setCheckable(true);
connect(_showWaypointLabelsAction, SIGNAL(triggered(bool)), _mapView, connect(_showWaypointLabelsAction, SIGNAL(triggered(bool)), _mapView,
SLOT(showWaypointLabels(bool))); SLOT(showWaypointLabels(bool)));
_showRouteWaypointsAction = new QAction(tr("Route waypoints"), this); _showRouteWaypointsAction = new QAction(tr("Route waypoints"), this);
_showRouteWaypointsAction->setMenuRole(QAction::NoRole);
_showRouteWaypointsAction->setCheckable(true); _showRouteWaypointsAction->setCheckable(true);
connect(_showRouteWaypointsAction, SIGNAL(triggered(bool)), _mapView, connect(_showRouteWaypointsAction, SIGNAL(triggered(bool)), _mapView,
SLOT(showRouteWaypoints(bool))); SLOT(showRouteWaypoints(bool)));
// Graph actions // Graph actions
_showGraphsAction = new QAction(QIcon(QPixmap(SHOW_GRAPHS_ICON)), _showGraphsAction = new QAction(QIcon(SHOW_GRAPHS_ICON), tr("Show graphs"),
tr("Show graphs"), this); this);
_showGraphsAction->setMenuRole(QAction::NoRole);
_showGraphsAction->setCheckable(true); _showGraphsAction->setCheckable(true);
_showGraphsAction->setShortcut(SHOW_GRAPHS_SHORTCUT); _showGraphsAction->setShortcut(SHOW_GRAPHS_SHORTCUT);
connect(_showGraphsAction, SIGNAL(triggered(bool)), this, connect(_showGraphsAction, SIGNAL(triggered(bool)), this,
@ -330,39 +358,46 @@ void GUI::createActions()
ag = new QActionGroup(this); ag = new QActionGroup(this);
ag->setExclusive(true); ag->setExclusive(true);
_distanceGraphAction = new QAction(tr("Distance"), this); _distanceGraphAction = new QAction(tr("Distance"), this);
_distanceGraphAction->setMenuRole(QAction::NoRole);
_distanceGraphAction->setCheckable(true); _distanceGraphAction->setCheckable(true);
_distanceGraphAction->setActionGroup(ag); _distanceGraphAction->setActionGroup(ag);
connect(_distanceGraphAction, SIGNAL(triggered()), this, connect(_distanceGraphAction, SIGNAL(triggered()), this,
SLOT(setDistanceGraph())); SLOT(setDistanceGraph()));
addAction(_distanceGraphAction); addAction(_distanceGraphAction);
_timeGraphAction = new QAction(tr("Time"), this); _timeGraphAction = new QAction(tr("Time"), this);
_timeGraphAction->setMenuRole(QAction::NoRole);
_timeGraphAction->setCheckable(true); _timeGraphAction->setCheckable(true);
_timeGraphAction->setActionGroup(ag); _timeGraphAction->setActionGroup(ag);
connect(_timeGraphAction, SIGNAL(triggered()), this, connect(_timeGraphAction, SIGNAL(triggered()), this,
SLOT(setTimeGraph())); SLOT(setTimeGraph()));
addAction(_timeGraphAction); addAction(_timeGraphAction);
_showGraphGridAction = new QAction(tr("Show grid"), this); _showGraphGridAction = new QAction(tr("Show grid"), this);
_showGraphGridAction->setMenuRole(QAction::NoRole);
_showGraphGridAction->setCheckable(true); _showGraphGridAction->setCheckable(true);
connect(_showGraphGridAction, SIGNAL(triggered(bool)), this, connect(_showGraphGridAction, SIGNAL(triggered(bool)), this,
SLOT(showGraphGrids(bool))); SLOT(showGraphGrids(bool)));
_showGraphSliderInfoAction = new QAction(tr("Show slider info"), this); _showGraphSliderInfoAction = new QAction(tr("Show slider info"), this);
_showGraphSliderInfoAction->setMenuRole(QAction::NoRole);
_showGraphSliderInfoAction->setCheckable(true); _showGraphSliderInfoAction->setCheckable(true);
connect(_showGraphSliderInfoAction, SIGNAL(triggered(bool)), this, connect(_showGraphSliderInfoAction, SIGNAL(triggered(bool)), this,
SLOT(showGraphSliderInfo(bool))); SLOT(showGraphSliderInfo(bool)));
// Settings actions // Settings actions
_showToolbarsAction = new QAction(tr("Show toolbars"), this); _showToolbarsAction = new QAction(tr("Show toolbars"), this);
_showToolbarsAction->setMenuRole(QAction::NoRole);
_showToolbarsAction->setCheckable(true); _showToolbarsAction->setCheckable(true);
connect(_showToolbarsAction, SIGNAL(triggered(bool)), this, connect(_showToolbarsAction, SIGNAL(triggered(bool)), this,
SLOT(showToolbars(bool))); SLOT(showToolbars(bool)));
ag = new QActionGroup(this); ag = new QActionGroup(this);
ag->setExclusive(true); ag->setExclusive(true);
_totalTimeAction = new QAction(tr("Total time"), this); _totalTimeAction = new QAction(tr("Total time"), this);
_totalTimeAction->setMenuRole(QAction::NoRole);
_totalTimeAction->setCheckable(true); _totalTimeAction->setCheckable(true);
_totalTimeAction->setActionGroup(ag); _totalTimeAction->setActionGroup(ag);
connect(_totalTimeAction, SIGNAL(triggered()), this, connect(_totalTimeAction, SIGNAL(triggered()), this,
SLOT(setTotalTime())); SLOT(setTotalTime()));
_movingTimeAction = new QAction(tr("Moving time"), this); _movingTimeAction = new QAction(tr("Moving time"), this);
_movingTimeAction->setMenuRole(QAction::NoRole);
_movingTimeAction->setCheckable(true); _movingTimeAction->setCheckable(true);
_movingTimeAction->setActionGroup(ag); _movingTimeAction->setActionGroup(ag);
connect(_movingTimeAction, SIGNAL(triggered()), this, connect(_movingTimeAction, SIGNAL(triggered()), this,
@ -370,16 +405,19 @@ void GUI::createActions()
ag = new QActionGroup(this); ag = new QActionGroup(this);
ag->setExclusive(true); ag->setExclusive(true);
_metricUnitsAction = new QAction(tr("Metric"), this); _metricUnitsAction = new QAction(tr("Metric"), this);
_metricUnitsAction->setMenuRole(QAction::NoRole);
_metricUnitsAction->setCheckable(true); _metricUnitsAction->setCheckable(true);
_metricUnitsAction->setActionGroup(ag); _metricUnitsAction->setActionGroup(ag);
connect(_metricUnitsAction, SIGNAL(triggered()), this, connect(_metricUnitsAction, SIGNAL(triggered()), this,
SLOT(setMetricUnits())); SLOT(setMetricUnits()));
_imperialUnitsAction = new QAction(tr("Imperial"), this); _imperialUnitsAction = new QAction(tr("Imperial"), this);
_imperialUnitsAction->setMenuRole(QAction::NoRole);
_imperialUnitsAction->setCheckable(true); _imperialUnitsAction->setCheckable(true);
_imperialUnitsAction->setActionGroup(ag); _imperialUnitsAction->setActionGroup(ag);
connect(_imperialUnitsAction, SIGNAL(triggered()), this, connect(_imperialUnitsAction, SIGNAL(triggered()), this,
SLOT(setImperialUnits())); SLOT(setImperialUnits()));
_nauticalUnitsAction = new QAction(tr("Nautical"), this); _nauticalUnitsAction = new QAction(tr("Nautical"), this);
_nauticalUnitsAction->setMenuRole(QAction::NoRole);
_nauticalUnitsAction->setCheckable(true); _nauticalUnitsAction->setCheckable(true);
_nauticalUnitsAction->setActionGroup(ag); _nauticalUnitsAction->setActionGroup(ag);
connect(_nauticalUnitsAction, SIGNAL(triggered()), this, connect(_nauticalUnitsAction, SIGNAL(triggered()), this,
@ -387,22 +425,26 @@ void GUI::createActions()
ag = new QActionGroup(this); ag = new QActionGroup(this);
ag->setExclusive(true); ag->setExclusive(true);
_decimalDegreesAction = new QAction(tr("Decimal degrees (DD)"), this); _decimalDegreesAction = new QAction(tr("Decimal degrees (DD)"), this);
_decimalDegreesAction->setMenuRole(QAction::NoRole);
_decimalDegreesAction->setCheckable(true); _decimalDegreesAction->setCheckable(true);
_decimalDegreesAction->setActionGroup(ag); _decimalDegreesAction->setActionGroup(ag);
connect(_decimalDegreesAction, SIGNAL(triggered()), this, connect(_decimalDegreesAction, SIGNAL(triggered()), this,
SLOT(setDecimalDegrees())); SLOT(setDecimalDegrees()));
_degreesMinutesAction = new QAction(tr("Degrees and decimal minutes (DMM)"), _degreesMinutesAction = new QAction(tr("Degrees and decimal minutes (DMM)"),
this); this);
_degreesMinutesAction->setMenuRole(QAction::NoRole);
_degreesMinutesAction->setCheckable(true); _degreesMinutesAction->setCheckable(true);
_degreesMinutesAction->setActionGroup(ag); _degreesMinutesAction->setActionGroup(ag);
connect(_degreesMinutesAction, SIGNAL(triggered()), this, connect(_degreesMinutesAction, SIGNAL(triggered()), this,
SLOT(setDegreesMinutes())); SLOT(setDegreesMinutes()));
_DMSAction = new QAction(tr("Degrees, minutes, seconds (DMS)"), this); _DMSAction = new QAction(tr("Degrees, minutes, seconds (DMS)"), this);
_DMSAction->setMenuRole(QAction::NoRole);
_DMSAction->setCheckable(true); _DMSAction->setCheckable(true);
_DMSAction->setActionGroup(ag); _DMSAction->setActionGroup(ag);
connect(_DMSAction, SIGNAL(triggered()), this, SLOT(setDMS())); connect(_DMSAction, SIGNAL(triggered()), this, SLOT(setDMS()));
_fullscreenAction = new QAction(QIcon(QPixmap(FULLSCREEN_ICON)), _fullscreenAction = new QAction(QIcon(FULLSCREEN_ICON),
tr("Fullscreen mode"), this); tr("Fullscreen mode"), this);
_fullscreenAction->setMenuRole(QAction::NoRole);
_fullscreenAction->setCheckable(true); _fullscreenAction->setCheckable(true);
_fullscreenAction->setShortcut(FULLSCREEN_SHORTCUT); _fullscreenAction->setShortcut(FULLSCREEN_SHORTCUT);
connect(_fullscreenAction, SIGNAL(triggered(bool)), this, connect(_fullscreenAction, SIGNAL(triggered(bool)), this,
@ -414,18 +456,20 @@ void GUI::createActions()
SLOT(openOptions())); SLOT(openOptions()));
// Navigation actions // 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->setActionGroup(_navigationActionGroup);
_nextAction->setMenuRole(QAction::NoRole);
connect(_nextAction, SIGNAL(triggered()), this, SLOT(next())); connect(_nextAction, SIGNAL(triggered()), this, SLOT(next()));
_prevAction = new QAction(QIcon(QPixmap(PREV_FILE_ICON)), tr("Previous"), _prevAction = new QAction(QIcon(PREV_FILE_ICON), tr("Previous"), this);
this); _prevAction->setMenuRole(QAction::NoRole);
_prevAction->setActionGroup(_navigationActionGroup); _prevAction->setActionGroup(_navigationActionGroup);
connect(_prevAction, SIGNAL(triggered()), this, SLOT(prev())); 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); _lastAction->setActionGroup(_navigationActionGroup);
connect(_lastAction, SIGNAL(triggered()), this, SLOT(last())); connect(_lastAction, SIGNAL(triggered()), this, SLOT(last()));
_firstAction = new QAction(QIcon(QPixmap(FIRST_FILE_ICON)), tr("First"), _firstAction = new QAction(QIcon(FIRST_FILE_ICON), tr("First"), this);
this); _firstAction->setMenuRole(QAction::NoRole);
_firstAction->setActionGroup(_navigationActionGroup); _firstAction->setActionGroup(_navigationActionGroup);
connect(_firstAction, SIGNAL(triggered()), this, SLOT(first())); connect(_firstAction, SIGNAL(triggered()), this, SLOT(first()));
} }
@ -438,8 +482,9 @@ void GUI::createMenus()
fileMenu->addAction(_printFileAction); fileMenu->addAction(_printFileAction);
fileMenu->addAction(_exportFileAction); fileMenu->addAction(_exportFileAction);
fileMenu->addSeparator(); fileMenu->addSeparator();
fileMenu->addAction(_reloadFileAction); fileMenu->addAction(_statisticsAction);
fileMenu->addSeparator(); fileMenu->addSeparator();
fileMenu->addAction(_reloadFileAction);
fileMenu->addAction(_closeFileAction); fileMenu->addAction(_closeFileAction);
#ifndef Q_OS_MAC #ifndef Q_OS_MAC
fileMenu->addSeparator(); fileMenu->addSeparator();
@ -511,22 +556,28 @@ void GUI::createMenus()
void GUI::createToolBars() 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 #ifdef Q_OS_MAC
setToolButtonStyle(Qt::ToolButtonTextUnderIcon); setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
#endif // Q_OS_MAC #endif // Q_OS_MAC
_fileToolBar = addToolBar(tr("File")); _fileToolBar = addToolBar(tr("File"));
_fileToolBar->setIconSize(iconSize);
_fileToolBar->addAction(_openFileAction); _fileToolBar->addAction(_openFileAction);
_fileToolBar->addAction(_reloadFileAction); _fileToolBar->addAction(_reloadFileAction);
_fileToolBar->addAction(_closeFileAction); _fileToolBar->addAction(_closeFileAction);
_fileToolBar->addAction(_printFileAction); _fileToolBar->addAction(_printFileAction);
_showToolBar = addToolBar(tr("Show")); _showToolBar = addToolBar(tr("Show"));
_showToolBar->setIconSize(iconSize);
_showToolBar->addAction(_showPOIAction); _showToolBar->addAction(_showPOIAction);
_showToolBar->addAction(_showMapAction); _showToolBar->addAction(_showMapAction);
_showToolBar->addAction(_showGraphsAction); _showToolBar->addAction(_showGraphsAction);
_navigationToolBar = addToolBar(tr("Navigation")); _navigationToolBar = addToolBar(tr("Navigation"));
_navigationToolBar->setIconSize(iconSize);
_navigationToolBar->addAction(_firstAction); _navigationToolBar->addAction(_firstAction);
_navigationToolBar->addAction(_prevAction); _navigationToolBar->addAction(_prevAction);
_navigationToolBar->addAction(_nextAction); _navigationToolBar->addAction(_nextAction);
@ -557,12 +608,13 @@ void GUI::createGraphTabs()
_graphTabWidget->setDocumentMode(true); _graphTabWidget->setDocumentMode(true);
#endif // Q_OS_WIN32 #endif // Q_OS_WIN32
_tabs.append(new ElevationGraph); _tabs.append(new ElevationGraph(_graphTabWidget));
_tabs.append(new SpeedGraph); _tabs.append(new SpeedGraph(_graphTabWidget));
_tabs.append(new HeartRateGraph); _tabs.append(new HeartRateGraph(_graphTabWidget));
_tabs.append(new CadenceGraph); _tabs.append(new CadenceGraph(_graphTabWidget));
_tabs.append(new PowerGraph); _tabs.append(new PowerGraph(_graphTabWidget));
_tabs.append(new TemperatureGraph); _tabs.append(new TemperatureGraph(_graphTabWidget));
_tabs.append(new GearRatioGraph(_graphTabWidget));
for (int i = 0; i < _tabs.count(); i++) for (int i = 0; i < _tabs.count(); i++)
connect(_tabs.at(i), SIGNAL(sliderPositionChanged(qreal)), this, connect(_tabs.at(i), SIGNAL(sliderPositionChanged(qreal)), this,
@ -646,19 +698,19 @@ void GUI::paths()
msgBox.setWindowTitle(tr("Paths")); msgBox.setWindowTitle(tr("Paths"));
msgBox.setText("<h3>" + tr("Paths") + "</h3>"); msgBox.setText("<h3>" + tr("Paths") + "</h3>");
msgBox.setInformativeText( msgBox.setInformativeText(
"<style>td {white-space: pre; padding-right: 1em;}</style>" "<style>td {white-space: pre; padding-right: 1em;}</style><h4>"
"<div><table><tr><td>" + tr("Map directory:") + "</td><td><code>" + tr("Global") + "</h4><table><tr><td>" + tr("Map directory:")
+ QDir::cleanPath(GLOBAL_MAP_DIR) + "</code></td></tr><tr><td>" + "</td><td><code>" + QDir::cleanPath(GLOBAL_MAP_DIR)
+ tr("POI directory:") + "</td><td><code>" + "</code></td></tr><tr><td>" + tr("POI directory:") + "</td><td><code>"
+ QDir::cleanPath(GLOBAL_POI_DIR) + "</code></td></tr><tr><td>" + QDir::cleanPath(GLOBAL_POI_DIR) + "</code></td></tr><tr><td>"
+ tr("GCS file:") + "</td><td><code>" + QDir::cleanPath(GLOBAL_GCS_FILE) + tr("GCS/PCS directory:") + "</td><td><code>"
+ "</code></td></tr><tr><td>" + tr("PCS file:") + "</td><td><code>" + QDir::cleanPath(GLOBAL_CSV_DIR) + "</code></td></tr></table>"
+ QDir::cleanPath(GLOBAL_PCS_FILE) + "</code></td></tr><tr><td>" + "<h4>" + tr("User-specific") + "</h4><table><tr><td>"
+ tr("Ellipsoids file:") + "</td><td><code>" + tr("Map directory:") + "</td><td><code>" + QDir::cleanPath(USER_MAP_DIR)
+ QDir::cleanPath(GLOBAL_ELLIPSOID_FILE) + "</code></td></tr>" + "</code></td></tr><tr><td>" + tr("POI directory:") + "</td><td><code>"
+ "<tr><td></td><td></td></tr></table></div><div><table><tr><td>" + QDir::cleanPath(USER_POI_DIR) + "</code></td></tr><tr><td>"
+ tr("User override directory:") + "</td><td><code>" + tr("GCS/PCS directory:") + "</td><td><code>"
+ QDir::cleanPath(USER_DIR) + "</td></tr></table></div>" + QDir::cleanPath(USER_CSV_DIR) + "</code></td></tr></table>"
); );
msgBox.exec(); msgBox.exec();
@ -867,6 +919,7 @@ void GUI::openOptions()
SET_TRACK_OPTION(outlierEliminate, setOutlierElimination); SET_TRACK_OPTION(outlierEliminate, setOutlierElimination);
SET_TRACK_OPTION(pauseSpeed, setPauseSpeed); SET_TRACK_OPTION(pauseSpeed, setPauseSpeed);
SET_TRACK_OPTION(pauseInterval, setPauseInterval); SET_TRACK_OPTION(pauseInterval, setPauseInterval);
SET_TRACK_OPTION(useReportedSpeed, useReportedSpeed);
if (options.poiRadius != _options.poiRadius) if (options.poiRadius != _options.poiRadius)
_poi->setRadius(options.poiRadius); _poi->setRadius(options.poiRadius);
@ -874,6 +927,10 @@ void GUI::openOptions()
QPixmapCache::setCacheLimit(options.pixmapCache * 1024); QPixmapCache::setCacheLimit(options.pixmapCache * 1024);
if (options.connectionTimeout != _options.connectionTimeout) if (options.connectionTimeout != _options.connectionTimeout)
Downloader::setTimeout(options.connectionTimeout); Downloader::setTimeout(options.connectionTimeout);
#ifdef ENABLE_HTTP2
if (options.enableHTTP2 != _options.enableHTTP2)
Downloader::enableHTTP2(options.enableHTTP2);
#endif // ENABLE_HTTP2
if (reload) if (reload)
reloadFile(); reloadFile();
@ -912,14 +969,78 @@ void GUI::exportFile()
plot(&printer); plot(&printer);
} }
void GUI::statistics()
{
#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>"
+ QString::number(_trackCount) + "</td></tr>");
if (_showRoutesAction->isChecked() && _routeCount > 1)
text.append("<tr><td>" + tr("Routes") + ":</td><td>"
+ QString::number(_routeCount) + "</td></tr>");
if (_showWaypointsAction->isChecked() && _waypointCount > 1)
text.append("<tr><td>" + tr("Waypoints") + ":</td><td>"
+ QString::number(_waypointCount) + "</td></tr>");
if (_dateRange.first.isValid()) {
if (_dateRange.first == _dateRange.second) {
QString format = QLocale::system().dateFormat(QLocale::LongFormat);
text.append("<tr><td>" + tr("Date") + ":</td><td>"
+ _dateRange.first.toString(format) + "</td></tr>");
} else {
QString format = QLocale::system().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) void GUI::plot(QPrinter *printer)
{ {
QPainter p(printer); QPainter p(printer);
TrackInfo info; TrackInfo info;
qreal ih, gh, mh, ratio; qreal ih, gh, mh, ratio;
qreal d = distance();
qreal t = time();
qreal tm = movingTime();
if (!_pathName.isNull() && _options.printName) if (!_pathName.isNull() && _options.printName)
info.insert(tr("Name"), _pathName); info.insert(tr("Name"), _pathName);
@ -929,7 +1050,7 @@ void GUI::plot(QPrinter *printer)
info.insert(tr("Tracks"), QString::number(_trackCount)); info.insert(tr("Tracks"), QString::number(_trackCount));
if (_showRoutesAction->isChecked() && _routeCount > 1) if (_showRoutesAction->isChecked() && _routeCount > 1)
info.insert(tr("Routes"), QString::number(_routeCount)); info.insert(tr("Routes"), QString::number(_routeCount));
if (_showWaypointsAction->isChecked() && _waypointCount > 2) if (_showWaypointsAction->isChecked() && _waypointCount > 1)
info.insert(tr("Waypoints"), QString::number(_waypointCount)); info.insert(tr("Waypoints"), QString::number(_waypointCount));
} }
@ -945,12 +1066,12 @@ void GUI::plot(QPrinter *printer)
} }
} }
if (d > 0 && _options.printDistance) if (distance() > 0 && _options.printDistance)
info.insert(tr("Distance"), Format::distance(d, units())); info.insert(tr("Distance"), Format::distance(distance(), units()));
if (t > 0 && _options.printTime) if (time() > 0 && _options.printTime)
info.insert(tr("Time"), Format::timeSpan(t)); info.insert(tr("Time"), Format::timeSpan(time()));
if (tm > 0 && _options.printMovingTime) if (movingTime() > 0 && _options.printMovingTime)
info.insert(tr("Moving time"), Format::timeSpan(tm)); info.insert(tr("Moving time"), Format::timeSpan(movingTime()));
qreal fsr = 1085.0 / (qMax(printer->width(), printer->height()) qreal fsr = 1085.0 / (qMax(printer->width(), printer->height())
/ (qreal)printer->resolution()); / (qreal)printer->resolution());
@ -1166,6 +1287,7 @@ bool GUI::loadMap(const QString &fileName)
if (_ml->loadFile(fileName)) { if (_ml->loadFile(fileName)) {
QAction *a = new QAction(_ml->maps().last()->name(), this); QAction *a = new QAction(_ml->maps().last()->name(), this);
a->setMenuRole(QAction::NoRole);
a->setCheckable(true); a->setCheckable(true);
a->setActionGroup(_mapsActionGroup); a->setActionGroup(_mapsActionGroup);
_mapsSignalMapper->setMapping(a, _ml->maps().size() - 1); _mapsSignalMapper->setMapping(a, _ml->maps().size() - 1);
@ -1638,10 +1760,16 @@ void GUI::writeSettings()
settings.setValue(PAUSE_SPEED_SETTING, _options.pauseSpeed); settings.setValue(PAUSE_SPEED_SETTING, _options.pauseSpeed);
if (_options.pauseInterval != PAUSE_INTERVAL_DEFAULT) if (_options.pauseInterval != PAUSE_INTERVAL_DEFAULT)
settings.setValue(PAUSE_INTERVAL_SETTING, _options.pauseInterval); settings.setValue(PAUSE_INTERVAL_SETTING, _options.pauseInterval);
if (_options.useReportedSpeed != USE_REPORTED_SPEED_DEFAULT)
settings.setValue(USE_REPORTED_SPEED_SETTING, _options.useReportedSpeed);
if (_options.poiRadius != POI_RADIUS_DEFAULT) if (_options.poiRadius != POI_RADIUS_DEFAULT)
settings.setValue(POI_RADIUS_SETTING, _options.poiRadius); settings.setValue(POI_RADIUS_SETTING, _options.poiRadius);
if (_options.useOpenGL != USE_OPENGL_DEFAULT) if (_options.useOpenGL != USE_OPENGL_DEFAULT)
settings.setValue(USE_OPENGL_SETTING, _options.useOpenGL); 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) if (_options.pixmapCache != PIXMAP_CACHE_DEFAULT)
settings.setValue(PIXMAP_CACHE_SETTING, _options.pixmapCache); settings.setValue(PIXMAP_CACHE_SETTING, _options.pixmapCache);
if (_options.connectionTimeout != CONNECTION_TIMEOUT_DEFAULT) if (_options.connectionTimeout != CONNECTION_TIMEOUT_DEFAULT)
@ -1866,12 +1994,18 @@ void GUI::readSettings()
OUTLIER_ELIMINATE_DEFAULT).toBool(); OUTLIER_ELIMINATE_DEFAULT).toBool();
_options.pauseSpeed = settings.value(PAUSE_SPEED_SETTING, _options.pauseSpeed = settings.value(PAUSE_SPEED_SETTING,
PAUSE_SPEED_DEFAULT).toFloat(); PAUSE_SPEED_DEFAULT).toFloat();
_options.useReportedSpeed = settings.value(USE_REPORTED_SPEED_SETTING,
USE_REPORTED_SPEED_DEFAULT).toBool();
_options.pauseInterval = settings.value(PAUSE_INTERVAL_SETTING, _options.pauseInterval = settings.value(PAUSE_INTERVAL_SETTING,
PAUSE_INTERVAL_DEFAULT).toInt(); PAUSE_INTERVAL_DEFAULT).toInt();
_options.poiRadius = settings.value(POI_RADIUS_SETTING, POI_RADIUS_DEFAULT) _options.poiRadius = settings.value(POI_RADIUS_SETTING, POI_RADIUS_DEFAULT)
.toInt(); .toInt();
_options.useOpenGL = settings.value(USE_OPENGL_SETTING, USE_OPENGL_DEFAULT) _options.useOpenGL = settings.value(USE_OPENGL_SETTING, USE_OPENGL_DEFAULT)
.toBool(); .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, _options.pixmapCache = settings.value(PIXMAP_CACHE_SETTING,
PIXMAP_CACHE_DEFAULT).toInt(); PIXMAP_CACHE_DEFAULT).toInt();
_options.connectionTimeout = settings.value(CONNECTION_TIMEOUT_SETTING, _options.connectionTimeout = settings.value(CONNECTION_TIMEOUT_SETTING,
@ -1931,11 +2065,15 @@ void GUI::readSettings()
Track::setOutlierElimination(_options.outlierEliminate); Track::setOutlierElimination(_options.outlierEliminate);
Track::setPauseSpeed(_options.pauseSpeed); Track::setPauseSpeed(_options.pauseSpeed);
Track::setPauseInterval(_options.pauseInterval); Track::setPauseInterval(_options.pauseInterval);
Track::useReportedSpeed(_options.useReportedSpeed);
_poi->setRadius(_options.poiRadius); _poi->setRadius(_options.poiRadius);
QPixmapCache::setCacheLimit(_options.pixmapCache * 1024); QPixmapCache::setCacheLimit(_options.pixmapCache * 1024);
Downloader::setTimeout(_options.connectionTimeout); Downloader::setTimeout(_options.connectionTimeout);
#ifdef ENABLE_HTTP2
Downloader::enableHTTP2(_options.enableHTTP2);
#endif // ENABLE_HTTP2
settings.endGroup(); settings.endGroup();
} }
@ -1976,3 +2114,39 @@ qreal GUI::movingTime() const
{ {
return (_showTracksAction->isChecked()) ? _movingTime : 0; 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->updateDevicePixelRatio();
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->updateDevicePixelRatio();
#endif // ENBLE_HIDPI
}

View File

@ -7,7 +7,6 @@
#include <QDate> #include <QDate>
#include <QPrinter> #include <QPrinter>
#include "data/graph.h" #include "data/graph.h"
#include "data/poi.h"
#include "units.h" #include "units.h"
#include "timetype.h" #include "timetype.h"
#include "format.h" #include "format.h"
@ -28,6 +27,8 @@ class GraphTab;
class MapView; class MapView;
class Map; class Map;
class MapList; class MapList;
class POI;
class QScreen;
class GUI : public QMainWindow class GUI : public QMainWindow
{ {
@ -35,9 +36,9 @@ class GUI : public QMainWindow
public: public:
GUI(); GUI();
~GUI();
bool openFile(const QString &fileName); bool openFile(const QString &fileName);
void show();
private slots: private slots:
void about(); void about();
@ -48,6 +49,7 @@ private slots:
void openFile(); void openFile();
void closeAll(); void closeAll();
void reloadFile(); void reloadFile();
void statistics();
void openPOIFile(); void openPOIFile();
void closePOIFiles(); void closePOIFiles();
void showGraphs(bool show); void showGraphs(bool show);
@ -83,6 +85,8 @@ private slots:
void setDMS() {setCoordinatesFormat(DMS);} void setDMS() {setCoordinatesFormat(DMS);}
void sliderPositionChanged(qreal pos); void sliderPositionChanged(qreal pos);
void screenChanged(QScreen *screen);
void logicalDotsPerInchChanged(qreal dpi);
private: private:
typedef QPair<QDate, QDate> DateRange; typedef QPair<QDate, QDate> DateRange;
@ -151,6 +155,7 @@ private:
QAction *_openFileAction; QAction *_openFileAction;
QAction *_closeFileAction; QAction *_closeFileAction;
QAction *_reloadFileAction; QAction *_reloadFileAction;
QAction *_statisticsAction;
QAction *_openPOIAction; QAction *_openPOIAction;
QAction *_closePOIAction; QAction *_closePOIAction;
QAction *_showPOIAction; QAction *_showPOIAction;

View File

@ -20,10 +20,10 @@
#define FULLSCREEN_ICON ":/icons/view-fullscreen.png" #define FULLSCREEN_ICON ":/icons/view-fullscreen.png"
// Options dialog icons // Options dialog icons
#define APPEARANCE_ICON ":/icons/preferences-desktop-display.png" #define APPEARANCE_ICON ":/icons/format-stroke-color.png"
#define POI_ICON ":/icons/flag_48.png" #define POI_ICON ":/icons/flag_32.png"
#define SYSTEM_ICON ":/icons/system-run.png" #define SYSTEM_ICON ":/icons/preferences-system.png"
#define PRINT_EXPORT_ICON ":/icons/document-print-preview.png" #define PRINT_EXPORT_ICON ":/icons/document-print_32.png"
#define DATA_ICON ":/icons/view-filter.png" #define DATA_ICON ":/icons/view-filter.png"
#endif /* ICONS_H */ #endif /* ICONS_H */

View File

@ -9,10 +9,6 @@ InfoItem::InfoItem(QGraphicsItem *parent) : QGraphicsItem(parent)
{ {
_font.setPixelSize(FONT_SIZE); _font.setPixelSize(FONT_SIZE);
_font.setFamily(FONT_FAMILY); _font.setFamily(FONT_FAMILY);
#ifndef Q_OS_MAC
setCacheMode(QGraphicsItem::DeviceCoordinateCache);
#endif // Q_OS_MAC
} }
void InfoItem::updateBoundingRect() void InfoItem::updateBoundingRect()
@ -22,8 +18,8 @@ void InfoItem::updateBoundingRect()
for (QList<KV>::const_iterator i = _list.constBegin(); for (QList<KV>::const_iterator i = _list.constBegin();
i != _list.constEnd(); i++) { i != _list.constEnd(); i++) {
width += fm.width(i->key + ": "); width += fm.width(i->key() + ": ");
width += fm.width(i->value) + ((i == _list.constEnd() - 1) width += fm.width(i->value()) + ((i == _list.constEnd() - 1)
? 0 : PADDING); ? 0 : PADDING);
} }
@ -43,10 +39,10 @@ void InfoItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
for (QList<KV>::const_iterator i = _list.constBegin(); for (QList<KV>::const_iterator i = _list.constBegin();
i != _list.constEnd(); i++) { i != _list.constEnd(); i++) {
painter->drawText(width, fm.height() - fm.descent(), i->key + ": "); painter->drawText(width, fm.height() - fm.descent(), i->key() + ": ");
width += fm.width(i->key + ": "); width += fm.width(i->key() + ": ");
painter->drawText(width, fm.height() - fm.descent(), i->value); painter->drawText(width, fm.height() - fm.descent(), i->value());
width += fm.width(i->value) + ((i == _list.constEnd() - 1) width += fm.width(i->value()) + ((i == _list.constEnd() - 1)
? 0 : PADDING); ? 0 : PADDING);
if (i != _list.constEnd() - 1) { if (i != _list.constEnd() - 1) {
painter->save(); painter->save();

View File

@ -3,6 +3,7 @@
#include <QGraphicsItem> #include <QGraphicsItem>
#include <QList> #include <QList>
#include "kv.h"
class InfoItem : public QGraphicsItem class InfoItem : public QGraphicsItem
{ {
@ -13,6 +14,8 @@ public:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget); QWidget *widget);
const QList<KV> &info() const {return _list;}
void insert(const QString &key, const QString &value); void insert(const QString &key, const QString &value);
void clear(); void clear();
bool isEmpty() {return _list.isEmpty();} bool isEmpty() {return _list.isEmpty();}
@ -20,17 +23,6 @@ public:
private: private:
void updateBoundingRect(); 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; QList<KV> _list;
QRectF _boundingRect; QRectF _boundingRect;
QFont _font; QFont _font;

View File

@ -24,6 +24,7 @@
#define NEXT_MAP_SHORTCUT QKeySequence(QKeySequence::Forward) #define NEXT_MAP_SHORTCUT QKeySequence(QKeySequence::Forward)
#define PREV_MAP_SHORTCUT QKeySequence(QKeySequence::Back) #define PREV_MAP_SHORTCUT QKeySequence(QKeySequence::Back)
#define SHOW_GRAPHS_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_G) #define SHOW_GRAPHS_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_G)
#define STATISTICS_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_S)
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
#define FULLSCREEN_SHORTCUT QKeySequence(Qt::META + Qt::CTRL + Qt::Key_F) #define FULLSCREEN_SHORTCUT QKeySequence(Qt::META + Qt::CTRL + Qt::Key_F)

21
src/GUI/kv.h Normal file
View 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

View File

@ -29,7 +29,6 @@ MapView::MapView(Map *map, POI *poi, QWidget *parent)
_scene = new QGraphicsScene(this); _scene = new QGraphicsScene(this);
setScene(_scene); setScene(_scene);
setCacheMode(QGraphicsView::CacheBackground);
setDragMode(QGraphicsView::ScrollHandDrag); setDragMode(QGraphicsView::ScrollHandDrag);
setViewportUpdateMode(QGraphicsView::FullViewportUpdate); setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
@ -42,6 +41,10 @@ MapView::MapView(Map *map, POI *poi, QWidget *parent)
_scene->addItem(_mapScale); _scene->addItem(_mapScale);
_map = map; _map = map;
#ifdef ENABLE_HIDPI
_ratio = devicePixelRatioF();
_map->setDevicePixelRatio(_ratio);
#endif // ENABLE_HIDPI
_map->load(); _map->load();
connect(_map, SIGNAL(loaded()), this, SLOT(reloadMap())); connect(_map, SIGNAL(loaded()), this, SLOT(reloadMap()));
@ -228,7 +231,7 @@ void MapView::updatePOIVisibility()
void MapView::rescale() void MapView::rescale()
{ {
_scene->setSceneRect(_map->bounds()); _scene->setSceneRect(_map->bounds());
resetCachedContent(); reloadMap();
for (int i = 0; i < _tracks.size(); i++) for (int i = 0; i < _tracks.size(); i++)
_tracks.at(i)->setMap(_map); _tracks.at(i)->setMap(_map);
@ -265,6 +268,9 @@ void MapView::setMap(Map *map)
disconnect(_map, SIGNAL(loaded()), this, SLOT(reloadMap())); disconnect(_map, SIGNAL(loaded()), this, SLOT(reloadMap()));
_map = map; _map = map;
#ifdef ENABLE_HIDPI
_map->setDevicePixelRatio(_ratio);
#endif // ENABLE_HIDPI
_map->load(); _map->load();
connect(_map, SIGNAL(loaded()), this, SLOT(reloadMap())); connect(_map, SIGNAL(loaded()), this, SLOT(reloadMap()));
@ -289,7 +295,7 @@ void MapView::setMap(Map *map)
_map->ll2xy(cr.bottomRight())).center(); _map->ll2xy(cr.bottomRight())).center();
centerOn(nc); centerOn(nc);
resetCachedContent(); reloadMap();
QPixmapCache::clear(); QPixmapCache::clear();
} }
@ -498,6 +504,9 @@ void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
// Enter plot mode // Enter plot mode
setUpdatesEnabled(false); setUpdatesEnabled(false);
_plot = true; _plot = true;
#ifdef ENABLE_HIDPI
_map->setDevicePixelRatio(1.0);
#endif // ENABLE_HIDPI
// Compute sizes & ratios // Compute sizes & ratios
orig = viewport()->rect(); orig = viewport()->rect();
@ -556,6 +565,9 @@ void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
_mapScale->setPos(origPos); _mapScale->setPos(origPos);
// Exit plot mode // Exit plot mode
#ifdef ENABLE_HIDPI
_map->setDevicePixelRatio(_ratio);
#endif // ENABLE_HIDPI
_plot = false; _plot = false;
setUpdatesEnabled(true); setUpdatesEnabled(true);
} }
@ -635,7 +647,7 @@ void MapView::showRouteWaypoints(bool show)
void MapView::showMap(bool show) void MapView::showMap(bool show)
{ {
_showMap = show; _showMap = show;
resetCachedContent(); reloadMap();
} }
void MapView::showPOI(bool show) void MapView::showPOI(bool show)
@ -738,13 +750,13 @@ void MapView::setPOIColor(const QColor &color)
void MapView::setMapOpacity(int opacity) void MapView::setMapOpacity(int opacity)
{ {
_opacity = opacity / 100.0; _opacity = opacity / 100.0;
resetCachedContent(); reloadMap();
} }
void MapView::setBackgroundColor(const QColor &color) void MapView::setBackgroundColor(const QColor &color)
{ {
_backgroundColor = color; _backgroundColor = color;
resetCachedContent(); reloadMap();
} }
void MapView::drawBackground(QPainter *painter, const QRectF &rect) void MapView::drawBackground(QPainter *painter, const QRectF &rect)
@ -819,5 +831,44 @@ void MapView::setMarkerColor(const QColor &color)
void MapView::reloadMap() void MapView::reloadMap()
{ {
resetCachedContent(); _scene->invalidate();
}
void MapView::updateDevicePixelRatio()
{
#ifdef ENABLE_HIDPI
if (_ratio == devicePixelRatioF())
return;
_ratio = devicePixelRatioF();
QRectF vr(mapToScene(viewport()->rect()).boundingRect()
.intersected(_map->bounds()));
RectC cr(_map->xy2ll(vr.topLeft()), _map->xy2ll(vr.bottomRight()));
_map->setDevicePixelRatio(_ratio);
digitalZoom(0);
_map->zoomFit(viewport()->rect().size(), cr);
_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();
#endif // ENABLE_HIDPI
} }

View File

@ -11,6 +11,7 @@
#include "units.h" #include "units.h"
#include "format.h" #include "format.h"
#include "palette.h" #include "palette.h"
#include "config.h"
class Data; class Data;
class POI; class POI;
@ -68,6 +69,7 @@ public slots:
void showRouteWaypoints(bool show); void showRouteWaypoints(bool show);
void clearMapCache(); void clearMapCache();
void setCoordinatesFormat(CoordinatesFormat format); void setCoordinatesFormat(CoordinatesFormat format);
void updateDevicePixelRatio();
private slots: private slots:
void updatePOI(); void updatePOI();
@ -136,6 +138,10 @@ private:
int _digitalZoom; int _digitalZoom;
bool _plot; bool _plot;
#ifdef ENABLE_HIDPI
qreal _ratio;
#endif // ENABLE_HIDPI
}; };
#endif // MAPVIEW_H #endif // MAPVIEW_H

View File

@ -1,5 +1,5 @@
#include <QtGlobal> #include <QtGlobal>
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) || defined(Q_OS_MAC) #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
#include <QGLWidget> #include <QGLWidget>
#include <QGLFormat> #include <QGLFormat>
#else #else
@ -7,13 +7,13 @@
#include <QSurfaceFormat> #include <QSurfaceFormat>
#endif #endif
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) || defined(Q_OS_MAC) #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
#define OPENGL_WIDGET QGLWidget #define OPENGL_WIDGET QGLWidget
#else #else
#define OPENGL_WIDGET QOpenGLWidget #define OPENGL_WIDGET QOpenGLWidget
#endif #endif
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) || defined(Q_OS_MAC) #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
#define OPENGL_SET_SAMPLES(samples) \ #define OPENGL_SET_SAMPLES(samples) \
{QGLFormat fmt; \ {QGLFormat fmt; \
fmt.setSamples(samples); \ fmt.setSamples(samples); \

View File

@ -12,7 +12,6 @@
#include <QRadioButton> #include <QRadioButton>
#include <QLabel> #include <QLabel>
#include <QSysInfo> #include <QSysInfo>
#include "config.h"
#include "icons.h" #include "icons.h"
#include "colorbox.h" #include "colorbox.h"
#include "stylecombobox.h" #include "stylecombobox.h"
@ -311,9 +310,25 @@ QWidget *OptionsDialog::createDataPage()
pauseTab->setLayout(pauseLayout); pauseTab->setLayout(pauseLayout);
_computed = new QRadioButton(tr("Computed from distance/time"));
_reported = new QRadioButton(tr("Recorded by device"));
if (_options->useReportedSpeed)
_reported->setChecked(true);
else
_computed->setChecked(true);
QFormLayout *sourceLayout = new QFormLayout();
sourceLayout->addWidget(_computed);
sourceLayout->addWidget(_reported);
QWidget *sourceTab = new QWidget();
sourceTab->setLayout(sourceLayout);
QTabWidget *filterPage = new QTabWidget(); QTabWidget *filterPage = new QTabWidget();
filterPage->addTab(filterTab, tr("Filtering")); filterPage->addTab(filterTab, tr("Filtering"));
filterPage->addTab(pauseTab, tr("Pause detection")); filterPage->addTab(pauseTab, tr("Pause detection"));
filterPage->addTab(sourceTab, tr("Speed"));
return filterPage; return filterPage;
} }
@ -424,6 +439,10 @@ QWidget *OptionsDialog::createSystemPage()
{ {
_useOpenGL = new QCheckBox(tr("Use OpenGL")); _useOpenGL = new QCheckBox(tr("Use OpenGL"));
_useOpenGL->setChecked(_options->useOpenGL); _useOpenGL->setChecked(_options->useOpenGL);
#ifdef ENABLE_HTTP2
_enableHTTP2 = new QCheckBox(tr("Enable HTTP/2"));
_enableHTTP2->setChecked(_options->enableHTTP2);
#endif // ENABLE_HTTP2
_pixmapCache = new QSpinBox(); _pixmapCache = new QSpinBox();
_pixmapCache->setMinimum(16); _pixmapCache->setMinimum(16);
@ -442,6 +461,9 @@ QWidget *OptionsDialog::createSystemPage()
formLayout->addRow(tr("Connection timeout:"), _connectionTimeout); formLayout->addRow(tr("Connection timeout:"), _connectionTimeout);
QFormLayout *checkboxLayout = new QFormLayout(); QFormLayout *checkboxLayout = new QFormLayout();
#ifdef ENABLE_HTTP2
checkboxLayout->addWidget(_enableHTTP2);
#endif // ENABLE_HTTP2
checkboxLayout->addWidget(_useOpenGL); checkboxLayout->addWidget(_useOpenGL);
QWidget *systemTab = new QWidget(); QWidget *systemTab = new QWidget();
@ -470,14 +492,14 @@ OptionsDialog::OptionsDialog(Options *options, QWidget *parent)
QListWidget *menu = new QListWidget(); QListWidget *menu = new QListWidget();
menu->setIconSize(QSize(MENU_ICON_SIZE, MENU_ICON_SIZE)); menu->setIconSize(QSize(MENU_ICON_SIZE, MENU_ICON_SIZE));
new QListWidgetItem(QIcon(QPixmap(APP_ICON)), tr("General"), menu); new QListWidgetItem(QIcon(APP_ICON), tr("General"), menu);
new QListWidgetItem(QIcon(QPixmap(APPEARANCE_ICON)), tr("Appearance"), new QListWidgetItem(QIcon(APPEARANCE_ICON), tr("Appearance"),
menu); menu);
new QListWidgetItem(QIcon(QPixmap(DATA_ICON)), tr("Data"), menu); new QListWidgetItem(QIcon(DATA_ICON), tr("Data"), menu);
new QListWidgetItem(QIcon(QPixmap(POI_ICON)), tr("POI"), menu); new QListWidgetItem(QIcon(POI_ICON), tr("POI"), menu);
new QListWidgetItem(QIcon(QPixmap(PRINT_EXPORT_ICON)), tr("Print & Export"), new QListWidgetItem(QIcon(PRINT_EXPORT_ICON), tr("Print & Export"),
menu); menu);
new QListWidgetItem(QIcon(QPixmap(SYSTEM_ICON)), tr("System"), menu); new QListWidgetItem(QIcon(SYSTEM_ICON), tr("System"), menu);
QHBoxLayout *contentLayout = new QHBoxLayout(); QHBoxLayout *contentLayout = new QHBoxLayout();
contentLayout->addWidget(menu); contentLayout->addWidget(menu);
@ -543,6 +565,7 @@ void OptionsDialog::accept()
if (qAbs(pauseSpeed - _options->pauseSpeed) > 0.01) if (qAbs(pauseSpeed - _options->pauseSpeed) > 0.01)
_options->pauseSpeed = pauseSpeed; _options->pauseSpeed = pauseSpeed;
_options->pauseInterval = _pauseInterval->value(); _options->pauseInterval = _pauseInterval->value();
_options->useReportedSpeed = _reported->isChecked();
qreal poiRadius = (_options->units == Imperial) qreal poiRadius = (_options->units == Imperial)
? _poiRadius->value() * MIINM : (_options->units == Nautical) ? _poiRadius->value() * MIINM : (_options->units == Nautical)
@ -551,6 +574,9 @@ void OptionsDialog::accept()
_options->poiRadius = poiRadius; _options->poiRadius = poiRadius;
_options->useOpenGL = _useOpenGL->isChecked(); _options->useOpenGL = _useOpenGL->isChecked();
#ifdef ENABLE_HTTP2
_options->enableHTTP2 = _enableHTTP2->isChecked();
#endif // ENABLE_HTTP2
_options->pixmapCache = _pixmapCache->value(); _options->pixmapCache = _pixmapCache->value();
_options->connectionTimeout = _connectionTimeout->value(); _options->connectionTimeout = _connectionTimeout->value();

View File

@ -4,6 +4,8 @@
#include <QDialog> #include <QDialog>
#include "palette.h" #include "palette.h"
#include "units.h" #include "units.h"
#include "config.h"
class ColorBox; class ColorBox;
class StyleComboBox; class StyleComboBox;
@ -43,10 +45,14 @@ struct Options {
bool outlierEliminate; bool outlierEliminate;
qreal pauseSpeed; qreal pauseSpeed;
int pauseInterval; int pauseInterval;
bool useReportedSpeed;
// POI // POI
int poiRadius; int poiRadius;
// System // System
bool useOpenGL; bool useOpenGL;
#ifdef ENABLE_HTTP2
bool enableHTTP2;
#endif // ENABLE_HTTP2
int pixmapCache; int pixmapCache;
int connectionTimeout; int connectionTimeout;
// Print/Export // Print/Export
@ -110,12 +116,17 @@ private:
QCheckBox *_outlierEliminate; QCheckBox *_outlierEliminate;
QDoubleSpinBox *_pauseSpeed; QDoubleSpinBox *_pauseSpeed;
QSpinBox *_pauseInterval; QSpinBox *_pauseInterval;
QRadioButton *_computed;
QRadioButton *_reported;
// POI // POI
QDoubleSpinBox *_poiRadius; QDoubleSpinBox *_poiRadius;
// System // System
QSpinBox *_pixmapCache; QSpinBox *_pixmapCache;
QSpinBox *_connectionTimeout; QSpinBox *_connectionTimeout;
QCheckBox *_useOpenGL; QCheckBox *_useOpenGL;
#ifdef ENABLE_HTTP2
QCheckBox *_enableHTTP2;
#endif // ENABLE_HTTP2
// Print/Export // Print/Export
QRadioButton *_wysiwyg; QRadioButton *_wysiwyg;
QRadioButton *_hires; QRadioButton *_hires;

View File

@ -175,10 +175,10 @@ void PathItem::setMarkerColor(const QColor &color)
void PathItem::hover(bool hover) void PathItem::hover(bool hover)
{ {
if (hover) { if (hover) {
_pen.setWidth(_width + 1); _pen.setWidth((_width + 1) * pow(2, -_digitalZoom));
setZValue(zValue() + 1.0); setZValue(zValue() + 1.0);
} else { } else {
_pen.setWidth(_width); _pen.setWidth(_width * pow(2, -_digitalZoom));
setZValue(zValue() - 1.0); setZValue(zValue() - 1.0);
} }

View File

@ -20,10 +20,6 @@ ScaleItem::ScaleItem(QGraphicsItem *parent) : QGraphicsItem(parent)
_font.setPixelSize(FONT_SIZE); _font.setPixelSize(FONT_SIZE);
_font.setFamily(FONT_FAMILY); _font.setFamily(FONT_FAMILY);
#ifndef Q_OS_MAC
setCacheMode(QGraphicsItem::DeviceCoordinateCache);
#endif // Q_OS_MAC
} }
void ScaleItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, void ScaleItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,

View File

@ -124,10 +124,14 @@
#define PAUSE_SPEED_DEFAULT 0.5 /* m/s */ #define PAUSE_SPEED_DEFAULT 0.5 /* m/s */
#define PAUSE_INTERVAL_SETTING "pauseInterval" #define PAUSE_INTERVAL_SETTING "pauseInterval"
#define PAUSE_INTERVAL_DEFAULT 10 /* s */ #define PAUSE_INTERVAL_DEFAULT 10 /* s */
#define USE_REPORTED_SPEED_SETTING "useReportedSpeed"
#define USE_REPORTED_SPEED_DEFAULT false
#define POI_RADIUS_SETTING "poiRadius" #define POI_RADIUS_SETTING "poiRadius"
#define POI_RADIUS_DEFAULT (int)(IMPERIAL_UNITS() ? MIINM : KMINM) #define POI_RADIUS_DEFAULT (int)(IMPERIAL_UNITS() ? MIINM : KMINM)
#define USE_OPENGL_SETTING "useOpenGL" #define USE_OPENGL_SETTING "useOpenGL"
#define USE_OPENGL_DEFAULT false #define USE_OPENGL_DEFAULT false
#define ENABLE_HTTP2_SETTING "enableHTTP2"
#define ENABLE_HTTP2_DEFAULT true
#define PIXMAP_CACHE_SETTING "pixmapCache" #define PIXMAP_CACHE_SETTING "pixmapCache"
#define PIXMAP_CACHE_DEFAULT 64 /* MB */ #define PIXMAP_CACHE_DEFAULT 64 /* MB */
#define CONNECTION_TIMEOUT_SETTING "connectionTimeout" #define CONNECTION_TIMEOUT_SETTING "connectionTimeout"

View File

@ -12,11 +12,12 @@
#define FONT_FAMILY "Arial" #define FONT_FAMILY "Arial"
#define FONT_SIZE 12 // px #define FONT_SIZE 12 // px
#define ELLIPSOID_FILE QString("csv/ellipsoids.csv")
#define GCS_FILE QString("csv/gcs.csv")
#define PCS_FILE QString("csv/pcs.csv")
#define MAP_DIR QString("maps") #define MAP_DIR QString("maps")
#define POI_DIR QString("POI") #define POI_DIR QString("POI")
#define CSV_DIR QString("csv")
#define ELLIPSOID_FILE QString("ellipsoids.csv")
#define GCS_FILE QString("gcs.csv")
#define PCS_FILE QString("pcs.csv")
#if defined(Q_OS_WIN32) #if defined(Q_OS_WIN32)
#define USER_DIR QDir::homePath() + QString("/GPXSee") #define USER_DIR QDir::homePath() + QString("/GPXSee")
@ -30,17 +31,28 @@
#define GLOBAL_DIR QString("/usr/share/gpxsee") #define GLOBAL_DIR QString("/usr/share/gpxsee")
#endif #endif
#define USER_ELLIPSOID_FILE USER_DIR + QString("/") + ELLIPSOID_FILE #define USER_CSV_DIR USER_DIR + QString("/") + CSV_DIR
#define USER_GCS_FILE USER_DIR + QString("/") + GCS_FILE #define USER_ELLIPSOID_FILE USER_CSV_DIR + QString("/") + ELLIPSOID_FILE
#define USER_PCS_FILE USER_DIR + QString("/") + PCS_FILE #define USER_GCS_FILE USER_CSV_DIR + QString("/") + GCS_FILE
#define USER_PCS_FILE USER_CSV_DIR + QString("/") + PCS_FILE
#define USER_MAP_DIR USER_DIR + QString("/") + MAP_DIR #define USER_MAP_DIR USER_DIR + QString("/") + MAP_DIR
#define USER_POI_DIR USER_DIR + QString("/") + POI_DIR #define USER_POI_DIR USER_DIR + QString("/") + POI_DIR
#define GLOBAL_ELLIPSOID_FILE GLOBAL_DIR + QString("/") + ELLIPSOID_FILE #define GLOBAL_CSV_DIR GLOBAL_DIR + QString("/") + CSV_DIR
#define GLOBAL_GCS_FILE GLOBAL_DIR + QString("/") + GCS_FILE #define GLOBAL_ELLIPSOID_FILE GLOBAL_CSV_DIR + QString("/") + ELLIPSOID_FILE
#define GLOBAL_PCS_FILE GLOBAL_DIR + QString("/") + PCS_FILE #define GLOBAL_GCS_FILE GLOBAL_CSV_DIR + QString("/") + GCS_FILE
#define GLOBAL_PCS_FILE GLOBAL_CSV_DIR + QString("/") + PCS_FILE
#define GLOBAL_MAP_DIR GLOBAL_DIR + QString("/") + MAP_DIR #define GLOBAL_MAP_DIR GLOBAL_DIR + QString("/") + MAP_DIR
#define GLOBAL_POI_DIR GLOBAL_DIR + QString("/") + POI_DIR #define GLOBAL_POI_DIR GLOBAL_DIR + QString("/") + POI_DIR
#define TILES_DIR USER_DIR + QString("/tiles") #define TILES_DIR USER_DIR + QString("/tiles")
#define TRANSLATIONS_DIR GLOBAL_DIR + QString("/translations") #define TRANSLATIONS_DIR GLOBAL_DIR + QString("/translations")
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 1)
#define ENABLE_HTTP2
#endif // QT >= 5.10.1
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
#define ENABLE_HIDPI
#endif // QT >= 5.6
#endif /* CONFIG_H */ #endif /* CONFIG_H */

Some files were not shown because too many files have changed in this diff Show More