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

Compare commits

..

31 Commits
5.7 ... 5.10

Author SHA1 Message Date
bd6c6ef344 Simplified zoom key bindings
Closes #99
2018-05-09 18:18:58 +02:00
dfb48d17bf Ignore missing namespace declarations
Fixes #110
2018-05-08 22:09:39 +02:00
362d065020 Added EST97 PCS 2018-05-05 18:18:54 +02:00
b0f4f2294a Fixed the instant-resize-after-first-load issue 2018-05-04 19:36:37 +02:00
4463241e50 Merge branch 'master' of https://github.com/tumic0/GPXSee 2018-05-03 19:12:22 +02:00
abc987cb0c Code cleanup 2018-05-03 19:11:55 +02:00
81f0c40bec Translations update (#109) 2018-05-02 23:29:25 +02:00
cf81e42f52 Remaining qreal/double separation
+ some minor TrekBuddy atlas issues fixes
2018-05-02 21:25:14 +02:00
1aedc1de93 Fixed scale info when printing/exporting with digital zoom 2018-04-28 22:34:37 +02:00
beb966c58f Fixed broken returning from print mode 2018-04-28 22:18:11 +02:00
9eb2e38499 Includes cleanup 2018-04-28 19:08:21 +02:00
247eef5261 Added download retries in case of connection timeout 2018-04-28 19:07:52 +02:00
9c125a0583 Cosmetics 2018-04-28 16:14:03 +02:00
bcff05c37c Code cleanup 2018-04-28 16:07:32 +02:00
266a1d037e Code cleanup 2018-04-27 23:08:44 +02:00
2b0989438a Version++ 2018-04-27 21:16:11 +02:00
f8c92cf036 Enable authorization for OSM type maps 2018-04-27 21:13:10 +02:00
2fb9a59bf0 A little bit more sane PDF resolutions 2018-04-27 19:37:15 +02:00
566f3185f9 Separated map downloaders, added configurable connection timeouts 2018-04-27 19:31:27 +02:00
62962b5de2 Added new Polish comment entry (#105) 2018-04-23 07:41:56 +02:00
cb09ea0681 Version++ 2018-04-19 19:50:04 +02:00
e5d566807a Fixed HTTP redirects (+addded support for relative URLs)
Fixes #104
2018-04-19 19:46:56 +02:00
0ce2cfd13c Update gpxsee_sv.ts (#102)
* Update gpxsee_sv.ts

* Fixed typo

Sorry! I edited online, on a borrowed windows machine.  :(
2018-04-18 22:03:26 +02:00
e1532b978f The true cause of the map switch offset... 2018-04-18 22:02:24 +02:00
bb10f7c0e1 Version++ 2018-04-17 22:54:42 +02:00
8ff21b5b37 Added the Polish translation into the builds 2018-04-17 22:52:47 +02:00
32f41e5287 Added new PL (Polish) translation file. (#103) 2018-04-17 22:40:12 +02:00
c50e41dea1 Numerical instability fix 2018-04-17 22:26:20 +02:00
e34800b8d1 Updated description (added OziExplorer files) 2018-04-17 21:27:03 +02:00
6642a2f810 Updated USGS maps URLs 2018-04-17 21:25:47 +02:00
55458b04a6 Fixed 1px map change offset & invalid zoom level 2018-04-17 21:24:46 +02:00
65 changed files with 2386 additions and 623 deletions

View File

@ -1,4 +1,4 @@
version: 5.7.{build}
version: 5.10.{build}
configuration: Release
platform: Any CPU
environment:

View File

@ -1,6 +1,6 @@
# GPXSee
GPXSee is a Qt-based GPS log file viewer and analyzer that supports GPX, TCX,
KML, FIT, IGC and NMEA files.
KML, FIT, IGC, NMEA and OziExplorer files.
## Features
* User-definable online maps (OSM/Google tiles, WMTS, WMS).
@ -11,7 +11,7 @@ KML, FIT, IGC and NMEA files.
* Print/export to PDF.
* Full-screen mode.
* Native GUI for Windows, Mac OS X and Linux.
* Opens GPX, TCX, FIT, KML, IGC, NMEA and Garmin CSV files.
* Opens GPX, TCX, FIT, KML, IGC, NMEA, OziExplorer (PLT, RTE, WPT) and Garmin CSV files.
![GPXSee - Linux](https://a.fsdn.com/con/app/proj/gpxsee/screenshots/linux2.png)

View File

@ -1,5 +1,5 @@
TARGET = GPXSee
VERSION = 5.7
VERSION = 5.10
QT += core \
gui \
network
@ -125,7 +125,8 @@ HEADERS += src/config.h \
src/data/fitparser.h \
src/data/igcparser.h \
src/data/nmeaparser.h \
src/data/oziparsers.h
src/data/oziparsers.h \
src/map/rectd.h
SOURCES += src/main.cpp \
src/common/coordinates.cpp \
src/common/rectc.cpp \
@ -226,7 +227,8 @@ TRANSLATIONS = lang/gpxsee_cs.ts \
lang/gpxsee_de.ts \
lang/gpxsee_ru.ts \
lang/gpxsee_fi.ts \
lang/gpxsee_fr.ts
lang/gpxsee_fr.ts \
lang/gpxsee_pl.ts
macx {
ICON = icons/gpxsee.icns
QMAKE_INFO_PLIST = pkg/Info.plist
@ -236,7 +238,8 @@ macx {
lang/gpxsee_fi.qm \
lang/gpxsee_fr.qm \
lang/gpxsee_ru.qm \
lang/gpxsee_sv.qm
lang/gpxsee_sv.qm \
lang/gpxsee_pl.qm
CSV.path = Contents/Resources
CSV.files = pkg/csv
MAPS.path = Contents/Resources

View File

@ -47,52 +47,52 @@
<context>
<name>Data</name>
<message>
<location filename="../src/data/data.cpp" line="112"/>
<location filename="../src/data/data.cpp" line="110"/>
<source>Supported files</source>
<translation>Tuetut tiedostot</translation>
</message>
<message>
<location filename="../src/data/data.cpp" line="114"/>
<location filename="../src/data/data.cpp" line="112"/>
<source>CSV files</source>
<translation>CSV-tiedostot</translation>
</message>
<message>
<location filename="../src/data/data.cpp" line="114"/>
<location filename="../src/data/data.cpp" line="112"/>
<source>FIT files</source>
<translation>FIT-tiedostot</translation>
</message>
<message>
<location filename="../src/data/data.cpp" line="115"/>
<location filename="../src/data/data.cpp" line="113"/>
<source>GPX files</source>
<translation>GPX-tiedostot</translation>
</message>
<message>
<location filename="../src/data/data.cpp" line="115"/>
<location filename="../src/data/data.cpp" line="113"/>
<source>IGC files</source>
<translation>IGC-tiedostot</translation>
</message>
<message>
<location filename="../src/data/data.cpp" line="116"/>
<location filename="../src/data/data.cpp" line="114"/>
<source>KML files</source>
<translation>KML-tiedostot</translation>
</message>
<message>
<location filename="../src/data/data.cpp" line="116"/>
<location filename="../src/data/data.cpp" line="114"/>
<source>NMEA files</source>
<translation>NMEA-tiedostot</translation>
</message>
<message>
<location filename="../src/data/data.cpp" line="117"/>
<location filename="../src/data/data.cpp" line="115"/>
<source>OziExplorer files</source>
<translation>OziExplorer-tiedostot</translation>
</message>
<message>
<location filename="../src/data/data.cpp" line="118"/>
<location filename="../src/data/data.cpp" line="116"/>
<source>TCX files</source>
<translation>TCX-tiedostot</translation>
</message>
<message>
<location filename="../src/data/data.cpp" line="118"/>
<location filename="../src/data/data.cpp" line="116"/>
<source>All files</source>
<translation>Kaikki tiedostot</translation>
</message>
@ -306,380 +306,380 @@
<context>
<name>GUI</name>
<message>
<location filename="../src/GUI/gui.cpp" line="592"/>
<location filename="../src/GUI/gui.cpp" line="593"/>
<source>GPXSee is distributed under the terms of the GNU General Public License version 3. For more info about GPXSee visit the project homepage at </source>
<translation>GPXSee levitetään GNU yleisen lisenssin version 3 alaisena. Voit katsoa lisätietoja GPXSee:stä projektin kotisivulla </translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="666"/>
<location filename="../src/GUI/gui.cpp" line="667"/>
<source>Open file</source>
<translation>Avaa tiedosto</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="757"/>
<location filename="../src/GUI/gui.cpp" line="758"/>
<source>Open POI file</source>
<translation>Avaa POI-tiedosto</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="199"/>
<location filename="../src/GUI/gui.cpp" line="200"/>
<source>Quit</source>
<translation>Lopeta</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="208"/>
<location filename="../src/GUI/gui.cpp" line="609"/>
<location filename="../src/GUI/gui.cpp" line="209"/>
<location filename="../src/GUI/gui.cpp" line="610"/>
<location filename="../src/GUI/gui.cpp" line="611"/>
<source>Keyboard controls</source>
<translation>Näppäimistön säätimet</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="233"/>
<location filename="../src/GUI/gui.cpp" line="234"/>
<source>Close</source>
<translation>Sulje</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="239"/>
<location filename="../src/GUI/gui.cpp" line="240"/>
<source>Reload</source>
<translation>Lataa uudelleen</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="521"/>
<location filename="../src/GUI/gui.cpp" line="522"/>
<source>Show</source>
<translation>Näytä</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="515"/>
<location filename="../src/GUI/gui.cpp" line="516"/>
<source>File</source>
<translation>Tiedosto</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="250"/>
<location filename="../src/GUI/gui.cpp" line="251"/>
<source>Close POI files</source>
<translation>Sulje POI-tiedostot</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="252"/>
<location filename="../src/GUI/gui.cpp" line="253"/>
<source>Overlap POIs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="256"/>
<location filename="../src/GUI/gui.cpp" line="257"/>
<source>Show POI labels</source>
<translation>Näytä POI:n nimiöt</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="261"/>
<location filename="../src/GUI/gui.cpp" line="262"/>
<source>Show POIs</source>
<translation>Näytä POI:t</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="270"/>
<location filename="../src/GUI/gui.cpp" line="271"/>
<source>Show map</source>
<translation>Näytä kartta</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="280"/>
<location filename="../src/GUI/gui.cpp" line="281"/>
<source>Clear tile cache</source>
<translation>Tyhjennä välimuisti</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="217"/>
<location filename="../src/GUI/gui.cpp" line="218"/>
<source>Open...</source>
<translation>Avaa...</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="206"/>
<location filename="../src/GUI/gui.cpp" line="643"/>
<location filename="../src/GUI/gui.cpp" line="207"/>
<location filename="../src/GUI/gui.cpp" line="644"/>
<location filename="../src/GUI/gui.cpp" line="645"/>
<source>Paths</source>
<translation>Tiedostopolut</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="247"/>
<location filename="../src/GUI/gui.cpp" line="248"/>
<source>Load POI file...</source>
<translation>Lataa POI-tiedosto...</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="278"/>
<location filename="../src/GUI/gui.cpp" line="279"/>
<source>Load map...</source>
<translation>Lataa kartta...</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="284"/>
<location filename="../src/GUI/gui.cpp" line="288"/>
<location filename="../src/GUI/gui.cpp" line="626"/>
<location filename="../src/GUI/gui.cpp" line="285"/>
<location filename="../src/GUI/gui.cpp" line="289"/>
<location filename="../src/GUI/gui.cpp" line="627"/>
<source>Next map</source>
<translation>Seuraava kartta</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="298"/>
<location filename="../src/GUI/gui.cpp" line="299"/>
<source>Show tracks</source>
<translation>Näytä jäljet</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="302"/>
<location filename="../src/GUI/gui.cpp" line="303"/>
<source>Show routes</source>
<translation>Näytä reitit</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="306"/>
<location filename="../src/GUI/gui.cpp" line="307"/>
<source>Show waypoints</source>
<translation>Näytä reittipisteet</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="310"/>
<location filename="../src/GUI/gui.cpp" line="311"/>
<source>Waypoint labels</source>
<translation>Reittipisteen nimiöt</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="321"/>
<location filename="../src/GUI/gui.cpp" line="322"/>
<source>Show graphs</source>
<translation>Näytä kaaviokuvat</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="341"/>
<location filename="../src/GUI/gui.cpp" line="342"/>
<source>Show grid</source>
<translation>Näytä ruudukko</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="345"/>
<location filename="../src/GUI/gui.cpp" line="346"/>
<source>Show slider info</source>
<translation>Näytä liukusäätimen arvo</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="351"/>
<location filename="../src/GUI/gui.cpp" line="352"/>
<source>Show toolbars</source>
<translation>Näytä työkalupalkit</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="357"/>
<location filename="../src/GUI/gui.cpp" line="358"/>
<source>Total time</source>
<translation>Kokonaisaika</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="362"/>
<location filename="../src/GUI/gui.cpp" line="934"/>
<location filename="../src/GUI/gui.cpp" line="363"/>
<location filename="../src/GUI/gui.cpp" line="937"/>
<source>Moving time</source>
<translation>Liikkumisaika</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="369"/>
<location filename="../src/GUI/gui.cpp" line="370"/>
<source>Metric</source>
<translation>Metriset</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="374"/>
<location filename="../src/GUI/gui.cpp" line="375"/>
<source>Imperial</source>
<translation>Brittiläiset</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="379"/>
<location filename="../src/GUI/gui.cpp" line="380"/>
<source>Nautical</source>
<translation>Merelliset</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="386"/>
<location filename="../src/GUI/gui.cpp" line="387"/>
<source>Decimal degrees (DD)</source>
<translation>Desimaaliasteet (DD)</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="391"/>
<location filename="../src/GUI/gui.cpp" line="392"/>
<source>Degrees and decimal minutes (DMM)</source>
<translation>Asteet, desimaaliminuutit (DMM)</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="397"/>
<location filename="../src/GUI/gui.cpp" line="398"/>
<source>Degrees, minutes, seconds (DMS)</source>
<translation>Asteet, minuutit, sekunnit (DMS)</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="402"/>
<location filename="../src/GUI/gui.cpp" line="403"/>
<source>Fullscreen mode</source>
<translation>Kokoruututila</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="408"/>
<location filename="../src/GUI/gui.cpp" line="409"/>
<source>Options...</source>
<translation>Valinnat...</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="414"/>
<location filename="../src/GUI/gui.cpp" line="415"/>
<source>Next</source>
<translation>Seuraava</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="417"/>
<location filename="../src/GUI/gui.cpp" line="418"/>
<source>Previous</source>
<translation>Edellinen</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="421"/>
<location filename="../src/GUI/gui.cpp" line="422"/>
<source>Last</source>
<translation>Viimeinen</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="424"/>
<location filename="../src/GUI/gui.cpp" line="425"/>
<source>First</source>
<translation>Ensimmäinen</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="464"/>
<location filename="../src/GUI/gui.cpp" line="465"/>
<source>POI files</source>
<translation>POI-tiedostot</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="476"/>
<location filename="../src/GUI/gui.cpp" line="477"/>
<source>Display</source>
<translation>Näytä</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="488"/>
<location filename="../src/GUI/gui.cpp" line="489"/>
<source>Units</source>
<translation>Yksiköt</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="492"/>
<location filename="../src/GUI/gui.cpp" line="493"/>
<source>Coordinates format</source>
<translation>Koordinaattien muoto</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="619"/>
<location filename="../src/GUI/gui.cpp" line="620"/>
<source>Append file</source>
<translation>Lisää tiedosto</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="620"/>
<location filename="../src/GUI/gui.cpp" line="621"/>
<source>Next/Previous</source>
<translation>Next/Previous</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="622"/>
<location filename="../src/GUI/gui.cpp" line="623"/>
<source>Toggle graph type</source>
<translation>Vaihda kaaviokuvan tyyppi</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="624"/>
<location filename="../src/GUI/gui.cpp" line="625"/>
<source>Toggle time type</source>
<translation>Vaihda ajan tyyppi</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="628"/>
<location filename="../src/GUI/gui.cpp" line="629"/>
<source>Previous map</source>
<translation>Edellinen kartta</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="629"/>
<location filename="../src/GUI/gui.cpp" line="630"/>
<source>Zoom in</source>
<translation>Lähennä</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="631"/>
<location filename="../src/GUI/gui.cpp" line="632"/>
<source>Zoom out</source>
<translation>Loitonna</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="633"/>
<location filename="../src/GUI/gui.cpp" line="634"/>
<source>Digital zoom</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="634"/>
<location filename="../src/GUI/gui.cpp" line="635"/>
<source>Zoom</source>
<translation>Zoom</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="1135"/>
<location filename="../src/GUI/gui.cpp" line="1138"/>
<source>Open map file</source>
<translation>Avaa karttatiedosto</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="1175"/>
<location filename="../src/GUI/gui.cpp" line="1178"/>
<source>No files loaded</source>
<translation>Yhtään tiedostoja ei ladattu</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="920"/>
<location filename="../src/GUI/gui.cpp" line="923"/>
<location filename="../src/GUI/gui.cpp" line="926"/>
<source>Date</source>
<translation>Päivämäärä</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="432"/>
<location filename="../src/GUI/gui.cpp" line="433"/>
<source>&amp;File</source>
<translation>&amp;Tiedosto</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="446"/>
<location filename="../src/GUI/gui.cpp" line="447"/>
<source>&amp;Map</source>
<translation>&amp;Kartat</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="454"/>
<location filename="../src/GUI/gui.cpp" line="455"/>
<source>&amp;Graph</source>
<translation>Kaa&amp;viokuva</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="463"/>
<location filename="../src/GUI/gui.cpp" line="464"/>
<source>&amp;POI</source>
<translation>&amp;POI</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="475"/>
<location filename="../src/GUI/gui.cpp" line="476"/>
<source>&amp;Data</source>
<translation>Tie&amp;dot</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="484"/>
<location filename="../src/GUI/gui.cpp" line="485"/>
<source>&amp;Settings</source>
<translation>&amp;Asetukset</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="502"/>
<location filename="../src/GUI/gui.cpp" line="503"/>
<source>&amp;Help</source>
<translation>&amp;Ohje</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="647"/>
<location filename="../src/GUI/gui.cpp" line="648"/>
<source>Map directory:</source>
<translation>Karttojen hakemisto:</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="649"/>
<location filename="../src/GUI/gui.cpp" line="650"/>
<source>POI directory:</source>
<translation>POI:n hakemisto:</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="651"/>
<location filename="../src/GUI/gui.cpp" line="652"/>
<source>GCS file:</source>
<translation>GCS-tiedosto:</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="652"/>
<location filename="../src/GUI/gui.cpp" line="653"/>
<source>PCS file:</source>
<translation>PCS-tiedosto:</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="654"/>
<location filename="../src/GUI/gui.cpp" line="655"/>
<source>Ellipsoids file:</source>
<translation>Ellipsoids-tiedosto:</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="657"/>
<location filename="../src/GUI/gui.cpp" line="658"/>
<source>User override directory:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="912"/>
<location filename="../src/GUI/gui.cpp" line="915"/>
<source>Routes</source>
<translation>Reitit</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="1164"/>
<location filename="../src/GUI/gui.cpp" line="1167"/>
<source>Error loading map:</source>
<translation>Virhe ladattaessa karttaa:</translation>
</message>
<message numerus="yes">
<location filename="../src/GUI/gui.cpp" line="1179"/>
<location filename="../src/GUI/gui.cpp" line="1182"/>
<source>%n files</source>
<translation>
<numerusform>%n tiedosto</numerusform>
@ -687,97 +687,97 @@
</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="613"/>
<location filename="../src/GUI/gui.cpp" line="614"/>
<source>Next file</source>
<translation>Seuraava tiedosto</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="589"/>
<location filename="../src/GUI/gui.cpp" line="590"/>
<source>Version </source>
<translation>Versio </translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="222"/>
<location filename="../src/GUI/gui.cpp" line="223"/>
<source>Print...</source>
<translation>Tulosta...</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="227"/>
<location filename="../src/GUI/gui.cpp" line="228"/>
<source>Export to PDF...</source>
<translation>Vie PDF:ksi...</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="914"/>
<location filename="../src/GUI/gui.cpp" line="917"/>
<source>Waypoints</source>
<translation>Reittipisteet</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="614"/>
<location filename="../src/GUI/gui.cpp" line="615"/>
<source>Previous file</source>
<translation>Edellinen tiedosto</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="314"/>
<location filename="../src/GUI/gui.cpp" line="315"/>
<source>Route waypoints</source>
<translation>Reittipisteet</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="616"/>
<location filename="../src/GUI/gui.cpp" line="617"/>
<source>First file</source>
<translation>Ensimmäinen tiedosto</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="618"/>
<location filename="../src/GUI/gui.cpp" line="619"/>
<source>Last file</source>
<translation>Viimeinen tiedosto</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="746"/>
<location filename="../src/GUI/gui.cpp" line="747"/>
<source>Error loading data file:</source>
<translation>Virhe ladattaessa datatiedostoa:</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="749"/>
<location filename="../src/GUI/gui.cpp" line="776"/>
<location filename="../src/GUI/gui.cpp" line="750"/>
<location filename="../src/GUI/gui.cpp" line="777"/>
<source>Line: %1</source>
<translation>Rivi: %1</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="773"/>
<location filename="../src/GUI/gui.cpp" line="774"/>
<source>Error loading POI file:</source>
<translation>Virhe ladattaessa POI-tiedostoa:</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="906"/>
<location filename="../src/GUI/gui.cpp" line="909"/>
<source>Name</source>
<translation>Nimi</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="910"/>
<location filename="../src/GUI/gui.cpp" line="913"/>
<source>Tracks</source>
<translation>Jäljet</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="211"/>
<location filename="../src/GUI/gui.cpp" line="588"/>
<location filename="../src/GUI/gui.cpp" line="212"/>
<location filename="../src/GUI/gui.cpp" line="589"/>
<source>About GPXSee</source>
<translation>Tietoja GPXSee:stä</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="526"/>
<location filename="../src/GUI/gui.cpp" line="527"/>
<source>Navigation</source>
<translation>Navigointi</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="329"/>
<location filename="../src/GUI/gui.cpp" line="930"/>
<location filename="../src/GUI/gui.cpp" line="330"/>
<location filename="../src/GUI/gui.cpp" line="933"/>
<source>Distance</source>
<translation>Etäisyys</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="335"/>
<location filename="../src/GUI/gui.cpp" line="485"/>
<location filename="../src/GUI/gui.cpp" line="932"/>
<location filename="../src/GUI/gui.cpp" line="336"/>
<location filename="../src/GUI/gui.cpp" line="486"/>
<location filename="../src/GUI/gui.cpp" line="935"/>
<source>Time</source>
<translation>Aika</translation>
</message>
@ -1004,7 +1004,7 @@
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="55"/>
<location filename="../src/GUI/optionsdialog.cpp" line="466"/>
<location filename="../src/GUI/optionsdialog.cpp" line="473"/>
<source>General</source>
<translation>Yleinen</translation>
</message>
@ -1139,6 +1139,7 @@
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="303"/>
<location filename="../src/GUI/optionsdialog.cpp" line="437"/>
<source>s</source>
<translation>s</translation>
</message>
@ -1184,7 +1185,7 @@
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="344"/>
<location filename="../src/GUI/optionsdialog.cpp" line="470"/>
<location filename="../src/GUI/optionsdialog.cpp" line="477"/>
<source>POI</source>
<translation>POI</translation>
</message>
@ -1264,33 +1265,38 @@
<translation>MT</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="435"/>
<location filename="../src/GUI/optionsdialog.cpp" line="441"/>
<source>Image cache size:</source>
<translation>Kuvavälimuistin koko:</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="448"/>
<location filename="../src/GUI/optionsdialog.cpp" line="473"/>
<location filename="../src/GUI/optionsdialog.cpp" line="442"/>
<source>Connection timeout:</source>
<translation>Yhteyden aikakatkaisu:</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="455"/>
<location filename="../src/GUI/optionsdialog.cpp" line="480"/>
<source>System</source>
<translation>Järjestelmä</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="467"/>
<location filename="../src/GUI/optionsdialog.cpp" line="474"/>
<source>Appearance</source>
<translation>Ulkoasu</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="469"/>
<location filename="../src/GUI/optionsdialog.cpp" line="476"/>
<source>Data</source>
<translation>Tiedot</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="471"/>
<location filename="../src/GUI/optionsdialog.cpp" line="478"/>
<source>Print &amp; Export</source>
<translation>Tulostus &amp; vienti</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="500"/>
<location filename="../src/GUI/optionsdialog.cpp" line="507"/>
<source>Options</source>
<translation>Valinnat</translation>
</message>

1614
lang/gpxsee_pl.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@ -47,52 +47,52 @@
<context>
<name>Data</name>
<message>
<location filename="../src/data/data.cpp" line="112"/>
<location filename="../src/data/data.cpp" line="110"/>
<source>Supported files</source>
<translation>Все поддерживаемые файлы</translation>
</message>
<message>
<location filename="../src/data/data.cpp" line="114"/>
<location filename="../src/data/data.cpp" line="112"/>
<source>CSV files</source>
<translation>CSV файлы</translation>
</message>
<message>
<location filename="../src/data/data.cpp" line="114"/>
<location filename="../src/data/data.cpp" line="112"/>
<source>FIT files</source>
<translation>FIT файлы</translation>
</message>
<message>
<location filename="../src/data/data.cpp" line="115"/>
<location filename="../src/data/data.cpp" line="113"/>
<source>GPX files</source>
<translation>GPX файлы</translation>
</message>
<message>
<location filename="../src/data/data.cpp" line="115"/>
<location filename="../src/data/data.cpp" line="113"/>
<source>IGC files</source>
<translation>IGC файлы</translation>
</message>
<message>
<location filename="../src/data/data.cpp" line="116"/>
<location filename="../src/data/data.cpp" line="114"/>
<source>KML files</source>
<translation>KML файлы</translation>
</message>
<message>
<location filename="../src/data/data.cpp" line="116"/>
<location filename="../src/data/data.cpp" line="114"/>
<source>NMEA files</source>
<translation>NMEA файлы</translation>
</message>
<message>
<location filename="../src/data/data.cpp" line="117"/>
<location filename="../src/data/data.cpp" line="115"/>
<source>OziExplorer files</source>
<translation>OziExplorer файлы</translation>
</message>
<message>
<location filename="../src/data/data.cpp" line="118"/>
<location filename="../src/data/data.cpp" line="116"/>
<source>TCX files</source>
<translation>TCX файлы</translation>
</message>
<message>
<location filename="../src/data/data.cpp" line="118"/>
<location filename="../src/data/data.cpp" line="116"/>
<source>All files</source>
<translation>Все файлы</translation>
</message>
@ -306,380 +306,380 @@
<context>
<name>GUI</name>
<message>
<location filename="../src/GUI/gui.cpp" line="592"/>
<location filename="../src/GUI/gui.cpp" line="593"/>
<source>GPXSee is distributed under the terms of the GNU General Public License version 3. For more info about GPXSee visit the project homepage at </source>
<translation>GPXSee распространяется в соответствиями с условиями версии 3 Стандартной Общественной Лицензии GNU. Для получения дополнительной информации о GPXSee посетите страницу проекта </translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="666"/>
<location filename="../src/GUI/gui.cpp" line="667"/>
<source>Open file</source>
<translation>Открыть файл</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="757"/>
<location filename="../src/GUI/gui.cpp" line="758"/>
<source>Open POI file</source>
<translation>Открыть файл с точками POI</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="199"/>
<location filename="../src/GUI/gui.cpp" line="200"/>
<source>Quit</source>
<translation>Выход</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="208"/>
<location filename="../src/GUI/gui.cpp" line="609"/>
<location filename="../src/GUI/gui.cpp" line="209"/>
<location filename="../src/GUI/gui.cpp" line="610"/>
<location filename="../src/GUI/gui.cpp" line="611"/>
<source>Keyboard controls</source>
<translation>Управление с помощью клавиатуры</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="233"/>
<location filename="../src/GUI/gui.cpp" line="234"/>
<source>Close</source>
<translation>Закрыть</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="239"/>
<location filename="../src/GUI/gui.cpp" line="240"/>
<source>Reload</source>
<translation>Обновить</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="521"/>
<location filename="../src/GUI/gui.cpp" line="522"/>
<source>Show</source>
<translation>Показать</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="515"/>
<location filename="../src/GUI/gui.cpp" line="516"/>
<source>File</source>
<translation>Файл</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="250"/>
<location filename="../src/GUI/gui.cpp" line="251"/>
<source>Close POI files</source>
<translation>Закрыть файлы с точками POI</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="252"/>
<location filename="../src/GUI/gui.cpp" line="253"/>
<source>Overlap POIs</source>
<translation>Наложение точек POI</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="256"/>
<location filename="../src/GUI/gui.cpp" line="257"/>
<source>Show POI labels</source>
<translation>Показать подписи к точкам POI</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="261"/>
<location filename="../src/GUI/gui.cpp" line="262"/>
<source>Show POIs</source>
<translation>Показать точки POI</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="270"/>
<location filename="../src/GUI/gui.cpp" line="271"/>
<source>Show map</source>
<translation>Показать карту</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="280"/>
<location filename="../src/GUI/gui.cpp" line="281"/>
<source>Clear tile cache</source>
<translation>Очистить кэш</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="217"/>
<location filename="../src/GUI/gui.cpp" line="218"/>
<source>Open...</source>
<translation>Открыть...</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="206"/>
<location filename="../src/GUI/gui.cpp" line="643"/>
<location filename="../src/GUI/gui.cpp" line="207"/>
<location filename="../src/GUI/gui.cpp" line="644"/>
<location filename="../src/GUI/gui.cpp" line="645"/>
<source>Paths</source>
<translation>Пути</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="247"/>
<location filename="../src/GUI/gui.cpp" line="248"/>
<source>Load POI file...</source>
<translation>Загрузить файл с точками POI...</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="278"/>
<location filename="../src/GUI/gui.cpp" line="279"/>
<source>Load map...</source>
<translation>Загрузить карту...</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="284"/>
<location filename="../src/GUI/gui.cpp" line="288"/>
<location filename="../src/GUI/gui.cpp" line="626"/>
<location filename="../src/GUI/gui.cpp" line="285"/>
<location filename="../src/GUI/gui.cpp" line="289"/>
<location filename="../src/GUI/gui.cpp" line="627"/>
<source>Next map</source>
<translation>Следующая карта</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="298"/>
<location filename="../src/GUI/gui.cpp" line="299"/>
<source>Show tracks</source>
<translation>Показать треки</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="302"/>
<location filename="../src/GUI/gui.cpp" line="303"/>
<source>Show routes</source>
<translation>Показать маршруты</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="306"/>
<location filename="../src/GUI/gui.cpp" line="307"/>
<source>Show waypoints</source>
<translation>Показать точки</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="310"/>
<location filename="../src/GUI/gui.cpp" line="311"/>
<source>Waypoint labels</source>
<translation>Подписи точек</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="321"/>
<location filename="../src/GUI/gui.cpp" line="322"/>
<source>Show graphs</source>
<translation>Показать графики</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="341"/>
<location filename="../src/GUI/gui.cpp" line="342"/>
<source>Show grid</source>
<translation>Показать сетку</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="345"/>
<location filename="../src/GUI/gui.cpp" line="346"/>
<source>Show slider info</source>
<translation>Показать значение на слайдере</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="351"/>
<location filename="../src/GUI/gui.cpp" line="352"/>
<source>Show toolbars</source>
<translation>Показывать панели инструментов</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="357"/>
<location filename="../src/GUI/gui.cpp" line="358"/>
<source>Total time</source>
<translation>Общее время</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="362"/>
<location filename="../src/GUI/gui.cpp" line="934"/>
<location filename="../src/GUI/gui.cpp" line="363"/>
<location filename="../src/GUI/gui.cpp" line="937"/>
<source>Moving time</source>
<translation>Время движения</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="369"/>
<location filename="../src/GUI/gui.cpp" line="370"/>
<source>Metric</source>
<translation>Метрические</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="374"/>
<location filename="../src/GUI/gui.cpp" line="375"/>
<source>Imperial</source>
<translation>Британские</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="379"/>
<location filename="../src/GUI/gui.cpp" line="380"/>
<source>Nautical</source>
<translation>Морские</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="386"/>
<location filename="../src/GUI/gui.cpp" line="387"/>
<source>Decimal degrees (DD)</source>
<translation>Десятичные градусы (DD)</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="391"/>
<location filename="../src/GUI/gui.cpp" line="392"/>
<source>Degrees and decimal minutes (DMM)</source>
<translation>Градусы, десятичные минуты (DMM)</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="397"/>
<location filename="../src/GUI/gui.cpp" line="398"/>
<source>Degrees, minutes, seconds (DMS)</source>
<translation>Градусы, минуты, секунды (DMS)</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="402"/>
<location filename="../src/GUI/gui.cpp" line="403"/>
<source>Fullscreen mode</source>
<translation>Полноэкранный режим</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="408"/>
<location filename="../src/GUI/gui.cpp" line="409"/>
<source>Options...</source>
<translation>Параметры...</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="414"/>
<location filename="../src/GUI/gui.cpp" line="415"/>
<source>Next</source>
<translation>Следующий</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="417"/>
<location filename="../src/GUI/gui.cpp" line="418"/>
<source>Previous</source>
<translation>Предыдущий</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="421"/>
<location filename="../src/GUI/gui.cpp" line="422"/>
<source>Last</source>
<translation>Последний</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="424"/>
<location filename="../src/GUI/gui.cpp" line="425"/>
<source>First</source>
<translation>Первый</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="464"/>
<location filename="../src/GUI/gui.cpp" line="465"/>
<source>POI files</source>
<translation>Файлы с точками POI</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="476"/>
<location filename="../src/GUI/gui.cpp" line="477"/>
<source>Display</source>
<translation>Отображать</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="488"/>
<location filename="../src/GUI/gui.cpp" line="489"/>
<source>Units</source>
<translation>Единицы</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="492"/>
<location filename="../src/GUI/gui.cpp" line="493"/>
<source>Coordinates format</source>
<translation>Формат координат</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="619"/>
<location filename="../src/GUI/gui.cpp" line="620"/>
<source>Append file</source>
<translation>Добавить файл</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="620"/>
<location filename="../src/GUI/gui.cpp" line="621"/>
<source>Next/Previous</source>
<translation>Next/Previous</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="622"/>
<location filename="../src/GUI/gui.cpp" line="623"/>
<source>Toggle graph type</source>
<translation>Переключить тип графика</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="624"/>
<location filename="../src/GUI/gui.cpp" line="625"/>
<source>Toggle time type</source>
<translation>Переключить тип времени</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="628"/>
<location filename="../src/GUI/gui.cpp" line="629"/>
<source>Previous map</source>
<translation>Предыдущая карта</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="629"/>
<location filename="../src/GUI/gui.cpp" line="630"/>
<source>Zoom in</source>
<translation>Увеличить</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="631"/>
<location filename="../src/GUI/gui.cpp" line="632"/>
<source>Zoom out</source>
<translation>Уменьшить</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="633"/>
<location filename="../src/GUI/gui.cpp" line="634"/>
<source>Digital zoom</source>
<translation>Цифровой зум</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="634"/>
<location filename="../src/GUI/gui.cpp" line="635"/>
<source>Zoom</source>
<translation>Zoom</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="1135"/>
<location filename="../src/GUI/gui.cpp" line="1138"/>
<source>Open map file</source>
<translation>Открыть файл карты</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="1175"/>
<location filename="../src/GUI/gui.cpp" line="1178"/>
<source>No files loaded</source>
<translation>Нет загруженных файлов</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="920"/>
<location filename="../src/GUI/gui.cpp" line="923"/>
<location filename="../src/GUI/gui.cpp" line="926"/>
<source>Date</source>
<translation>Дата</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="432"/>
<location filename="../src/GUI/gui.cpp" line="433"/>
<source>&amp;File</source>
<translation>&amp;Файл</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="446"/>
<location filename="../src/GUI/gui.cpp" line="447"/>
<source>&amp;Map</source>
<translation>&amp;Карты</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="454"/>
<location filename="../src/GUI/gui.cpp" line="455"/>
<source>&amp;Graph</source>
<translation>&amp;График</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="463"/>
<location filename="../src/GUI/gui.cpp" line="464"/>
<source>&amp;POI</source>
<translation>&amp;Точки POI</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="475"/>
<location filename="../src/GUI/gui.cpp" line="476"/>
<source>&amp;Data</source>
<translation>&amp;Данные</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="484"/>
<location filename="../src/GUI/gui.cpp" line="485"/>
<source>&amp;Settings</source>
<translation>&amp;Параметры</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="502"/>
<location filename="../src/GUI/gui.cpp" line="503"/>
<source>&amp;Help</source>
<translation>&amp;Справка</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="647"/>
<location filename="../src/GUI/gui.cpp" line="648"/>
<source>Map directory:</source>
<translation>Директория с картами:</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="649"/>
<location filename="../src/GUI/gui.cpp" line="650"/>
<source>POI directory:</source>
<translation>Директория с POI:</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="651"/>
<location filename="../src/GUI/gui.cpp" line="652"/>
<source>GCS file:</source>
<translation>GCS файл:</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="652"/>
<location filename="../src/GUI/gui.cpp" line="653"/>
<source>PCS file:</source>
<translation>PCS файл:</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="654"/>
<location filename="../src/GUI/gui.cpp" line="655"/>
<source>Ellipsoids file:</source>
<translation>Ellipsoids файл:</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="657"/>
<location filename="../src/GUI/gui.cpp" line="658"/>
<source>User override directory:</source>
<translation>Каталог пользовательских настроек:</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="912"/>
<location filename="../src/GUI/gui.cpp" line="915"/>
<source>Routes</source>
<translation>Маршруты</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="1164"/>
<location filename="../src/GUI/gui.cpp" line="1167"/>
<source>Error loading map:</source>
<translation>Ошибка загрузки карты:</translation>
</message>
<message numerus="yes">
<location filename="../src/GUI/gui.cpp" line="1179"/>
<location filename="../src/GUI/gui.cpp" line="1182"/>
<source>%n files</source>
<translation>
<numerusform>%n файл</numerusform>
@ -688,97 +688,97 @@
</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="613"/>
<location filename="../src/GUI/gui.cpp" line="614"/>
<source>Next file</source>
<translation>Следующий файл</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="589"/>
<location filename="../src/GUI/gui.cpp" line="590"/>
<source>Version </source>
<translation>Версия </translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="222"/>
<location filename="../src/GUI/gui.cpp" line="223"/>
<source>Print...</source>
<translation>Печать...</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="227"/>
<location filename="../src/GUI/gui.cpp" line="228"/>
<source>Export to PDF...</source>
<translation>Экспорт в PDF...</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="914"/>
<location filename="../src/GUI/gui.cpp" line="917"/>
<source>Waypoints</source>
<translation>Точки</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="614"/>
<location filename="../src/GUI/gui.cpp" line="615"/>
<source>Previous file</source>
<translation>Предыдущий файл</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="314"/>
<location filename="../src/GUI/gui.cpp" line="315"/>
<source>Route waypoints</source>
<translation>Маршрутные точки</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="616"/>
<location filename="../src/GUI/gui.cpp" line="617"/>
<source>First file</source>
<translation>Первый файл</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="618"/>
<location filename="../src/GUI/gui.cpp" line="619"/>
<source>Last file</source>
<translation>Последний файл</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="746"/>
<location filename="../src/GUI/gui.cpp" line="747"/>
<source>Error loading data file:</source>
<translation>Ошибка загрузки файла данных:</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="749"/>
<location filename="../src/GUI/gui.cpp" line="776"/>
<location filename="../src/GUI/gui.cpp" line="750"/>
<location filename="../src/GUI/gui.cpp" line="777"/>
<source>Line: %1</source>
<translation>Строка: %1</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="773"/>
<location filename="../src/GUI/gui.cpp" line="774"/>
<source>Error loading POI file:</source>
<translation>Ошибка загрузки файла с точками POI:</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="906"/>
<location filename="../src/GUI/gui.cpp" line="909"/>
<source>Name</source>
<translation>Имя</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="910"/>
<location filename="../src/GUI/gui.cpp" line="913"/>
<source>Tracks</source>
<translation>Треки</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="211"/>
<location filename="../src/GUI/gui.cpp" line="588"/>
<location filename="../src/GUI/gui.cpp" line="212"/>
<location filename="../src/GUI/gui.cpp" line="589"/>
<source>About GPXSee</source>
<translation>О GPXSee</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="526"/>
<location filename="../src/GUI/gui.cpp" line="527"/>
<source>Navigation</source>
<translation>Навигация</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="329"/>
<location filename="../src/GUI/gui.cpp" line="930"/>
<location filename="../src/GUI/gui.cpp" line="330"/>
<location filename="../src/GUI/gui.cpp" line="933"/>
<source>Distance</source>
<translation>Расстояние</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="335"/>
<location filename="../src/GUI/gui.cpp" line="485"/>
<location filename="../src/GUI/gui.cpp" line="932"/>
<location filename="../src/GUI/gui.cpp" line="336"/>
<location filename="../src/GUI/gui.cpp" line="486"/>
<location filename="../src/GUI/gui.cpp" line="935"/>
<source>Time</source>
<translation>Время</translation>
</message>
@ -1005,7 +1005,7 @@
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="55"/>
<location filename="../src/GUI/optionsdialog.cpp" line="466"/>
<location filename="../src/GUI/optionsdialog.cpp" line="473"/>
<source>General</source>
<translation>Общие</translation>
</message>
@ -1140,6 +1140,7 @@
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="303"/>
<location filename="../src/GUI/optionsdialog.cpp" line="437"/>
<source>s</source>
<translation>с</translation>
</message>
@ -1185,7 +1186,7 @@
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="344"/>
<location filename="../src/GUI/optionsdialog.cpp" line="470"/>
<location filename="../src/GUI/optionsdialog.cpp" line="477"/>
<source>POI</source>
<translation>Точки POI</translation>
</message>
@ -1265,33 +1266,38 @@
<translation>МБ</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="435"/>
<location filename="../src/GUI/optionsdialog.cpp" line="441"/>
<source>Image cache size:</source>
<translation>Размер кэша изображений:</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="448"/>
<location filename="../src/GUI/optionsdialog.cpp" line="473"/>
<location filename="../src/GUI/optionsdialog.cpp" line="442"/>
<source>Connection timeout:</source>
<translation>Таймаут соединения:</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="455"/>
<location filename="../src/GUI/optionsdialog.cpp" line="480"/>
<source>System</source>
<translation>Система</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="467"/>
<location filename="../src/GUI/optionsdialog.cpp" line="474"/>
<source>Appearance</source>
<translation>Внешний вид</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="469"/>
<location filename="../src/GUI/optionsdialog.cpp" line="476"/>
<source>Data</source>
<translation>Данные</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="471"/>
<location filename="../src/GUI/optionsdialog.cpp" line="478"/>
<source>Print &amp; Export</source>
<translation>Печать и экспорт</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="500"/>
<location filename="../src/GUI/optionsdialog.cpp" line="507"/>
<source>Options</source>
<translation>Параметры</translation>
</message>

View File

@ -84,7 +84,7 @@
<message>
<location filename="../src/data/data.cpp" line="117"/>
<source>OziExplorer files</source>
<translation type="unfinished"></translation>
<translation>OziExplorer-filer</translation>
</message>
<message>
<location filename="../src/data/data.cpp" line="118"/>
@ -1155,7 +1155,7 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="315"/>
<source>Filtering</source>
<translation>Filtrerar</translation>
<translation>Filtrering</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="316"/>

View File

@ -29,6 +29,7 @@ Djakarta (Batavia),4211,6211,9122,7004,8901,9603,-377,681,-50
DOS 1968,,,9122,7022,8901,9603,230,-199,-752
Easter Island 1967,4719,6719,9122,7022,8901,9603,211,147,111
Egypt,4199,6199,9122,7022,8901,9603,-130,-117,-151
EST97,4180,6180,9122,7019,8901,9603,0,0,0
ETRS 89,4258,6258,9122,7019,8901,9603,0,0,0
European 1950,4230,6230,9122,7022,8901,9603,-87,-98,-121
European 1950 (Mean France),,,9122,7022,8901,9603,-87,-96,-120

1 Adindan 4201 6201 9122 7012 8901 9603 -162 -12 206
29 DOS 1968 9122 7022 8901 9603 230 -199 -752
30 Easter Island 1967 4719 6719 9122 7022 8901 9603 211 147 111
31 Egypt 4199 6199 9122 7022 8901 9603 -130 -117 -151
32 EST97 4180 6180 9122 7019 8901 9603 0 0 0
33 ETRS 89 4258 6258 9122 7019 8901 9603 0 0 0
34 European 1950 4230 6230 9122 7022 8901 9603 -87 -98 -121
35 European 1950 (Mean France) 9122 7022 8901 9603 -87 -96 -120

View File

@ -460,6 +460,7 @@ WGS 84 / SCAR IMW ST49-52,3272,4326,17272,9001,9802,4400,8821,-90,9102,8822,120,
WGS 84 / SCAR IMW ST53-56,3273,4326,17273,9001,9802,4400,8821,-90,9102,8822,144,9102,8823,-76.4,9110,8824,-79.2,9110,8826,0,9001,8827,0,9001,,,
WGS 84 / SCAR IMW ST57-60,3274,4326,17274,9001,9802,4400,8821,-90,9102,8822,168,9102,8823,-76.4,9110,8824,-79.2,9110,8826,0,9001,8827,0,9001,,,
WGS 84 / USGS Transantarctic Mountains,3294,4326,17294,9001,9802,4400,8821,-78,9102,8822,162,9102,8823,-76.4,9110,8824,-79.2,9110,8826,0,9001,8827,0,9001,,,
Estonian Coordinate System of 1997,3301,4180,19938,9001,9802,4530,8821,57.310319415,9110,8822,24,9110,8823,59.2,9110,8824,58,9110,8826,500000,9001,8827,6375000,9001,,,
GDA94 / NSW Lambert,3308,4283,17364,9001,9802,4400,8821,-33.25,9102,8822,147,9102,8823,-30.75,9102,8824,-35.75,9102,8826,9300000,9001,8827,4500000,9001,,,
NAD27 / California Albers,3309,4267,10420,9001,9822,4499,8821,0,9102,8822,-120,9102,8823,34,9102,8824,40.5,9102,8826,0,9001,8827,-4000000,9001,,,
NAD83 / California Albers,3310,4269,10420,9001,9822,4499,8821,0,9102,8822,-120,9102,8823,34,9102,8824,40.5,9102,8826,0,9001,8827,-4000000,9001,,,

1 Hito XVIII 1963 / Argentina 2 2083 4254 18032 9001 9807 4530 8801 -90 9102 8802 -69 9102 8805 1 9201 8806 2500000 9001 8807 0 9001
460 WGS 84 / SCAR IMW ST53-56 3273 4326 17273 9001 9802 4400 8821 -90 9102 8822 144 9102 8823 -76.4 9110 8824 -79.2 9110 8826 0 9001 8827 0 9001
461 WGS 84 / SCAR IMW ST57-60 3274 4326 17274 9001 9802 4400 8821 -90 9102 8822 168 9102 8823 -76.4 9110 8824 -79.2 9110 8826 0 9001 8827 0 9001
462 WGS 84 / USGS Transantarctic Mountains 3294 4326 17294 9001 9802 4400 8821 -78 9102 8822 162 9102 8823 -76.4 9110 8824 -79.2 9110 8826 0 9001 8827 0 9001
463 Estonian Coordinate System of 1997 3301 4180 19938 9001 9802 4530 8821 57.310319415 9110 8822 24 9110 8823 59.2 9110 8824 58 9110 8826 500000 9001 8827 6375000 9001
464 GDA94 / NSW Lambert 3308 4283 17364 9001 9802 4400 8821 -33.25 9102 8822 147 9102 8823 -30.75 9102 8824 -35.75 9102 8826 9300000 9001 8827 4500000 9001
465 NAD27 / California Albers 3309 4267 10420 9001 9822 4499 8821 0 9102 8822 -120 9102 8823 34 9102 8824 40.5 9102 8826 0 9001 8827 -4000000 9001
466 NAD83 / California Albers 3310 4269 10420 9001 9822 4499 8821 0 9102 8822 -120 9102 8823 34 9102 8824 40.5 9102 8826 0 9001 8827 -4000000 9001

View File

@ -3,6 +3,7 @@ Name=GPXSee
Comment=GPS log file viewer and analyzer
Comment[cz]=Prohlížeč a analyzátor GPS logů
Comment[fi]=Ohjelma GPS-lokien katseluun ja analysointiin
Comment[pl]=Przeglądarka i analizator plików dziennika GPS
Comment[ru]=Программа для просмотра и анализа GPS логов
Comment[sv]=GPS-loggfilsläsare och analysator
Exec=gpxsee %F

View File

@ -5,7 +5,7 @@
; The name of the installer
Name "GPXSee"
; Program version
!define VERSION "5.7"
!define VERSION "5.10"
; The file to write
OutFile "GPXSee-${VERSION}.exe"
@ -230,6 +230,11 @@ SectionGroup "Localization" SEC_LOCALIZATION
File /oname=translations\gpxsee_de.qm translations\gpxsee_de.qm
File /oname=translations\qt_de.qm translations\qt_de.qm
SectionEnd
Section "Polish"
CreateDirectory "$INSTDIR\translations"
File /oname=translations\gpxsee_pl.qm translations\gpxsee_pl.qm
File /oname=translations\qt_pl.qm translations\qt_pl.qm
SectionEnd
Section "Russian"
CreateDirectory "$INSTDIR\translations"
File /oname=translations\gpxsee_ru.qm translations\gpxsee_ru.qm

View File

@ -5,7 +5,7 @@
; The name of the installer
Name "GPXSee"
; Program version
!define VERSION "5.7"
!define VERSION "5.10"
; The file to write
OutFile "GPXSee-${VERSION}_x64.exe"
@ -232,6 +232,11 @@ SectionGroup "Localization" SEC_LOCALIZATION
File /oname=translations\gpxsee_de.qm translations\gpxsee_de.qm
File /oname=translations\qt_de.qm translations\qt_de.qm
SectionEnd
Section "Polish"
CreateDirectory "$INSTDIR\translations"
File /oname=translations\gpxsee_pl.qm translations\gpxsee_pl.qm
File /oname=translations\qt_pl.qm translations\qt_pl.qm
SectionEnd
Section "Russian"
CreateDirectory "$INSTDIR\translations"
File /oname=translations\gpxsee_ru.qm translations\gpxsee_ru.qm
@ -312,4 +317,4 @@ LangString DESC_LOCALIZATION ${LANG_ENGLISH} \
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_LOCALIZATION} $(DESC_LOCALIZATION)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
!insertmacro MUI_FUNCTION_DESCRIPTION_END

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<map xmlns="http://www.gpxsee.org/map/1">
<name>USGS Imagery</name>
<url>https://navigator.er.usgs.gov/tiles/aerial_Imagery.cgi/$z/$x/$y</url>
<url>https://basemap.nationalmap.gov/ArcGIS/rest/services/USGSImageryOnly/MapServer/tile/$z/$y/$x</url>
<copyright>Map services and data available from U.S. Geological Survey, National Geospatial Program.</copyright>
<zoom min="2" max="15"/>
<bounds bottom="0" top="74"/>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<map xmlns="http://www.gpxsee.org/map/1">
<name>USGS Topo</name>
<url>https://navigator.er.usgs.gov/tiles/tcr.cgi/$z/$x/$y.png</url>
<url>https://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/$z/$y/$x</url>
<copyright>Map services and data available from U.S. Geological Survey, National Geospatial Program.</copyright>
<zoom min="2" max="15"/>
</map>

View File

@ -3,10 +3,8 @@
#include <QLocale>
#include <QFileOpenEvent>
#include <QNetworkProxyFactory>
#include <QNetworkAccessManager>
#include <QLibraryInfo>
#include "map/wmts.h"
#include "map/wms.h"
#include "map/tileloader.h"
#include "map/downloader.h"
#include "map/ellipsoid.h"
#include "map/gcs.h"
@ -38,10 +36,7 @@ App::App(int &argc, char **argv) : QApplication(argc, argv),
#endif // Q_OS_MAC
QNetworkProxyFactory::setUseSystemConfiguration(true);
Downloader *dl = new Downloader(this);
TileLoader::setDownloader(dl);
WMTS::setDownloader(dl);
WMS::setDownloader(dl);
Downloader::setNetworkAccessManager(new QNetworkAccessManager(this));
OPENGL_SET_SAMPLES(4);
loadDatums();
loadPCSs();

View File

@ -24,28 +24,33 @@ void CadenceGraph::setInfo()
clearInfo();
}
void CadenceGraph::loadData(const Data &data, const QList<PathItem *> &paths)
QList<GraphItem*> CadenceGraph::loadData(const Data &data)
{
QList<GraphItem*> graphs;
for (int i = 0; i < data.tracks().count(); i++) {
const Graph &graph = data.tracks().at(i)->cadence();
if (graph.size() < 2) {
skipColor();
continue;
graphs.append(0);
} else {
CadenceGraphItem *gi = new CadenceGraphItem(graph, _graphType);
GraphView::addGraph(gi);
_avg.append(QPointF(data.tracks().at(i)->distance(), gi->avg()));
graphs.append(gi);
}
CadenceGraphItem *gi = new CadenceGraphItem(graph, _graphType);
GraphView::addGraph(gi, paths.at(i));
_avg.append(QPointF(data.tracks().at(i)->distance(), gi->avg()));
}
for (int i = 0; i < data.routes().count(); i++)
for (int i = 0; i < data.routes().count(); i++) {
skipColor();
graphs.append(0);
}
setInfo();
redraw();
return graphs;
}
qreal CadenceGraph::avg() const

View File

@ -11,7 +11,7 @@ public:
CadenceGraph(QWidget *parent = 0);
QString label() const {return tr("Cadence");}
void loadData(const Data &data, const QList<PathItem *> &paths);
QList<GraphItem*> loadData(const Data &data);
void clear();
void showTracks(bool show);
void showRoutes(bool show) {Q_UNUSED(show);}

View File

@ -65,15 +65,15 @@ void ElevationGraph::setInfo()
}
}
void ElevationGraph::loadGraph(const Graph &graph, Type type, PathItem *path)
GraphItem *ElevationGraph::loadGraph(const Graph &graph, Type type)
{
if (graph.size() < 2) {
skipColor();
return;
return 0;
}
ElevationGraphItem *gi = new ElevationGraphItem(graph, _graphType);
GraphView::addGraph(gi, path, type);
GraphView::addGraph(gi, type);
if (type == Track) {
_trackAscent += gi->ascent();
@ -86,20 +86,23 @@ void ElevationGraph::loadGraph(const Graph &graph, Type type, PathItem *path)
_routeMax = nMax(_routeMax, gi->max());
_routeMin = nMin(_routeMin, gi->min());
}
return gi;
}
void ElevationGraph::loadData(const Data &data, const QList<PathItem *> &paths)
QList<GraphItem*> ElevationGraph::loadData(const Data &data)
{
int p = 0;
QList<GraphItem*> graphs;
for (int i = 0; i < data.tracks().count(); i++)
loadGraph(data.tracks().at(i)->elevation(), Track, paths.at(p++));
graphs.append(loadGraph(data.tracks().at(i)->elevation(), Track));
for (int i = 0; i < data.routes().count(); i++)
loadGraph(data.routes().at(i)->elevation(), Route, paths.at(p++));
graphs.append(loadGraph(data.routes().at(i)->elevation(), Route));
setInfo();
redraw();
return graphs;
}
void ElevationGraph::clear()

View File

@ -11,7 +11,7 @@ public:
ElevationGraph(QWidget *parent = 0);
QString label() const {return tr("Elevation");}
void loadData(const Data &data, const QList<PathItem *> &paths);
QList<GraphItem*> loadData(const Data &data);
void clear();
void setUnits(enum Units units);
void showTracks(bool show);
@ -28,7 +28,7 @@ private:
void setYUnits(Units units);
void setInfo();
void loadGraph(const Graph &graph, Type type, PathItem *path);
GraphItem *loadGraph(const Graph &graph, Type type);
qreal _trackAscent, _trackDescent;
qreal _routeAscent, _routeDescent;

View File

@ -42,9 +42,9 @@ ExportDialog::ExportDialog(Export *exp, QWidget *parent)
_paperSize->setCurrentIndex(index);
_resolution = new QComboBox();
_resolution->addItem("150 DPI", 150);
_resolution->addItem("300 DPI", 300);
_resolution->addItem("600 DPI", 600);
_resolution->addItem("1200 DPI", 1200);
if ((index = _resolution->findData(_export->resolution)) >= 0)
_resolution->setCurrentIndex(index);

View File

@ -7,7 +7,7 @@
#include "timetype.h"
class Data;
class PathItem;
class GraphItem;
class GraphTab : public GraphView
{
@ -19,7 +19,7 @@ public:
virtual ~GraphTab() {}
virtual QString label() const = 0;
virtual void loadData(const Data &data, const QList<PathItem *> &paths) = 0;
virtual QList<GraphItem*> loadData(const Data &data) = 0;
virtual void clear() {GraphView::clear();}
virtual void setUnits(enum Units units) {GraphView::setUnits(units);}
virtual void setGraphType(GraphType type) {GraphView::setGraphType(type);}

View File

@ -187,7 +187,7 @@ void GraphView::showSliderInfo(bool show)
_sliderInfo->setVisible(show);
}
void GraphView::addGraph(GraphItem *graph, PathItem *path, int id)
void GraphView::addGraph(GraphItem *graph, int id)
{
QColor color(_palette.nextColor());
color.setAlpha(255);
@ -199,10 +199,6 @@ void GraphView::addGraph(GraphItem *graph, PathItem *path, int id)
connect(this, SIGNAL(sliderPositionChanged(qreal)), graph,
SLOT(emitSliderPositionChanged(qreal)));
connect(graph, SIGNAL(sliderPositionChanged(qreal)), path,
SLOT(moveMarker(qreal)));
connect(path, SIGNAL(selected(bool)), graph, SLOT(hover(bool)));
connect(graph, SIGNAL(selected(bool)), path, SLOT(hover(bool)));
_graphs.append(graph);

View File

@ -44,7 +44,7 @@ signals:
void sliderPositionChanged(qreal);
protected:
void addGraph(GraphItem *graph, PathItem *path, int id = 0);
void addGraph(GraphItem *graph, int id = 0);
void showGraph(bool show, int id = 0);
void setGraphType(GraphType type);

View File

@ -25,6 +25,7 @@
#include "data/data.h"
#include "map/maplist.h"
#include "map/emptymap.h"
#include "map/downloader.h"
#include "config.h"
#include "icons.h"
#include "keys.h"
@ -40,6 +41,8 @@
#include "filebrowser.h"
#include "cpuarch.h"
#include "graphtab.h"
#include "graphitem.h"
#include "pathitem.h"
#include "gui.h"
@ -57,15 +60,15 @@ GUI::GUI()
createBrowser();
QSplitter *splitter = new QSplitter();
splitter->setOrientation(Qt::Vertical);
splitter->setChildrenCollapsible(false);
splitter->addWidget(_mapView);
splitter->addWidget(_graphTabWidget);
splitter->setContentsMargins(0, 0, 0, 0);
splitter->setStretchFactor(0, 255);
splitter->setStretchFactor(1, 1);
setCentralWidget(splitter);
_splitter = new QSplitter();
_splitter->setOrientation(Qt::Vertical);
_splitter->setChildrenCollapsible(false);
_splitter->addWidget(_mapView);
_splitter->addWidget(_graphTabWidget);
_splitter->setContentsMargins(0, 0, 0, 0);
_splitter->setStretchFactor(0, 255);
_splitter->setStretchFactor(1, 1);
setCentralWidget(_splitter);
setWindowIcon(QIcon(QPixmap(APP_ICON)));
setWindowTitle(APP_NAME);
@ -687,8 +690,6 @@ bool GUI::openFile(const QString &fileName)
updateNavigationActions();
updateStatusBarInfo();
updateWindowTitle();
updateGraphTabs();
updateMapView();
return true;
} else {
@ -702,13 +703,10 @@ bool GUI::openFile(const QString &fileName)
bool GUI::loadFile(const QString &fileName)
{
Data data;
QList<QList<GraphItem*> > graphs;
QList<PathItem*> paths;
if (data.loadFile(fileName)) {
paths = _mapView->loadData(data);
for (int i = 0; i < _tabs.count(); i++)
_tabs.at(i)->loadData(data, paths);
for (int i = 0; i < data.tracks().count(); i++) {
_trackDistance += data.tracks().at(i)->distance();
_time += data.tracks().at(i)->time();
@ -735,6 +733,25 @@ bool GUI::loadFile(const QString &fileName)
} else
_pathName = QString();
for (int i = 0; i < _tabs.count(); i++)
graphs.append(_tabs.at(i)->loadData(data));
if (updateGraphTabs() | updateMapView())
_splitter->refresh();
paths = _mapView->loadData(data);
for (int i = 0; i < paths.count(); i++) {
const PathItem *pi = paths.at(i);
for (int j = 0; j < graphs.count(); j++) {
const GraphItem *gi = graphs.at(j).at(i);
if (!gi)
continue;
connect(gi, SIGNAL(sliderPositionChanged(qreal)), pi,
SLOT(moveMarker(qreal)));
connect(pi, SIGNAL(selected(bool)), gi, SLOT(hover(bool)));
connect(gi, SIGNAL(selected(bool)), pi, SLOT(hover(bool)));
}
}
return true;
} else {
updateNavigationActions();
@ -855,6 +872,8 @@ void GUI::openOptions()
_poi->setRadius(options.poiRadius);
if (options.pixmapCache != _options.pixmapCache)
QPixmapCache::setCacheLimit(options.pixmapCache * 1024);
if (options.connectionTimeout != _options.connectionTimeout)
Downloader::setTimeout(options.connectionTimeout);
if (reload)
reloadFile();
@ -1007,8 +1026,6 @@ void GUI::reloadFile()
updateStatusBarInfo();
updateWindowTitle();
updateGraphTabs();
updateMapView();
if (_files.isEmpty())
_fileActionGroup->setEnabled(false);
else
@ -1273,10 +1290,11 @@ void GUI::updateNavigationActions()
}
}
void GUI::updateGraphTabs()
bool GUI::updateGraphTabs()
{
int index;
GraphTab *tab;
bool hidden = _graphTabWidget->isHidden();
for (int i = 0; i < _tabs.size(); i++) {
tab = _tabs.at(i);
@ -1300,14 +1318,20 @@ void GUI::updateGraphTabs()
_graphTabWidget->setHidden(true);
_showGraphsAction->setEnabled(false);
}
return (hidden != _graphTabWidget->isHidden());
}
void GUI::updateMapView()
bool GUI::updateMapView()
{
bool hidden = _mapView->isHidden();
if (_options.alwaysShowMap)
_mapView->setHidden(false);
else
_mapView->setHidden(!(_trackCount + _routeCount + _waypointCount));
return (hidden != _mapView->isHidden());
}
void GUI::setTimeType(TimeType type)
@ -1620,6 +1644,8 @@ void GUI::writeSettings()
settings.setValue(USE_OPENGL_SETTING, _options.useOpenGL);
if (_options.pixmapCache != PIXMAP_CACHE_DEFAULT)
settings.setValue(PIXMAP_CACHE_SETTING, _options.pixmapCache);
if (_options.connectionTimeout != CONNECTION_TIMEOUT_DEFAULT)
settings.setValue(CONNECTION_TIMEOUT_SETTING, _options.connectionTimeout);
if (_options.hiresPrint != HIRES_PRINT_DEFAULT)
settings.setValue(HIRES_PRINT_SETTING, _options.hiresPrint);
if (_options.printName != PRINT_NAME_DEFAULT)
@ -1848,6 +1874,8 @@ void GUI::readSettings()
.toBool();
_options.pixmapCache = settings.value(PIXMAP_CACHE_SETTING,
PIXMAP_CACHE_DEFAULT).toInt();
_options.connectionTimeout = settings.value(CONNECTION_TIMEOUT_SETTING,
CONNECTION_TIMEOUT_DEFAULT).toInt();
_options.hiresPrint = settings.value(HIRES_PRINT_SETTING,
HIRES_PRINT_DEFAULT).toBool();
_options.printName = settings.value(PRINT_NAME_SETTING, PRINT_NAME_DEFAULT)
@ -1907,6 +1935,7 @@ void GUI::readSettings()
_poi->setRadius(_options.poiRadius);
QPixmapCache::setCacheLimit(_options.pixmapCache * 1024);
Downloader::setTimeout(_options.connectionTimeout);
settings.endGroup();
}

View File

@ -20,6 +20,7 @@ class QTabWidget;
class QActionGroup;
class QAction;
class QLabel;
class QSplitter;
class QSignalMapper;
class QPrinter;
class FileBrowser;
@ -109,8 +110,8 @@ private:
void updateStatusBarInfo();
void updateWindowTitle();
void updateNavigationActions();
void updateGraphTabs();
void updateMapView();
bool updateGraphTabs();
bool updateMapView();
TimeType timeType() const;
Units units() const;
@ -196,6 +197,7 @@ private:
QLabel *_distanceLabel;
QLabel *_timeLabel;
QSplitter *_splitter;
MapView *_mapView;
QTabWidget *_graphTabWidget;
QList<GraphTab*> _tabs;

View File

@ -24,28 +24,33 @@ void HeartRateGraph::setInfo()
clearInfo();
}
void HeartRateGraph::loadData(const Data &data, const QList<PathItem *> &paths)
QList<GraphItem*> HeartRateGraph::loadData(const Data &data)
{
QList<GraphItem*> graphs;
for (int i = 0; i < data.tracks().count(); i++) {
const Graph &graph = data.tracks().at(i)->heartRate();
if (graph.size() < 2) {
skipColor();
continue;
graphs.append(0);
} else {
HeartRateGraphItem *gi = new HeartRateGraphItem(graph, _graphType);
GraphView::addGraph(gi);
_avg.append(QPointF(data.tracks().at(i)->distance(), gi->avg()));
graphs.append(gi);
}
HeartRateGraphItem *gi = new HeartRateGraphItem(graph, _graphType);
GraphView::addGraph(gi, paths.at(i));
_avg.append(QPointF(data.tracks().at(i)->distance(), gi->avg()));
}
for (int i = 0; i < data.routes().count(); i++)
for (int i = 0; i < data.routes().count(); i++) {
skipColor();
graphs.append(0);
}
setInfo();
redraw();
return graphs;
}
qreal HeartRateGraph::avg() const

View File

@ -11,7 +11,7 @@ public:
HeartRateGraph(QWidget *parent = 0);
QString label() const {return tr("Heart rate");}
void loadData(const Data &data, const QList<PathItem *> &paths);
QList<GraphItem*> loadData(const Data &data);
void clear();
void showTracks(bool show);

View File

@ -9,10 +9,8 @@
#define FIRST_KEY Qt::Key_Home
#define LAST_KEY Qt::Key_End
#define MODIFIER Qt::ShiftModifier
#define ZOOM_IN QKeySequence::ZoomIn
#define ZOOM_OUT QKeySequence::ZoomOut
#define ZOOM_IN Qt::Key_Plus
#define ZOOM_OUT Qt::Key_Minus
#define TOGGLE_GRAPH_TYPE_KEY Qt::Key_X
#define TOGGLE_TIME_TYPE_KEY Qt::Key_T

View File

@ -287,7 +287,9 @@ void MapView::setMap(Map *map)
it.value()->setMap(_map);
updatePOIVisibility();
centerOn(_map->ll2xy(cr.center()));
QPointF nc = QRectF(_map->ll2xy(cr.topLeft()),
_map->ll2xy(cr.bottomRight())).center();
centerOn(nc);
resetCachedContent();
QPixmapCache::clear();
@ -419,7 +421,7 @@ void MapView::digitalZoom(int zoom)
_mapScale->setDigitalZoom(_digitalZoom);
}
void MapView::zoom(int zoom, const QPoint &pos, const Coordinates &c)
void MapView::zoom(int zoom, const QPoint &pos)
{
bool shift = QApplication::keyboardModifiers() & Qt::ShiftModifier;
@ -431,9 +433,9 @@ void MapView::zoom(int zoom, const QPoint &pos, const Coordinates &c)
digitalZoom(zoom);
} else {
qreal os, ns;
os = _map->zoom();
ns = (zoom > 0) ? _map->zoomIn() : _map->zoomOut();
Coordinates c = _map->xy2ll(mapToScene(pos));
qreal os = _map->zoom();
qreal ns = (zoom > 0) ? _map->zoomIn() : _map->zoomOut();
if (ns != os) {
rescale();
@ -454,8 +456,7 @@ void MapView::wheelEvent(QWheelEvent *event)
return;
deg = 0;
Coordinates c = _map->xy2ll(mapToScene(event->pos()));
zoom((event->delta() > 0) ? 1 : -1, event->pos(), c);
zoom((event->delta() > 0) ? 1 : -1, event->pos());
}
void MapView::mouseDoubleClickEvent(QMouseEvent *event)
@ -463,8 +464,7 @@ void MapView::mouseDoubleClickEvent(QMouseEvent *event)
if (event->button() != Qt::LeftButton && event->button() != Qt::RightButton)
return;
Coordinates c = _map->xy2ll(mapToScene(event->pos()));
zoom((event->button() == Qt::LeftButton) ? 1 : -1, event->pos(), c);
zoom((event->button() == Qt::LeftButton) ? 1 : -1, event->pos());
}
void MapView::keyPressEvent(QKeyEvent *event)
@ -472,11 +472,10 @@ void MapView::keyPressEvent(QKeyEvent *event)
int z;
QPoint pos = viewport()->rect().center();
Coordinates c = _map->xy2ll(mapToScene(pos));
if (event->matches(ZOOM_IN))
if (event->key() == ZOOM_IN)
z = 1;
else if (event->matches(ZOOM_OUT))
else if (event->key() == ZOOM_OUT)
z = -1;
else if (_digitalZoom && event->key() == Qt::Key_Escape) {
digitalZoom(0);
@ -486,7 +485,7 @@ void MapView::keyPressEvent(QKeyEvent *event)
return;
}
zoom(z, pos, c);
zoom(z, pos);
}
void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
@ -495,13 +494,12 @@ void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
QRect orig, adj;
qreal ratio, diff, q;
QPointF origScene, origPos;
RectC origC;
int zoom;
// Enter plot mode
setUpdatesEnabled(false);
_plot = true;
_map->setBlockingMode(true);
// Compute sizes & ratios
orig = viewport()->rect();
@ -520,8 +518,8 @@ void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
// Adjust the view for printing
if (hires) {
zoom = _map->zoom();
QRectF vr(mapToScene(orig).boundingRect());
origC = RectC(_map->xy2ll(vr.topLeft()), _map->xy2ll(vr.bottomRight()));
origScene = vr.center();
QPointF s(painter->device()->logicalDpiX()
@ -536,12 +534,12 @@ void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
centerOn(center);
adj.moveCenter(mapFromScene(center));
_mapScale->setDigitalZoom(-log2(s.x() / q));
_mapScale->setDigitalZoom(_digitalZoom - log2(s.x() / q));
_mapScale->setPos(mapToScene(QPoint(adj.bottomRight() + QPoint(
-(SCALE_OFFSET + _mapScale->boundingRect().width()) * (s.x() / q),
-(SCALE_OFFSET + _mapScale->boundingRect().height()) * (s.x() / q)))));
} else {
_mapScale->setDigitalZoom(-log2(1.0 / q));
_mapScale->setDigitalZoom(_digitalZoom - log2(1.0 / q));
_mapScale->setPos(mapToScene(QPoint(adj.bottomRight() + QPoint(
-(SCALE_OFFSET + _mapScale->boundingRect().width()) / q ,
-(SCALE_OFFSET + _mapScale->boundingRect().height()) / q))));
@ -552,15 +550,14 @@ void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
// Revert view changes to display mode
if (hires) {
_map->zoomFit(orig.size(), origC);
_map->setZoom(zoom);
rescale();
centerOn(origScene);
}
_mapScale->setDigitalZoom(0);
_mapScale->setDigitalZoom(_digitalZoom);
_mapScale->setPos(origPos);
// Exit plot mode
_map->setBlockingMode(false);
_plot = false;
setUpdatesEnabled(true);
}
@ -761,7 +758,7 @@ void MapView::drawBackground(QPainter *painter, const QRectF &rect)
QRectF ir = rect.intersected(_map->bounds());
if (_opacity < 1.0)
painter->setOpacity(_opacity);
_map->draw(painter, ir);
_map->draw(painter, ir, _plot);
}
}

