mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-07-14 19:04:23 +02:00
Compare commits
175 Commits
Author | SHA1 | Date | |
---|---|---|---|
82d2ac0871 | |||
0b3e35db72 | |||
0c4e5b0017 | |||
933f2c3837 | |||
6e4cc406ab | |||
21ce65146a | |||
c99adfd6d2 | |||
c537f1ba6c | |||
4e36d8633c | |||
8beeeb7526 | |||
69cc6ccb75 | |||
f042f11eed | |||
f72835f05e | |||
c8779b4592 | |||
4b30e665cc | |||
ac45ccaab6 | |||
6d2182eb46 | |||
50aea76bf7 | |||
7676a21fc3 | |||
dc6a57338e | |||
fa3fac5314 | |||
a53fedf838 | |||
4d284ad0e5 | |||
3f3ccb6856 | |||
2ea16eaaab | |||
effb0bb654 | |||
8bd08b31a3 | |||
7a9d941e60 | |||
5c341c8339 | |||
abddd8f9f1 | |||
29f9fb7a68 | |||
1387e9f12e | |||
b04ac5fae3 | |||
9754e52f2d | |||
ced95a9b3d | |||
c5e1872c2e | |||
52a88d39df | |||
199806a107 | |||
50dfa34dbc | |||
eaaa1b0506 | |||
15f194a848 | |||
56e60e32a7 | |||
762180542f | |||
e48c5bf740 | |||
b36aa057e8 | |||
62d37df40c | |||
d51b16b398 | |||
6234216862 | |||
5b3b7128f6 | |||
f1dd54457d | |||
3644ed3b1f | |||
655d4ea362 | |||
3d7e64a470 | |||
c667972498 | |||
34e3e04e03 | |||
f4d0c7f032 | |||
f77e428eeb | |||
0935ce45b6 | |||
442fc24776 | |||
2f6556dbb3 | |||
a54bfbadab | |||
e9220d5526 | |||
e90959ff34 | |||
17ed28ebf7 | |||
e9cd0963dc | |||
fa0f7f95d2 | |||
0dcfeeead1 | |||
af9ba34521 | |||
8e26ed5a50 | |||
141f88e46e | |||
c84b677938 | |||
31bd85bcc8 | |||
c0c7e9046a | |||
f5ea667f34 | |||
04b8d015cc | |||
3db2828874 | |||
1a3660ba2f | |||
a8b76f350d | |||
e49351a7c9 | |||
057c625283 | |||
47d9eea1af | |||
c60aa8876b | |||
31db5f2140 | |||
9ff94f3b24 | |||
334e0c3b37 | |||
3244dd675d | |||
6f093b2148 | |||
319f1180f1 | |||
ec5a1c7851 | |||
4ada19b4bf | |||
1777e708d3 | |||
fd590c83d1 | |||
811d41c26f | |||
8887e5d7a7 | |||
8ac739c50a | |||
d291320832 | |||
14c90e3eb0 | |||
7163441cb5 | |||
1cb478e707 | |||
8589716a59 | |||
9973236912 | |||
aff4dc9408 | |||
c173a0372f | |||
c7ef24ff30 | |||
ee36404613 | |||
c9083c184b | |||
918a55732f | |||
bfca1a127b | |||
89044d215b | |||
86993863c5 | |||
28333ffc28 | |||
723f2060a3 | |||
190a4a437a | |||
cbe03a7a29 | |||
11c9fd6d48 | |||
a53f20314f | |||
59e680d695 | |||
d39bd296f6 | |||
441ccc59d0 | |||
a74495a5e2 | |||
0f8478c380 | |||
d1cd1be878 | |||
596e1fd754 | |||
bfa7eea6ed | |||
7ad051ddd5 | |||
52d715e3ce | |||
2748849032 | |||
0f48e7c137 | |||
f3c0ed3f7f | |||
d1faf6c2c5 | |||
e0dc4ea352 | |||
2235231723 | |||
b8c2f77fee | |||
c5516071ab | |||
64307c0641 | |||
7ccb80cb91 | |||
38d6f52965 | |||
854454248e | |||
1b66dc4744 | |||
87df10d099 | |||
f310230fd3 | |||
b9e3e81ac1 | |||
c84c3bfd65 | |||
86cb33266d | |||
881f380cf0 | |||
637820930b | |||
4b2bee2368 | |||
86e8ac71ee | |||
ae270de0c5 | |||
9dccc113f5 | |||
4b4053e85b | |||
72b550f209 | |||
9373c7070b | |||
5efd3d1e33 | |||
411428718e | |||
6f0a6511db | |||
4c65cb186a | |||
14b884f61a | |||
6a941566cb | |||
64aa44d09b | |||
cbaecee4a8 | |||
3908c363d9 | |||
ff8be4206c | |||
fc75bbfbc3 | |||
95c9b42f66 | |||
9ed4418e1b | |||
0b634b33ad | |||
2e2fee560f | |||
527f9891c8 | |||
8c8ad4a4ba | |||
9f3917b0f2 | |||
7673154795 | |||
e05c47b9ce | |||
d33bcd1e55 | |||
f248e1a735 |
@ -1,4 +1,4 @@
|
|||||||
version: 9.0.{build}
|
version: 9.4.{build}
|
||||||
|
|
||||||
configuration:
|
configuration:
|
||||||
- Release
|
- Release
|
||||||
@ -30,43 +30,29 @@ environment:
|
|||||||
NSISDEF: /DQT6
|
NSISDEF: /DQT6
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- cmd: >-
|
- cmd: |-
|
||||||
set PATH=%QTDIR%\bin;%NSISDIR%;%PATH%
|
set PATH=%QTDIR%\bin;%NSISDIR%;%PATH%
|
||||||
|
|
||||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\"%VCVARS%
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\"%VCVARS%
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- cmd: >-
|
- cmd: |-
|
||||||
lrelease gpxsee.pro
|
lrelease gpxsee.pro
|
||||||
|
|
||||||
qmake gpxsee.pro
|
qmake gpxsee.pro
|
||||||
|
|
||||||
nmake release
|
nmake release
|
||||||
|
|
||||||
|
|
||||||
md installer
|
md installer
|
||||||
|
|
||||||
copy release\GPXSee.exe installer
|
copy release\GPXSee.exe installer
|
||||||
|
|
||||||
windeployqt --release installer\GPXSee.exe
|
windeployqt --release installer\GPXSee.exe
|
||||||
|
|
||||||
copy pkg\%NSI% installer
|
copy pkg\%NSI% installer
|
||||||
|
|
||||||
copy pkg\macros.nsh installer
|
copy pkg\macros.nsh installer
|
||||||
|
|
||||||
xcopy pkg\csv installer\csv /i
|
xcopy pkg\csv installer\csv /i
|
||||||
|
|
||||||
xcopy pkg\maps installer\maps /i
|
xcopy pkg\maps installer\maps /i
|
||||||
|
|
||||||
xcopy lang\*.qm installer\translations\ /sy
|
xcopy lang\*.qm installer\translations\ /sy
|
||||||
|
|
||||||
copy licence.txt installer
|
copy licence.txt installer
|
||||||
|
|
||||||
copy %OPENSSLDIR%\%LIBCRYPTO% installer
|
copy %OPENSSLDIR%\%LIBCRYPTO% installer
|
||||||
|
|
||||||
copy %OPENSSLDIR%\%LIBSSL% installer
|
copy %OPENSSLDIR%\%LIBSSL% installer
|
||||||
|
|
||||||
|
|
||||||
makensis.exe %NSISDEF% installer\%NSI%
|
makensis.exe %NSISDEF% installer\%NSI%
|
||||||
|
|
||||||
artifacts:
|
artifacts:
|
||||||
- path: installer\GPXSee-*.exe
|
- path: installer\GPXSee-*.exe
|
||||||
|
23
.travis.yml
23
.travis.yml
@ -5,14 +5,25 @@ os:
|
|||||||
- osx
|
- osx
|
||||||
|
|
||||||
dist: focal
|
dist: focal
|
||||||
|
osx_image: xcode12
|
||||||
|
|
||||||
before_install:
|
cache:
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -qq update; fi
|
directories:
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
|
- $HOME/Library/Caches/Homebrew
|
||||||
|
|
||||||
install:
|
before_cache:
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install qt; fi
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew cleanup; fi
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install qtbase5-dev qtbase5-private-dev libqt5opengl5-dev qttools5-dev-tools; fi
|
|
||||||
|
addons:
|
||||||
|
homebrew:
|
||||||
|
packages:
|
||||||
|
- qt
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- qtbase5-dev
|
||||||
|
- qtbase5-private-dev
|
||||||
|
- libqt5opengl5-dev
|
||||||
|
- qttools5-dev-tools
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PATH=/usr/local/opt/qt/bin/:${PATH}; fi
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PATH=/usr/local/opt/qt/bin/:${PATH}; fi
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
GPXSee is a Qt-based GPS log file viewer and analyzer that supports all common GPS log file formats.
|
GPXSee is a Qt-based GPS log file viewer and analyzer that supports all common GPS log file formats.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
* Opens GPX, TCX, FIT, KML, NMEA, IGC, CUP, SIGMA SLF, Suunto SML, LOC, GeoJSON, OziExplorer (PLT, RTE, WPT), Garmin GPI&CSV and geotagged JPEG files.
|
* Opens GPX, TCX, FIT, KML, NMEA, IGC, CUP, SIGMA SLF, Suunto SML, LOC, GeoJSON, OziExplorer (PLT, RTE, WPT), Garmin GPI&CSV, TomTom OV2&ITN and geotagged JPEG files.
|
||||||
* User-definable online maps (OpenStreetMap/Google tiles, WMTS, WMS, TMS, QuadTiles).
|
* User-definable online maps (OpenStreetMap/Google tiles, WMTS, WMS, TMS, QuadTiles).
|
||||||
* Offline maps (MBTiles, OziExplorer maps, TrekBuddy maps/atlases, Garmin IMG/GMAP & JNX maps, TwoNav RMaps, GeoTIFF images, BSB charts, KMZ maps, AlpineQuest maps, Locus/OsmAnd/RMaps SQLite maps, Mapsforge vector maps).
|
* Offline maps (MBTiles, OziExplorer maps, TrekBuddy maps/atlases, Garmin IMG/GMAP & JNX maps, TwoNav RMaps, GeoTIFF images, BSB charts, KMZ maps, AlpineQuest maps, Locus/OsmAnd/RMaps SQLite maps, Mapsforge vector maps, ESRI World-File georeferenced images).
|
||||||
* Elevation, speed, heart rate, cadence, power, temperature and gear ratio/shifts graphs.
|
* Elevation, speed, heart rate, cadence, power, temperature and gear ratio/shifts graphs.
|
||||||
* Support for DEM files (SRTM HGT).
|
* Support for DEM files (SRTM HGT).
|
||||||
* Support for multiple tracks in one view.
|
* Support for multiple tracks in one view.
|
||||||
|
37
gpxsee.pro
37
gpxsee.pro
@ -3,7 +3,7 @@ unix:!macx {
|
|||||||
} else {
|
} else {
|
||||||
TARGET = GPXSee
|
TARGET = GPXSee
|
||||||
}
|
}
|
||||||
VERSION = 9.0
|
VERSION = 9.4
|
||||||
|
|
||||||
QT += core \
|
QT += core \
|
||||||
gui \
|
gui \
|
||||||
@ -19,6 +19,8 @@ CONFIG += object_parallel_to_source
|
|||||||
INCLUDEPATH += ./src
|
INCLUDEPATH += ./src
|
||||||
HEADERS += src/common/config.h \
|
HEADERS += src/common/config.h \
|
||||||
src/GUI/axislabelitem.h \
|
src/GUI/axislabelitem.h \
|
||||||
|
src/GUI/dirselectwidget.h \
|
||||||
|
src/GUI/flowlayout.h \
|
||||||
src/GUI/graphicsscene.h \
|
src/GUI/graphicsscene.h \
|
||||||
src/GUI/mapaction.h \
|
src/GUI/mapaction.h \
|
||||||
src/GUI/mapitem.h \
|
src/GUI/mapitem.h \
|
||||||
@ -27,6 +29,7 @@ HEADERS += src/common/config.h \
|
|||||||
src/GUI/planeitem.h \
|
src/GUI/planeitem.h \
|
||||||
src/GUI/poiaction.h \
|
src/GUI/poiaction.h \
|
||||||
src/GUI/popup.h \
|
src/GUI/popup.h \
|
||||||
|
src/GUI/thumbnail.h \
|
||||||
src/common/garmin.h \
|
src/common/garmin.h \
|
||||||
src/common/coordinates.h \
|
src/common/coordinates.h \
|
||||||
src/common/range.h \
|
src/common/range.h \
|
||||||
@ -90,7 +93,9 @@ HEADERS += src/common/config.h \
|
|||||||
src/GUI/mapview.h \
|
src/GUI/mapview.h \
|
||||||
src/GUI/font.h \
|
src/GUI/font.h \
|
||||||
src/GUI/areaitem.h \
|
src/GUI/areaitem.h \
|
||||||
|
src/data/itnparser.h \
|
||||||
src/data/link.h \
|
src/data/link.h \
|
||||||
|
src/data/ov2parser.h \
|
||||||
src/map/IMG/bitmapline.h \
|
src/map/IMG/bitmapline.h \
|
||||||
src/map/IMG/bitstream.h \
|
src/map/IMG/bitstream.h \
|
||||||
src/map/IMG/deltastream.h \
|
src/map/IMG/deltastream.h \
|
||||||
@ -105,6 +110,7 @@ HEADERS += src/common/config.h \
|
|||||||
src/map/IMG/rastertile.h \
|
src/map/IMG/rastertile.h \
|
||||||
src/map/IMG/shield.h \
|
src/map/IMG/shield.h \
|
||||||
src/map/mapsforge/style.h \
|
src/map/mapsforge/style.h \
|
||||||
|
src/map/prjfile.h \
|
||||||
src/map/textpathitem.h \
|
src/map/textpathitem.h \
|
||||||
src/map/textpointitem.h \
|
src/map/textpointitem.h \
|
||||||
src/map/mapsforge/mapdata.h \
|
src/map/mapsforge/mapdata.h \
|
||||||
@ -147,6 +153,7 @@ HEADERS += src/common/config.h \
|
|||||||
src/map/ct.h \
|
src/map/ct.h \
|
||||||
src/map/mapsource.h \
|
src/map/mapsource.h \
|
||||||
src/map/tileloader.h \
|
src/map/tileloader.h \
|
||||||
|
src/map/wldfile.h \
|
||||||
src/map/wmtsmap.h \
|
src/map/wmtsmap.h \
|
||||||
src/map/wmts.h \
|
src/map/wmts.h \
|
||||||
src/map/wmsmap.h \
|
src/map/wmsmap.h \
|
||||||
@ -205,7 +212,7 @@ HEADERS += src/common/config.h \
|
|||||||
src/map/IMG/subdiv.h \
|
src/map/IMG/subdiv.h \
|
||||||
src/map/IMG/style.h \
|
src/map/IMG/style.h \
|
||||||
src/map/IMG/netfile.h \
|
src/map/IMG/netfile.h \
|
||||||
src/GUI/limitedcombobox.h \
|
src/GUI/projectioncombobox.h \
|
||||||
src/GUI/pathtickitem.h \
|
src/GUI/pathtickitem.h \
|
||||||
src/map/textitem.h \
|
src/map/textitem.h \
|
||||||
src/map/IMG/label.h \
|
src/map/IMG/label.h \
|
||||||
@ -219,14 +226,18 @@ HEADERS += src/common/config.h \
|
|||||||
src/data/geojsonparser.h \
|
src/data/geojsonparser.h \
|
||||||
src/GUI/timezoneinfo.h \
|
src/GUI/timezoneinfo.h \
|
||||||
src/map/aqmmap.h \
|
src/map/aqmmap.h \
|
||||||
src/map/mapsforgemap.h
|
src/map/mapsforgemap.h \
|
||||||
|
src/map/worldfilemap.h
|
||||||
|
|
||||||
SOURCES += src/main.cpp \
|
SOURCES += src/main.cpp \
|
||||||
src/GUI/axislabelitem.cpp \
|
src/GUI/axislabelitem.cpp \
|
||||||
|
src/GUI/dirselectwidget.cpp \
|
||||||
|
src/GUI/flowlayout.cpp \
|
||||||
src/GUI/mapitem.cpp \
|
src/GUI/mapitem.cpp \
|
||||||
src/GUI/marginswidget.cpp \
|
src/GUI/marginswidget.cpp \
|
||||||
src/GUI/markerinfoitem.cpp \
|
src/GUI/markerinfoitem.cpp \
|
||||||
src/GUI/popup.cpp \
|
src/GUI/popup.cpp \
|
||||||
|
src/GUI/thumbnail.cpp \
|
||||||
src/common/coordinates.cpp \
|
src/common/coordinates.cpp \
|
||||||
src/common/rectc.cpp \
|
src/common/rectc.cpp \
|
||||||
src/common/range.cpp \
|
src/common/range.cpp \
|
||||||
@ -254,7 +265,6 @@ SOURCES += src/main.cpp \
|
|||||||
src/GUI/fileselectwidget.cpp \
|
src/GUI/fileselectwidget.cpp \
|
||||||
src/GUI/temperaturegraph.cpp \
|
src/GUI/temperaturegraph.cpp \
|
||||||
src/GUI/trackitem.cpp \
|
src/GUI/trackitem.cpp \
|
||||||
src/GUI/tooltip.cpp \
|
|
||||||
src/GUI/routeitem.cpp \
|
src/GUI/routeitem.cpp \
|
||||||
src/GUI/graphitem.cpp \
|
src/GUI/graphitem.cpp \
|
||||||
src/GUI/pathitem.cpp \
|
src/GUI/pathitem.cpp \
|
||||||
@ -277,6 +287,9 @@ SOURCES += src/main.cpp \
|
|||||||
src/GUI/gearratiographitem.cpp \
|
src/GUI/gearratiographitem.cpp \
|
||||||
src/GUI/mapview.cpp \
|
src/GUI/mapview.cpp \
|
||||||
src/GUI/areaitem.cpp \
|
src/GUI/areaitem.cpp \
|
||||||
|
src/data/address.cpp \
|
||||||
|
src/data/itnparser.cpp \
|
||||||
|
src/data/ov2parser.cpp \
|
||||||
src/data/waypoint.cpp \
|
src/data/waypoint.cpp \
|
||||||
src/map/IMG/bitmapline.cpp \
|
src/map/IMG/bitmapline.cpp \
|
||||||
src/map/IMG/bitstream.cpp \
|
src/map/IMG/bitstream.cpp \
|
||||||
@ -290,6 +303,7 @@ SOURCES += src/main.cpp \
|
|||||||
src/map/IMG/mapdata.cpp \
|
src/map/IMG/mapdata.cpp \
|
||||||
src/map/IMG/rastertile.cpp \
|
src/map/IMG/rastertile.cpp \
|
||||||
src/map/mapsforge/style.cpp \
|
src/map/mapsforge/style.cpp \
|
||||||
|
src/map/prjfile.cpp \
|
||||||
src/map/textpathitem.cpp \
|
src/map/textpathitem.cpp \
|
||||||
src/map/textpointitem.cpp \
|
src/map/textpointitem.cpp \
|
||||||
src/map/mapsforge/mapdata.cpp \
|
src/map/mapsforge/mapdata.cpp \
|
||||||
@ -327,6 +341,7 @@ SOURCES += src/main.cpp \
|
|||||||
src/map/linearunits.cpp \
|
src/map/linearunits.cpp \
|
||||||
src/map/mapsource.cpp \
|
src/map/mapsource.cpp \
|
||||||
src/map/tileloader.cpp \
|
src/map/tileloader.cpp \
|
||||||
|
src/map/wldfile.cpp \
|
||||||
src/map/wmtsmap.cpp \
|
src/map/wmtsmap.cpp \
|
||||||
src/map/wmts.cpp \
|
src/map/wmts.cpp \
|
||||||
src/map/wmsmap.cpp \
|
src/map/wmsmap.cpp \
|
||||||
@ -384,7 +399,9 @@ SOURCES += src/main.cpp \
|
|||||||
src/GUI/pngexportdialog.cpp \
|
src/GUI/pngexportdialog.cpp \
|
||||||
src/data/geojsonparser.cpp \
|
src/data/geojsonparser.cpp \
|
||||||
src/map/aqmmap.cpp \
|
src/map/aqmmap.cpp \
|
||||||
src/map/mapsforgemap.cpp
|
src/map/mapsforgemap.cpp \
|
||||||
|
src/map/worldfilemap.cpp \
|
||||||
|
src/GUI/projectioncombobox.cpp
|
||||||
|
|
||||||
DEFINES += APP_VERSION=\\\"$$VERSION\\\" \
|
DEFINES += APP_VERSION=\\\"$$VERSION\\\" \
|
||||||
QT_NO_DEPRECATED_WARNINGS
|
QT_NO_DEPRECATED_WARNINGS
|
||||||
@ -456,7 +473,10 @@ macx {
|
|||||||
icons/formats/rmap.icns \
|
icons/formats/rmap.icns \
|
||||||
icons/formats/tba.icns \
|
icons/formats/tba.icns \
|
||||||
icons/formats/aqm.icns \
|
icons/formats/aqm.icns \
|
||||||
icons/formats/sqlt.icns
|
icons/formats/sqlt.icns \
|
||||||
|
icons/formats/ov2.icns \
|
||||||
|
icons/formats/itn.icns \
|
||||||
|
icons/formats/wld.icns
|
||||||
QMAKE_BUNDLE_DATA += locale maps icons csv
|
QMAKE_BUNDLE_DATA += locale maps icons csv
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -485,7 +505,10 @@ win32 {
|
|||||||
icons/formats/rmap.ico \
|
icons/formats/rmap.ico \
|
||||||
icons/formats/tba.ico \
|
icons/formats/tba.ico \
|
||||||
icons/formats/aqm.ico \
|
icons/formats/aqm.ico \
|
||||||
icons/formats/sqlt.ico
|
icons/formats/sqlt.ico \
|
||||||
|
icons/formats/ov2.ico \
|
||||||
|
icons/formats/itn.ico \
|
||||||
|
icons/formats/wld.ico
|
||||||
DEFINES += _USE_MATH_DEFINES \
|
DEFINES += _USE_MATH_DEFINES \
|
||||||
NOGDI
|
NOGDI
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
icons/formats/itn.icns
Normal file
BIN
icons/formats/itn.icns
Normal file
Binary file not shown.
BIN
icons/formats/itn.ico
Normal file
BIN
icons/formats/itn.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 302 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
icons/formats/ov2.icns
Normal file
BIN
icons/formats/ov2.icns
Normal file
Binary file not shown.
BIN
icons/formats/ov2.ico
Normal file
BIN
icons/formats/ov2.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 306 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -22,3 +22,6 @@ rmap:#145cba
|
|||||||
tba:#367050
|
tba:#367050
|
||||||
aqm:#32a89e
|
aqm:#32a89e
|
||||||
sqlt:#303030
|
sqlt:#303030
|
||||||
|
ov2:#a8c920
|
||||||
|
itn:#b8540d
|
||||||
|
wld:#c74c8f
|
||||||
|
@ -9,16 +9,16 @@ while read e; do
|
|||||||
ICONSET=$1.iconset
|
ICONSET=$1.iconset
|
||||||
mkdir $ICONSET
|
mkdir $ICONSET
|
||||||
|
|
||||||
convert -density 400 -background none -resize '16x16' "$1.svg" "$ICONSET/icon_16x16.png"
|
rsvg-convert -w 16 -h 16 -o "$ICONSET/icon_16x16.png" "$1.svg"
|
||||||
convert -density 400 -background none -resize '32x32' "$1.svg" "$ICONSET/icon_16x16@2x.png"
|
rsvg-convert -w 32 -h 32 -o "$ICONSET/icon_16x16@2x.png" "$1.svg"
|
||||||
cp "$ICONSET/icon_16x16@2x.png" "$ICONSET/icon_32x32.png"
|
cp "$ICONSET/icon_16x16@2x.png" "$ICONSET/icon_32x32.png"
|
||||||
convert -density 400 -background none -resize '64x64' "$1.svg" "$ICONSET/icon_32x32@2x.png"
|
rsvg-convert -w 64 -h 64 -o "$ICONSET/icon_32x32@2x.png" "$1.svg"
|
||||||
convert -density 400 -background none -resize '128x128' "$1.svg" "$ICONSET/icon_128x128.png"
|
rsvg-convert -w 128 -h 128 -o "$ICONSET/icon_128x128.png" "$1.svg"
|
||||||
convert -density 400 -background none -resize '256x256' "$1.svg" "$ICONSET/icon_128x128@2x.png"
|
rsvg-convert -w 256 -h 256 -o "$ICONSET/icon_128x128@2x.png" "$1.svg"
|
||||||
cp "$ICONSET/icon_128x128@2x.png" "$ICONSET/icon_256x256.png"
|
cp "$ICONSET/icon_128x128@2x.png" "$ICONSET/icon_256x256.png"
|
||||||
convert -density 400 -background none -resize '512x512' "$1.svg" "$ICONSET/icon_256x256@2x.png"
|
rsvg-convert -w 512 -h 512 -o "$ICONSET/icon_256x256@2x.png" "$1.svg"
|
||||||
cp "$ICONSET/icon_256x256@2x.png" "$ICONSET/icon_512x512.png"
|
cp "$ICONSET/icon_256x256@2x.png" "$ICONSET/icon_512x512.png"
|
||||||
convert -density 400 -background none -resize '1024x1024' "$1.svg" "$ICONSET/icon_512x512@2x.png"
|
rsvg-convert -w 1024 -h 1024 -o "$ICONSET/icon_512x512@2x.png" "$1.svg"
|
||||||
|
|
||||||
iconutil -c icns -o $1.icns "$ICONSET"
|
iconutil -c icns -o $1.icns "$ICONSET"
|
||||||
rm -R "$ICONSET" $1.svg
|
rm -R "$ICONSET" $1.svg
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
icons/formats/wld.icns
Normal file
BIN
icons/formats/wld.icns
Normal file
Binary file not shown.
BIN
icons/formats/wld.ico
Normal file
BIN
icons/formats/wld.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 305 KiB |
Binary file not shown.
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
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
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
2122
lang/gpxsee_zh.ts
2122
lang/gpxsee_zh.ts
File diff suppressed because it is too large
Load Diff
119
pkg/Info.plist
119
pkg/Info.plist
@ -494,6 +494,58 @@
|
|||||||
<key>CFBundleTypeRole</key>
|
<key>CFBundleTypeRole</key>
|
||||||
<string>Viewer</string>
|
<string>Viewer</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeExtensions</key>
|
||||||
|
<array>
|
||||||
|
<string>ov2</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleTypeMIMETypes</key>
|
||||||
|
<array>
|
||||||
|
<string>application/vnd.tomtom.ov2</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleTypeIconFile</key>
|
||||||
|
<string>icons/ov2.icns</string>
|
||||||
|
<key>CFBundleTypeName</key>
|
||||||
|
<string>TomTom POI File</string>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Viewer</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeExtensions</key>
|
||||||
|
<array>
|
||||||
|
<string>itn</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleTypeMIMETypes</key>
|
||||||
|
<array>
|
||||||
|
<string>application/vnd.tomtom.itn</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleTypeIconFile</key>
|
||||||
|
<string>icons/itn.icns</string>
|
||||||
|
<key>CFBundleTypeName</key>
|
||||||
|
<string>TomTom Route File</string>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Viewer</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeExtensions</key>
|
||||||
|
<array>
|
||||||
|
<string>wld</string>
|
||||||
|
<string>jgw</string>
|
||||||
|
<string>gfw</string>
|
||||||
|
<string>pgw</string>
|
||||||
|
<string>tfw</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleTypeMIMETypes</key>
|
||||||
|
<array>
|
||||||
|
<string>application/vnd.esri.wld</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleTypeIconFile</key>
|
||||||
|
<string>icons/wld.icns</string>
|
||||||
|
<key>CFBundleTypeName</key>
|
||||||
|
<string>ESRI World File</string>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Viewer</string>
|
||||||
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
|
|
||||||
<key>UTImportedTypeDeclarations</key>
|
<key>UTImportedTypeDeclarations</key>
|
||||||
@ -1113,6 +1165,73 @@
|
|||||||
<string>image/tiff</string>
|
<string>image/tiff</string>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>UTTypeIdentifier</key>
|
||||||
|
<string>com.tomtom.ov2</string>
|
||||||
|
<key>UTTypeReferenceURL</key>
|
||||||
|
<string>https://www.tomtom.com/lib/doc/ttnavsdk3_manual.pdf</string>
|
||||||
|
<key>UTTypeDescription</key>
|
||||||
|
<string>TomTom POI File</string>
|
||||||
|
<key>UTTypeConformsTo</key>
|
||||||
|
<array>
|
||||||
|
<string>public.data</string>
|
||||||
|
</array>
|
||||||
|
<key>UTTypeTagSpecification</key>
|
||||||
|
<dict>
|
||||||
|
<key>public.filename-extension</key>
|
||||||
|
<array>
|
||||||
|
<string>ov2</string>
|
||||||
|
</array>
|
||||||
|
<key>public.mime-type</key>
|
||||||
|
<string>application/vnd.tomtom.ov2</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>UTTypeIdentifier</key>
|
||||||
|
<string>com.tomtom.itn</string>
|
||||||
|
<key>UTTypeReferenceURL</key>
|
||||||
|
<string>https://www.tomtom.com/lib/doc/ttnavsdk3_manual.pdf</string>
|
||||||
|
<key>UTTypeDescription</key>
|
||||||
|
<string>TomTom Route File</string>
|
||||||
|
<key>UTTypeConformsTo</key>
|
||||||
|
<array>
|
||||||
|
<string>public.data</string>
|
||||||
|
</array>
|
||||||
|
<key>UTTypeTagSpecification</key>
|
||||||
|
<dict>
|
||||||
|
<key>public.filename-extension</key>
|
||||||
|
<array>
|
||||||
|
<string>itn</string>
|
||||||
|
</array>
|
||||||
|
<key>public.mime-type</key>
|
||||||
|
<string>application/vnd.tomtom.itn</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>UTTypeIdentifier</key>
|
||||||
|
<string>com.esri.wld</string>
|
||||||
|
<key>UTTypeReferenceURL</key>
|
||||||
|
<string>http://webhelp.esri.com/arcims/9.3/General/topics/author_world_files.htm</string>
|
||||||
|
<key>UTTypeDescription</key>
|
||||||
|
<string>ESRI World File</string>
|
||||||
|
<key>UTTypeConformsTo</key>
|
||||||
|
<array>
|
||||||
|
<string>public.data</string>
|
||||||
|
</array>
|
||||||
|
<key>UTTypeTagSpecification</key>
|
||||||
|
<dict>
|
||||||
|
<key>public.filename-extension</key>
|
||||||
|
<array>
|
||||||
|
<string>wld</string>
|
||||||
|
<string>jgw</string>
|
||||||
|
<string>gfw</string>
|
||||||
|
<string>pgw</string>
|
||||||
|
<string>tfw</string>
|
||||||
|
</array>
|
||||||
|
<key>public.mime-type</key>
|
||||||
|
<string>application/vnd.esri.wld</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
|
|
||||||
<key>UTExportedTypeDeclarations</key>
|
<key>UTExportedTypeDeclarations</key>
|
||||||
|
@ -14,13 +14,14 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>Opens GPX, TCX, FIT, KML, IGC, NMEA, SIGMA SLF, Suunto SML, LOC,
|
<li>Opens GPX, TCX, FIT, KML, IGC, NMEA, SIGMA SLF, Suunto SML, LOC,
|
||||||
OziExplorer (PLT, WPT, RTE), GeoJSON, SeeYou CUP,
|
OziExplorer (PLT, WPT, RTE), GeoJSON, SeeYou CUP,
|
||||||
Garmin GPI & CSV and geotagged JPEG files.</li>
|
Garmin GPI & CSV, TomTom OV2 & ITN and geotagged JPEG
|
||||||
|
files.</li>
|
||||||
<li>User-definable online maps (OpenStreetMap/Google tiles, WMTS,
|
<li>User-definable online maps (OpenStreetMap/Google tiles, WMTS,
|
||||||
WMS, TMS, QuadTiles).</li>
|
WMS, TMS, QuadTiles).</li>
|
||||||
<li>Offline maps (MBTiles, OziExplorer maps, TrekBuddy maps/atlases,
|
<li>Offline maps (MBTiles, OziExplorer maps, TrekBuddy maps/atlases,
|
||||||
TwoNav RMaps, Garmin IMG & JNX maps, GeoTIFF images,
|
TwoNav RMaps, Garmin IMG & JNX maps, GeoTIFF images,
|
||||||
BSB nautical charts, KMZ maps, AlpineQuest maps,
|
BSB nautical charts, KMZ maps, AlpineQuest maps,
|
||||||
Mapsforge maps).</li>
|
Mapsforge maps), ESRI world files.</li>
|
||||||
<li>Elevation, speed, heart rate, cadence, power, temperature and
|
<li>Elevation, speed, heart rate, cadence, power, temperature and
|
||||||
gear ratio graphs.</li>
|
gear ratio graphs.</li>
|
||||||
<li>Support for multiple tracks in one view.</li>
|
<li>Support for multiple tracks in one view.</li>
|
||||||
@ -91,5 +92,8 @@
|
|||||||
<mimetype>application/vnd.alpinequest.aqm</mimetype>
|
<mimetype>application/vnd.alpinequest.aqm</mimetype>
|
||||||
<mimetype>application/vnd.rmaps.sqlite</mimetype>
|
<mimetype>application/vnd.rmaps.sqlite</mimetype>
|
||||||
<mimetype>application/vnd.mapsforge.map</mimetype>
|
<mimetype>application/vnd.mapsforge.map</mimetype>
|
||||||
|
<mimetype>application/vnd.tomtom.ov2</mimetype>
|
||||||
|
<mimetype>application/vnd.tomtom.itn</mimetype>
|
||||||
|
<mimetype>application/vnd.esri.wld</mimetype>
|
||||||
</mimetypes>
|
</mimetypes>
|
||||||
</component>
|
</component>
|
||||||
|
@ -15,4 +15,4 @@ Icon=gpxsee
|
|||||||
Terminal=false
|
Terminal=false
|
||||||
Type=Application
|
Type=Application
|
||||||
Categories=Graphics;Viewer;Education;Geography;Maps;Sports;Qt
|
Categories=Graphics;Viewer;Education;Geography;Maps;Sports;Qt
|
||||||
MimeType=application/gpx+xml;application/vnd.garmin.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/vnd.groundspeak.loc+xml;application/vnd.sigma.slf+xml;application/geo+json;application/vnd.naviter.seeyou.cup;application/vnd.garmin.gpi;application/vnd.suunto.sml+xml;image/jpeg;text/csv;application/vnd.garmin.img;application/vnd.garmin.jnx;application/vnd.garmin.gmap+xml;image/vnd.maptech.kap;application/vnd.oziexplorer.map;application/vnd.mapbox.mbtiles;application/vnd.twonav.rmap;application/vnd.trekbuddy.tba;application/vnd.gpxsee.map+xml;application/x-tar;image/tiff;application/vnd.google-earth.kmz;application/vnd.alpinequest.aqm;application/vnd.rmaps.sqlite;application/vnd.mapsforge.map
|
MimeType=application/gpx+xml;application/vnd.garmin.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/vnd.groundspeak.loc+xml;application/vnd.sigma.slf+xml;application/geo+json;application/vnd.naviter.seeyou.cup;application/vnd.garmin.gpi;application/vnd.suunto.sml+xml;image/jpeg;text/csv;application/vnd.garmin.img;application/vnd.garmin.jnx;application/vnd.garmin.gmap+xml;image/vnd.maptech.kap;application/vnd.oziexplorer.map;application/vnd.mapbox.mbtiles;application/vnd.twonav.rmap;application/vnd.trekbuddy.tba;application/vnd.gpxsee.map+xml;application/x-tar;image/tiff;application/vnd.google-earth.kmz;application/vnd.alpinequest.aqm;application/vnd.rmaps.sqlite;application/vnd.mapsforge.map;application/vnd.tomtom.ov2;application/vnd.tomtom.itn;application/vnd.esri.wld
|
||||||
|
@ -9,7 +9,7 @@ Unicode true
|
|||||||
; The name of the installer
|
; The name of the installer
|
||||||
Name "GPXSee"
|
Name "GPXSee"
|
||||||
; Program version
|
; Program version
|
||||||
!define VERSION "9.0"
|
!define VERSION "9.4"
|
||||||
|
|
||||||
; The file to write
|
; The file to write
|
||||||
OutFile "GPXSee-${VERSION}.exe"
|
OutFile "GPXSee-${VERSION}.exe"
|
||||||
@ -130,15 +130,22 @@ Section "GPXSee" SEC_APP
|
|||||||
!insertmacro FILE_ASSOCIATION_ADD "rmap" "TwoNav Raster Map File" 14
|
!insertmacro FILE_ASSOCIATION_ADD "rmap" "TwoNav Raster Map File" 14
|
||||||
!insertmacro FILE_ASSOCIATION_ADD "tba" "TrekBuddy Atlas" 15
|
!insertmacro FILE_ASSOCIATION_ADD "tba" "TrekBuddy Atlas" 15
|
||||||
!insertmacro FILE_ASSOCIATION_ADD "aqm" "AlpineQuest Map File" 16
|
!insertmacro FILE_ASSOCIATION_ADD "aqm" "AlpineQuest Map File" 16
|
||||||
!insertmacro FILE_ASSOCIATION_ADD "sqlitedb" "RMAps SQLite Map File" 17
|
!insertmacro FILE_ASSOCIATION_ADD "sqlitedb" "RMaps SQLite Map File" 17
|
||||||
!insertmacro FILE_ASSOCIATION_ADD "tcx" "Training Center XML" 18
|
!insertmacro FILE_ASSOCIATION_ADD "ov2" "TomTom POI File" 18
|
||||||
!insertmacro FILE_ASSOCIATION_ADD "kml" "Keyhole Markup Language" 19
|
!insertmacro FILE_ASSOCIATION_ADD "itn" "TomTom Route File" 19
|
||||||
!insertmacro FILE_ASSOCIATION_ADD "kmz" "KML geographic compressed data" 19
|
!insertmacro FILE_ASSOCIATION_ADD "wld" "ESRI World File" 20
|
||||||
!insertmacro FILE_ASSOCIATION_ADD "fit" "Flexible and Interoperable Data Transfer" 20
|
!insertmacro FILE_ASSOCIATION_ADD "jgw" "ESRI World File" 20
|
||||||
!insertmacro FILE_ASSOCIATION_ADD "igc" "Flight Recorder Data Format" 21
|
!insertmacro FILE_ASSOCIATION_ADD "gfw" "ESRI World File" 20
|
||||||
!insertmacro FILE_ASSOCIATION_ADD "nmea" "NMEA 0183 Data" 22
|
!insertmacro FILE_ASSOCIATION_ADD "pgw" "ESRI World File" 20
|
||||||
!insertmacro FILE_ASSOCIATION_ADD "plt" "OziExplorer Track File" 23
|
!insertmacro FILE_ASSOCIATION_ADD "tfw" "ESRI World File" 20
|
||||||
!insertmacro FILE_ASSOCIATION_ADD "rte" "OziExplorer Route File" 24
|
!insertmacro FILE_ASSOCIATION_ADD "tcx" "Training Center XML" 21
|
||||||
|
!insertmacro FILE_ASSOCIATION_ADD "kml" "Keyhole Markup Language" 22
|
||||||
|
!insertmacro FILE_ASSOCIATION_ADD "kmz" "KML geographic compressed data" 22
|
||||||
|
!insertmacro FILE_ASSOCIATION_ADD "fit" "Flexible and Interoperable Data Transfer" 23
|
||||||
|
!insertmacro FILE_ASSOCIATION_ADD "igc" "Flight Recorder Data Format" 24
|
||||||
|
!insertmacro FILE_ASSOCIATION_ADD "nmea" "NMEA 0183 Data" 25
|
||||||
|
!insertmacro FILE_ASSOCIATION_ADD "plt" "OziExplorer Track File" 26
|
||||||
|
!insertmacro FILE_ASSOCIATION_ADD "rte" "OziExplorer Route File" 27
|
||||||
|
|
||||||
WriteRegStr HKCR "Applications\GPXSee.exe\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
WriteRegStr HKCR "Applications\GPXSee.exe\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||||
WriteRegStr HKCR ".gpx\OpenWithList" "GPXSee.exe" ""
|
WriteRegStr HKCR ".gpx\OpenWithList" "GPXSee.exe" ""
|
||||||
@ -156,6 +163,8 @@ Section "GPXSee" SEC_APP
|
|||||||
WriteRegStr HKCR ".cup\OpenWithList" "GPXSee.exe" ""
|
WriteRegStr HKCR ".cup\OpenWithList" "GPXSee.exe" ""
|
||||||
WriteRegStr HKCR ".gpi\OpenWithList" "GPXSee.exe" ""
|
WriteRegStr HKCR ".gpi\OpenWithList" "GPXSee.exe" ""
|
||||||
WriteRegStr HKCR ".sml\OpenWithList" "GPXSee.exe" ""
|
WriteRegStr HKCR ".sml\OpenWithList" "GPXSee.exe" ""
|
||||||
|
WriteRegStr HKCR ".ov2\OpenWithList" "GPXSee.exe" ""
|
||||||
|
WriteRegStr HKCR ".itn\OpenWithList" "GPXSee.exe" ""
|
||||||
WriteRegStr HKCR ".csv\OpenWithList" "GPXSee.exe" ""
|
WriteRegStr HKCR ".csv\OpenWithList" "GPXSee.exe" ""
|
||||||
WriteRegStr HKCR ".json\OpenWithList" "GPXSee.exe" ""
|
WriteRegStr HKCR ".json\OpenWithList" "GPXSee.exe" ""
|
||||||
WriteRegStr HKCR ".jpg\OpenWithList" "GPXSee.exe" ""
|
WriteRegStr HKCR ".jpg\OpenWithList" "GPXSee.exe" ""
|
||||||
@ -175,6 +184,11 @@ Section "GPXSee" SEC_APP
|
|||||||
WriteRegStr HKCR ".kmz\OpenWithList" "GPXSee.exe" ""
|
WriteRegStr HKCR ".kmz\OpenWithList" "GPXSee.exe" ""
|
||||||
WriteRegStr HKCR ".aqm\OpenWithList" "GPXSee.exe" ""
|
WriteRegStr HKCR ".aqm\OpenWithList" "GPXSee.exe" ""
|
||||||
WriteRegStr HKCR ".sqlitedb\OpenWithList" "GPXSee.exe" ""
|
WriteRegStr HKCR ".sqlitedb\OpenWithList" "GPXSee.exe" ""
|
||||||
|
WriteRegStr HKCR ".wld\OpenWithList" "GPXSee.exe" ""
|
||||||
|
WriteRegStr HKCR ".jgw\OpenWithList" "GPXSee.exe" ""
|
||||||
|
WriteRegStr HKCR ".gfw\OpenWithList" "GPXSee.exe" ""
|
||||||
|
WriteRegStr HKCR ".pgw\OpenWithList" "GPXSee.exe" ""
|
||||||
|
WriteRegStr HKCR ".tfw\OpenWithList" "GPXSee.exe" ""
|
||||||
|
|
||||||
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)'
|
||||||
|
|
||||||
@ -292,6 +306,13 @@ Section "Uninstall"
|
|||||||
!insertmacro FILE_ASSOCIATION_REMOVE "kmz"
|
!insertmacro FILE_ASSOCIATION_REMOVE "kmz"
|
||||||
!insertmacro FILE_ASSOCIATION_REMOVE "aqm"
|
!insertmacro FILE_ASSOCIATION_REMOVE "aqm"
|
||||||
!insertmacro FILE_ASSOCIATION_REMOVE "sqlitedb"
|
!insertmacro FILE_ASSOCIATION_REMOVE "sqlitedb"
|
||||||
|
!insertmacro FILE_ASSOCIATION_REMOVE "ov2"
|
||||||
|
!insertmacro FILE_ASSOCIATION_REMOVE "itn"
|
||||||
|
!insertmacro FILE_ASSOCIATION_REMOVE "wld"
|
||||||
|
!insertmacro FILE_ASSOCIATION_REMOVE "jgw"
|
||||||
|
!insertmacro FILE_ASSOCIATION_REMOVE "gfw"
|
||||||
|
!insertmacro FILE_ASSOCIATION_REMOVE "pgw"
|
||||||
|
!insertmacro FILE_ASSOCIATION_REMOVE "tfw"
|
||||||
|
|
||||||
DeleteRegValue HKCR ".gpx\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".gpx\OpenWithList" "GPXSee.exe"
|
||||||
DeleteRegValue HKCR ".tcx\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".tcx\OpenWithList" "GPXSee.exe"
|
||||||
@ -308,6 +329,8 @@ Section "Uninstall"
|
|||||||
DeleteRegValue HKCR ".cup\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".cup\OpenWithList" "GPXSee.exe"
|
||||||
DeleteRegValue HKCR ".gpi\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".gpi\OpenWithList" "GPXSee.exe"
|
||||||
DeleteRegValue HKCR ".sml\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".sml\OpenWithList" "GPXSee.exe"
|
||||||
|
DeleteRegValue HKCR ".ov2\OpenWithList" "GPXSee.exe"
|
||||||
|
DeleteRegValue HKCR ".itn\OpenWithList" "GPXSee.exe"
|
||||||
DeleteRegValue HKCR ".csv\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".csv\OpenWithList" "GPXSee.exe"
|
||||||
DeleteRegValue HKCR ".json\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".json\OpenWithList" "GPXSee.exe"
|
||||||
DeleteRegValue HKCR ".jpg\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".jpg\OpenWithList" "GPXSee.exe"
|
||||||
@ -327,6 +350,11 @@ Section "Uninstall"
|
|||||||
DeleteRegValue HKCR ".kmz\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".kmz\OpenWithList" "GPXSee.exe"
|
||||||
DeleteRegValue HKCR ".aqm\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".aqm\OpenWithList" "GPXSee.exe"
|
||||||
DeleteRegValue HKCR ".sqlitedb\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".sqlitedb\OpenWithList" "GPXSee.exe"
|
||||||
|
DeleteRegValue HKCR ".wld\OpenWithList" "GPXSee.exe"
|
||||||
|
DeleteRegValue HKCR ".jgw\OpenWithList" "GPXSee.exe"
|
||||||
|
DeleteRegValue HKCR ".gfw\OpenWithList" "GPXSee.exe"
|
||||||
|
DeleteRegValue HKCR ".pgw\OpenWithList" "GPXSee.exe"
|
||||||
|
DeleteRegValue HKCR ".tfw\OpenWithList" "GPXSee.exe"
|
||||||
DeleteRegKey HKCR "Applications\GPXSee.exe"
|
DeleteRegKey HKCR "Applications\GPXSee.exe"
|
||||||
|
|
||||||
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)'
|
||||||
|
@ -128,6 +128,19 @@
|
|||||||
<glob pattern="*.sml"/>
|
<glob pattern="*.sml"/>
|
||||||
</mime-type>
|
</mime-type>
|
||||||
|
|
||||||
|
<mime-type type="application/vnd.tomtom.ov2">
|
||||||
|
<comment>TomTom POI File</comment>
|
||||||
|
<sub-class-of type="application/octet-stream"/>
|
||||||
|
<generic-icon name="application/octet-stream"/>
|
||||||
|
<glob pattern="*.ov2"/>
|
||||||
|
</mime-type>
|
||||||
|
|
||||||
|
<mime-type type="application/vnd.tomtom.itn">
|
||||||
|
<comment>TomTom Route File</comment>
|
||||||
|
<sub-class-of type="text/csv"/>
|
||||||
|
<generic-icon name="text/csv"/>
|
||||||
|
<glob pattern="*.itn"/>
|
||||||
|
</mime-type>
|
||||||
|
|
||||||
<!-- Maps -->
|
<!-- Maps -->
|
||||||
|
|
||||||
@ -247,4 +260,15 @@
|
|||||||
<glob pattern="*.map"/>
|
<glob pattern="*.map"/>
|
||||||
</mime-type>
|
</mime-type>
|
||||||
|
|
||||||
|
<mime-type type="application/vnd.esri.wld">
|
||||||
|
<comment>ESRI World File</comment>
|
||||||
|
<sub-class-of type="text/plain"/>
|
||||||
|
<generic-icon name="text/plain"/>
|
||||||
|
<glob pattern="*.wld"/>
|
||||||
|
<glob pattern="*.jgw"/>
|
||||||
|
<glob pattern="*.gfw"/>
|
||||||
|
<glob pattern="*.pgw"/>
|
||||||
|
<glob pattern="*.tfw"/>
|
||||||
|
</mime-type>
|
||||||
|
|
||||||
</mime-info>
|
</mime-info>
|
||||||
|
@ -9,7 +9,7 @@ Unicode true
|
|||||||
; The name of the installer
|
; The name of the installer
|
||||||
Name "GPXSee"
|
Name "GPXSee"
|
||||||
; Program version
|
; Program version
|
||||||
!define VERSION "9.0"
|
!define VERSION "9.4"
|
||||||
|
|
||||||
; The file to write
|
; The file to write
|
||||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||||
@ -138,14 +138,21 @@ Section "GPXSee" SEC_APP
|
|||||||
!insertmacro FILE_ASSOCIATION_ADD "tba" "TrekBuddy Atlas" 15
|
!insertmacro FILE_ASSOCIATION_ADD "tba" "TrekBuddy Atlas" 15
|
||||||
!insertmacro FILE_ASSOCIATION_ADD "aqm" "AlpineQuest Map File" 16
|
!insertmacro FILE_ASSOCIATION_ADD "aqm" "AlpineQuest Map File" 16
|
||||||
!insertmacro FILE_ASSOCIATION_ADD "sqlitedb" "RMaps SQLite Map File" 17
|
!insertmacro FILE_ASSOCIATION_ADD "sqlitedb" "RMaps SQLite Map File" 17
|
||||||
!insertmacro FILE_ASSOCIATION_ADD "tcx" "Training Center XML" 18
|
!insertmacro FILE_ASSOCIATION_ADD "ov2" "TomTom POI File" 18
|
||||||
!insertmacro FILE_ASSOCIATION_ADD "kml" "Keyhole Markup Language" 19
|
!insertmacro FILE_ASSOCIATION_ADD "itn" "TomTom Route File" 19
|
||||||
!insertmacro FILE_ASSOCIATION_ADD "kmz" "KML geographic compressed data" 19
|
!insertmacro FILE_ASSOCIATION_ADD "wld" "ESRI World File" 20
|
||||||
!insertmacro FILE_ASSOCIATION_ADD "fit" "Flexible and Interoperable Data Transfer" 20
|
!insertmacro FILE_ASSOCIATION_ADD "jgw" "ESRI World File" 20
|
||||||
!insertmacro FILE_ASSOCIATION_ADD "igc" "Flight Recorder Data Format" 21
|
!insertmacro FILE_ASSOCIATION_ADD "gfw" "ESRI World File" 20
|
||||||
!insertmacro FILE_ASSOCIATION_ADD "nmea" "NMEA 0183 Data" 22
|
!insertmacro FILE_ASSOCIATION_ADD "pgw" "ESRI World File" 20
|
||||||
!insertmacro FILE_ASSOCIATION_ADD "plt" "OziExplorer Track File" 23
|
!insertmacro FILE_ASSOCIATION_ADD "tfw" "ESRI World File" 20
|
||||||
!insertmacro FILE_ASSOCIATION_ADD "rte" "OziExplorer Route File" 24
|
!insertmacro FILE_ASSOCIATION_ADD "tcx" "Training Center XML" 21
|
||||||
|
!insertmacro FILE_ASSOCIATION_ADD "kml" "Keyhole Markup Language" 22
|
||||||
|
!insertmacro FILE_ASSOCIATION_ADD "kmz" "KML geographic compressed data" 22
|
||||||
|
!insertmacro FILE_ASSOCIATION_ADD "fit" "Flexible and Interoperable Data Transfer" 23
|
||||||
|
!insertmacro FILE_ASSOCIATION_ADD "igc" "Flight Recorder Data Format" 24
|
||||||
|
!insertmacro FILE_ASSOCIATION_ADD "nmea" "NMEA 0183 Data" 25
|
||||||
|
!insertmacro FILE_ASSOCIATION_ADD "plt" "OziExplorer Track File" 26
|
||||||
|
!insertmacro FILE_ASSOCIATION_ADD "rte" "OziExplorer Route File" 27
|
||||||
|
|
||||||
WriteRegStr HKCR "Applications\GPXSee.exe\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
WriteRegStr HKCR "Applications\GPXSee.exe\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||||
WriteRegStr HKCR ".gpx\OpenWithList" "GPXSee.exe" ""
|
WriteRegStr HKCR ".gpx\OpenWithList" "GPXSee.exe" ""
|
||||||
@ -163,6 +170,8 @@ Section "GPXSee" SEC_APP
|
|||||||
WriteRegStr HKCR ".cup\OpenWithList" "GPXSee.exe" ""
|
WriteRegStr HKCR ".cup\OpenWithList" "GPXSee.exe" ""
|
||||||
WriteRegStr HKCR ".gpi\OpenWithList" "GPXSee.exe" ""
|
WriteRegStr HKCR ".gpi\OpenWithList" "GPXSee.exe" ""
|
||||||
WriteRegStr HKCR ".sml\OpenWithList" "GPXSee.exe" ""
|
WriteRegStr HKCR ".sml\OpenWithList" "GPXSee.exe" ""
|
||||||
|
WriteRegStr HKCR ".ov2\OpenWithList" "GPXSee.exe" ""
|
||||||
|
WriteRegStr HKCR ".itn\OpenWithList" "GPXSee.exe" ""
|
||||||
WriteRegStr HKCR ".csv\OpenWithList" "GPXSee.exe" ""
|
WriteRegStr HKCR ".csv\OpenWithList" "GPXSee.exe" ""
|
||||||
WriteRegStr HKCR ".json\OpenWithList" "GPXSee.exe" ""
|
WriteRegStr HKCR ".json\OpenWithList" "GPXSee.exe" ""
|
||||||
WriteRegStr HKCR ".jpg\OpenWithList" "GPXSee.exe" ""
|
WriteRegStr HKCR ".jpg\OpenWithList" "GPXSee.exe" ""
|
||||||
@ -182,6 +191,11 @@ Section "GPXSee" SEC_APP
|
|||||||
WriteRegStr HKCR ".kmz\OpenWithList" "GPXSee.exe" ""
|
WriteRegStr HKCR ".kmz\OpenWithList" "GPXSee.exe" ""
|
||||||
WriteRegStr HKCR ".aqm\OpenWithList" "GPXSee.exe" ""
|
WriteRegStr HKCR ".aqm\OpenWithList" "GPXSee.exe" ""
|
||||||
WriteRegStr HKCR ".sqlitedb\OpenWithList" "GPXSee.exe" ""
|
WriteRegStr HKCR ".sqlitedb\OpenWithList" "GPXSee.exe" ""
|
||||||
|
WriteRegStr HKCR ".wld\OpenWithList" "GPXSee.exe" ""
|
||||||
|
WriteRegStr HKCR ".jgw\OpenWithList" "GPXSee.exe" ""
|
||||||
|
WriteRegStr HKCR ".gfw\OpenWithList" "GPXSee.exe" ""
|
||||||
|
WriteRegStr HKCR ".pgw\OpenWithList" "GPXSee.exe" ""
|
||||||
|
WriteRegStr HKCR ".tfw\OpenWithList" "GPXSee.exe" ""
|
||||||
|
|
||||||
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)'
|
||||||
|
|
||||||
@ -315,6 +329,13 @@ Section "Uninstall"
|
|||||||
!insertmacro FILE_ASSOCIATION_REMOVE "kmz"
|
!insertmacro FILE_ASSOCIATION_REMOVE "kmz"
|
||||||
!insertmacro FILE_ASSOCIATION_REMOVE "aqm"
|
!insertmacro FILE_ASSOCIATION_REMOVE "aqm"
|
||||||
!insertmacro FILE_ASSOCIATION_REMOVE "sqlitedb"
|
!insertmacro FILE_ASSOCIATION_REMOVE "sqlitedb"
|
||||||
|
!insertmacro FILE_ASSOCIATION_REMOVE "ov2"
|
||||||
|
!insertmacro FILE_ASSOCIATION_REMOVE "itn"
|
||||||
|
!insertmacro FILE_ASSOCIATION_REMOVE "wld"
|
||||||
|
!insertmacro FILE_ASSOCIATION_REMOVE "jgw"
|
||||||
|
!insertmacro FILE_ASSOCIATION_REMOVE "gfw"
|
||||||
|
!insertmacro FILE_ASSOCIATION_REMOVE "pgw"
|
||||||
|
!insertmacro FILE_ASSOCIATION_REMOVE "tfw"
|
||||||
|
|
||||||
DeleteRegValue HKCR ".gpx\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".gpx\OpenWithList" "GPXSee.exe"
|
||||||
DeleteRegValue HKCR ".tcx\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".tcx\OpenWithList" "GPXSee.exe"
|
||||||
@ -331,6 +352,8 @@ Section "Uninstall"
|
|||||||
DeleteRegValue HKCR ".cup\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".cup\OpenWithList" "GPXSee.exe"
|
||||||
DeleteRegValue HKCR ".gpi\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".gpi\OpenWithList" "GPXSee.exe"
|
||||||
DeleteRegValue HKCR ".sml\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".sml\OpenWithList" "GPXSee.exe"
|
||||||
|
DeleteRegValue HKCR ".ov2\OpenWithList" "GPXSee.exe"
|
||||||
|
DeleteRegValue HKCR ".itn\OpenWithList" "GPXSee.exe"
|
||||||
DeleteRegValue HKCR ".csv\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".csv\OpenWithList" "GPXSee.exe"
|
||||||
DeleteRegValue HKCR ".json\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".json\OpenWithList" "GPXSee.exe"
|
||||||
DeleteRegValue HKCR ".jpg\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".jpg\OpenWithList" "GPXSee.exe"
|
||||||
@ -350,6 +373,11 @@ Section "Uninstall"
|
|||||||
DeleteRegValue HKCR ".kmz\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".kmz\OpenWithList" "GPXSee.exe"
|
||||||
DeleteRegValue HKCR ".aqm\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".aqm\OpenWithList" "GPXSee.exe"
|
||||||
DeleteRegValue HKCR ".sqlitedb\OpenWithList" "GPXSee.exe"
|
DeleteRegValue HKCR ".sqlitedb\OpenWithList" "GPXSee.exe"
|
||||||
|
DeleteRegValue HKCR ".wld\OpenWithList" "GPXSee.exe"
|
||||||
|
DeleteRegValue HKCR ".jgw\OpenWithList" "GPXSee.exe"
|
||||||
|
DeleteRegValue HKCR ".gfw\OpenWithList" "GPXSee.exe"
|
||||||
|
DeleteRegValue HKCR ".pgw\OpenWithList" "GPXSee.exe"
|
||||||
|
DeleteRegValue HKCR ".tfw\OpenWithList" "GPXSee.exe"
|
||||||
DeleteRegKey HKCR "Applications\GPXSee.exe"
|
DeleteRegKey HKCR "Applications\GPXSee.exe"
|
||||||
|
|
||||||
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)'
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include "areaitem.h"
|
#include "areaitem.h"
|
||||||
|
|
||||||
|
|
||||||
QString AreaItem::info() const
|
ToolTip AreaItem::info() const
|
||||||
{
|
{
|
||||||
ToolTip tt;
|
ToolTip tt;
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ QString AreaItem::info() const
|
|||||||
tt.insert(qApp->translate("PolygonItem", "Description"),
|
tt.insert(qApp->translate("PolygonItem", "Description"),
|
||||||
_area.description());
|
_area.description());
|
||||||
|
|
||||||
return tt.toString();
|
return tt;
|
||||||
}
|
}
|
||||||
|
|
||||||
AreaItem::AreaItem(const Area &area, Map *map, GraphicsItem *parent)
|
AreaItem::AreaItem(const Area &area, Map *map, GraphicsItem *parent)
|
||||||
|
@ -25,7 +25,7 @@ public:
|
|||||||
void setStyle(Qt::PenStyle style);
|
void setStyle(Qt::PenStyle style);
|
||||||
void setDigitalZoom(int zoom);
|
void setDigitalZoom(int zoom);
|
||||||
|
|
||||||
QString info() const;
|
ToolTip info() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
||||||
|
@ -9,7 +9,7 @@ CadenceGraphItem::CadenceGraphItem(const Graph &graph, GraphType type,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CadenceGraphItem::info() const
|
ToolTip CadenceGraphItem::info() const
|
||||||
{
|
{
|
||||||
ToolTip tt;
|
ToolTip tt;
|
||||||
QLocale l(QLocale::system());
|
QLocale l(QLocale::system());
|
||||||
@ -19,5 +19,5 @@ QString CadenceGraphItem::info() const
|
|||||||
tt.insert(tr("Average"), l.toString(avg(), 'f', 1)
|
tt.insert(tr("Average"), l.toString(avg(), 'f', 1)
|
||||||
+ UNIT_SPACE + tr("rpm"));
|
+ UNIT_SPACE + tr("rpm"));
|
||||||
|
|
||||||
return tt.toString();
|
return tt;
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ public:
|
|||||||
CadenceGraphItem(const Graph &graph, GraphType type, int width,
|
CadenceGraphItem(const Graph &graph, GraphType type, int width,
|
||||||
const QColor &color, QGraphicsItem *parent = 0);
|
const QColor &color, QGraphicsItem *parent = 0);
|
||||||
|
|
||||||
QString info() const;
|
ToolTip info() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CADENCEGRAPHITEM_H
|
#endif // CADENCEGRAPHITEM_H
|
||||||
|
43
src/GUI/dirselectwidget.cpp
Normal file
43
src/GUI/dirselectwidget.cpp
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
#include <QPushButton>
|
||||||
|
#include <QToolButton>
|
||||||
|
#include <QFileDialog>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
#include <QFileInfo>
|
||||||
|
#include <QFontMetrics>
|
||||||
|
#include <QApplication>
|
||||||
|
#include "dirselectwidget.h"
|
||||||
|
|
||||||
|
DirSelectWidget::DirSelectWidget(QWidget *parent) : QWidget(parent)
|
||||||
|
{
|
||||||
|
QFontMetrics fm(QApplication::font());
|
||||||
|
_edit = new QLineEdit();
|
||||||
|
_edit->setMinimumWidth(fm.averageCharWidth() * (QDir::homePath().length()
|
||||||
|
+ 12));
|
||||||
|
_edit->setPlaceholderText(tr("System default"));
|
||||||
|
#ifdef Q_OS_WIN32
|
||||||
|
_button = new QPushButton("...");
|
||||||
|
_button->setMaximumWidth(_button->sizeHint().width() / 2);
|
||||||
|
#else // Q_OS_WIN32
|
||||||
|
_button = new QToolButton();
|
||||||
|
_button->setText("...");
|
||||||
|
#endif // Q_OS_WIN32
|
||||||
|
connect(_button, &QToolButton::clicked, this, &DirSelectWidget::browse);
|
||||||
|
|
||||||
|
QHBoxLayout *layout = new QHBoxLayout();
|
||||||
|
layout->setContentsMargins(QMargins());
|
||||||
|
layout->addWidget(_edit);
|
||||||
|
layout->addWidget(_button);
|
||||||
|
setLayout(layout);
|
||||||
|
|
||||||
|
QSizePolicy p(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
|
||||||
|
setSizePolicy(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DirSelectWidget::browse()
|
||||||
|
{
|
||||||
|
QString dir(QFileDialog::getExistingDirectory(this, tr("Select directory"),
|
||||||
|
_edit->text()));
|
||||||
|
|
||||||
|
if (!dir.isEmpty())
|
||||||
|
_edit->setText(dir);
|
||||||
|
}
|
33
src/GUI/dirselectwidget.h
Normal file
33
src/GUI/dirselectwidget.h
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#ifndef DIRSELECTWIDGET_H
|
||||||
|
#define DIRSELECTWIDGET_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
#include <QLineEdit>
|
||||||
|
|
||||||
|
class QPushButton;
|
||||||
|
class QToolButton;
|
||||||
|
|
||||||
|
class DirSelectWidget : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DirSelectWidget(QWidget *parent = 0);
|
||||||
|
|
||||||
|
QString dir() const {return _edit->text();}
|
||||||
|
void setDir(const QString &path) {_edit->setText(path);}
|
||||||
|
bool checkDir(QString &error) const;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void browse();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QLineEdit *_edit;
|
||||||
|
#ifdef Q_OS_WIN32
|
||||||
|
QPushButton *_button;
|
||||||
|
#else // Q_OS_WIN32
|
||||||
|
QToolButton *_button;
|
||||||
|
#endif // Q_OS_WIN32
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIRSELECTWIDGET_H
|
@ -26,7 +26,7 @@ ElevationGraphItem::ElevationGraphItem(const Graph &graph, GraphType type,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ElevationGraphItem::info() const
|
ToolTip ElevationGraphItem::info() const
|
||||||
{
|
{
|
||||||
ToolTip tt;
|
ToolTip tt;
|
||||||
qreal scale = (_units == Metric) ? 1.0 : M2FT;
|
qreal scale = (_units == Metric) ? 1.0 : M2FT;
|
||||||
@ -42,6 +42,5 @@ QString ElevationGraphItem::info() const
|
|||||||
tt.insert(tr("Minimum"), l.toString(min() * scale, 'f', 0)
|
tt.insert(tr("Minimum"), l.toString(min() * scale, 'f', 0)
|
||||||
+ UNIT_SPACE + su);
|
+ UNIT_SPACE + su);
|
||||||
|
|
||||||
|
return tt;
|
||||||
return tt.toString();
|
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ public:
|
|||||||
qreal max() const {return _max;}
|
qreal max() const {return _max;}
|
||||||
qreal min() const {return _min;}
|
qreal min() const {return _min;}
|
||||||
|
|
||||||
QString info() const;
|
ToolTip info() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
qreal _ascent, _descent, _min, _max;
|
qreal _ascent, _descent, _min, _max;
|
||||||
|
@ -7,8 +7,8 @@ FileBrowser::FileBrowser(QObject *parent) : QObject(parent)
|
|||||||
{
|
{
|
||||||
_watcher = new QFileSystemWatcher(this);
|
_watcher = new QFileSystemWatcher(this);
|
||||||
|
|
||||||
connect(_watcher, SIGNAL(directoryChanged(const QString &)), this,
|
connect(_watcher, &QFileSystemWatcher::directoryChanged, this,
|
||||||
SLOT(reloadDirectory(const QString &)));
|
&FileBrowser::reloadDirectory);
|
||||||
|
|
||||||
_index = -1;
|
_index = -1;
|
||||||
}
|
}
|
||||||
@ -83,8 +83,10 @@ QString FileBrowser::first()
|
|||||||
void FileBrowser::reloadDirectory(const QString &path)
|
void FileBrowser::reloadDirectory(const QString &path)
|
||||||
{
|
{
|
||||||
QDir dir(path);
|
QDir dir(path);
|
||||||
QFileInfo current = _files.at(_index);
|
QFileInfo current = (_index >= 0) ? _files.at(_index) : QFileInfo();
|
||||||
|
|
||||||
_files = dir.entryInfoList(_filter, QDir::Files);
|
_files = dir.entryInfoList(_filter, QDir::Files);
|
||||||
_index = _files.empty() ? -1 : _files.indexOf(current);
|
_index = _files.empty() ? -1 : _files.indexOf(current);
|
||||||
|
|
||||||
|
emit listChanged();
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,9 @@ public:
|
|||||||
bool isLast() const;
|
bool isLast() const;
|
||||||
bool isFirst() const;
|
bool isFirst() const;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void listChanged();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void reloadDirectory(const QString &path);
|
void reloadDirectory(const QString &path);
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ FileSelectWidget::FileSelectWidget(QWidget *parent) : QWidget(parent)
|
|||||||
_button = new QToolButton();
|
_button = new QToolButton();
|
||||||
_button->setText("...");
|
_button->setText("...");
|
||||||
#endif // Q_OS_WIN32
|
#endif // Q_OS_WIN32
|
||||||
connect(_button, SIGNAL(clicked()), this, SLOT(browse()));
|
connect(_button, &QToolButton::clicked, this, &FileSelectWidget::browse);
|
||||||
|
|
||||||
QHBoxLayout *layout = new QHBoxLayout();
|
QHBoxLayout *layout = new QHBoxLayout();
|
||||||
layout->setContentsMargins(QMargins());
|
layout->setContentsMargins(QMargins());
|
||||||
|
181
src/GUI/flowlayout.cpp
Normal file
181
src/GUI/flowlayout.cpp
Normal file
@ -0,0 +1,181 @@
|
|||||||
|
#include <QtWidgets>
|
||||||
|
#include "flowlayout.h"
|
||||||
|
|
||||||
|
struct FlowLayoutItem
|
||||||
|
{
|
||||||
|
FlowLayoutItem() : item(0) {}
|
||||||
|
FlowLayoutItem(QLayoutItem *item, int x, int y) : item(item), pos(x, y) {}
|
||||||
|
|
||||||
|
QLayoutItem *item;
|
||||||
|
QPoint pos;
|
||||||
|
};
|
||||||
|
|
||||||
|
FlowLayout::FlowLayout(QWidget *parent, int margin, int hSpacing, int vSpacing)
|
||||||
|
: QLayout(parent), _hSpace(hSpacing), _vSpace(vSpacing)
|
||||||
|
{
|
||||||
|
setContentsMargins(margin, margin, margin, margin);
|
||||||
|
}
|
||||||
|
|
||||||
|
FlowLayout::FlowLayout(int margin, int hSpacing, int vSpacing)
|
||||||
|
: _hSpace(hSpacing), _vSpace(vSpacing)
|
||||||
|
{
|
||||||
|
setContentsMargins(margin, margin, margin, margin);
|
||||||
|
}
|
||||||
|
|
||||||
|
FlowLayout::~FlowLayout()
|
||||||
|
{
|
||||||
|
qDeleteAll(_items);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FlowLayout::addItem(QLayoutItem *item)
|
||||||
|
{
|
||||||
|
_items.append(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
int FlowLayout::horizontalSpacing() const
|
||||||
|
{
|
||||||
|
return (_hSpace >= 0)
|
||||||
|
? _hSpace
|
||||||
|
: smartSpacing(QStyle::PM_LayoutHorizontalSpacing);
|
||||||
|
}
|
||||||
|
|
||||||
|
int FlowLayout::verticalSpacing() const
|
||||||
|
{
|
||||||
|
return (_vSpace >= 0)
|
||||||
|
? _vSpace
|
||||||
|
: smartSpacing(QStyle::PM_LayoutVerticalSpacing);
|
||||||
|
}
|
||||||
|
|
||||||
|
int FlowLayout::count() const
|
||||||
|
{
|
||||||
|
return _items.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
QLayoutItem *FlowLayout::itemAt(int index) const
|
||||||
|
{
|
||||||
|
return _items.value(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
QLayoutItem *FlowLayout::takeAt(int index)
|
||||||
|
{
|
||||||
|
if (index >= 0 && index < _items.size())
|
||||||
|
return _items.takeAt(index);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Qt::Orientations FlowLayout::expandingDirections() const
|
||||||
|
{
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FlowLayout::hasHeightForWidth() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int FlowLayout::heightForWidth(int width) const
|
||||||
|
{
|
||||||
|
int height = doLayout(QRect(0, 0, width, 0), true);
|
||||||
|
return height;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FlowLayout::setGeometry(const QRect &rect)
|
||||||
|
{
|
||||||
|
QLayout::setGeometry(rect);
|
||||||
|
doLayout(rect, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
QSize FlowLayout::sizeHint() const
|
||||||
|
{
|
||||||
|
return minimumSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
QSize FlowLayout::minimumSize() const
|
||||||
|
{
|
||||||
|
QSize size;
|
||||||
|
|
||||||
|
for (int i = 0; i < _items.size(); i++)
|
||||||
|
size = size.expandedTo(_items.at(i)->minimumSize());
|
||||||
|
|
||||||
|
const QMargins margins = contentsMargins();
|
||||||
|
size += QSize(margins.left() + margins.right(), margins.top()
|
||||||
|
+ margins.bottom());
|
||||||
|
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
int FlowLayout::doLayout(const QRect &rect, bool testOnly) const
|
||||||
|
{
|
||||||
|
int left, top, right, bottom;
|
||||||
|
getContentsMargins(&left, &top, &right, &bottom);
|
||||||
|
QRect effectiveRect = rect.adjusted(+left, +top, -right, -bottom);
|
||||||
|
int x = effectiveRect.x();
|
||||||
|
int y = effectiveRect.y();
|
||||||
|
int lineHeight = 0;
|
||||||
|
QVector<QVector<FlowLayoutItem>> rows;
|
||||||
|
|
||||||
|
for (int i = 0; i < _items.size(); i++) {
|
||||||
|
QLayoutItem *item = _items.at(i);
|
||||||
|
const QWidget *wid = item->widget();
|
||||||
|
int spaceX = horizontalSpacing();
|
||||||
|
if (spaceX == -1)
|
||||||
|
spaceX = wid->style()->layoutSpacing(QSizePolicy::PushButton,
|
||||||
|
QSizePolicy::PushButton, Qt::Horizontal);
|
||||||
|
int spaceY = verticalSpacing();
|
||||||
|
if (spaceY == -1)
|
||||||
|
spaceY = wid->style()->layoutSpacing(QSizePolicy::PushButton,
|
||||||
|
QSizePolicy::PushButton, Qt::Vertical);
|
||||||
|
|
||||||
|
int nextX = x + item->sizeHint().width() + spaceX;
|
||||||
|
if (nextX - spaceX > effectiveRect.right() && lineHeight > 0) {
|
||||||
|
x = effectiveRect.x();
|
||||||
|
y = y + lineHeight + spaceY;
|
||||||
|
nextX = x + item->sizeHint().width() + spaceX;
|
||||||
|
lineHeight = 0;
|
||||||
|
rows.append(QVector<FlowLayoutItem>());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rows.isEmpty())
|
||||||
|
rows.append(QVector<FlowLayoutItem>());
|
||||||
|
rows.last().append(FlowLayoutItem(item, x, y));
|
||||||
|
|
||||||
|
x = nextX;
|
||||||
|
lineHeight = qMax(lineHeight, item->sizeHint().height());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!testOnly) {
|
||||||
|
for (int i = 0; i < rows.size(); i++) {
|
||||||
|
const FlowLayoutItem &li = rows.at(i).last();
|
||||||
|
int width = li.item->sizeHint().width() + li.pos.x()
|
||||||
|
- effectiveRect.x();
|
||||||
|
int offset = (effectiveRect.width() - width) / 2;
|
||||||
|
|
||||||
|
int height = 0;
|
||||||
|
for (int j = 0; j < rows.at(i).size(); j++)
|
||||||
|
height = qMax(rows.at(i).at(j).item->sizeHint().height(), height);
|
||||||
|
|
||||||
|
for (int j = 0; j < rows.at(i).size(); j++) {
|
||||||
|
QLayoutItem *item = rows.at(i).at(j).item;
|
||||||
|
const QPoint &p = rows.at(i).at(j).pos;
|
||||||
|
QSize sh(item->sizeHint());
|
||||||
|
item->setGeometry(QRect(QPoint(p.x() + offset, p.y() + height
|
||||||
|
- sh.height()), sh));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return y + lineHeight - rect.y() + bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
int FlowLayout::smartSpacing(QStyle::PixelMetric pm) const
|
||||||
|
{
|
||||||
|
QObject *parent = this->parent();
|
||||||
|
if (!parent)
|
||||||
|
return -1;
|
||||||
|
else if (parent->isWidgetType()) {
|
||||||
|
QWidget *pw = static_cast<QWidget *>(parent);
|
||||||
|
return pw->style()->pixelMetric(pm, 0, pw);
|
||||||
|
} else
|
||||||
|
return static_cast<QLayout *>(parent)->spacing();
|
||||||
|
}
|
38
src/GUI/flowlayout.h
Normal file
38
src/GUI/flowlayout.h
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#ifndef FLOWLAYOUT_H
|
||||||
|
#define FLOWLAYOUT_H
|
||||||
|
|
||||||
|
#include <QLayout>
|
||||||
|
#include <QRect>
|
||||||
|
#include <QStyle>
|
||||||
|
|
||||||
|
class FlowLayout : public QLayout
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
FlowLayout(QWidget *parent, int margin = -1, int hSpacing = -1,
|
||||||
|
int vSpacing = -1);
|
||||||
|
FlowLayout(int margin = -1, int hSpacing = -1, int vSpacing = -1);
|
||||||
|
~FlowLayout();
|
||||||
|
|
||||||
|
void addItem(QLayoutItem *item);
|
||||||
|
int horizontalSpacing() const;
|
||||||
|
int verticalSpacing() const;
|
||||||
|
Qt::Orientations expandingDirections() const;
|
||||||
|
bool hasHeightForWidth() const;
|
||||||
|
int heightForWidth(int) const;
|
||||||
|
int count() const;
|
||||||
|
QLayoutItem *itemAt(int index) const;
|
||||||
|
QSize minimumSize() const;
|
||||||
|
void setGeometry(const QRect &rect);
|
||||||
|
QSize sizeHint() const;
|
||||||
|
QLayoutItem *takeAt(int index);
|
||||||
|
|
||||||
|
private:
|
||||||
|
int doLayout(const QRect &rect, bool testOnly) const;
|
||||||
|
int smartSpacing(QStyle::PixelMetric pm) const;
|
||||||
|
|
||||||
|
QList<QLayoutItem *> _items;
|
||||||
|
int _hSpace;
|
||||||
|
int _vSpace;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // FLOWLAYOUT_H
|
@ -27,7 +27,7 @@ GearRatioGraphItem::GearRatioGraphItem(const Graph &graph, GraphType type,
|
|||||||
_top = key;
|
_top = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString GearRatioGraphItem::info() const
|
ToolTip GearRatioGraphItem::info() const
|
||||||
{
|
{
|
||||||
ToolTip tt;
|
ToolTip tt;
|
||||||
QLocale l(QLocale::system());
|
QLocale l(QLocale::system());
|
||||||
@ -36,5 +36,5 @@ QString GearRatioGraphItem::info() const
|
|||||||
tt.insert(tr("Maximum"), l.toString(max(), 'f', 2));
|
tt.insert(tr("Maximum"), l.toString(max(), 'f', 2));
|
||||||
tt.insert(tr("Most used"), l.toString(top(), 'f', 2));
|
tt.insert(tr("Most used"), l.toString(top(), 'f', 2));
|
||||||
|
|
||||||
return tt.toString();
|
return tt;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ public:
|
|||||||
qreal top() const {return _top;}
|
qreal top() const {return _top;}
|
||||||
const QMap<qreal, qreal> &map() const {return _map;}
|
const QMap<qreal, qreal> &map() const {return _map;}
|
||||||
|
|
||||||
QString info() const;
|
ToolTip info() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QMap<qreal, qreal> _map;
|
QMap<qreal, qreal> _map;
|
||||||
|
@ -3,13 +3,14 @@
|
|||||||
|
|
||||||
#include <QGraphicsScene>
|
#include <QGraphicsScene>
|
||||||
#include <QGraphicsItem>
|
#include <QGraphicsItem>
|
||||||
|
#include "tooltip.h"
|
||||||
|
|
||||||
class GraphicsItem : public QGraphicsItem
|
class GraphicsItem : public QGraphicsItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GraphicsItem(QGraphicsItem *parent = 0) : QGraphicsItem(parent) {}
|
GraphicsItem(QGraphicsItem *parent = 0) : QGraphicsItem(parent) {}
|
||||||
|
|
||||||
virtual QString info() const = 0;
|
virtual ToolTip info() const = 0;
|
||||||
int type() const {return QGraphicsItem::UserType + 1;}
|
int type() const {return QGraphicsItem::UserType + 1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ public:
|
|||||||
const QColor &color, Qt::PenStyle style, QGraphicsItem *parent = 0);
|
const QColor &color, Qt::PenStyle style, QGraphicsItem *parent = 0);
|
||||||
virtual ~GraphItem() {}
|
virtual ~GraphItem() {}
|
||||||
|
|
||||||
virtual QString info() const = 0;
|
virtual ToolTip info() const = 0;
|
||||||
|
|
||||||
QPainterPath shape() const {return _shape;}
|
QPainterPath shape() const {return _shape;}
|
||||||
QRectF boundingRect() const {return _shape.boundingRect();}
|
QRectF boundingRect() const {return _shape.boundingRect();}
|
||||||
|
@ -56,8 +56,8 @@ GraphView::GraphView(QWidget *parent)
|
|||||||
_message->setBrush(QPalette().brush(QPalette::Disabled,
|
_message->setBrush(QPalette().brush(QPalette::Disabled,
|
||||||
QPalette::WindowText));
|
QPalette::WindowText));
|
||||||
|
|
||||||
connect(_slider, SIGNAL(positionChanged(const QPointF&)), this,
|
connect(_slider, &SliderItem::positionChanged, this,
|
||||||
SLOT(emitSliderPositionChanged(const QPointF&)));
|
&GraphView::emitSliderPositionChanged);
|
||||||
|
|
||||||
_width = 1;
|
_width = 1;
|
||||||
|
|
||||||
|
286
src/GUI/gui.cpp
286
src/GUI/gui.cpp
@ -31,6 +31,7 @@
|
|||||||
#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 "map/crs.h"
|
||||||
#include "icons.h"
|
#include "icons.h"
|
||||||
#include "keys.h"
|
#include "keys.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
@ -95,12 +96,12 @@ GUI::GUI()
|
|||||||
_movingTime = 0;
|
_movingTime = 0;
|
||||||
_lastTab = 0;
|
_lastTab = 0;
|
||||||
|
|
||||||
_dataDir = QDir::homePath();
|
|
||||||
_mapDir = QDir::homePath();
|
|
||||||
_poiDir = QDir::homePath();
|
|
||||||
|
|
||||||
readSettings();
|
readSettings();
|
||||||
|
|
||||||
|
_dataDir = _options.dataPath;
|
||||||
|
_mapDir = _options.mapsPath;
|
||||||
|
_poiDir = _options.poiPath;
|
||||||
|
|
||||||
updateGraphTabs();
|
updateGraphTabs();
|
||||||
updateStatusBarInfo();
|
updateStatusBarInfo();
|
||||||
}
|
}
|
||||||
@ -109,20 +110,22 @@ void GUI::createBrowser()
|
|||||||
{
|
{
|
||||||
_browser = new FileBrowser(this);
|
_browser = new FileBrowser(this);
|
||||||
_browser->setFilter(Data::filter());
|
_browser->setFilter(Data::filter());
|
||||||
|
connect(_browser, &FileBrowser::listChanged, this,
|
||||||
|
&GUI::updateNavigationActions);
|
||||||
}
|
}
|
||||||
|
|
||||||
TreeNode<MapAction*> GUI::createMapActions()
|
TreeNode<MapAction*> GUI::createMapActions()
|
||||||
{
|
{
|
||||||
_mapsActionGroup = new QActionGroup(this);
|
_mapsActionGroup = new QActionGroup(this);
|
||||||
_mapsActionGroup->setExclusive(true);
|
_mapsActionGroup->setExclusive(true);
|
||||||
connect(_mapsActionGroup, SIGNAL(triggered(QAction*)), this,
|
connect(_mapsActionGroup, &QActionGroup::triggered, this, &GUI::mapChanged);
|
||||||
SLOT(mapChanged(QAction*)));
|
|
||||||
|
|
||||||
QString mapDir(ProgramPaths::mapDir());
|
QString mapDir(ProgramPaths::mapDir());
|
||||||
if (mapDir.isNull())
|
if (mapDir.isNull())
|
||||||
return TreeNode<MapAction*>();
|
return TreeNode<MapAction*>();
|
||||||
|
|
||||||
TreeNode<Map*> maps(MapList::loadMaps(mapDir));
|
TreeNode<Map*> maps(MapList::loadMaps(mapDir,
|
||||||
|
CRS::projection(_options.inputProjection)));
|
||||||
return createMapActionsNode(maps);
|
return createMapActionsNode(maps);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,7 +140,7 @@ TreeNode<MapAction*> GUI::createMapActionsNode(const TreeNode<Map*> &node)
|
|||||||
Map *map = node.items().at(i);
|
Map *map = node.items().at(i);
|
||||||
if (map->isValid()) {
|
if (map->isValid()) {
|
||||||
MapAction *a = new MapAction(map, _mapsActionGroup);
|
MapAction *a = new MapAction(map, _mapsActionGroup);
|
||||||
connect(a, SIGNAL(loaded()), this, SLOT(mapInitialized()));
|
connect(a, &MapAction::loaded, this, &GUI::mapInitialized);
|
||||||
tree.addItem(a);
|
tree.addItem(a);
|
||||||
} else {
|
} else {
|
||||||
qWarning("%s: %s", qPrintable(map->path()),
|
qWarning("%s: %s", qPrintable(map->path()),
|
||||||
@ -169,8 +172,8 @@ TreeNode<POIAction *> GUI::createPOIActions()
|
|||||||
{
|
{
|
||||||
_poisActionGroup = new QActionGroup(this);
|
_poisActionGroup = new QActionGroup(this);
|
||||||
_poisActionGroup->setExclusive(false);
|
_poisActionGroup->setExclusive(false);
|
||||||
connect(_poisActionGroup, SIGNAL(triggered(QAction*)), this,
|
connect(_poisActionGroup, &QActionGroup::triggered, this,
|
||||||
SLOT(poiFileChecked(QAction*)));
|
&GUI::poiFileChecked);
|
||||||
|
|
||||||
TreeNode<QString> poiFiles;
|
TreeNode<QString> poiFiles;
|
||||||
QString poiDir(ProgramPaths::poiDir());
|
QString poiDir(ProgramPaths::poiDir());
|
||||||
@ -209,64 +212,65 @@ void GUI::createActions(TreeNode<MapAction*> &mapActions,
|
|||||||
_exitAction = new QAction(QIcon(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, &QAction::triggered, this, &GUI::close);
|
||||||
addAction(_exitAction);
|
addAction(_exitAction);
|
||||||
|
|
||||||
// Help & About
|
// Help & About
|
||||||
_pathsAction = new QAction(tr("Paths"), this);
|
_pathsAction = new QAction(tr("Paths"), this);
|
||||||
_pathsAction->setMenuRole(QAction::NoRole);
|
_pathsAction->setMenuRole(QAction::NoRole);
|
||||||
connect(_pathsAction, SIGNAL(triggered()), this, SLOT(paths()));
|
connect(_pathsAction, &QAction::triggered, this, &GUI::paths);
|
||||||
_keysAction = new QAction(tr("Keyboard controls"), this);
|
_keysAction = new QAction(tr("Keyboard controls"), this);
|
||||||
_keysAction->setMenuRole(QAction::NoRole);
|
_keysAction->setMenuRole(QAction::NoRole);
|
||||||
connect(_keysAction, SIGNAL(triggered()), this, SLOT(keys()));
|
connect(_keysAction, &QAction::triggered, this, &GUI::keys);
|
||||||
_aboutAction = new QAction(QIcon(APP_ICON), tr("About GPXSee"), this);
|
_aboutAction = new QAction(QIcon(APP_ICON), tr("About GPXSee"), this);
|
||||||
_aboutAction->setMenuRole(QAction::AboutRole);
|
_aboutAction->setMenuRole(QAction::AboutRole);
|
||||||
connect(_aboutAction, SIGNAL(triggered()), this, SLOT(about()));
|
connect(_aboutAction, &QAction::triggered, this, &GUI::about);
|
||||||
|
|
||||||
// File actions
|
// File actions
|
||||||
_openFileAction = new QAction(QIcon(OPEN_FILE_ICON), tr("Open..."), this);
|
_openFileAction = new QAction(QIcon(OPEN_FILE_ICON), tr("Open..."), this);
|
||||||
_openFileAction->setMenuRole(QAction::NoRole);
|
_openFileAction->setMenuRole(QAction::NoRole);
|
||||||
_openFileAction->setShortcut(OPEN_SHORTCUT);
|
_openFileAction->setShortcut(OPEN_SHORTCUT);
|
||||||
connect(_openFileAction, SIGNAL(triggered()), this, SLOT(openFile()));
|
connect(_openFileAction, &QAction::triggered, this,
|
||||||
|
QOverload<>::of(&GUI::openFile));
|
||||||
addAction(_openFileAction);
|
addAction(_openFileAction);
|
||||||
_printFileAction = new QAction(QIcon(PRINT_FILE_ICON), tr("Print..."),
|
_printFileAction = new QAction(QIcon(PRINT_FILE_ICON), tr("Print..."),
|
||||||
this);
|
this);
|
||||||
_printFileAction->setMenuRole(QAction::NoRole);
|
_printFileAction->setMenuRole(QAction::NoRole);
|
||||||
_printFileAction->setActionGroup(_fileActionGroup);
|
_printFileAction->setActionGroup(_fileActionGroup);
|
||||||
connect(_printFileAction, SIGNAL(triggered()), this, SLOT(printFile()));
|
connect(_printFileAction, &QAction::triggered, this, &GUI::printFile);
|
||||||
addAction(_printFileAction);
|
addAction(_printFileAction);
|
||||||
_exportPDFFileAction = new QAction(QIcon(EXPORT_FILE_ICON),
|
_exportPDFFileAction = new QAction(QIcon(EXPORT_FILE_ICON),
|
||||||
tr("Export to PDF..."), this);
|
tr("Export to PDF..."), this);
|
||||||
_exportPDFFileAction->setMenuRole(QAction::NoRole);
|
_exportPDFFileAction->setMenuRole(QAction::NoRole);
|
||||||
_exportPDFFileAction->setShortcut(PDF_EXPORT_SHORTCUT);
|
_exportPDFFileAction->setShortcut(PDF_EXPORT_SHORTCUT);
|
||||||
_exportPDFFileAction->setActionGroup(_fileActionGroup);
|
_exportPDFFileAction->setActionGroup(_fileActionGroup);
|
||||||
connect(_exportPDFFileAction, SIGNAL(triggered()), this, SLOT(exportPDFFile()));
|
connect(_exportPDFFileAction, &QAction::triggered, this, &GUI::exportPDFFile);
|
||||||
addAction(_exportPDFFileAction);
|
addAction(_exportPDFFileAction);
|
||||||
_exportPNGFileAction = new QAction(QIcon(EXPORT_FILE_ICON),
|
_exportPNGFileAction = new QAction(QIcon(EXPORT_FILE_ICON),
|
||||||
tr("Export to PNG..."), this);
|
tr("Export to PNG..."), this);
|
||||||
_exportPNGFileAction->setMenuRole(QAction::NoRole);
|
_exportPNGFileAction->setMenuRole(QAction::NoRole);
|
||||||
_exportPNGFileAction->setShortcut(PNG_EXPORT_SHORTCUT);
|
_exportPNGFileAction->setShortcut(PNG_EXPORT_SHORTCUT);
|
||||||
_exportPNGFileAction->setActionGroup(_fileActionGroup);
|
_exportPNGFileAction->setActionGroup(_fileActionGroup);
|
||||||
connect(_exportPNGFileAction, SIGNAL(triggered()), this, SLOT(exportPNGFile()));
|
connect(_exportPNGFileAction, &QAction::triggered, this, &GUI::exportPNGFile);
|
||||||
addAction(_exportPNGFileAction);
|
addAction(_exportPNGFileAction);
|
||||||
_closeFileAction = new QAction(QIcon(CLOSE_FILE_ICON), tr("Close"), this);
|
_closeFileAction = new QAction(QIcon(CLOSE_FILE_ICON), tr("Close"), this);
|
||||||
_closeFileAction->setMenuRole(QAction::NoRole);
|
_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, &QAction::triggered, this, &GUI::closeAll);
|
||||||
addAction(_closeFileAction);
|
addAction(_closeFileAction);
|
||||||
_reloadFileAction = new QAction(QIcon(RELOAD_FILE_ICON), tr("Reload"),
|
_reloadFileAction = new QAction(QIcon(RELOAD_FILE_ICON), tr("Reload"),
|
||||||
this);
|
this);
|
||||||
_reloadFileAction->setMenuRole(QAction::NoRole);
|
_reloadFileAction->setMenuRole(QAction::NoRole);
|
||||||
_reloadFileAction->setShortcut(RELOAD_SHORTCUT);
|
_reloadFileAction->setShortcut(RELOAD_SHORTCUT);
|
||||||
_reloadFileAction->setActionGroup(_fileActionGroup);
|
_reloadFileAction->setActionGroup(_fileActionGroup);
|
||||||
connect(_reloadFileAction, SIGNAL(triggered()), this, SLOT(reloadFiles()));
|
connect(_reloadFileAction, &QAction::triggered, this, &GUI::reloadFiles);
|
||||||
addAction(_reloadFileAction);
|
addAction(_reloadFileAction);
|
||||||
_statisticsAction = new QAction(tr("Statistics..."), this);
|
_statisticsAction = new QAction(tr("Statistics..."), this);
|
||||||
_statisticsAction->setMenuRole(QAction::NoRole);
|
_statisticsAction->setMenuRole(QAction::NoRole);
|
||||||
_statisticsAction->setShortcut(STATISTICS_SHORTCUT);
|
_statisticsAction->setShortcut(STATISTICS_SHORTCUT);
|
||||||
_statisticsAction->setActionGroup(_fileActionGroup);
|
_statisticsAction->setActionGroup(_fileActionGroup);
|
||||||
connect(_statisticsAction, SIGNAL(triggered()), this, SLOT(statistics()));
|
connect(_statisticsAction, &QAction::triggered, this, &GUI::statistics);
|
||||||
addAction(_statisticsAction);
|
addAction(_statisticsAction);
|
||||||
|
|
||||||
// POI actions
|
// POI actions
|
||||||
@ -274,33 +278,33 @@ void GUI::createActions(TreeNode<MapAction*> &mapActions,
|
|||||||
_openPOIAction = new QAction(QIcon(OPEN_FILE_ICON), tr("Load POI file..."),
|
_openPOIAction = new QAction(QIcon(OPEN_FILE_ICON), tr("Load POI file..."),
|
||||||
this);
|
this);
|
||||||
_openPOIAction->setMenuRole(QAction::NoRole);
|
_openPOIAction->setMenuRole(QAction::NoRole);
|
||||||
connect(_openPOIAction, SIGNAL(triggered()), this, SLOT(openPOIFile()));
|
connect(_openPOIAction, &QAction::triggered, this,
|
||||||
|
QOverload<>::of(&GUI::openPOIFile));
|
||||||
_selectAllPOIAction = new QAction(tr("Select all files"), this);
|
_selectAllPOIAction = new QAction(tr("Select all files"), this);
|
||||||
_selectAllPOIAction->setMenuRole(QAction::NoRole);
|
_selectAllPOIAction->setMenuRole(QAction::NoRole);
|
||||||
_selectAllPOIAction->setEnabled(!_poisActionGroup->actions().isEmpty());
|
_selectAllPOIAction->setEnabled(!_poisActionGroup->actions().isEmpty());
|
||||||
connect(_selectAllPOIAction, SIGNAL(triggered()), this,
|
connect(_selectAllPOIAction, &QAction::triggered, this,
|
||||||
SLOT(selectAllPOIs()));
|
&GUI::selectAllPOIs);
|
||||||
_unselectAllPOIAction = new QAction(tr("Unselect all files"), this);
|
_unselectAllPOIAction = new QAction(tr("Unselect all files"), this);
|
||||||
_unselectAllPOIAction->setMenuRole(QAction::NoRole);
|
_unselectAllPOIAction->setMenuRole(QAction::NoRole);
|
||||||
_unselectAllPOIAction->setEnabled(_selectAllPOIAction->isEnabled());
|
_unselectAllPOIAction->setEnabled(_selectAllPOIAction->isEnabled());
|
||||||
connect(_unselectAllPOIAction, SIGNAL(triggered()), this,
|
connect(_unselectAllPOIAction, &QAction::triggered, this,
|
||||||
SLOT(unselectAllPOIs()));
|
&GUI::unselectAllPOIs);
|
||||||
_overlapPOIAction = new QAction(tr("Overlap POIs"), this);
|
_overlapPOIAction = new QAction(tr("Overlap POIs"), this);
|
||||||
_overlapPOIAction->setMenuRole(QAction::NoRole);
|
_overlapPOIAction->setMenuRole(QAction::NoRole);
|
||||||
_overlapPOIAction->setCheckable(true);
|
_overlapPOIAction->setCheckable(true);
|
||||||
connect(_overlapPOIAction, SIGNAL(triggered(bool)), _mapView,
|
connect(_overlapPOIAction, &QAction::triggered, _mapView,
|
||||||
SLOT(showOverlappedPOIs(bool)));
|
&MapView::showOverlappedPOIs);
|
||||||
_showPOILabelsAction = new QAction(tr("Show POI labels"), this);
|
_showPOILabelsAction = new QAction(tr("Show POI labels"), this);
|
||||||
_showPOILabelsAction->setMenuRole(QAction::NoRole);
|
_showPOILabelsAction->setMenuRole(QAction::NoRole);
|
||||||
_showPOILabelsAction->setCheckable(true);
|
_showPOILabelsAction->setCheckable(true);
|
||||||
connect(_showPOILabelsAction, SIGNAL(triggered(bool)), _mapView,
|
connect(_showPOILabelsAction, &QAction::triggered, _mapView,
|
||||||
SLOT(showPOILabels(bool)));
|
&MapView::showPOILabels);
|
||||||
_showPOIAction = new QAction(QIcon(SHOW_POI_ICON), tr("Show POIs"), this);
|
_showPOIAction = new QAction(QIcon(SHOW_POI_ICON), tr("Show POIs"), this);
|
||||||
_showPOIAction->setMenuRole(QAction::NoRole);
|
_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, &QAction::triggered, _mapView, &MapView::showPOI);
|
||||||
SLOT(showPOI(bool)));
|
|
||||||
addAction(_showPOIAction);
|
addAction(_showPOIAction);
|
||||||
|
|
||||||
// Map actions
|
// Map actions
|
||||||
@ -311,77 +315,76 @@ void GUI::createActions(TreeNode<MapAction*> &mapActions,
|
|||||||
_showMapAction->setMenuRole(QAction::NoRole);
|
_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, &QAction::triggered, _mapView,
|
||||||
SLOT(showMap(bool)));
|
&MapView::showMap);
|
||||||
addAction(_showMapAction);
|
addAction(_showMapAction);
|
||||||
_loadMapAction = new QAction(QIcon(OPEN_FILE_ICON), tr("Load map..."),
|
_loadMapAction = new QAction(QIcon(OPEN_FILE_ICON), tr("Load map..."),
|
||||||
this);
|
this);
|
||||||
_loadMapAction->setMenuRole(QAction::NoRole);
|
_loadMapAction->setMenuRole(QAction::NoRole);
|
||||||
connect(_loadMapAction, SIGNAL(triggered()), this, SLOT(loadMap()));
|
connect(_loadMapAction, &QAction::triggered, this,
|
||||||
|
QOverload<>::of(&GUI::loadMap));
|
||||||
_loadMapDirAction = new QAction(QIcon(OPEN_FILE_ICON),
|
_loadMapDirAction = new QAction(QIcon(OPEN_FILE_ICON),
|
||||||
tr("Load map directory..."), this);
|
tr("Load map directory..."), this);
|
||||||
_loadMapDirAction->setMenuRole(QAction::NoRole);
|
_loadMapDirAction->setMenuRole(QAction::NoRole);
|
||||||
connect(_loadMapDirAction, SIGNAL(triggered()), this, SLOT(loadMapDir()));
|
connect(_loadMapDirAction, &QAction::triggered, this, &GUI::loadMapDir);
|
||||||
_clearMapCacheAction = new QAction(tr("Clear tile cache"), this);
|
_clearMapCacheAction = new QAction(tr("Clear tile cache"), this);
|
||||||
_clearMapCacheAction->setEnabled(false);
|
_clearMapCacheAction->setEnabled(false);
|
||||||
_clearMapCacheAction->setMenuRole(QAction::NoRole);
|
_clearMapCacheAction->setMenuRole(QAction::NoRole);
|
||||||
connect(_clearMapCacheAction, SIGNAL(triggered()), this,
|
connect(_clearMapCacheAction, &QAction::triggered, this,
|
||||||
SLOT(clearMapCache()));
|
&GUI::clearMapCache);
|
||||||
_nextMapAction = new QAction(tr("Next map"), this);
|
_nextMapAction = new QAction(tr("Next map"), this);
|
||||||
_nextMapAction->setMenuRole(QAction::NoRole);
|
_nextMapAction->setMenuRole(QAction::NoRole);
|
||||||
_nextMapAction->setShortcut(NEXT_MAP_SHORTCUT);
|
_nextMapAction->setShortcut(NEXT_MAP_SHORTCUT);
|
||||||
connect(_nextMapAction, SIGNAL(triggered()), this, SLOT(nextMap()));
|
connect(_nextMapAction, &QAction::triggered, this, &GUI::nextMap);
|
||||||
addAction(_nextMapAction);
|
addAction(_nextMapAction);
|
||||||
_prevMapAction = new QAction(tr("Next map"), this);
|
_prevMapAction = new QAction(tr("Next map"), this);
|
||||||
_prevMapAction->setMenuRole(QAction::NoRole);
|
_prevMapAction->setMenuRole(QAction::NoRole);
|
||||||
_prevMapAction->setShortcut(PREV_MAP_SHORTCUT);
|
_prevMapAction->setShortcut(PREV_MAP_SHORTCUT);
|
||||||
connect(_prevMapAction, SIGNAL(triggered()), this, SLOT(prevMap()));
|
connect(_prevMapAction, &QAction::triggered, this, &GUI::prevMap);
|
||||||
addAction(_prevMapAction);
|
addAction(_prevMapAction);
|
||||||
_showCoordinatesAction = new QAction(tr("Show cursor coordinates"), this);
|
_showCoordinatesAction = new QAction(tr("Show cursor coordinates"), this);
|
||||||
_showCoordinatesAction->setMenuRole(QAction::NoRole);
|
_showCoordinatesAction->setMenuRole(QAction::NoRole);
|
||||||
_showCoordinatesAction->setCheckable(true);
|
_showCoordinatesAction->setCheckable(true);
|
||||||
connect(_showCoordinatesAction, SIGNAL(triggered(bool)), _mapView,
|
connect(_showCoordinatesAction, &QAction::triggered, _mapView,
|
||||||
SLOT(showCoordinates(bool)));
|
&MapView::showCoordinates);
|
||||||
|
|
||||||
// Data actions
|
// Data actions
|
||||||
_showTracksAction = new QAction(tr("Show tracks"), this);
|
_showTracksAction = new QAction(tr("Show tracks"), this);
|
||||||
_showTracksAction->setMenuRole(QAction::NoRole);
|
_showTracksAction->setMenuRole(QAction::NoRole);
|
||||||
_showTracksAction->setCheckable(true);
|
_showTracksAction->setCheckable(true);
|
||||||
connect(_showTracksAction, SIGNAL(triggered(bool)), this,
|
connect(_showTracksAction, &QAction::triggered, this, &GUI::showTracks);
|
||||||
SLOT(showTracks(bool)));
|
|
||||||
_showRoutesAction = new QAction(tr("Show routes"), this);
|
_showRoutesAction = new QAction(tr("Show routes"), this);
|
||||||
_showRoutesAction->setMenuRole(QAction::NoRole);
|
_showRoutesAction->setMenuRole(QAction::NoRole);
|
||||||
_showRoutesAction->setCheckable(true);
|
_showRoutesAction->setCheckable(true);
|
||||||
connect(_showRoutesAction, SIGNAL(triggered(bool)), this,
|
connect(_showRoutesAction, &QAction::triggered, this, &GUI::showRoutes);
|
||||||
SLOT(showRoutes(bool)));
|
|
||||||
_showWaypointsAction = new QAction(tr("Show waypoints"), this);
|
_showWaypointsAction = new QAction(tr("Show waypoints"), this);
|
||||||
_showWaypointsAction->setMenuRole(QAction::NoRole);
|
_showWaypointsAction->setMenuRole(QAction::NoRole);
|
||||||
_showWaypointsAction->setCheckable(true);
|
_showWaypointsAction->setCheckable(true);
|
||||||
connect(_showWaypointsAction, SIGNAL(triggered(bool)), _mapView,
|
connect(_showWaypointsAction, &QAction::triggered, _mapView,
|
||||||
SLOT(showWaypoints(bool)));
|
&MapView::showWaypoints);
|
||||||
_showAreasAction = new QAction(tr("Show areas"), this);
|
_showAreasAction = new QAction(tr("Show areas"), this);
|
||||||
_showAreasAction->setMenuRole(QAction::NoRole);
|
_showAreasAction->setMenuRole(QAction::NoRole);
|
||||||
_showAreasAction->setCheckable(true);
|
_showAreasAction->setCheckable(true);
|
||||||
connect(_showAreasAction, SIGNAL(triggered(bool)), _mapView,
|
connect(_showAreasAction, &QAction::triggered, _mapView,
|
||||||
SLOT(showAreas(bool)));
|
&MapView::showAreas);
|
||||||
_showWaypointLabelsAction = new QAction(tr("Waypoint labels"), this);
|
_showWaypointLabelsAction = new QAction(tr("Waypoint labels"), this);
|
||||||
_showWaypointLabelsAction->setMenuRole(QAction::NoRole);
|
_showWaypointLabelsAction->setMenuRole(QAction::NoRole);
|
||||||
_showWaypointLabelsAction->setCheckable(true);
|
_showWaypointLabelsAction->setCheckable(true);
|
||||||
connect(_showWaypointLabelsAction, SIGNAL(triggered(bool)), _mapView,
|
connect(_showWaypointLabelsAction, &QAction::triggered, _mapView,
|
||||||
SLOT(showWaypointLabels(bool)));
|
&MapView::showWaypointLabels);
|
||||||
_showRouteWaypointsAction = new QAction(tr("Route waypoints"), this);
|
_showRouteWaypointsAction = new QAction(tr("Route waypoints"), this);
|
||||||
_showRouteWaypointsAction->setMenuRole(QAction::NoRole);
|
_showRouteWaypointsAction->setMenuRole(QAction::NoRole);
|
||||||
_showRouteWaypointsAction->setCheckable(true);
|
_showRouteWaypointsAction->setCheckable(true);
|
||||||
connect(_showRouteWaypointsAction, SIGNAL(triggered(bool)), _mapView,
|
connect(_showRouteWaypointsAction, &QAction::triggered, _mapView,
|
||||||
SLOT(showRouteWaypoints(bool)));
|
&MapView::showRouteWaypoints);
|
||||||
_showTicksAction = new QAction(tr("km/mi markers"), this);
|
_showTicksAction = new QAction(tr("km/mi markers"), this);
|
||||||
_showTicksAction->setMenuRole(QAction::NoRole);
|
_showTicksAction->setMenuRole(QAction::NoRole);
|
||||||
_showTicksAction->setCheckable(true);
|
_showTicksAction->setCheckable(true);
|
||||||
connect(_showTicksAction, SIGNAL(triggered(bool)), _mapView,
|
connect(_showTicksAction, &QAction::triggered, _mapView,
|
||||||
SLOT(showTicks(bool)));
|
&MapView::showTicks);
|
||||||
QActionGroup *markerInfoGroup = new QActionGroup(this);
|
QActionGroup *markerInfoGroup = new QActionGroup(this);
|
||||||
connect(markerInfoGroup, SIGNAL(triggered(QAction*)), this,
|
connect(markerInfoGroup, &QActionGroup::triggered, this,
|
||||||
SLOT(showPathMarkerInfo(QAction*)));
|
&GUI::showPathMarkerInfo);
|
||||||
_hideMarkersAction = new QAction(tr("Do not show"), this);
|
_hideMarkersAction = new QAction(tr("Do not show"), this);
|
||||||
_hideMarkersAction->setMenuRole(QAction::NoRole);
|
_hideMarkersAction->setMenuRole(QAction::NoRole);
|
||||||
_hideMarkersAction->setCheckable(true);
|
_hideMarkersAction->setCheckable(true);
|
||||||
@ -405,8 +408,7 @@ void GUI::createActions(TreeNode<MapAction*> &mapActions,
|
|||||||
_showGraphsAction->setMenuRole(QAction::NoRole);
|
_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, &QAction::triggered, this, &GUI::showGraphs);
|
||||||
SLOT(showGraphs(bool)));
|
|
||||||
addAction(_showGraphsAction);
|
addAction(_showGraphsAction);
|
||||||
ag = new QActionGroup(this);
|
ag = new QActionGroup(this);
|
||||||
ag->setExclusive(true);
|
ag->setExclusive(true);
|
||||||
@ -414,117 +416,110 @@ void GUI::createActions(TreeNode<MapAction*> &mapActions,
|
|||||||
_distanceGraphAction->setMenuRole(QAction::NoRole);
|
_distanceGraphAction->setMenuRole(QAction::NoRole);
|
||||||
_distanceGraphAction->setCheckable(true);
|
_distanceGraphAction->setCheckable(true);
|
||||||
_distanceGraphAction->setActionGroup(ag);
|
_distanceGraphAction->setActionGroup(ag);
|
||||||
connect(_distanceGraphAction, SIGNAL(triggered()), this,
|
connect(_distanceGraphAction, &QAction::triggered, this,
|
||||||
SLOT(setDistanceGraph()));
|
&GUI::setDistanceGraph);
|
||||||
addAction(_distanceGraphAction);
|
addAction(_distanceGraphAction);
|
||||||
_timeGraphAction = new QAction(tr("Time"), this);
|
_timeGraphAction = new QAction(tr("Time"), this);
|
||||||
_timeGraphAction->setMenuRole(QAction::NoRole);
|
_timeGraphAction->setMenuRole(QAction::NoRole);
|
||||||
_timeGraphAction->setCheckable(true);
|
_timeGraphAction->setCheckable(true);
|
||||||
_timeGraphAction->setActionGroup(ag);
|
_timeGraphAction->setActionGroup(ag);
|
||||||
connect(_timeGraphAction, SIGNAL(triggered()), this,
|
connect(_timeGraphAction, &QAction::triggered, this, &GUI::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->setMenuRole(QAction::NoRole);
|
||||||
_showGraphGridAction->setCheckable(true);
|
_showGraphGridAction->setCheckable(true);
|
||||||
connect(_showGraphGridAction, SIGNAL(triggered(bool)), this,
|
connect(_showGraphGridAction, &QAction::triggered, this,
|
||||||
SLOT(showGraphGrids(bool)));
|
&GUI::showGraphGrids);
|
||||||
_showGraphSliderInfoAction = new QAction(tr("Show slider info"), this);
|
_showGraphSliderInfoAction = new QAction(tr("Show slider info"), this);
|
||||||
_showGraphSliderInfoAction->setMenuRole(QAction::NoRole);
|
_showGraphSliderInfoAction->setMenuRole(QAction::NoRole);
|
||||||
_showGraphSliderInfoAction->setCheckable(true);
|
_showGraphSliderInfoAction->setCheckable(true);
|
||||||
connect(_showGraphSliderInfoAction, SIGNAL(triggered(bool)), this,
|
connect(_showGraphSliderInfoAction, &QAction::triggered, this,
|
||||||
SLOT(showGraphSliderInfo(bool)));
|
&GUI::showGraphSliderInfo);
|
||||||
|
|
||||||
// Settings actions
|
// Settings actions
|
||||||
_showToolbarsAction = new QAction(tr("Show toolbars"), this);
|
_showToolbarsAction = new QAction(tr("Show toolbars"), this);
|
||||||
_showToolbarsAction->setMenuRole(QAction::NoRole);
|
_showToolbarsAction->setMenuRole(QAction::NoRole);
|
||||||
_showToolbarsAction->setCheckable(true);
|
_showToolbarsAction->setCheckable(true);
|
||||||
connect(_showToolbarsAction, SIGNAL(triggered(bool)), this,
|
connect(_showToolbarsAction, &QAction::triggered, this, &GUI::showToolbars);
|
||||||
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->setMenuRole(QAction::NoRole);
|
||||||
_totalTimeAction->setCheckable(true);
|
_totalTimeAction->setCheckable(true);
|
||||||
_totalTimeAction->setActionGroup(ag);
|
_totalTimeAction->setActionGroup(ag);
|
||||||
connect(_totalTimeAction, SIGNAL(triggered()), this,
|
connect(_totalTimeAction, &QAction::triggered, this, &GUI::setTotalTime);
|
||||||
SLOT(setTotalTime()));
|
|
||||||
_movingTimeAction = new QAction(tr("Moving time"), this);
|
_movingTimeAction = new QAction(tr("Moving time"), this);
|
||||||
_movingTimeAction->setMenuRole(QAction::NoRole);
|
_movingTimeAction->setMenuRole(QAction::NoRole);
|
||||||
_movingTimeAction->setCheckable(true);
|
_movingTimeAction->setCheckable(true);
|
||||||
_movingTimeAction->setActionGroup(ag);
|
_movingTimeAction->setActionGroup(ag);
|
||||||
connect(_movingTimeAction, SIGNAL(triggered()), this,
|
connect(_movingTimeAction, &QAction::triggered, this, &GUI::setMovingTime);
|
||||||
SLOT(setMovingTime()));
|
|
||||||
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->setMenuRole(QAction::NoRole);
|
||||||
_metricUnitsAction->setCheckable(true);
|
_metricUnitsAction->setCheckable(true);
|
||||||
_metricUnitsAction->setActionGroup(ag);
|
_metricUnitsAction->setActionGroup(ag);
|
||||||
connect(_metricUnitsAction, SIGNAL(triggered()), this,
|
connect(_metricUnitsAction, &QAction::triggered, this, &GUI::setMetricUnits);
|
||||||
SLOT(setMetricUnits()));
|
|
||||||
_imperialUnitsAction = new QAction(tr("Imperial"), this);
|
_imperialUnitsAction = new QAction(tr("Imperial"), this);
|
||||||
_imperialUnitsAction->setMenuRole(QAction::NoRole);
|
_imperialUnitsAction->setMenuRole(QAction::NoRole);
|
||||||
_imperialUnitsAction->setCheckable(true);
|
_imperialUnitsAction->setCheckable(true);
|
||||||
_imperialUnitsAction->setActionGroup(ag);
|
_imperialUnitsAction->setActionGroup(ag);
|
||||||
connect(_imperialUnitsAction, SIGNAL(triggered()), this,
|
connect(_imperialUnitsAction, &QAction::triggered, this,
|
||||||
SLOT(setImperialUnits()));
|
&GUI::setImperialUnits);
|
||||||
_nauticalUnitsAction = new QAction(tr("Nautical"), this);
|
_nauticalUnitsAction = new QAction(tr("Nautical"), this);
|
||||||
_nauticalUnitsAction->setMenuRole(QAction::NoRole);
|
_nauticalUnitsAction->setMenuRole(QAction::NoRole);
|
||||||
_nauticalUnitsAction->setCheckable(true);
|
_nauticalUnitsAction->setCheckable(true);
|
||||||
_nauticalUnitsAction->setActionGroup(ag);
|
_nauticalUnitsAction->setActionGroup(ag);
|
||||||
connect(_nauticalUnitsAction, SIGNAL(triggered()), this,
|
connect(_nauticalUnitsAction, &QAction::triggered, this,
|
||||||
SLOT(setNauticalUnits()));
|
&GUI::setNauticalUnits);
|
||||||
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->setMenuRole(QAction::NoRole);
|
||||||
_decimalDegreesAction->setCheckable(true);
|
_decimalDegreesAction->setCheckable(true);
|
||||||
_decimalDegreesAction->setActionGroup(ag);
|
_decimalDegreesAction->setActionGroup(ag);
|
||||||
connect(_decimalDegreesAction, SIGNAL(triggered()), this,
|
connect(_decimalDegreesAction, &QAction::triggered, this,
|
||||||
SLOT(setDecimalDegrees()));
|
&GUI::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->setMenuRole(QAction::NoRole);
|
||||||
_degreesMinutesAction->setCheckable(true);
|
_degreesMinutesAction->setCheckable(true);
|
||||||
_degreesMinutesAction->setActionGroup(ag);
|
_degreesMinutesAction->setActionGroup(ag);
|
||||||
connect(_degreesMinutesAction, SIGNAL(triggered()), this,
|
connect(_degreesMinutesAction, &QAction::triggered, this,
|
||||||
SLOT(setDegreesMinutes()));
|
&GUI::setDegreesMinutes);
|
||||||
_dmsAction = new QAction(tr("Degrees, minutes, seconds (DMS)"), this);
|
_dmsAction = new QAction(tr("Degrees, minutes, seconds (DMS)"), this);
|
||||||
_dmsAction->setMenuRole(QAction::NoRole);
|
_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, &QAction::triggered, this, &GUI::setDMS);
|
||||||
_fullscreenAction = new QAction(QIcon(FULLSCREEN_ICON),
|
_fullscreenAction = new QAction(QIcon(FULLSCREEN_ICON),
|
||||||
tr("Fullscreen mode"), this);
|
tr("Fullscreen mode"), this);
|
||||||
_fullscreenAction->setMenuRole(QAction::NoRole);
|
_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, &QAction::triggered, this, &GUI::showFullscreen);
|
||||||
SLOT(showFullscreen(bool)));
|
|
||||||
addAction(_fullscreenAction);
|
addAction(_fullscreenAction);
|
||||||
_openOptionsAction = new QAction(tr("Options..."), this);
|
_openOptionsAction = new QAction(tr("Options..."), this);
|
||||||
_openOptionsAction->setMenuRole(QAction::PreferencesRole);
|
_openOptionsAction->setMenuRole(QAction::PreferencesRole);
|
||||||
connect(_openOptionsAction, SIGNAL(triggered()), this,
|
connect(_openOptionsAction, &QAction::triggered, this, &GUI::openOptions);
|
||||||
SLOT(openOptions()));
|
|
||||||
|
|
||||||
// Navigation actions
|
// Navigation actions
|
||||||
_nextAction = new QAction(QIcon(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);
|
_nextAction->setMenuRole(QAction::NoRole);
|
||||||
connect(_nextAction, SIGNAL(triggered()), this, SLOT(next()));
|
connect(_nextAction, &QAction::triggered, this, &GUI::next);
|
||||||
_prevAction = new QAction(QIcon(PREV_FILE_ICON), tr("Previous"), this);
|
_prevAction = new QAction(QIcon(PREV_FILE_ICON), tr("Previous"), this);
|
||||||
_prevAction->setMenuRole(QAction::NoRole);
|
_prevAction->setMenuRole(QAction::NoRole);
|
||||||
_prevAction->setActionGroup(_navigationActionGroup);
|
_prevAction->setActionGroup(_navigationActionGroup);
|
||||||
connect(_prevAction, SIGNAL(triggered()), this, SLOT(prev()));
|
connect(_prevAction, &QAction::triggered, this, &GUI::prev);
|
||||||
_lastAction = new QAction(QIcon(LAST_FILE_ICON), tr("Last"), this);
|
_lastAction = new QAction(QIcon(LAST_FILE_ICON), tr("Last"), this);
|
||||||
_lastAction->setMenuRole(QAction::NoRole);
|
_lastAction->setMenuRole(QAction::NoRole);
|
||||||
_lastAction->setActionGroup(_navigationActionGroup);
|
_lastAction->setActionGroup(_navigationActionGroup);
|
||||||
connect(_lastAction, SIGNAL(triggered()), this, SLOT(last()));
|
connect(_lastAction, &QAction::triggered, this, &GUI::last);
|
||||||
_firstAction = new QAction(QIcon(FIRST_FILE_ICON), tr("First"), this);
|
_firstAction = new QAction(QIcon(FIRST_FILE_ICON), tr("First"), this);
|
||||||
_firstAction->setMenuRole(QAction::NoRole);
|
_firstAction->setMenuRole(QAction::NoRole);
|
||||||
_firstAction->setActionGroup(_navigationActionGroup);
|
_firstAction->setActionGroup(_navigationActionGroup);
|
||||||
connect(_firstAction, SIGNAL(triggered()), this, SLOT(first()));
|
connect(_firstAction, &QAction::triggered, this, &GUI::first);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI::createMapNodeMenu(const TreeNode<MapAction*> &node, QMenu *menu)
|
void GUI::createMapNodeMenu(const TreeNode<MapAction*> &node, QMenu *menu)
|
||||||
@ -697,8 +692,8 @@ void GUI::createGraphTabs()
|
|||||||
_graphTabWidget->setDocumentMode(true);
|
_graphTabWidget->setDocumentMode(true);
|
||||||
#endif // Q_OS_MAC
|
#endif // Q_OS_MAC
|
||||||
|
|
||||||
connect(_graphTabWidget, SIGNAL(currentChanged(int)), this,
|
connect(_graphTabWidget, &QTabWidget::currentChanged, this,
|
||||||
SLOT(graphChanged(int)));
|
&GUI::graphChanged);
|
||||||
|
|
||||||
_tabs.append(new ElevationGraph(_graphTabWidget));
|
_tabs.append(new ElevationGraph(_graphTabWidget));
|
||||||
_tabs.append(new SpeedGraph(_graphTabWidget));
|
_tabs.append(new SpeedGraph(_graphTabWidget));
|
||||||
@ -709,8 +704,8 @@ void GUI::createGraphTabs()
|
|||||||
_tabs.append(new GearRatioGraph(_graphTabWidget));
|
_tabs.append(new GearRatioGraph(_graphTabWidget));
|
||||||
|
|
||||||
for (int i = 0; i < _tabs.size(); i++)
|
for (int i = 0; i < _tabs.size(); i++)
|
||||||
connect(_tabs.at(i), SIGNAL(sliderPositionChanged(qreal)), _mapView,
|
connect(_tabs.at(i), &GraphTab::sliderPositionChanged, _mapView,
|
||||||
SLOT(setMarkerPosition(qreal)));
|
&MapView::setMarkerPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI::createStatusBar()
|
void GUI::createStatusBar()
|
||||||
@ -1013,8 +1008,19 @@ void GUI::openOptions()
|
|||||||
SET_VIEW_OPTION(pathAntiAliasing, useAntiAliasing);
|
SET_VIEW_OPTION(pathAntiAliasing, useAntiAliasing);
|
||||||
SET_VIEW_OPTION(useOpenGL, useOpenGL);
|
SET_VIEW_OPTION(useOpenGL, useOpenGL);
|
||||||
SET_VIEW_OPTION(sliderColor, setMarkerColor);
|
SET_VIEW_OPTION(sliderColor, setMarkerColor);
|
||||||
SET_VIEW_OPTION(outputProjection, setOutputProjection);
|
|
||||||
SET_VIEW_OPTION(inputProjection, setInputProjection);
|
if (options.hidpiMap != _options.hidpiMap)
|
||||||
|
_mapView->setDevicePixelRatio(devicePixelRatioF(),
|
||||||
|
options.hidpiMap ? devicePixelRatioF() : 1.0);
|
||||||
|
if (options.outputProjection != _options.outputProjection)
|
||||||
|
_mapView->setOutputProjection(CRS::projection(options.outputProjection));
|
||||||
|
if (options.inputProjection != _options.inputProjection)
|
||||||
|
_mapView->setInputProjection(CRS::projection(options.inputProjection));
|
||||||
|
if (options.timeZone != _options.timeZone) {
|
||||||
|
_mapView->setTimeZone(options.timeZone.zone());
|
||||||
|
_dateRange.first = _dateRange.first.toTimeZone(options.timeZone.zone());
|
||||||
|
_dateRange.second = _dateRange.second.toTimeZone(options.timeZone.zone());
|
||||||
|
}
|
||||||
|
|
||||||
SET_TAB_OPTION(palette, setPalette);
|
SET_TAB_OPTION(palette, setPalette);
|
||||||
SET_TAB_OPTION(graphWidth, setGraphWidth);
|
SET_TAB_OPTION(graphWidth, setGraphWidth);
|
||||||
@ -1054,15 +1060,12 @@ void GUI::openOptions()
|
|||||||
if (options.enableHTTP2 != _options.enableHTTP2)
|
if (options.enableHTTP2 != _options.enableHTTP2)
|
||||||
Downloader::enableHTTP2(options.enableHTTP2);
|
Downloader::enableHTTP2(options.enableHTTP2);
|
||||||
|
|
||||||
if (options.hidpiMap != _options.hidpiMap)
|
if (options.dataPath != _options.dataPath)
|
||||||
_mapView->setDevicePixelRatio(devicePixelRatioF(),
|
_dataDir = options.dataPath;
|
||||||
options.hidpiMap ? devicePixelRatioF() : 1.0);
|
if (options.mapsPath != _options.mapsPath)
|
||||||
|
_mapDir = options.mapsPath;
|
||||||
if (options.timeZone != _options.timeZone) {
|
if (options.poiPath != _options.poiPath)
|
||||||
_mapView->setTimeZone(options.timeZone.zone());
|
_poiDir = options.poiPath;
|
||||||
_dateRange.first = _dateRange.first.toTimeZone(options.timeZone.zone());
|
|
||||||
_dateRange.second = _dateRange.second.toTimeZone(options.timeZone.zone());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reload)
|
if (reload)
|
||||||
reloadFiles();
|
reloadFiles();
|
||||||
@ -1553,7 +1556,7 @@ bool GUI::loadMapNode(const TreeNode<Map*> &node, MapAction *&action,
|
|||||||
_showMapAction->setEnabled(true);
|
_showMapAction->setEnabled(true);
|
||||||
_clearMapCacheAction->setEnabled(true);
|
_clearMapCacheAction->setEnabled(true);
|
||||||
} else
|
} else
|
||||||
connect(a, SIGNAL(loaded()), this, SLOT(mapLoaded()));
|
connect(a, &MapAction::loaded, this, &GUI::mapLoaded);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
valid = true;
|
valid = true;
|
||||||
@ -1568,7 +1571,8 @@ bool GUI::loadMapNode(const TreeNode<Map*> &node, MapAction *&action,
|
|||||||
|
|
||||||
bool GUI::loadMap(const QString &fileName, MapAction *&action, bool silent)
|
bool GUI::loadMap(const QString &fileName, MapAction *&action, bool silent)
|
||||||
{
|
{
|
||||||
TreeNode<Map*> maps(MapList::loadMaps(fileName));
|
TreeNode<Map*> maps(MapList::loadMaps(fileName,
|
||||||
|
CRS::projection(_options.inputProjection)));
|
||||||
QList<QAction*> existingActions(_mapsActionGroup->actions());
|
QList<QAction*> existingActions(_mapsActionGroup->actions());
|
||||||
|
|
||||||
return loadMapNode(maps, action, silent, existingActions);
|
return loadMapNode(maps, action, silent, existingActions);
|
||||||
@ -1637,10 +1641,10 @@ void GUI::loadMapDirNode(const TreeNode<Map *> &node, QList<MapAction*> &actions
|
|||||||
_clearMapCacheAction->setEnabled(true);
|
_clearMapCacheAction->setEnabled(true);
|
||||||
actions.append(a);
|
actions.append(a);
|
||||||
} else
|
} else
|
||||||
connect(a, SIGNAL(loaded()), this, SLOT(mapLoadedDir()));
|
connect(a, &MapAction::loaded, this, &GUI::mapLoadedDir);
|
||||||
}
|
|
||||||
|
|
||||||
_areaCount++;
|
_areaCount++;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
map = a->data().value<Map*>();
|
map = a->data().value<Map*>();
|
||||||
if (map->isReady())
|
if (map->isReady())
|
||||||
@ -1657,7 +1661,8 @@ void GUI::loadMapDir()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
QFileInfo fi(dir);
|
QFileInfo fi(dir);
|
||||||
TreeNode<Map*> maps(MapList::loadMaps(dir));
|
TreeNode<Map*> maps(MapList::loadMaps(dir,
|
||||||
|
CRS::projection(_options.inputProjection)));
|
||||||
QList<QAction*> existingActions(_mapsActionGroup->actions());
|
QList<QAction*> existingActions(_mapsActionGroup->actions());
|
||||||
QList<MapAction*> actions;
|
QList<MapAction*> actions;
|
||||||
QMenu *menu = new QMenu(maps.name());
|
QMenu *menu = new QMenu(maps.name());
|
||||||
@ -1800,21 +1805,10 @@ void GUI::graphChanged(int index)
|
|||||||
|
|
||||||
void GUI::updateNavigationActions()
|
void GUI::updateNavigationActions()
|
||||||
{
|
{
|
||||||
if (_browser->isLast()) {
|
_lastAction->setEnabled(!_browser->isLast());
|
||||||
_nextAction->setEnabled(false);
|
_nextAction->setEnabled(!_browser->isLast());
|
||||||
_lastAction->setEnabled(false);
|
_firstAction->setEnabled(!_browser->isFirst());
|
||||||
} else {
|
_prevAction->setEnabled(!_browser->isFirst());
|
||||||
_nextAction->setEnabled(true);
|
|
||||||
_lastAction->setEnabled(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_browser->isFirst()) {
|
|
||||||
_prevAction->setEnabled(false);
|
|
||||||
_firstAction->setEnabled(false);
|
|
||||||
} else {
|
|
||||||
_prevAction->setEnabled(true);
|
|
||||||
_firstAction->setEnabled(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GUI::updateGraphTabs()
|
bool GUI::updateGraphTabs()
|
||||||
@ -2081,6 +2075,9 @@ void GUI::writeSettings()
|
|||||||
settings.setValue(SHOW_POI_SETTING, _showPOIAction->isChecked());
|
settings.setValue(SHOW_POI_SETTING, _showPOIAction->isChecked());
|
||||||
if (_overlapPOIAction->isChecked() != OVERLAP_POI_DEFAULT)
|
if (_overlapPOIAction->isChecked() != OVERLAP_POI_DEFAULT)
|
||||||
settings.setValue(OVERLAP_POI_SETTING, _overlapPOIAction->isChecked());
|
settings.setValue(OVERLAP_POI_SETTING, _overlapPOIAction->isChecked());
|
||||||
|
if (_showPOILabelsAction->isChecked() != SHOW_POI_LABELS_DEFAULT)
|
||||||
|
settings.setValue(SHOW_POI_LABELS_SETTING,
|
||||||
|
_showPOILabelsAction->isChecked());
|
||||||
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
QList<QAction*> poiActions(_poisActionGroup->actions());
|
QList<QAction*> poiActions(_poisActionGroup->actions());
|
||||||
@ -2272,6 +2269,13 @@ void GUI::writeSettings()
|
|||||||
settings.setValue(INPUT_PROJECTION_SETTING, _options.inputProjection);
|
settings.setValue(INPUT_PROJECTION_SETTING, _options.inputProjection);
|
||||||
if (_options.hidpiMap != HIDPI_MAP_DEFAULT)
|
if (_options.hidpiMap != HIDPI_MAP_DEFAULT)
|
||||||
settings.setValue(HIDPI_MAP_SETTING, _options.hidpiMap);
|
settings.setValue(HIDPI_MAP_SETTING, _options.hidpiMap);
|
||||||
|
if (_options.dataPath != DATA_PATH_DEFAULT)
|
||||||
|
settings.setValue(DATA_PATH_SETTING, _options.dataPath);
|
||||||
|
if (_options.mapsPath != MAPS_PATH_DEFAULT)
|
||||||
|
settings.setValue(MAPS_PATH_SETTING, _options.mapsPath);
|
||||||
|
if (_options.poiPath != POI_PATH_DEFAULT)
|
||||||
|
settings.setValue(POI_PATH_SETTING, _options.poiPath);
|
||||||
|
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2359,7 +2363,8 @@ void GUI::readSettings()
|
|||||||
_mapView->showOverlappedPOIs(false);
|
_mapView->showOverlappedPOIs(false);
|
||||||
else
|
else
|
||||||
_overlapPOIAction->setChecked(true);
|
_overlapPOIAction->setChecked(true);
|
||||||
if (!settings.value(LABELS_POI_SETTING, LABELS_POI_DEFAULT).toBool())
|
if (!settings.value(SHOW_POI_LABELS_SETTING, SHOW_POI_LABELS_DEFAULT)
|
||||||
|
.toBool())
|
||||||
_mapView->showPOILabels(false);
|
_mapView->showPOILabels(false);
|
||||||
else
|
else
|
||||||
_showPOILabelsAction->setChecked(true);
|
_showPOILabelsAction->setChecked(true);
|
||||||
@ -2572,8 +2577,14 @@ void GUI::readSettings()
|
|||||||
OUTPUT_PROJECTION_DEFAULT).toInt();
|
OUTPUT_PROJECTION_DEFAULT).toInt();
|
||||||
_options.inputProjection = settings.value(INPUT_PROJECTION_SETTING,
|
_options.inputProjection = settings.value(INPUT_PROJECTION_SETTING,
|
||||||
INPUT_PROJECTION_DEFAULT).toInt();
|
INPUT_PROJECTION_DEFAULT).toInt();
|
||||||
_options.hidpiMap = settings.value(HIDPI_MAP_SETTING, HIDPI_MAP_SETTING)
|
_options.hidpiMap = settings.value(HIDPI_MAP_SETTING, HIDPI_MAP_DEFAULT)
|
||||||
.toBool();
|
.toBool();
|
||||||
|
_options.dataPath = settings.value(DATA_PATH_SETTING, DATA_PATH_DEFAULT)
|
||||||
|
.toString();
|
||||||
|
_options.mapsPath = settings.value(MAPS_PATH_SETTING, MAPS_PATH_DEFAULT)
|
||||||
|
.toString();
|
||||||
|
_options.poiPath = settings.value(POI_PATH_SETTING, POI_PATH_DEFAULT)
|
||||||
|
.toString();
|
||||||
|
|
||||||
_mapView->setPalette(_options.palette);
|
_mapView->setPalette(_options.palette);
|
||||||
_mapView->setMapOpacity(_options.mapOpacity);
|
_mapView->setMapOpacity(_options.mapOpacity);
|
||||||
@ -2595,8 +2606,8 @@ void GUI::readSettings()
|
|||||||
_mapView->useOpenGL(true);
|
_mapView->useOpenGL(true);
|
||||||
_mapView->setDevicePixelRatio(devicePixelRatioF(),
|
_mapView->setDevicePixelRatio(devicePixelRatioF(),
|
||||||
_options.hidpiMap ? devicePixelRatioF() : 1.0);
|
_options.hidpiMap ? devicePixelRatioF() : 1.0);
|
||||||
_mapView->setOutputProjection(_options.outputProjection);
|
_mapView->setOutputProjection(CRS::projection(_options.outputProjection));
|
||||||
_mapView->setInputProjection(_options.inputProjection);
|
_mapView->setInputProjection(CRS::projection(_options.inputProjection));
|
||||||
_mapView->setTimeZone(_options.timeZone.zone());
|
_mapView->setTimeZone(_options.timeZone.zone());
|
||||||
|
|
||||||
for (int i = 0; i < _tabs.count(); i++) {
|
for (int i = 0; i < _tabs.count(); i++) {
|
||||||
@ -2689,10 +2700,9 @@ void GUI::show()
|
|||||||
QMainWindow::show();
|
QMainWindow::show();
|
||||||
|
|
||||||
QWindow *w = windowHandle();
|
QWindow *w = windowHandle();
|
||||||
connect(w->screen(), SIGNAL(logicalDotsPerInchChanged(qreal)), this,
|
connect(w->screen(), &QScreen::logicalDotsPerInchChanged, this,
|
||||||
SLOT(logicalDotsPerInchChanged(qreal)));
|
&GUI::logicalDotsPerInchChanged);
|
||||||
connect(w, SIGNAL(screenChanged(QScreen*)), this,
|
connect(w, &QWindow::screenChanged, this, &GUI::screenChanged);
|
||||||
SLOT(screenChanged(QScreen*)));
|
|
||||||
|
|
||||||
_mapView->fitContentToSize();
|
_mapView->fitContentToSize();
|
||||||
}
|
}
|
||||||
@ -2704,8 +2714,8 @@ void GUI::screenChanged(QScreen *screen)
|
|||||||
|
|
||||||
disconnect(SIGNAL(logicalDotsPerInchChanged(qreal)), this,
|
disconnect(SIGNAL(logicalDotsPerInchChanged(qreal)), this,
|
||||||
SLOT(logicalDotsPerInchChanged(qreal)));
|
SLOT(logicalDotsPerInchChanged(qreal)));
|
||||||
connect(screen, SIGNAL(logicalDotsPerInchChanged(qreal)), this,
|
connect(screen, &QScreen::logicalDotsPerInchChanged, this,
|
||||||
SLOT(logicalDotsPerInchChanged(qreal)));
|
&GUI::logicalDotsPerInchChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI::logicalDotsPerInchChanged(qreal dpi)
|
void GUI::logicalDotsPerInchChanged(qreal dpi)
|
||||||
|
@ -82,6 +82,7 @@ private slots:
|
|||||||
void prev();
|
void prev();
|
||||||
void last();
|
void last();
|
||||||
void first();
|
void first();
|
||||||
|
void updateNavigationActions();
|
||||||
|
|
||||||
void setTotalTime() {setTimeType(Total);}
|
void setTotalTime() {setTimeType(Total);}
|
||||||
void setMovingTime() {setTimeType(Moving);}
|
void setMovingTime() {setTimeType(Moving);}
|
||||||
@ -136,7 +137,6 @@ private:
|
|||||||
QMenu *menu, const QList<QAction*> &existingActions);
|
QMenu *menu, const QList<QAction*> &existingActions);
|
||||||
void updateStatusBarInfo();
|
void updateStatusBarInfo();
|
||||||
void updateWindowTitle();
|
void updateWindowTitle();
|
||||||
void updateNavigationActions();
|
|
||||||
bool updateGraphTabs();
|
bool updateGraphTabs();
|
||||||
|
|
||||||
TimeType timeType() const;
|
TimeType timeType() const;
|
||||||
|
@ -9,7 +9,7 @@ HeartRateGraphItem::HeartRateGraphItem(const Graph &graph, GraphType type,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QString HeartRateGraphItem::info() const
|
ToolTip HeartRateGraphItem::info() const
|
||||||
{
|
{
|
||||||
ToolTip tt;
|
ToolTip tt;
|
||||||
QLocale l(QLocale::system());
|
QLocale l(QLocale::system());
|
||||||
@ -19,5 +19,5 @@ QString HeartRateGraphItem::info() const
|
|||||||
tt.insert(tr("Average"), l.toString(avg(), 'f', 0)
|
tt.insert(tr("Average"), l.toString(avg(), 'f', 0)
|
||||||
+ UNIT_SPACE + tr("bpm"));
|
+ UNIT_SPACE + tr("bpm"));
|
||||||
|
|
||||||
return tt.toString();
|
return tt;
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ public:
|
|||||||
HeartRateGraphItem(const Graph &graph, GraphType type, int width,
|
HeartRateGraphItem(const Graph &graph, GraphType type, int width,
|
||||||
const QColor &color, QGraphicsItem *parent = 0);
|
const QColor &color, QGraphicsItem *parent = 0);
|
||||||
|
|
||||||
QString info() const;
|
ToolTip info() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // HEARTRATEGRAPHITEM_H
|
#endif // HEARTRATEGRAPHITEM_H
|
||||||
|
@ -56,17 +56,25 @@ void InfoItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|||||||
//painter->drawRect(boundingRect());
|
//painter->drawRect(boundingRect());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int InfoItem::indexOf(const QString &key) const
|
||||||
|
{
|
||||||
|
for (int i = 0; i < _list.size(); i++)
|
||||||
|
if (_list.at(i).key() == key)
|
||||||
|
return i;
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
void InfoItem::insert(const QString &key, const QString &value)
|
void InfoItem::insert(const QString &key, const QString &value)
|
||||||
{
|
{
|
||||||
KV<QString, QString> kv(key, value);
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
|
|
||||||
if ((i = _list.indexOf(kv)) < 0)
|
if ((i = indexOf(key)) < 0)
|
||||||
_list.append(kv);
|
_list.append(KV<QString, QString>(key, value));
|
||||||
else
|
else
|
||||||
_list[i] = kv;
|
_list[i] = KV<QString, QString>(key, value);
|
||||||
|
|
||||||
updateBoundingRect();
|
updateBoundingRect();
|
||||||
update();
|
update();
|
||||||
|
@ -22,6 +22,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void updateBoundingRect();
|
void updateBoundingRect();
|
||||||
|
int indexOf(const QString &key) const;
|
||||||
|
|
||||||
QList<KV<QString, QString> > _list;
|
QList<KV<QString, QString> > _list;
|
||||||
QRectF _boundingRect;
|
QRectF _boundingRect;
|
||||||
|
@ -28,11 +28,8 @@
|
|||||||
#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)
|
#define STATISTICS_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_S)
|
||||||
|
#define FULLSCREEN_SHORTCUT (QKeySequence(QKeySequence::FullScreen).isEmpty() \
|
||||||
#ifdef Q_OS_MAC
|
? QKeySequence(Qt::Key_F11) \
|
||||||
#define FULLSCREEN_SHORTCUT QKeySequence(Qt::META + Qt::CTRL + Qt::Key_F)
|
: QKeySequence(QKeySequence::FullScreen))
|
||||||
#else // Q_OS_MAC
|
|
||||||
#define FULLSCREEN_SHORTCUT QKeySequence(Qt::Key_F11)
|
|
||||||
#endif // Q_OS_MAC
|
|
||||||
|
|
||||||
#endif // KEYS_H
|
#endif // KEYS_H
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
#ifndef LIMITEDCOMBOBOX_H
|
|
||||||
#define LIMITEDCOMBOBOX_H
|
|
||||||
|
|
||||||
#include <QComboBox>
|
|
||||||
#include <QEvent>
|
|
||||||
|
|
||||||
class LimitedComboBox : public QComboBox
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LimitedComboBox(int limit, QWidget *parent = 0)
|
|
||||||
: QComboBox(parent), _limit(limit)
|
|
||||||
{
|
|
||||||
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
|
|
||||||
setStyleSheet("combobox-popup: 0;");
|
|
||||||
}
|
|
||||||
|
|
||||||
QSize sizeHint() const
|
|
||||||
{
|
|
||||||
return QSize(qMin(_limit, QComboBox::sizeHint().width()),
|
|
||||||
QComboBox::sizeHint().height());
|
|
||||||
}
|
|
||||||
QSize minimumSizeHint() const
|
|
||||||
{
|
|
||||||
return QSize(qMin(_limit, QComboBox::minimumSizeHint().width()),
|
|
||||||
QComboBox::minimumSizeHint().height());
|
|
||||||
}
|
|
||||||
|
|
||||||
bool event(QEvent *e)
|
|
||||||
{
|
|
||||||
if (e->type() == QEvent::Polish)
|
|
||||||
view()->setMinimumWidth(QComboBox::sizeHint().width());
|
|
||||||
return QComboBox::event(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
int _limit;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // LIMITEDCOMBOBOX_H
|
|
@ -18,7 +18,7 @@ public:
|
|||||||
setMenuRole(QAction::NoRole);
|
setMenuRole(QAction::NoRole);
|
||||||
setCheckable(true);
|
setCheckable(true);
|
||||||
|
|
||||||
connect(map, SIGNAL(mapLoaded()), this, SLOT(mapLoaded()));
|
connect(map, &Map::mapLoaded, this, &MapAction::mapLoaded);
|
||||||
}
|
}
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
@ -69,7 +69,7 @@ static QRectF bbox(const RectC &rect, Map *map, int samples = 100)
|
|||||||
return prect;
|
return prect;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MapItem::info() const
|
ToolTip MapItem::info() const
|
||||||
{
|
{
|
||||||
ToolTip tt;
|
ToolTip tt;
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ QString MapItem::info() const
|
|||||||
if (!_fileName.isEmpty())
|
if (!_fileName.isEmpty())
|
||||||
tt.insert(tr("File"), _fileName);
|
tt.insert(tr("File"), _fileName);
|
||||||
|
|
||||||
return tt.toString();
|
return tt;
|
||||||
}
|
}
|
||||||
|
|
||||||
MapItem::MapItem(MapAction *action, Map *map, GraphicsItem *parent)
|
MapItem::MapItem(MapAction *action, Map *map, GraphicsItem *parent)
|
||||||
@ -91,7 +91,7 @@ MapItem::MapItem(MapAction *action, Map *map, GraphicsItem *parent)
|
|||||||
_fileName = src->path();
|
_fileName = src->path();
|
||||||
_bounds = src->llBounds();
|
_bounds = src->llBounds();
|
||||||
|
|
||||||
connect(this, SIGNAL(triggered()), action, SLOT(trigger()));
|
connect(this, &MapItem::triggered, action, &MapAction::trigger);
|
||||||
|
|
||||||
_map = map;
|
_map = map;
|
||||||
_digitalZoom = 0;
|
_digitalZoom = 0;
|
||||||
|
@ -26,7 +26,7 @@ public:
|
|||||||
void setStyle(Qt::PenStyle style);
|
void setStyle(Qt::PenStyle style);
|
||||||
void setDigitalZoom(int zoom);
|
void setDigitalZoom(int zoom);
|
||||||
|
|
||||||
QString info() const;
|
ToolTip info() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void triggered();
|
void triggered();
|
||||||
|
@ -74,10 +74,10 @@ MapView::MapView(Map *map, POI *poi, QWidget *parent)
|
|||||||
_map->load();
|
_map->load();
|
||||||
_map->setOutputProjection(_outputProjection);
|
_map->setOutputProjection(_outputProjection);
|
||||||
_map->setInputProjection(_inputProjection);
|
_map->setInputProjection(_inputProjection);
|
||||||
connect(_map, SIGNAL(tilesLoaded()), this, SLOT(reloadMap()));
|
connect(_map, &Map::tilesLoaded, this, &MapView::reloadMap);
|
||||||
|
|
||||||
_poi = poi;
|
_poi = poi;
|
||||||
connect(_poi, SIGNAL(pointsChanged()), this, SLOT(updatePOI()));
|
connect(_poi, &POI::pointsChanged, this, &MapView::updatePOI);
|
||||||
|
|
||||||
_mapOpacity = 1.0;
|
_mapOpacity = 1.0;
|
||||||
_backgroundColor = Qt::white;
|
_backgroundColor = Qt::white;
|
||||||
@ -371,14 +371,14 @@ void MapView::setMap(Map *map)
|
|||||||
RectC cr(_map->xy2ll(vr.topLeft()), _map->xy2ll(vr.bottomRight()));
|
RectC cr(_map->xy2ll(vr.topLeft()), _map->xy2ll(vr.bottomRight()));
|
||||||
|
|
||||||
_map->unload();
|
_map->unload();
|
||||||
disconnect(_map, SIGNAL(tilesLoaded()), this, SLOT(reloadMap()));
|
disconnect(_map, &Map::tilesLoaded, this, &MapView::reloadMap);
|
||||||
|
|
||||||
_map = map;
|
_map = map;
|
||||||
_map->load();
|
_map->load();
|
||||||
_map->setOutputProjection(_outputProjection);
|
_map->setOutputProjection(_outputProjection);
|
||||||
_map->setInputProjection(_inputProjection);
|
_map->setInputProjection(_inputProjection);
|
||||||
_map->setDevicePixelRatio(_deviceRatio, _mapRatio);
|
_map->setDevicePixelRatio(_deviceRatio, _mapRatio);
|
||||||
connect(_map, SIGNAL(tilesLoaded()), this, SLOT(reloadMap()));
|
connect(_map, &Map::tilesLoaded, this, &MapView::reloadMap);
|
||||||
|
|
||||||
digitalZoom(0);
|
digitalZoom(0);
|
||||||
|
|
||||||
@ -408,8 +408,8 @@ void MapView::setMap(Map *map)
|
|||||||
|
|
||||||
void MapView::setPOI(POI *poi)
|
void MapView::setPOI(POI *poi)
|
||||||
{
|
{
|
||||||
disconnect(_poi, SIGNAL(pointsChanged()), this, SLOT(updatePOI()));
|
disconnect(_poi, &POI::pointsChanged, this, &MapView::updatePOI);
|
||||||
connect(poi, SIGNAL(pointsChanged()), this, SLOT(updatePOI()));
|
connect(poi, &POI::pointsChanged, this, &MapView::updatePOI);
|
||||||
|
|
||||||
_poi = poi;
|
_poi = poi;
|
||||||
|
|
||||||
@ -1121,37 +1121,19 @@ void MapView::setDevicePixelRatio(qreal deviceRatio, qreal mapRatio)
|
|||||||
reloadMap();
|
reloadMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapView::setOutputProjection(int id)
|
void MapView::setOutputProjection(const Projection &proj)
|
||||||
{
|
{
|
||||||
const PCS *pcs;
|
_outputProjection = proj;
|
||||||
const GCS *gcs;
|
|
||||||
Coordinates center = _map->xy2ll(mapToScene(viewport()->rect().center()));
|
Coordinates center = _map->xy2ll(mapToScene(viewport()->rect().center()));
|
||||||
|
|
||||||
if ((pcs = PCS::pcs(id)))
|
|
||||||
_outputProjection = Projection(pcs);
|
|
||||||
else if ((gcs = GCS::gcs(id)))
|
|
||||||
_outputProjection = Projection(gcs);
|
|
||||||
else
|
|
||||||
qWarning("%d: Unknown PCS/GCS id", id);
|
|
||||||
|
|
||||||
_map->setOutputProjection(_outputProjection);
|
_map->setOutputProjection(_outputProjection);
|
||||||
rescale();
|
rescale();
|
||||||
centerOn(_map->ll2xy(center));
|
centerOn(_map->ll2xy(center));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapView::setInputProjection(int id)
|
void MapView::setInputProjection(const Projection &proj)
|
||||||
{
|
{
|
||||||
const PCS *pcs;
|
_inputProjection = proj;
|
||||||
const GCS *gcs;
|
|
||||||
Coordinates center = _map->xy2ll(mapToScene(viewport()->rect().center()));
|
Coordinates center = _map->xy2ll(mapToScene(viewport()->rect().center()));
|
||||||
|
|
||||||
if ((pcs = PCS::pcs(id)))
|
|
||||||
_inputProjection = Projection(pcs);
|
|
||||||
else if ((gcs = GCS::gcs(id)))
|
|
||||||
_inputProjection = Projection(gcs);
|
|
||||||
else
|
|
||||||
qWarning("%d: Unknown PCS/GCS id", id);
|
|
||||||
|
|
||||||
_map->setInputProjection(_inputProjection);
|
_map->setInputProjection(_inputProjection);
|
||||||
rescale();
|
rescale();
|
||||||
centerOn(_map->ll2xy(center));
|
centerOn(_map->ll2xy(center));
|
||||||
|
@ -83,8 +83,8 @@ public:
|
|||||||
void setCoordinatesFormat(CoordinatesFormat format);
|
void setCoordinatesFormat(CoordinatesFormat format);
|
||||||
void setTimeZone(const QTimeZone &zone);
|
void setTimeZone(const QTimeZone &zone);
|
||||||
void setDevicePixelRatio(qreal deviceRatio, qreal mapRatio);
|
void setDevicePixelRatio(qreal deviceRatio, qreal mapRatio);
|
||||||
void setOutputProjection(int id);
|
void setOutputProjection(const Projection &proj);
|
||||||
void setInputProjection(int id);
|
void setInputProjection(const Projection &proj);
|
||||||
void clearMapCache();
|
void clearMapCache();
|
||||||
void fitContentToSize();
|
void fitContentToSize();
|
||||||
|
|
||||||
|
@ -13,13 +13,13 @@
|
|||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QSysInfo>
|
#include <QSysInfo>
|
||||||
#include <QButtonGroup>
|
#include <QButtonGroup>
|
||||||
#include "map/pcs.h"
|
|
||||||
#include "icons.h"
|
#include "icons.h"
|
||||||
#include "colorbox.h"
|
#include "colorbox.h"
|
||||||
#include "stylecombobox.h"
|
#include "stylecombobox.h"
|
||||||
#include "oddspinbox.h"
|
#include "oddspinbox.h"
|
||||||
#include "percentslider.h"
|
#include "percentslider.h"
|
||||||
#include "limitedcombobox.h"
|
#include "projectioncombobox.h"
|
||||||
|
#include "dirselectwidget.h"
|
||||||
#include "optionsdialog.h"
|
#include "optionsdialog.h"
|
||||||
|
|
||||||
|
|
||||||
@ -46,46 +46,18 @@ void OptionsDialog::automaticPauseDetectionSet(bool set)
|
|||||||
|
|
||||||
QWidget *OptionsDialog::createMapPage()
|
QWidget *OptionsDialog::createMapPage()
|
||||||
{
|
{
|
||||||
int last = -1;
|
_outputProjection = new ProjectionComboBox();
|
||||||
|
|
||||||
_outputProjection = new LimitedComboBox(200);
|
|
||||||
QList<KV<int, QString> > projections(GCS::list() + PCS::list());
|
|
||||||
std::sort(projections.begin(), projections.end());
|
|
||||||
for (int i = 0; i < projections.size(); i++) {
|
|
||||||
const KV<int, QString> &proj = projections.at(i);
|
|
||||||
// There may be same EPSG codes with different names
|
|
||||||
if (proj.key() == last)
|
|
||||||
continue;
|
|
||||||
else
|
|
||||||
last = proj.key();
|
|
||||||
QString text = QString::number(proj.key()) + " - " + proj.value();
|
|
||||||
_outputProjection->addItem(text, QVariant(proj.key()));
|
|
||||||
}
|
|
||||||
_outputProjection->setCurrentIndex(_outputProjection->findData(
|
_outputProjection->setCurrentIndex(_outputProjection->findData(
|
||||||
_options.outputProjection));
|
_options.outputProjection));
|
||||||
|
_inputProjection = new ProjectionComboBox();
|
||||||
_inputProjection = new LimitedComboBox(200);
|
|
||||||
last = -1;
|
|
||||||
for (int i = 0; i < projections.size(); i++) {
|
|
||||||
const KV<int, QString> &proj = projections.at(i);
|
|
||||||
// There may be same EPSG codes with different names
|
|
||||||
if (proj.key() == last)
|
|
||||||
continue;
|
|
||||||
else
|
|
||||||
last = proj.key();
|
|
||||||
if (proj.key() == 4326 || proj.key() == 3857) {
|
|
||||||
QString text = QString::number(proj.key()) + " - " + proj.value();
|
|
||||||
_inputProjection->addItem(text, QVariant(proj.key()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_inputProjection->setCurrentIndex(_inputProjection->findData(
|
_inputProjection->setCurrentIndex(_inputProjection->findData(
|
||||||
_options.inputProjection));
|
_options.inputProjection));
|
||||||
|
|
||||||
QLabel *inInfo = new QLabel(tr("Select the proper projection of"
|
QLabel *inInfo = new QLabel(tr("Select the proper projection of maps"
|
||||||
" JNX and KMZ maps. Both EPSG:3857 and EPSG:4326 projected maps"
|
" without a projection definition (JNX, KMZ and world file maps)."));
|
||||||
" exist and there is no projection info in the map file."));
|
QLabel *outInfo = new QLabel(tr("Select the desired projection of vector"
|
||||||
QLabel *outInfo = new QLabel(tr("Select the desired projection of IMG"
|
" maps (IMG and Mapsforge maps). The projection must be valid for"
|
||||||
" maps. The projection must be valid for the whole map area."));
|
" the whole map area."));
|
||||||
QFont f = inInfo->font();
|
QFont f = inInfo->font();
|
||||||
f.setPointSize(f.pointSize() - 1);
|
f.setPointSize(f.pointSize() - 1);
|
||||||
inInfo->setWordWrap(true);
|
inInfo->setWordWrap(true);
|
||||||
@ -421,8 +393,8 @@ QWidget *OptionsDialog::createDataPage()
|
|||||||
_pauseInterval->setValue(_options.pauseInterval);
|
_pauseInterval->setValue(_options.pauseInterval);
|
||||||
_pauseInterval->setEnabled(_manualPause->isChecked());
|
_pauseInterval->setEnabled(_manualPause->isChecked());
|
||||||
|
|
||||||
connect(_automaticPause, SIGNAL(toggled(bool)), this,
|
connect(_automaticPause, &QRadioButton::toggled, this,
|
||||||
SLOT(automaticPauseDetectionSet(bool)));
|
&OptionsDialog::automaticPauseDetectionSet);
|
||||||
|
|
||||||
QHBoxLayout *pauseTypeLayout = new QHBoxLayout();
|
QHBoxLayout *pauseTypeLayout = new QHBoxLayout();
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
@ -477,8 +449,8 @@ QWidget *OptionsDialog::createDataPage()
|
|||||||
for (int i = 0; i < zones.size(); i++)
|
for (int i = 0; i < zones.size(); i++)
|
||||||
_timeZone->addItem(zones.at(i));
|
_timeZone->addItem(zones.at(i));
|
||||||
_timeZone->setCurrentText(_options.timeZone.customZone().id());
|
_timeZone->setCurrentText(_options.timeZone.customZone().id());
|
||||||
connect(_customZone, SIGNAL(toggled(bool)), _timeZone,
|
connect(_customZone, &QRadioButton::toggled, _timeZone,
|
||||||
SLOT(setEnabled(bool)));
|
&QComboBox::setEnabled);
|
||||||
QHBoxLayout *customZoneLayout = new QHBoxLayout();
|
QHBoxLayout *customZoneLayout = new QHBoxLayout();
|
||||||
customZoneLayout->addSpacing(20);
|
customZoneLayout->addSpacing(20);
|
||||||
customZoneLayout->addWidget(_timeZone);
|
customZoneLayout->addWidget(_timeZone);
|
||||||
@ -568,12 +540,12 @@ QWidget *OptionsDialog::createDataPage()
|
|||||||
sourceTab->setLayout(sourceTabLayout);
|
sourceTab->setLayout(sourceTabLayout);
|
||||||
|
|
||||||
|
|
||||||
QTabWidget *filterPage = new QTabWidget();
|
QTabWidget *dataPage = new QTabWidget();
|
||||||
filterPage->addTab(filterTab, tr("Filtering"));
|
dataPage->addTab(filterTab, tr("Filtering"));
|
||||||
filterPage->addTab(sourceTab, tr("Sources"));
|
dataPage->addTab(sourceTab, tr("Sources"));
|
||||||
filterPage->addTab(pauseTab, tr("Pause detection"));
|
dataPage->addTab(pauseTab, tr("Pause detection"));
|
||||||
|
|
||||||
return filterPage;
|
return dataPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *OptionsDialog::createPOIPage()
|
QWidget *OptionsDialog::createPOIPage()
|
||||||
@ -712,8 +684,35 @@ QWidget *OptionsDialog::createSystemPage()
|
|||||||
systemTabLayout->addStretch();
|
systemTabLayout->addStretch();
|
||||||
systemTab->setLayout(systemTabLayout);
|
systemTab->setLayout(systemTabLayout);
|
||||||
|
|
||||||
|
_dataPath = new DirSelectWidget();
|
||||||
|
_dataPath->setDir(_options.dataPath);
|
||||||
|
_mapsPath = new DirSelectWidget();
|
||||||
|
_mapsPath->setDir(_options.mapsPath);
|
||||||
|
_poiPath = new DirSelectWidget();
|
||||||
|
_poiPath->setDir(_options.poiPath);
|
||||||
|
|
||||||
|
QLabel *info = new QLabel(tr("Select the initial paths of the file open"
|
||||||
|
" dialogues. Leave the field empty for the system default."));
|
||||||
|
QFont f = info->font();
|
||||||
|
f.setPointSize(f.pointSize() - 1);
|
||||||
|
info->setFont(f);
|
||||||
|
info->setWordWrap(true);
|
||||||
|
|
||||||
|
QFormLayout *pathsFormLayout = new QFormLayout();
|
||||||
|
pathsFormLayout->addRow(tr("Data:"), _dataPath);
|
||||||
|
pathsFormLayout->addRow(tr("Maps:"), _mapsPath);
|
||||||
|
pathsFormLayout->addRow(tr("POI:"), _poiPath);
|
||||||
|
|
||||||
|
QWidget *pathsTab = new QWidget();
|
||||||
|
QVBoxLayout *pathsTabLayout = new QVBoxLayout();
|
||||||
|
pathsTabLayout->addWidget(info);
|
||||||
|
pathsTabLayout->addLayout(pathsFormLayout);
|
||||||
|
pathsTabLayout->addStretch();
|
||||||
|
pathsTab->setLayout(pathsTabLayout);
|
||||||
|
|
||||||
QTabWidget *systemPage = new QTabWidget();
|
QTabWidget *systemPage = new QTabWidget();
|
||||||
systemPage->addTab(systemTab, tr("System"));
|
systemPage->addTab(systemTab, tr("System"));
|
||||||
|
systemPage->addTab(pathsTab, tr("Initial paths"));
|
||||||
|
|
||||||
return systemPage;
|
return systemPage;
|
||||||
}
|
}
|
||||||
@ -750,15 +749,17 @@ OptionsDialog::OptionsDialog(Options &options, Units units, QWidget *parent)
|
|||||||
pages->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
|
pages->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
|
||||||
pages->setMinimumWidth(2 * menu->size().width());
|
pages->setMinimumWidth(2 * menu->size().width());
|
||||||
|
|
||||||
connect(menu, SIGNAL(currentRowChanged(int)), pages,
|
connect(menu, &QListWidget::currentRowChanged, pages,
|
||||||
SLOT(setCurrentIndex(int)));
|
&QStackedWidget::setCurrentIndex);
|
||||||
menu->item(0)->setSelected(true);
|
menu->item(0)->setSelected(true);
|
||||||
|
|
||||||
|
|
||||||
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok
|
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok
|
||||||
| QDialogButtonBox::Cancel);
|
| QDialogButtonBox::Cancel);
|
||||||
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
connect(buttonBox, &QDialogButtonBox::accepted, this,
|
||||||
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
&OptionsDialog::accept);
|
||||||
|
connect(buttonBox, &QDialogButtonBox::rejected, this,
|
||||||
|
&OptionsDialog::reject);
|
||||||
|
|
||||||
QVBoxLayout *layout = new QVBoxLayout;
|
QVBoxLayout *layout = new QVBoxLayout;
|
||||||
layout->addLayout(contentLayout);
|
layout->addLayout(contentLayout);
|
||||||
@ -834,6 +835,9 @@ void OptionsDialog::accept()
|
|||||||
_options.enableHTTP2 = _enableHTTP2->isChecked();
|
_options.enableHTTP2 = _enableHTTP2->isChecked();
|
||||||
_options.pixmapCache = _pixmapCache->value();
|
_options.pixmapCache = _pixmapCache->value();
|
||||||
_options.connectionTimeout = _connectionTimeout->value();
|
_options.connectionTimeout = _connectionTimeout->value();
|
||||||
|
_options.dataPath = _dataPath->dir();
|
||||||
|
_options.mapsPath = _mapsPath->dir();
|
||||||
|
_options.poiPath = _poiPath->dir();
|
||||||
|
|
||||||
_options.hiresPrint = _hires->isChecked();
|
_options.hiresPrint = _hires->isChecked();
|
||||||
_options.printName = _name->isChecked();
|
_options.printName = _name->isChecked();
|
||||||
|
@ -15,7 +15,8 @@ class QComboBox;
|
|||||||
class QCheckBox;
|
class QCheckBox;
|
||||||
class QRadioButton;
|
class QRadioButton;
|
||||||
class PercentSlider;
|
class PercentSlider;
|
||||||
class LimitedComboBox;
|
class ProjectionComboBox;
|
||||||
|
class DirSelectWidget;
|
||||||
|
|
||||||
|
|
||||||
struct Options {
|
struct Options {
|
||||||
@ -65,6 +66,9 @@ struct Options {
|
|||||||
bool enableHTTP2;
|
bool enableHTTP2;
|
||||||
int pixmapCache;
|
int pixmapCache;
|
||||||
int connectionTimeout;
|
int connectionTimeout;
|
||||||
|
QString dataPath;
|
||||||
|
QString mapsPath;
|
||||||
|
QString poiPath;
|
||||||
// Print/Export
|
// Print/Export
|
||||||
bool hiresPrint;
|
bool hiresPrint;
|
||||||
bool printName;
|
bool printName;
|
||||||
@ -121,8 +125,8 @@ private:
|
|||||||
ColorBox *_sliderColor;
|
ColorBox *_sliderColor;
|
||||||
QCheckBox *_graphAA;
|
QCheckBox *_graphAA;
|
||||||
// Map
|
// Map
|
||||||
LimitedComboBox *_outputProjection;
|
ProjectionComboBox *_outputProjection;
|
||||||
LimitedComboBox *_inputProjection;
|
ProjectionComboBox *_inputProjection;
|
||||||
QRadioButton *_hidpi;
|
QRadioButton *_hidpi;
|
||||||
QRadioButton *_lodpi;
|
QRadioButton *_lodpi;
|
||||||
// Data
|
// Data
|
||||||
@ -154,6 +158,9 @@ private:
|
|||||||
QSpinBox *_connectionTimeout;
|
QSpinBox *_connectionTimeout;
|
||||||
QCheckBox *_useOpenGL;
|
QCheckBox *_useOpenGL;
|
||||||
QCheckBox *_enableHTTP2;
|
QCheckBox *_enableHTTP2;
|
||||||
|
DirSelectWidget *_dataPath;
|
||||||
|
DirSelectWidget *_mapsPath;
|
||||||
|
DirSelectWidget *_poiPath;
|
||||||
// Print/Export
|
// Print/Export
|
||||||
QRadioButton *_wysiwyg;
|
QRadioButton *_wysiwyg;
|
||||||
QRadioButton *_hires;
|
QRadioButton *_hires;
|
||||||
|
@ -196,6 +196,8 @@ void PathItem::setDigitalZoom(int zoom)
|
|||||||
_digitalZoom = zoom;
|
_digitalZoom = zoom;
|
||||||
_pen.setWidthF(_width * pow(2, -_digitalZoom));
|
_pen.setWidthF(_width * pow(2, -_digitalZoom));
|
||||||
_marker->setScale(pow(2, -_digitalZoom));
|
_marker->setScale(pow(2, -_digitalZoom));
|
||||||
|
for (int i = 0; i < _ticks.size(); i++)
|
||||||
|
_ticks.at(i)->setDigitalZoom(zoom);
|
||||||
|
|
||||||
updateShape();
|
updateShape();
|
||||||
}
|
}
|
||||||
@ -409,8 +411,8 @@ void PathItem::addGraph(GraphItem *graph)
|
|||||||
_graphs.append(graph);
|
_graphs.append(graph);
|
||||||
|
|
||||||
if (graph) {
|
if (graph) {
|
||||||
connect(this, SIGNAL(selected(bool)), graph, SLOT(hover(bool)));
|
connect(this, &PathItem::selected, graph, &GraphItem::hover);
|
||||||
connect(graph, SIGNAL(selected(bool)), this, SLOT(hover(bool)));
|
connect(graph, &GraphItem::selected, this, &PathItem::hover);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,9 +16,13 @@ public:
|
|||||||
|
|
||||||
void setPos(const QPointF &pos);
|
void setPos(const QPointF &pos);
|
||||||
void setColor(const QColor &color) {_brush = QBrush(color);}
|
void setColor(const QColor &color) {_brush = QBrush(color);}
|
||||||
|
void setDigitalZoom(int zoom) {setScale(pow(2, -zoom));}
|
||||||
|
|
||||||
int type() const {return parentItem()->type();}
|
int type() const {return parentItem()->type();}
|
||||||
QString info() const {return static_cast<GraphicsItem*>(parentItem())->info();}
|
ToolTip info() const
|
||||||
|
{
|
||||||
|
return static_cast<GraphicsItem*>(parentItem())->info();
|
||||||
|
}
|
||||||
|
|
||||||
static QRect tickRect(int value);
|
static QRect tickRect(int value);
|
||||||
|
|
||||||
|
@ -91,8 +91,10 @@ PDFExportDialog::PDFExportDialog(PDFExport &exp, Units units, QWidget *parent)
|
|||||||
QDialogButtonBox *buttonBox = new QDialogButtonBox();
|
QDialogButtonBox *buttonBox = new QDialogButtonBox();
|
||||||
buttonBox->addButton(tr("Export"), QDialogButtonBox::AcceptRole);
|
buttonBox->addButton(tr("Export"), QDialogButtonBox::AcceptRole);
|
||||||
buttonBox->addButton(QDialogButtonBox::Cancel);
|
buttonBox->addButton(QDialogButtonBox::Cancel);
|
||||||
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
connect(buttonBox, &QDialogButtonBox::accepted, this,
|
||||||
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
&PDFExportDialog::accept);
|
||||||
|
connect(buttonBox, &QDialogButtonBox::rejected, this,
|
||||||
|
&PDFExportDialog::reject);
|
||||||
|
|
||||||
QVBoxLayout *layout = new QVBoxLayout;
|
QVBoxLayout *layout = new QVBoxLayout;
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
|
@ -24,7 +24,7 @@ PercentSlider::PercentSlider(QWidget *parent) : QWidget(parent)
|
|||||||
_label->setAlignment(Qt::AlignRight);
|
_label->setAlignment(Qt::AlignRight);
|
||||||
_label->setText(format(_slider->value()));
|
_label->setText(format(_slider->value()));
|
||||||
|
|
||||||
connect(_slider, SIGNAL(valueChanged(int)), this, SLOT(updateLabel(int)));
|
connect(_slider, &QSlider::valueChanged, this, &PercentSlider::updateLabel);
|
||||||
|
|
||||||
QHBoxLayout *layout = new QHBoxLayout();
|
QHBoxLayout *layout = new QHBoxLayout();
|
||||||
layout->addWidget(_slider);
|
layout->addWidget(_slider);
|
||||||
|
@ -67,8 +67,10 @@ PNGExportDialog::PNGExportDialog(PNGExport &exp, QWidget *parent)
|
|||||||
QDialogButtonBox *buttonBox = new QDialogButtonBox();
|
QDialogButtonBox *buttonBox = new QDialogButtonBox();
|
||||||
buttonBox->addButton(tr("Export"), QDialogButtonBox::AcceptRole);
|
buttonBox->addButton(tr("Export"), QDialogButtonBox::AcceptRole);
|
||||||
buttonBox->addButton(QDialogButtonBox::Cancel);
|
buttonBox->addButton(QDialogButtonBox::Cancel);
|
||||||
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
connect(buttonBox, &QDialogButtonBox::accepted, this,
|
||||||
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
&PNGExportDialog::accept);
|
||||||
|
connect(buttonBox, &QDialogButtonBox::rejected, this,
|
||||||
|
&PNGExportDialog::reject);
|
||||||
|
|
||||||
QVBoxLayout *layout = new QVBoxLayout;
|
QVBoxLayout *layout = new QVBoxLayout;
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
|
@ -6,25 +6,31 @@
|
|||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QBasicTimer>
|
#include <QBasicTimer>
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
|
#include <QVBoxLayout>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
#endif // QT 5.15
|
#endif // QT 5.15
|
||||||
|
#include "tooltip.h"
|
||||||
|
#include "thumbnail.h"
|
||||||
|
#include "flowlayout.h"
|
||||||
#include "popup.h"
|
#include "popup.h"
|
||||||
|
|
||||||
|
|
||||||
class PopupLabel : public QLabel
|
class PopupFrame : public QFrame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PopupLabel(const QString &text, QWidget *parent = 0);
|
PopupFrame(const ToolTip &toolTip, QWidget *parent = 0);
|
||||||
~PopupLabel();
|
~PopupFrame();
|
||||||
|
|
||||||
|
const ToolTip &toolTip() const {return _toolTip;}
|
||||||
|
|
||||||
bool eventFilter(QObject *o, QEvent *ev);
|
bool eventFilter(QObject *o, QEvent *ev);
|
||||||
void place(const QPoint &pos, QWidget *w);
|
void place(const QPoint &pos, QWidget *w);
|
||||||
void deleteAfterTimer();
|
void deleteAfterTimer();
|
||||||
void stopTimer() {_timer.stop();}
|
void stopTimer() {_timer.stop();}
|
||||||
|
|
||||||
static PopupLabel *_instance;
|
static PopupFrame *_instance;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent *event);
|
void paintEvent(QPaintEvent *event);
|
||||||
@ -32,14 +38,17 @@ protected:
|
|||||||
void contextMenuEvent(QContextMenuEvent *) {}
|
void contextMenuEvent(QContextMenuEvent *) {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void createLayout(const ToolTip &content);
|
||||||
|
|
||||||
QBasicTimer _timer;
|
QBasicTimer _timer;
|
||||||
|
ToolTip _toolTip;
|
||||||
};
|
};
|
||||||
|
|
||||||
PopupLabel *PopupLabel::_instance = 0;
|
PopupFrame *PopupFrame::_instance = 0;
|
||||||
|
|
||||||
PopupLabel::PopupLabel(const QString &text, QWidget *parent)
|
PopupFrame::PopupFrame(const ToolTip &toolTip, QWidget *parent)
|
||||||
: QLabel(text, parent, Qt::ToolTip | Qt::BypassGraphicsProxyWidget
|
: QFrame(parent, Qt::ToolTip | Qt::BypassGraphicsProxyWidget
|
||||||
| Qt::WindowDoesNotAcceptFocus)
|
| Qt::WindowDoesNotAcceptFocus), _toolTip(toolTip)
|
||||||
{
|
{
|
||||||
delete _instance;
|
delete _instance;
|
||||||
_instance = this;
|
_instance = this;
|
||||||
@ -48,39 +57,73 @@ PopupLabel::PopupLabel(const QString &text, QWidget *parent)
|
|||||||
setBackgroundRole(QPalette::ToolTipBase);
|
setBackgroundRole(QPalette::ToolTipBase);
|
||||||
setPalette(QToolTip::palette());
|
setPalette(QToolTip::palette());
|
||||||
ensurePolished();
|
ensurePolished();
|
||||||
setMargin(1 + style()->pixelMetric(QStyle::PM_ToolTipLabelFrameWidth, 0,
|
|
||||||
this));
|
|
||||||
setFrameStyle(QFrame::NoFrame);
|
setFrameStyle(QFrame::NoFrame);
|
||||||
setAlignment(Qt::AlignLeft);
|
|
||||||
setIndent(1);
|
|
||||||
setWindowOpacity(style()->styleHint(QStyle::SH_ToolTipLabel_Opacity, 0,
|
setWindowOpacity(style()->styleHint(QStyle::SH_ToolTipLabel_Opacity, 0,
|
||||||
this) / 255.0);
|
this) / 255.0);
|
||||||
|
|
||||||
setTextInteractionFlags(Qt::TextBrowserInteraction);
|
createLayout(toolTip);
|
||||||
setOpenExternalLinks(true);
|
|
||||||
setWordWrap(true);
|
|
||||||
|
|
||||||
setMouseTracking(true);
|
setMouseTracking(true);
|
||||||
|
|
||||||
qApp->installEventFilter(this);
|
qApp->installEventFilter(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
PopupLabel::~PopupLabel()
|
PopupFrame::~PopupFrame()
|
||||||
{
|
{
|
||||||
_instance = 0;
|
_instance = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupLabel::paintEvent(QPaintEvent *event)
|
void PopupFrame::createLayout(const ToolTip &content)
|
||||||
|
{
|
||||||
|
QVBoxLayout *layout = new QVBoxLayout();
|
||||||
|
int margin = 1 + style()->pixelMetric(QStyle::PM_ToolTipLabelFrameWidth, 0,
|
||||||
|
this);
|
||||||
|
layout->setContentsMargins(margin, margin, margin, margin);
|
||||||
|
layout->setSpacing(0);
|
||||||
|
|
||||||
|
if (!content.images().isEmpty()) {
|
||||||
|
FlowLayout *imagesLayout = new FlowLayout(0, 2, 2);
|
||||||
|
int size = qMin(960/content.images().size(), 240);
|
||||||
|
|
||||||
|
for (int i = 0; i < content.images().size(); i++)
|
||||||
|
imagesLayout->addWidget(new Thumbnail(content.images().at(i), size));
|
||||||
|
|
||||||
|
layout->addLayout(imagesLayout);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!content.list().isEmpty()) {
|
||||||
|
QString html = "<table>";
|
||||||
|
for (int i = 0; i < content.list().count(); i++)
|
||||||
|
html += "<tr><td align=\"right\"><b>" + content.list().at(i).key()
|
||||||
|
+ ": </b></td><td>" + content.list().at(i).value()
|
||||||
|
+ "</td></tr>";
|
||||||
|
html += "</table>";
|
||||||
|
|
||||||
|
QLabel *label = new QLabel(html);
|
||||||
|
label->setAlignment(Qt::AlignLeft);
|
||||||
|
label->setIndent(1);
|
||||||
|
label->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||||
|
label->setOpenExternalLinks(true);
|
||||||
|
label->setWordWrap(true);
|
||||||
|
|
||||||
|
layout->addWidget(label);
|
||||||
|
}
|
||||||
|
|
||||||
|
setLayout(layout);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PopupFrame::paintEvent(QPaintEvent *event)
|
||||||
{
|
{
|
||||||
QStylePainter p(this);
|
QStylePainter p(this);
|
||||||
QStyleOptionFrame opt;
|
QStyleOptionFrame opt;
|
||||||
opt.initFrom(this);
|
opt.initFrom(this);
|
||||||
p.drawPrimitive(QStyle::PE_PanelTipLabel, opt);
|
p.drawPrimitive(QStyle::PE_PanelTipLabel, opt);
|
||||||
p.end();
|
p.end();
|
||||||
QLabel::paintEvent(event);
|
QFrame::paintEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupLabel::timerEvent(QTimerEvent *event)
|
void PopupFrame::timerEvent(QTimerEvent *event)
|
||||||
{
|
{
|
||||||
if (event->timerId() == _timer.timerId()) {
|
if (event->timerId() == _timer.timerId()) {
|
||||||
_timer.stop();
|
_timer.stop();
|
||||||
@ -88,7 +131,7 @@ void PopupLabel::timerEvent(QTimerEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PopupLabel::eventFilter(QObject *o, QEvent *ev)
|
bool PopupFrame::eventFilter(QObject *o, QEvent *ev)
|
||||||
{
|
{
|
||||||
Q_UNUSED(o);
|
Q_UNUSED(o);
|
||||||
|
|
||||||
@ -123,7 +166,7 @@ bool PopupLabel::eventFilter(QObject *o, QEvent *ev)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupLabel::place(const QPoint &pos, QWidget *w)
|
void PopupFrame::place(const QPoint &pos, QWidget *w)
|
||||||
{
|
{
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
||||||
QRect screen = QApplication::desktop()->screenGeometry(w);
|
QRect screen = QApplication::desktop()->screenGeometry(w);
|
||||||
@ -148,31 +191,34 @@ void PopupLabel::place(const QPoint &pos, QWidget *w)
|
|||||||
this->move(p);
|
this->move(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupLabel::deleteAfterTimer()
|
void PopupFrame::deleteAfterTimer()
|
||||||
{
|
{
|
||||||
if (!_timer.isActive())
|
if (!_timer.isActive())
|
||||||
_timer.start(300, this);
|
_timer.start(300, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Popup::show(const QPoint &pos, const ToolTip &toolTip, QWidget *w)
|
||||||
void Popup::show(const QPoint &pos, const QString &text, QWidget *w)
|
|
||||||
{
|
{
|
||||||
if (text.isEmpty())
|
if (toolTip.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (PopupLabel::_instance) {
|
if (PopupFrame::_instance) {
|
||||||
PopupLabel::_instance->stopTimer();
|
if (toolTip == PopupFrame::_instance->toolTip())
|
||||||
PopupLabel::_instance->setText(text);
|
PopupFrame::_instance->stopTimer();
|
||||||
|
else {
|
||||||
|
delete PopupFrame::_instance;
|
||||||
|
PopupFrame::_instance = new PopupFrame(toolTip);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
PopupLabel::_instance = new PopupLabel(text);
|
PopupFrame::_instance = new PopupFrame(toolTip);
|
||||||
|
|
||||||
PopupLabel::_instance->resize(PopupLabel::_instance->sizeHint());
|
PopupFrame::_instance->resize(PopupFrame::_instance->sizeHint());
|
||||||
PopupLabel::_instance->place(pos, w);
|
PopupFrame::_instance->place(pos, w);
|
||||||
PopupLabel::_instance->showNormal();
|
PopupFrame::_instance->showNormal();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Popup::clear()
|
void Popup::clear()
|
||||||
{
|
{
|
||||||
if (PopupLabel::_instance)
|
if (PopupFrame::_instance)
|
||||||
delete PopupLabel::_instance;
|
delete PopupFrame::_instance;
|
||||||
}
|
}
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
#define POPUP_H
|
#define POPUP_H
|
||||||
|
|
||||||
class QPoint;
|
class QPoint;
|
||||||
class QString;
|
|
||||||
class QWidget;
|
class QWidget;
|
||||||
|
class ToolTip;
|
||||||
|
|
||||||
class Popup
|
class Popup
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void show(const QPoint &pos, const QString &text, QWidget *w);
|
static void show(const QPoint &pos, const ToolTip &toolTip, QWidget *w);
|
||||||
static void clear();
|
static void clear();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ PowerGraphItem::PowerGraphItem(const Graph &graph, GraphType type, int width,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PowerGraphItem::info() const
|
ToolTip PowerGraphItem::info() const
|
||||||
{
|
{
|
||||||
ToolTip tt;
|
ToolTip tt;
|
||||||
QLocale l(QLocale::system());
|
QLocale l(QLocale::system());
|
||||||
@ -19,5 +19,5 @@ QString PowerGraphItem::info() const
|
|||||||
tt.insert(tr("Average"), l.toString(avg(), 'f', 1)
|
tt.insert(tr("Average"), l.toString(avg(), 'f', 1)
|
||||||
+ UNIT_SPACE + tr("W"));
|
+ UNIT_SPACE + tr("W"));
|
||||||
|
|
||||||
return tt.toString();
|
return tt;
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user