View File

@ -22,6 +22,7 @@ class RouteItem;
class WaypointItem;
class ScaleItem;
class PathItem;
class GraphItem;
class MapView : public QGraphicsView
{
@ -30,7 +31,7 @@ class MapView : public QGraphicsView
public:
MapView(Map *map, POI *poi, QWidget *parent = 0);
QList<PathItem*> loadData(const Data &data);
QList<PathItem *> loadData(const Data &data);
void setPalette(const Palette &palette);
void setPOI(POI *poi);
@ -84,7 +85,7 @@ private:
QPointF contentCenter() const;
void rescale();
void centerOn(const QPointF &pos);
void zoom(int zoom, const QPoint &pos, const Coordinates &c);
void zoom(int zoom, const QPoint &pos);
void digitalZoom(int zoom);
void updatePOIVisibility();

View File

@ -431,16 +431,23 @@ QWidget *OptionsDialog::createSystemPage()
_pixmapCache->setSuffix(UNIT_SPACE + tr("MB"));
_pixmapCache->setValue(_options->pixmapCache);
QFormLayout *cacheLayout = new QFormLayout();
cacheLayout->addRow(tr("Image cache size:"), _pixmapCache);
_connectionTimeout = new QSpinBox();
_connectionTimeout->setMinimum(30);
_connectionTimeout->setMaximum(120);
_connectionTimeout->setSuffix(UNIT_SPACE + tr("s"));
_connectionTimeout->setValue(_options->connectionTimeout);
QFormLayout *openGLLayout = new QFormLayout();
openGLLayout->addWidget(_useOpenGL);
QFormLayout *formLayout = new QFormLayout();
formLayout->addRow(tr("Image cache size:"), _pixmapCache);
formLayout->addRow(tr("Connection timeout:"), _connectionTimeout);
QFormLayout *checkboxLayout = new QFormLayout();
checkboxLayout->addWidget(_useOpenGL);
QWidget *systemTab = new QWidget();
QVBoxLayout *systemTabLayout = new QVBoxLayout();
systemTabLayout->addLayout(cacheLayout);
systemTabLayout->addLayout(openGLLayout);
systemTabLayout->addLayout(formLayout);
systemTabLayout->addLayout(checkboxLayout);
systemTabLayout->addStretch();
systemTab->setLayout(systemTabLayout);
@ -545,6 +552,7 @@ void OptionsDialog::accept()
_options->useOpenGL = _useOpenGL->isChecked();
_options->pixmapCache = _pixmapCache->value();
_options->connectionTimeout = _connectionTimeout->value();
_options->hiresPrint = _hires->isChecked();
_options->printName = _name->isChecked();

View File

@ -48,6 +48,7 @@ struct Options {
// System
bool useOpenGL;
int pixmapCache;
int connectionTimeout;
// Print/Export
bool hiresPrint;
bool printName;
@ -113,6 +114,7 @@ private:
QDoubleSpinBox *_poiRadius;
// System
QSpinBox *_pixmapCache;
QSpinBox *_connectionTimeout;
QCheckBox *_useOpenGL;
// Print/Export
QRadioButton *_wysiwyg;

View File

@ -24,28 +24,33 @@ void PowerGraph::setInfo()
clearInfo();
}
void PowerGraph::loadData(const Data &data, const QList<PathItem *> &paths)
QList<GraphItem*> PowerGraph::loadData(const Data &data)
{
QList<GraphItem*> graphs;
for (int i = 0; i < data.tracks().count(); i++) {
const Graph &graph = data.tracks().at(i)->power();
if (graph.size() < 2) {
skipColor();
continue;
graphs.append(0);
} else {
PowerGraphItem *gi = new PowerGraphItem(graph, _graphType);
GraphView::addGraph(gi);
_avg.append(QPointF(data.tracks().at(i)->distance(), gi->avg()));
graphs.append(gi);
}
PowerGraphItem *gi = new PowerGraphItem(graph, _graphType);
GraphView::addGraph(gi, paths.at(i));
_avg.append(QPointF(data.tracks().at(i)->distance(), gi->avg()));
}
for (int i = 0; i < data.routes().count(); i++)
for (int i = 0; i < data.routes().count(); i++) {
skipColor();
graphs.append(0);
}
setInfo();
redraw();
return graphs;
}
qreal PowerGraph::avg() const

View File

@ -11,7 +11,7 @@ public:
PowerGraph(QWidget *parent = 0);
QString label() const {return tr("Power");}
void loadData(const Data &data, const QList<PathItem *> &paths);
QList<GraphItem*> loadData(const Data &data);
void clear();
void showTracks(bool show);

View File

@ -130,6 +130,8 @@
#define USE_OPENGL_DEFAULT false
#define PIXMAP_CACHE_SETTING "pixmapCache"
#define PIXMAP_CACHE_DEFAULT 64 /* MB */
#define CONNECTION_TIMEOUT_SETTING "connectionTimeout"
#define CONNECTION_TIMEOUT_DEFAULT 30 /* s */
#define HIRES_PRINT_SETTING "hiresPrint"
#define HIRES_PRINT_DEFAULT false
#define PRINT_NAME_SETTING "printName"

View File

@ -34,32 +34,37 @@ void SpeedGraph::setInfo()
clearInfo();
}
void SpeedGraph::loadData(const Data &data, const QList<PathItem *> &paths)
QList<GraphItem*> SpeedGraph::loadData(const Data &data)
{
QList<GraphItem*> graphs;
for (int i = 0; i < data.tracks().count(); i++) {
const Track *track = data.tracks().at(i);
const Graph &graph = track->speed();
if (graph.size() < 2) {
skipColor();
continue;
graphs.append(0);
} else {
SpeedGraphItem *gi = new SpeedGraphItem(graph, _graphType,
track->movingTime());
gi->setTimeType(_timeType);
GraphView::addGraph(gi);
_avg.append(QPointF(track->distance(), gi->avg()));
_mavg.append(QPointF(track->distance(), gi->mavg()));
graphs.append(gi);
}
SpeedGraphItem *gi = new SpeedGraphItem(graph, _graphType,
track->movingTime());
gi->setTimeType(_timeType);
GraphView::addGraph(gi, paths.at(i));
_avg.append(QPointF(track->distance(), gi->avg()));
_mavg.append(QPointF(track->distance(), gi->mavg()));
}
for (int i = 0; i < data.routes().count(); i++)
for (int i = 0; i < data.routes().count(); i++) {
skipColor();
graphs.append(0);
}
setInfo();
redraw();
return graphs;
}
qreal SpeedGraph::avg() const

View File

@ -12,7 +12,7 @@ public:
SpeedGraph(QWidget *parent = 0);
QString label() const {return tr("Speed");}
void loadData(const Data &data, const QList<PathItem *> &paths);
QList<GraphItem*> loadData(const Data &data);
void clear();
void setUnits(Units units);
void setTimeType(TimeType type);

View File

@ -26,28 +26,34 @@ void TemperatureGraph::setInfo()
clearInfo();
}
void TemperatureGraph::loadData(const Data &data, const QList<PathItem *> &paths)
QList<GraphItem*> TemperatureGraph::loadData(const Data &data)
{
QList<GraphItem*> graphs;
for (int i = 0; i < data.tracks().count(); i++) {
const Graph &graph = data.tracks().at(i)->temperature();
if (graph.size() < 2) {
skipColor();
continue;
graphs.append(0);
} else {
TemperatureGraphItem *gi = new TemperatureGraphItem(graph,
_graphType);
GraphView::addGraph(gi);
_avg.append(QPointF(data.tracks().at(i)->distance(), gi->avg()));
graphs.append(gi);
}
TemperatureGraphItem *gi = new TemperatureGraphItem(graph, _graphType);
GraphView::addGraph(gi, paths.at(i));
_avg.append(QPointF(data.tracks().at(i)->distance(), gi->avg()));
}
for (int i = 0; i < data.routes().count(); i++)
for (int i = 0; i < data.routes().count(); i++) {
skipColor();
graphs.append(0);
}
setInfo();
redraw();
return graphs;
}
qreal TemperatureGraph::avg() const

View File

@ -11,7 +11,7 @@ public:
TemperatureGraph(QWidget *parent = 0);
QString label() const {return tr("Temperature");}
void loadData(const Data &data, const QList<PathItem *> &paths);
QList<GraphItem*> loadData(const Data &data);
void clear();
void setUnits(enum Units units);
void showTracks(bool show);

View File

@ -190,6 +190,7 @@ bool GPXParser::parse(QFile *file, QList<TrackData> &tracks,
{
_reader.clear();
_reader.setDevice(file);
_reader.setNamespaceProcessing(false);
if (_reader.readNextStartElement()) {
if (_reader.name() == "gpx")

View File

@ -36,13 +36,13 @@ void Atlas::computeZooms()
{
qSort(_maps.begin(), _maps.end(), resCmp);
_zooms.append(QPair<int, int>(0, _maps.count() - 1));
_zooms.append(Zoom(0, _maps.count() - 1));
for (int i = 1; i < _maps.count(); i++) {
qreal last = _maps.at(i-1)->resolution(_maps.at(i)->bounds());
qreal cur = _maps.at(i)->resolution(_maps.at(i)->bounds());
if (cur < last * ZOOM_THRESHOLD) {
_zooms.last().second = i-1;
_zooms.append(QPair<int, int>(i, _maps.count() - 1));
_zooms.last().last = i-1;
_zooms.append(Zoom(i, _maps.count() - 1));
}
}
}
@ -56,7 +56,7 @@ void Atlas::computeBounds()
for (int z = 0; z < _zooms.count(); z++) {
QList<OfflineMap*> m;
for (int i = _zooms.at(z).first; i <= _zooms.at(z).second; i++)
for (int i = _zooms.at(z).first; i <= _zooms.at(z).last; i++)
m.append(_maps.at(i));
qSort(m.begin(), m.end(), xCmp);
@ -75,9 +75,8 @@ void Atlas::computeBounds()
}
for (int i = 0; i < _maps.count(); i++)
_bounds.append(QPair<QRectF, QRectF>(QRectF(TL(_maps.at(i)).toPointF(),
BR(_maps.at(i)).toPointF()), QRectF(offsets.at(i),
_maps.at(i)->bounds().size())));
_bounds.append(Bounds(RectD(TL(_maps.at(i)), BR(_maps.at(i))),
QRectF(offsets.at(i), _maps.at(i)->bounds().size())));
}
Atlas::Atlas(const QString &fileName, QObject *parent)
@ -152,11 +151,11 @@ QRectF Atlas::bounds() const
{
QSizeF s(0, 0);
for (int i = _zooms.at(_zoom).first; i <= _zooms.at(_zoom).second; i++) {
if (_bounds.at(i).second.right() > s.width())
s.setWidth(_bounds.at(i).second.right());
if (_bounds.at(i).second.bottom() > s.height())
s.setHeight(_bounds.at(i).second.bottom());
for (int i = _zooms.at(_zoom).first; i <= _zooms.at(_zoom).last; i++) {
if (_bounds.at(i).xy.right() > s.width())
s.setWidth(_bounds.at(i).xy.right());
if (_bounds.at(i).xy.bottom() > s.height())
s.setHeight(_bounds.at(i).xy.bottom());
}
return QRectF(QPointF(0, 0), s);
@ -166,9 +165,8 @@ qreal Atlas::resolution(const QRectF &rect) const
{
int idx = _zooms.at(_zoom).first;
for (int i = _zooms.at(_zoom).first; i <= _zooms.at(_zoom).second; i++) {
if (_bounds.at(i).second.contains(_maps.at(i)->xy2pp(rect.center())
.toPointF())) {
for (int i = _zooms.at(_zoom).first; i <= _zooms.at(_zoom).last; i++) {
if (_bounds.at(i).xy.contains(rect.center())) {
idx = i;
break;
}
@ -188,9 +186,8 @@ int Atlas::zoomFit(const QSize &size, const RectC &br)
}
for (int z = 0; z < _zooms.count(); z++) {
for (int i = _zooms.at(z).first; i <= _zooms.at(z).second; i++) {
if (!_bounds.at(i).first.contains(_maps.at(i)->ll2pp(br.center())
.toPointF()))
for (int i = _zooms.at(z).first; i <= _zooms.at(z).last; i++) {
if (!_bounds.at(i).pp.contains(_maps.at(i)->ll2pp(br.center())))
continue;
QRect sbr = QRectF(_maps.at(i)->ll2xy(br.topLeft()),
@ -208,6 +205,12 @@ int Atlas::zoomFit(const QSize &size, const RectC &br)
return _zoom;
}
void Atlas::setZoom(int zoom)
{
_mapIndex = -1;
_zoom = zoom;
}
int Atlas::zoomIn()
{
_zoom = qMin(_zoom + 1, _zooms.size() - 1);
@ -226,15 +229,15 @@ int Atlas::zoomOut()
QPointF Atlas::ll2xy(const Coordinates &c)
{
QPointF pp;
PointD pp;
if (_mapIndex >= 0)
pp = _maps.at(_mapIndex)->ll2pp(c).toPointF();
if (_mapIndex < 0 || !_bounds.at(_mapIndex).first.contains(pp)) {
pp = _maps.at(_mapIndex)->ll2pp(c);
if (_mapIndex < 0 || !_bounds.at(_mapIndex).pp.contains(pp)) {
_mapIndex = _zooms.at(_zoom).first;
for (int i = _zooms.at(_zoom).first; i <= _zooms.at(_zoom).second; i++) {
pp = _maps.at(i)->ll2pp(c).toPointF();
if (_bounds.at(i).first.contains(pp)) {
for (int i = _zooms.at(_zoom).first; i <= _zooms.at(_zoom).last; i++) {
pp = _maps.at(i)->ll2pp(c);
if (_bounds.at(i).pp.contains(pp)) {
_mapIndex = i;
break;
}
@ -242,29 +245,31 @@ QPointF Atlas::ll2xy(const Coordinates &c)
}
QPointF p = _maps.at(_mapIndex)->pp2xy(pp);
return p + _bounds.at(_mapIndex).second.topLeft();
return p + _bounds.at(_mapIndex).xy.topLeft();
}
Coordinates Atlas::xy2ll(const QPointF &p)
{
int idx = _zooms.at(_zoom).first;
for (int i = _zooms.at(_zoom).first; i <= _zooms.at(_zoom).second; i++) {
if (_bounds.at(i).second.contains(_maps.at(i)->xy2pp(p).toPointF())) {
for (int i = _zooms.at(_zoom).first; i <= _zooms.at(_zoom).last; i++) {
if (_bounds.at(i).xy.contains(p)) {
idx = i;
break;
}
}
QPointF p2 = p - _bounds.at(idx).second.topLeft();
QPointF p2 = p - _bounds.at(idx).xy.topLeft();
return _maps.at(idx)->xy2ll(p2);
}
void Atlas::draw(QPainter *painter, const QRectF &rect)
void Atlas::draw(QPainter *painter, const QRectF &rect, bool block)
{
Q_UNUSED(block);
// All in one map
for (int i = _zooms.at(_zoom).first; i <= _zooms.at(_zoom).second; i++) {
if (_bounds.at(i).second.contains(rect)) {
for (int i = _zooms.at(_zoom).first; i <= _zooms.at(_zoom).last; i++) {
if (_bounds.at(i).xy.contains(rect)) {
draw(painter, rect, i);
return;
}
@ -272,8 +277,8 @@ void Atlas::draw(QPainter *painter, const QRectF &rect)
// Multiple maps
painter->fillRect(rect, _backgroundColor);
for (int i = _zooms.at(_zoom).first; i <= _zooms.at(_zoom).second; i++) {
QRectF ir = rect.intersected(_bounds.at(i).second);
for (int i = _zooms.at(_zoom).first; i <= _zooms.at(_zoom).last; i++) {
QRectF ir = rect.intersected(_bounds.at(i).xy);
if (!ir.isNull())
draw(painter, ir, i);
}
@ -282,13 +287,13 @@ void Atlas::draw(QPainter *painter, const QRectF &rect)
void Atlas::draw(QPainter *painter, const QRectF &rect, int mapIndex)
{
OfflineMap *map = _maps.at(mapIndex);
const QPointF offset = _bounds.at(mapIndex).second.topLeft();
const QPointF offset = _bounds.at(mapIndex).xy.topLeft();
QRectF pr = QRectF(rect.topLeft() - offset, rect.size());
map->load();
painter->translate(offset);
map->draw(painter, pr);
map->draw(painter, pr, true);
painter->translate(-offset);
}

View File

@ -2,6 +2,7 @@
#define ATLAS_H
#include "map.h"
#include "rectd.h"
class OfflineMap;
@ -18,6 +19,7 @@ public:
qreal resolution(const QRectF &rect) const;
int zoom() const {return _zoom;}
void setZoom(int zoom);
int zoomFit(const QSize &size, const RectC &br);
int zoomIn();
int zoomOut();
@ -25,7 +27,7 @@ public:
QPointF ll2xy(const Coordinates &c);
Coordinates xy2ll(const QPointF &p);
void draw(QPainter *painter, const QRectF &rect);
void draw(QPainter *painter, const QRectF &rect, bool block);
void unload();
@ -35,6 +37,22 @@ public:
static bool isAtlas(const QString &path);
private:
struct Zoom {
int first;
int last;
Zoom() : first(-1), last(-1) {}
Zoom(int first, int last) : first(first), last(last) {}
};
struct Bounds {
RectD pp;
QRectF xy;
Bounds() {}
Bounds(const RectD &pp, const QRectF &xy) : pp(pp), xy(xy) {}
};
void draw(QPainter *painter, const QRectF &rect, int mapIndex);
void computeZooms();
void computeBounds();
@ -42,8 +60,8 @@ private:
QString _name;
QList<OfflineMap*> _maps;
QVector<QPair<int, int> > _zooms;
QVector<QPair<QRectF, QRectF> > _bounds;
QVector<Zoom> _zooms;
QVector<Bounds> _bounds;
int _zoom;
int _mapIndex;

View File

@ -1,7 +1,6 @@
#include <QFile>
#include <QFileInfo>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QBasicTimer>
#include "config.h"
#include "downloader.h"
@ -26,7 +25,7 @@
#define ATTR_LEVEL (QNetworkRequest::Attribute)(QNetworkRequest::User + 2)
#define MAX_REDIRECT_LEVEL 5
#define TIMEOUT 30 /* s */
#define RETRIES 3
Authorization::Authorization(const QString &username, const QString &password)
@ -80,20 +79,24 @@ private:
};
Downloader::Downloader(QObject *parent) : QObject(parent)
{
connect(&_manager, SIGNAL(finished(QNetworkReply*)),
SLOT(downloadFinished(QNetworkReply*)));
}
QNetworkAccessManager *Downloader::_manager = 0;
int Downloader::_timeout = 30;
bool Downloader::doDownload(const Download &dl,
const QByteArray &authorization, const Redirect *redirect)
{
QUrl url(dl.url());
if (_errorDownloads.contains(url))
if (!url.isValid() || !(url.scheme() == "http" || url.scheme() == "https")) {
qWarning("%s: Invalid URL\n", qPrintable(url.toString()));
if (redirect)
_errorDownloads.insert(redirect->origin(), RETRIES);
return false;
if (_currentDownloads.contains(url))
}
if (_errorDownloads.value(url) >= RETRIES)
return false;
if (_currentDownloads.contains(url) && !redirect)
return false;
QNetworkRequest request(url);
@ -106,16 +109,24 @@ bool Downloader::doDownload(const Download &dl,
if (!authorization.isNull())
request.setRawHeader("Authorization", authorization);
QNetworkReply *reply = _manager.get(request);
if (reply) {
QNetworkReply *reply = _manager->get(request);
if (reply && reply->isRunning()) {
_currentDownloads.insert(url);
ReplyTimeout::setTimeout(reply, TIMEOUT);
} else
ReplyTimeout::setTimeout(reply, _timeout);
connect(reply, SIGNAL(finished()), this, SLOT(emitFinished()));
} else if (reply)
downloadFinished(reply);
else
return false;
return true;
}
void Downloader::emitFinished()
{
downloadFinished(static_cast<QNetworkReply*>(sender()));
}
bool Downloader::saveToDisk(const QString &filename, QIODevice *data)
{
QFile file(filename);
@ -132,18 +143,27 @@ bool Downloader::saveToDisk(const QString &filename, QIODevice *data)
return true;
}
void Downloader::insertError(const QUrl &url, QNetworkReply::NetworkError error)
{
if (error == QNetworkReply::OperationCanceledError)
_errorDownloads.insert(url, _errorDownloads.value(url) + 1);
else
_errorDownloads.insert(url, RETRIES);
}
void Downloader::downloadFinished(QNetworkReply *reply)
{
QUrl url = reply->request().url();
QNetworkReply::NetworkError error = reply->error();
if (reply->error()) {
if (error) {
QUrl origin = reply->request().attribute(ATTR_ORIGIN).toUrl();
if (origin.isEmpty()) {
_errorDownloads.insert(url);
insertError(url, error);
qWarning("Error downloading file: %s: %s\n",
url.toEncoded().constData(), qPrintable(reply->errorString()));
} else {
_errorDownloads.insert(origin);
insertError(origin, error);
qWarning("Error downloading file: %s -> %s: %s\n",
origin.toEncoded().constData(), url.toEncoded().constData(),
qPrintable(reply->errorString()));
@ -157,24 +177,29 @@ void Downloader::downloadFinished(QNetworkReply *reply)
QUrl origin = reply->request().attribute(ATTR_ORIGIN).toUrl();
int level = reply->request().attribute(ATTR_LEVEL).toInt();
if (location == url) {
_errorDownloads.insert(url);
if (level >= MAX_REDIRECT_LEVEL) {
_errorDownloads.insert(origin, RETRIES);
qWarning("Error downloading file: %s: "
"redirect loop\n", url.toEncoded().constData());
} else if (level >= MAX_REDIRECT_LEVEL) {
_errorDownloads.insert(origin);
qWarning("Error downloading file: %s: "
"redirect level limit reached\n",
"redirect level limit reached (redirect loop?)\n",
origin.toEncoded().constData());
} else {
QUrl redirectUrl;
if (location.isRelative()) {
QString path = QDir::isAbsolutePath(location.path())
? location.path() : "/" + location.path();
redirectUrl = QUrl(url.scheme() + "://" + url.host() + path);
} else
redirectUrl = location;
Redirect redirect(origin.isEmpty() ? url : origin, level + 1);
Download dl(location, filename);
Download dl(redirectUrl, filename);
doDownload(dl, reply->request().rawHeader("Authorization"),
&redirect);
}
} else
} else {
if (!saveToDisk(filename, reply))
_errorDownloads.insert(url);
_errorDownloads.insert(url, RETRIES);
}
}
_currentDownloads.remove(url);

View File

@ -1,12 +1,13 @@
#ifndef DOWNLOADER_H
#ifndef DOWNLOADER_H
#define DOWNLOADER_H
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QUrl>
#include <QList>
#include <QSet>
#include <QHash>
class QNetworkReply;
class Download
{
@ -38,29 +39,37 @@ class Downloader : public QObject
Q_OBJECT
public:
Downloader(QObject *parent = 0);
Downloader(QObject *parent = 0) : QObject(parent) {}
bool get(const QList<Download> &list, const Authorization &authorization
= Authorization());
void clearErrors() {_errorDownloads.clear();}
static void setTimeout(int timeout) {_timeout = timeout;}
static void setNetworkAccessManager(QNetworkAccessManager *manager)
{_manager = manager;}
signals:
void finished();
private slots:
void emitFinished();
void downloadFinished(QNetworkReply *reply);
private:
class Redirect;
class ReplyTimeout;
void insertError(const QUrl &url, QNetworkReply::NetworkError error);
bool doDownload(const Download &dl, const QByteArray &authorization,
const Redirect *redirect = 0);
bool saveToDisk(const QString &filename, QIODevice *data);
QNetworkAccessManager _manager;
QSet<QUrl> _currentDownloads;
QSet<QUrl> _errorDownloads;
QHash<QUrl, int> _errorDownloads;
static int _timeout;
static QNetworkAccessManager *_manager;
};
#endif // DOWNLOADER_H

View File

@ -85,8 +85,9 @@ int EmptyMap::zoomOut()
return _zoom;
}
void EmptyMap::draw(QPainter *painter, const QRectF &rect)
void EmptyMap::draw(QPainter *painter, const QRectF &rect, bool block)
{
Q_UNUSED(block);
painter->fillRect(rect, _backgroundColor);
}

View File

@ -16,6 +16,7 @@ public:
qreal resolution(const QRectF &rect) const;
int zoom() const {return _zoom;}
void setZoom(int zoom) {_zoom = zoom;}
int zoomFit(const QSize &size, const RectC &rect);
int zoomIn();
int zoomOut();
@ -25,7 +26,7 @@ public:
Coordinates xy2ll(const QPointF &p)
{return static_cast<const EmptyMap &>(*this).xy2ll(p);}
void draw(QPainter *painter, const QRectF &rect);
void draw(QPainter *painter, const QRectF &rect, bool block);
private:
QPointF ll2xy(const Coordinates &c) const;

View File

@ -24,6 +24,7 @@ public:
virtual qreal resolution(const QRectF &rect) const = 0;
virtual int zoom() const = 0;
virtual void setZoom(int zoom) = 0;
virtual int zoomFit(const QSize &size, const RectC &rect) = 0;
virtual int zoomIn() = 0;
virtual int zoomOut() = 0;
@ -31,18 +32,17 @@ public:
virtual QPointF ll2xy(const Coordinates &c) = 0;
virtual Coordinates xy2ll(const QPointF &p) = 0;
virtual void draw(QPainter *painter, const QRectF &rect) = 0;
virtual void draw(QPainter *painter, const QRectF &rect, bool block) = 0;
virtual void setBlockingMode(bool block) {Q_UNUSED(block);}
virtual void clearCache() {}
virtual void load() {}
virtual void unload() {}
void setBackgroundColor(const QColor &color) {_backgroundColor = color;}
virtual bool isValid() const {return true;}
virtual QString errorString() const {return QString();}
void setBackgroundColor(const QColor &color) {_backgroundColor = color;}
signals:
void loaded();

View File

@ -230,7 +230,8 @@ Map *MapSource::loadFile(const QString &path)
config.style, config.format, config.crs, config.coordinateSystem,
config.dimensions, config.authorization));
else
m = new OnlineMap(config.name, config.url, config.zooms, config.bounds);
m = new OnlineMap(config.name, config.url, config.zooms, config.bounds,
config.authorization);
if (!m->isValid()) {
_errorString = m->errorString();

View File

@ -311,8 +311,10 @@ void OfflineMap::drawImage(QPainter *painter, const QRectF &rect) const
r.width(), r.height());
}
void OfflineMap::draw(QPainter *painter, const QRectF &rect)
void OfflineMap::draw(QPainter *painter, const QRectF &rect, bool block)
{
Q_UNUSED(block);
if (_ozf)
drawOZF(painter, rect);
else if (_tile.isValid())

View File

@ -24,6 +24,7 @@ public:
qreal resolution(const QRectF &rect) const;
int zoom() const {return _zoom;}
void setZoom(int zoom) {_zoom = zoom;}
int zoomFit(const QSize &size, const RectC &rect);
int zoomIn();
int zoomOut();
@ -33,7 +34,7 @@ public:
Coordinates xy2ll(const QPointF &p)
{return static_cast<const OfflineMap &>(*this).xy2ll(p);}
void draw(QPainter *painter, const QRectF &rect);
void draw(QPainter *painter, const QRectF &rect, bool block);
void load();
void unload();

View File

@ -8,6 +8,7 @@
#define TILE_SIZE 256
#define EPSILON 1e-6
static QPointF ll2m(const Coordinates &c)
{
@ -36,19 +37,24 @@ static qreal zoom2scale(int zoom)
static int scale2zoom(qreal scale)
{
return (int)log2(360.0/(scale * (qreal)TILE_SIZE));
return (int)(log2(360.0/(scale * (qreal)TILE_SIZE)) + EPSILON);
}
OnlineMap::OnlineMap(const QString &name, const QString &url,
const Range &zooms, const RectC &bounds, QObject *parent) :
Map(parent), _name(name), _zooms(zooms), _bounds(bounds), _block(false),
const Range &zooms, const RectC &bounds, const Authorization &authorization,
QObject *parent) : Map(parent), _name(name), _zooms(zooms), _bounds(bounds),
_valid(false)
{
QString dir(TILES_DIR + "/" + _name);
_zoom = _zooms.max();
_tileLoader = TileLoader(url, dir);
_tileLoader = new TileLoader(this);
_tileLoader->setUrl(url);
_tileLoader->setDir(dir);
_tileLoader->setAuthorization(authorization);
connect(_tileLoader, SIGNAL(finished()), this, SIGNAL(loaded()));
if (!QDir().mkpath(dir)) {
_errorString = "Error creating tiles dir";
@ -58,23 +64,6 @@ OnlineMap::OnlineMap(const QString &name, const QString &url,
_valid = true;
}
void OnlineMap::load()
{
connect(TileLoader::downloader(), SIGNAL(finished()), this,
SLOT(emitLoaded()));
}
void OnlineMap::unload()
{
disconnect(TileLoader::downloader(), SIGNAL(finished()), this,
SLOT(emitLoaded()));
}
void OnlineMap::emitLoaded()
{
emit loaded();
}
QRectF OnlineMap::bounds() const
{
return QRectF(ll2xy(_bounds.topLeft()), ll2xy(_bounds.bottomRight()));
@ -123,7 +112,7 @@ int OnlineMap::zoomOut()
return _zoom;
}
void OnlineMap::draw(QPainter *painter, const QRectF &rect)
void OnlineMap::draw(QPainter *painter, const QRectF &rect, bool block)
{
qreal scale = zoom2scale(_zoom);
@ -138,10 +127,10 @@ void OnlineMap::draw(QPainter *painter, const QRectF &rect)
for (int j = 0; j < ceil(s.height() / TILE_SIZE); j++)
tiles.append(Tile(QPoint(tile.x() + i, tile.y() + j), _zoom));
if (_block)
_tileLoader.loadTilesSync(tiles);
if (block)
_tileLoader->loadTilesSync(tiles);
else
_tileLoader.loadTilesAsync(tiles);
_tileLoader->loadTilesAsync(tiles);
for (int i = 0; i < tiles.count(); i++) {
Tile &t = tiles[i];

View File

@ -12,7 +12,8 @@ class OnlineMap : public Map
public:
OnlineMap(const QString &name, const QString &url, const Range &zooms,
const RectC &bounds, QObject *parent = 0);
const RectC &bounds, const Authorization &authorization,
QObject *parent = 0);
const QString &name() const {return _name;}
@ -20,6 +21,7 @@ public:
qreal resolution(const QRectF &rect) const;
int zoom() const {return _zoom;}
void setZoom(int zoom) {_zoom = zoom;}
int zoomFit(const QSize &size, const RectC &rect);
int zoomIn();
int zoomOut();
@ -29,31 +31,23 @@ public:
Coordinates xy2ll(const QPointF &p)
{return static_cast<const OnlineMap &>(*this).xy2ll(p);}
void draw(QPainter *painter, const QRectF &rect);
void draw(QPainter *painter, const QRectF &rect, bool block);
void setBlockingMode(bool block) {_block = block;}
void clearCache() {_tileLoader.clearCache();}
void load();
void unload();
void clearCache() {_tileLoader->clearCache();}
bool isValid() const {return _valid;}
QString errorString() const {return _errorString;}
private slots:
void emitLoaded();
private:
QPointF ll2xy(const Coordinates &c) const;
Coordinates xy2ll(const QPointF &p) const;
int limitZoom(int zoom) const;
TileLoader _tileLoader;
TileLoader *_tileLoader;
QString _name;
Range _zooms;
RectC _bounds;
int _zoom;
bool _block;
bool _valid;
QString _errorString;

View File

@ -19,7 +19,7 @@ public:
bool isNull() const {return std::isnan(_x) && std::isnan(_y);}
QPointF toPointF() const {return QPointF(_x, _y);}
QPointF toPointF() const {return QPointF((qreal)_x, (qreal)_y);}
private:
double _x, _y;

43
src/map/rectd.h Normal file
View File

@ -0,0 +1,43 @@
#ifndef RECTD_H
#define RECTD_H
#include "pointd.h"
class RectD
{
public:
RectD() {}
RectD(const PointD &topLeft, const PointD &bottomRight)
: _tl(topLeft), _br(bottomRight) {}
PointD topLeft() const {return _tl;}
PointD bottomRight() const {return _br;}
double left() const {return _tl.x();}
double right() const {return _br.x();}
double top() const {return _tl.y();}
double bottom() const {return _br.y();}
double width() const {return (right() - left());}
double height() const {return (top() - bottom());}
bool contains(const PointD &p) const
{return (p.x() >= left() && p.x() <= right() && p.y() <= top()
&& p.y() >= bottom());}
bool isNull() const {return _tl.isNull() && _br.isNull();}
private:
PointD _tl, _br;
};
#ifndef QT_NO_DEBUG
inline QDebug operator<<(QDebug dbg, const RectD &rect)
{
dbg.nospace() << "RectD(" << rect.topLeft() << ", " << rect.bottomRight()
<< ")";
return dbg.space();
}
#endif // QT_NO_DEBUG
#endif // RECTD_H

View File

@ -4,22 +4,23 @@
#include <QPixmap>
#include <QPoint>
#include <QDebug>
#include "rectd.h"
class Tile
{
public:
Tile(const QPoint &xy, const QVariant &zoom, const QRectF &bbox = QRectF())
Tile(const QPoint &xy, const QVariant &zoom, const RectD &bbox = RectD())
{_xy = xy; _zoom = zoom; _bbox = bbox;}
const QVariant &zoom() const {return _zoom;}
const QPoint &xy() const {return _xy;}
const QRectF &bbox() const {return _bbox;}
const RectD &bbox() const {return _bbox;}
QPixmap& pixmap() {return _pixmap;}
private:
QVariant _zoom;
QPoint _xy;
QRectF _bbox;
RectD _bbox;
QPixmap _pixmap;
};

View File

@ -1,7 +1,6 @@
#include <QDir>
#include <QFileInfo>
#include <QEventLoop>
#include "downloader.h"
#include "tileloader.h"
@ -15,7 +14,11 @@ static bool loadTileFile(Tile &tile, const QString &file)
return true;
}
Downloader *TileLoader::_downloader = 0;
TileLoader::TileLoader(QObject *parent) : QObject(parent)
{
_downloader = new Downloader(this);
connect(_downloader, SIGNAL(finished()), this, SIGNAL(finished()));
}
void TileLoader::loadTilesAsync(QList<Tile> &list)
{

View File

@ -1,35 +1,38 @@
#ifndef TILELOADER_H
#define TILELOADER_H
#include <QObject>
#include <QString>
#include "tile.h"
#include "downloader.h"
class TileLoader
class TileLoader : public QObject
{
Q_OBJECT
public:
TileLoader() {}
TileLoader(const QString &url, const QString &dir,
const Authorization &authorization = Authorization())
: _url(url), _dir(dir), _authorization(authorization) {}
TileLoader(QObject *parent = 0);
void setUrl(const QString &url) {_url = url;}
void setDir(const QString &dir) {_dir = dir;}
void setAuthorization(const Authorization &authorization)
{_authorization = authorization;}
void loadTilesAsync(QList<Tile> &list);
void loadTilesSync(QList<Tile> &list);
void clearCache();
static Downloader *downloader() {return _downloader;}
static void setDownloader(Downloader *downloader)
{_downloader = downloader;}
signals:
void finished();
private:
QString tileUrl(const Tile &tile) const;
QString tileFile(const Tile &tile) const;
Downloader *_downloader;
QString _url;
QString _dir;
Authorization _authorization;
static Downloader *_downloader;
};
#endif // TILELOADER_Honlinemap

View File

@ -7,8 +7,6 @@
#include "wms.h"
Downloader *WMS::_downloader = 0;
WMS::CTX::CTX(const Setup &setup) : setup(setup), formatSupported(false)
{
QStringList ll = setup.layer().split(',');
@ -256,13 +254,14 @@ bool WMS::parseCapabilities(const QString &path, const Setup &setup)
bool WMS::getCapabilities(const QString &url, const QString &file,
const Authorization &authorization)
{
Downloader d;
QList<Download> dl;
dl.append(Download(url, file));
QEventLoop wait;
QObject::connect(_downloader, SIGNAL(finished()), &wait, SLOT(quit()));
if (_downloader->get(dl, authorization))
QObject::connect(&d, SIGNAL(finished()), &wait, SLOT(quit()));
if (d.get(dl, authorization))
wait.exec();
if (QFileInfo(file).exists())

View File

@ -58,9 +58,6 @@ public:
bool isValid() const {return _valid;}
const QString &errorString() const {return _errorString;}
static void setDownloader(Downloader *downloader)
{_downloader = downloader;}
private:
struct Layer {
QString name;

View File

@ -4,6 +4,7 @@
#include "common/rectc.h"
#include "config.h"
#include "downloader.h"
#include "tileloader.h"
#include "wmsmap.h"
@ -63,14 +64,12 @@ void WMSMap::updateTransform()
double pixelSpan = sd2res(_zooms.at(_zoom));
if (_projection.isGeographic())
pixelSpan /= deg2rad(WGS84_RADIUS);
double sx = (_br.x() - _tl.x()) / pixelSpan;
double sy = (_tl.y() - _br.y()) / pixelSpan;
double sx = _bbox.width() / pixelSpan;
double sy = _bbox.height() / pixelSpan;
ReferencePoint tl(PointD(0, 0), _tl);
ReferencePoint br(PointD(sx, sy), _br);
ReferencePoint tl(PointD(0, 0), _bbox.topLeft());
ReferencePoint br(PointD(sx, sy), _bbox.bottomRight());
_transform = Transform(tl, br);
_bounds = QRectF(QPointF(0, 0), QSizeF(sx, sy));
}
bool WMSMap::loadWMS()
@ -84,10 +83,9 @@ bool WMSMap::loadWMS()
}
_projection = wms.projection();
_tl = _projection.ll2xy(wms.boundingBox().topLeft());
_br = _projection.ll2xy(wms.boundingBox().bottomRight());
_tileLoader = TileLoader(tileUrl(wms.version()), tilesDir(),
_setup.authorization());
_bbox = RectD(_projection.ll2xy(wms.boundingBox().topLeft()),
_projection.ll2xy(wms.boundingBox().bottomRight()));
_tileLoader->setUrl(tileUrl(wms.version()));
if (wms.version() >= "1.3.0") {
if (_setup.coordinateSystem().axisOrder() == CoordinateSystem::Unknown)
@ -104,41 +102,34 @@ bool WMSMap::loadWMS()
}
WMSMap::WMSMap(const QString &name, const WMS::Setup &setup, QObject *parent)
: Map(parent), _name(name), _setup(setup), _zoom(0), _block(false),
_valid(false)
: Map(parent), _name(name), _setup(setup), _zoom(0), _valid(false)
{
if (!QDir().mkpath(tilesDir())) {
_errorString = "Error creating tiles dir";
return;
}
_tileLoader = new TileLoader(this);
_tileLoader->setDir(tilesDir());
_tileLoader->setAuthorization(_setup.authorization());
connect(_tileLoader, SIGNAL(finished()), this, SIGNAL(loaded()));
_valid = loadWMS();
}
void WMSMap::clearCache()
{
_tileLoader.clearCache();
_tileLoader->clearCache();
_zoom = 0;
if (!loadWMS())
qWarning("%s: %s\n", qPrintable(_name), qPrintable(_errorString));
}
void WMSMap::load()
QRectF WMSMap::bounds() const
{
connect(TileLoader::downloader(), SIGNAL(finished()), this,
SLOT(emitLoaded()));
}
void WMSMap::unload()
{
disconnect(TileLoader::downloader(), SIGNAL(finished()), this,
SLOT(emitLoaded()));
}
void WMSMap::emitLoaded()
{
emit loaded();
return QRectF(_transform.proj2img(_bbox.topLeft()),
_transform.proj2img(_bbox.bottomRight()));
}
qreal WMSMap::resolution(const QRectF &rect) const
@ -176,6 +167,12 @@ int WMSMap::zoomFit(const QSize &size, const RectC &rect)
return _zoom;
}
void WMSMap::setZoom(int zoom)
{
_zoom = zoom;
updateTransform();
}
int WMSMap::zoomIn()
{
_zoom = qMin(_zoom + 1, _zooms.size() - 1);
@ -200,7 +197,7 @@ Coordinates WMSMap::xy2ll(const QPointF &p) const
return _projection.xy2ll(_transform.img2proj(p));
}
void WMSMap::draw(QPainter *painter, const QRectF &rect)
void WMSMap::draw(QPainter *painter, const QRectF &rect, bool block)
{
QPoint tl = QPoint((int)floor(rect.left() / (qreal)TILE_SIZE),
(int)floor(rect.top() / (qreal)TILE_SIZE));
@ -214,18 +211,18 @@ void WMSMap::draw(QPainter *painter, const QRectF &rect)
j * TILE_SIZE)));
PointD tbr(_transform.img2proj(QPointF(i * TILE_SIZE + TILE_SIZE
- 1, j * TILE_SIZE + TILE_SIZE - 1)));
QRectF bbox = (_cs.axisOrder() == CoordinateSystem::YX)
? QRectF(QPointF(tbr.y(), tbr.x()), QPointF(ttl.y(), ttl.x()))
: QRectF(ttl.toPointF(), tbr.toPointF());
RectD bbox = (_cs.axisOrder() == CoordinateSystem::YX)
? RectD(PointD(tbr.y(), tbr.x()), PointD(ttl.y(), ttl.x()))
: RectD(ttl, tbr);
tiles.append(Tile(QPoint(i, j), _zoom, bbox));
}
}
if (_block)
_tileLoader.loadTilesSync(tiles);
if (block)
_tileLoader->loadTilesSync(tiles);
else
_tileLoader.loadTilesAsync(tiles);
_tileLoader->loadTilesAsync(tiles);
for (int i = 0; i < tiles.count(); i++) {
Tile &t = tiles[i];

View File

@ -5,8 +5,9 @@
#include "projection.h"
#include "map.h"
#include "wms.h"
#include "tileloader.h"
#include "rectd.h"
class TileLoader;
class WMSMap : public Map
{
@ -17,10 +18,11 @@ public:
const QString &name() const {return _name;}
QRectF bounds() const {return _bounds;}
QRectF bounds() const;
qreal resolution(const QRectF &rect) const;
int zoom() const {return _zoom;}
void setZoom(int zoom);
int zoomFit(const QSize &size, const RectC &rect);
int zoomIn();
int zoomOut();
@ -30,20 +32,13 @@ public:
Coordinates xy2ll(const QPointF &p)
{return static_cast<const WMSMap &>(*this).xy2ll(p);}
void draw(QPainter *painter, const QRectF &rect);
void draw(QPainter *painter, const QRectF &rect, bool block);
void setBlockingMode(bool block) {_block = block;}
void clearCache();
void load();
void unload();
bool isValid() const {return _valid;}
QString errorString() const {return _errorString;}
private slots:
void emitLoaded();
private:
QString tileUrl(const QString &version) const;
double sd2res(double scaleDenominator) const;
@ -58,15 +53,13 @@ private:
QString _name;
WMS::Setup _setup;
TileLoader _tileLoader;
TileLoader *_tileLoader;
Projection _projection;
Transform _transform;
CoordinateSystem _cs;
QVector<double> _zooms;
PointD _tl, _br;
QRectF _bounds;
RectD _bbox;
int _zoom;
bool _block;
bool _valid;
QString _errorString;

View File

@ -12,8 +12,6 @@
#include "wmts.h"
Downloader *WMTS::_downloader = 0;
WMTS::TileMatrix WMTS::tileMatrix(QXmlStreamReader &reader)
{
TileMatrix matrix;
@ -282,13 +280,14 @@ bool WMTS::parseCapabilities(const QString &path, const Setup &setup)
bool WMTS::getCapabilities(const QString &url, const QString &file,
const Authorization &authorization)
{
Downloader d;
QList<Download> dl;
dl.append(Download(url, file));
QEventLoop wait;
QObject::connect(_downloader, SIGNAL(finished()), &wait, SLOT(quit()));
if (_downloader->get(dl, authorization))
QObject::connect(&d, SIGNAL(finished()), &wait, SLOT(quit()));
if (d.get(dl, authorization))
wait.exec();
if (QFileInfo(file).exists())

View File

@ -88,9 +88,6 @@ public:
bool isValid() const {return _valid;}
const QString &errorString() const {return _errorString;}
static void setDownloader(Downloader *downloader)
{_downloader = downloader;}
private:
struct TileMatrix {
QString id;
@ -154,8 +151,6 @@ private:
bool _valid;
QString _errorString;
static Downloader *_downloader;
friend uint qHash(const WMTS::TileMatrix &key);
friend uint qHash(const WMTS::MatrixLimits &key);
};

View File

@ -3,7 +3,7 @@
#include "common/wgs84.h"
#include "config.h"
#include "transform.h"
#include "downloader.h"
#include "tileloader.h"
#include "wmts.h"
#include "wmtsmap.h"
@ -23,8 +23,7 @@ bool WMTSMap::loadWMTS()
_bounds = wmts.bounds();
_zooms = wmts.zooms();
_projection = wmts.projection();
_tileLoader = TileLoader(wmts.tileUrl(), tilesDir(),
_setup.authorization());
_tileLoader->setUrl(wmts.tileUrl());
if (_setup.coordinateSystem().axisOrder() == CoordinateSystem::Unknown)
_cs = _projection.coordinateSystem();
@ -37,20 +36,24 @@ bool WMTSMap::loadWMTS()
}
WMTSMap::WMTSMap(const QString &name, const WMTS::Setup &setup, QObject *parent)
: Map(parent), _name(name), _setup(setup), _zoom(0), _block(false),
_valid(false)
: Map(parent), _name(name), _setup(setup), _zoom(0), _valid(false)
{
if (!QDir().mkpath(tilesDir())) {
_errorString = "Error creating tiles dir";
return;
}
_tileLoader = new TileLoader(this);
_tileLoader->setDir(tilesDir());
_tileLoader->setAuthorization(_setup.authorization());
connect(_tileLoader, SIGNAL(finished()), this, SIGNAL(loaded()));
_valid = loadWMTS();
}
void WMTSMap::clearCache()
{
_tileLoader.clearCache();
_tileLoader->clearCache();
_zoom = 0;
if (!loadWMTS())
@ -87,23 +90,6 @@ void WMTSMap::updateTransform()
_transform = Transform(tl, br);
}
void WMTSMap::load()
{
connect(TileLoader::downloader(), SIGNAL(finished()), this,
SLOT(emitLoaded()));
}
void WMTSMap::unload()
{
disconnect(TileLoader::downloader(), SIGNAL(finished()), this,
SLOT(emitLoaded()));
}
void WMTSMap::emitLoaded()
{
emit loaded();
}
QRectF WMTSMap::bounds() const
{
const WMTS::Zoom &z = _zooms.at(_zoom);
@ -157,6 +143,12 @@ qreal WMTSMap::resolution(const QRectF &rect) const
return ds/ps;
}
void WMTSMap::setZoom(int zoom)
{
_zoom = zoom;
updateTransform();
}
int WMTSMap::zoomIn()
{
_zoom = qMin(_zoom + 1, _zooms.size() - 1);
@ -171,7 +163,7 @@ int WMTSMap::zoomOut()
return _zoom;
}
void WMTSMap::draw(QPainter *painter, const QRectF &rect)
void WMTSMap::draw(QPainter *painter, const QRectF &rect, bool block)
{
const WMTS::Zoom &z = _zooms.at(_zoom);
QPoint tl = QPoint((int)floor(rect.left() / (qreal)z.tile().width()),
@ -184,10 +176,10 @@ void WMTSMap::draw(QPainter *painter, const QRectF &rect)
for (int j = tl.y(); j < br.y(); j++)
tiles.append(Tile(QPoint(i, j), z.id()));
if (_block)
_tileLoader.loadTilesSync(tiles);
if (block)
_tileLoader->loadTilesSync(tiles);
else
_tileLoader.loadTilesAsync(tiles);
_tileLoader->loadTilesAsync(tiles);
for (int i = 0; i < tiles.count(); i++) {
Tile &t = tiles[i];

View File

@ -5,8 +5,8 @@
#include "projection.h"
#include "map.h"
#include "wmts.h"
#include "tileloader.h"
class TileLoader;
class WMTSMap : public Map
{
@ -21,6 +21,7 @@ public:
qreal resolution(const QRectF &rect) const;
int zoom() const {return _zoom;}
void setZoom(int zoom);
int zoomFit(const QSize &size, const RectC &rect);
int zoomIn();
int zoomOut();
@ -30,20 +31,13 @@ public:
Coordinates xy2ll(const QPointF &p)
{return static_cast<const WMTSMap &>(*this).xy2ll(p);}
void draw(QPainter *painter, const QRectF &rect);
void draw(QPainter *painter, const QRectF &rect, bool block);
void setBlockingMode(bool block) {_block = block;}
void clearCache();
void load();
void unload();
bool isValid() const {return _valid;}
QString errorString() const {return _errorString;}
private slots:
void emitLoaded();
private:
bool loadWMTS();
double sd2res(double scaleDenominator) const;
@ -55,14 +49,13 @@ private:
QString _name;
WMTS::Setup _setup;
TileLoader _tileLoader;
TileLoader *_tileLoader;
RectC _bounds;
QList<WMTS::Zoom> _zooms;
Projection _projection;
Transform _transform;
CoordinateSystem _cs;
int _zoom;
bool _block;
bool _valid;
QString _errorString;