1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-04 06:49:16 +02:00

Compare commits

...

47 Commits
3.4 ... 3.9

Author SHA1 Message Date
1ec732c78d Version++ 2017-02-12 20:13:04 +01:00
ff733b2705 Indicate moving time in status bar 2017-02-12 20:11:36 +01:00
99e32b1a15 Made the moving time switch affect all related values
More standardized time type switching (menu)
2017-02-12 19:57:55 +01:00
f4a992a66f Added missing background color definition (OpenGL issue fix) 2017-02-12 17:49:54 +01:00
f52fa9a9ef Removed obsolete stuff 2017-02-12 17:38:20 +01:00
61f3a1c932 Added OpenSSL to Windows builds
Skipped Windows XP support in Windows builds
2017-02-12 17:34:13 +01:00
93313da01d Fixed QNetworkManager related crashes on program termination. 2017-02-07 23:36:06 +01:00
a253ac1796 Localization update 2017-02-05 16:10:42 +01:00
e6a0eeefcc Better Time/Moving Time display approach. 2017-02-05 16:01:54 +01:00
214d7c40dc Added missing coordinates bounding rectangle normalization
(Fixes issue #19)
2017-02-03 00:54:57 +01:00
cd89706d74 Do not use hardcoded control keys info 2017-02-02 20:06:17 +01:00
961eac9324 Added moving time info.
Added special track data processing for "pause states".
2017-01-31 09:37:01 +01:00
ddacac8d2e Added Open Topo Map to default map sources 2017-01-26 09:46:36 +01:00
bd9b5dbc6a Merge pull request #17 from eson57/patch-2
Update gpxsee_sv.ts
2017-01-24 23:57:29 +01:00
8b813b5879 Update gpxsee_sv.ts 2017-01-24 21:32:49 +01:00
b79de29464 Added missing swedish string 2017-01-24 18:30:00 +01:00
ae2765528d Updated obsolete strings 2017-01-24 18:23:56 +01:00
0356917790 Version++ 2017-01-24 18:12:08 +01:00
7352b24473 Added missing item update on content change 2017-01-24 18:11:08 +01:00
3a9ec6247c Removed Czech strings from Swedish translation 2017-01-23 10:01:27 +01:00
e74ac78138 Added missing swedish translation resource 2017-01-23 00:08:10 +01:00
5fa91be4ac Localization update 2017-01-23 00:03:48 +01:00
536b4fd121 Added swedish translation 2017-01-23 00:02:16 +01:00
0556ae0f58 Merge pull request #16 from eson57/patch-1
Swedish translation
2017-01-22 23:51:41 +01:00
e38fdb26d7 Version 3.7 2017-01-22 22:54:42 +01:00
e420602c69 Fixed scene bounding rect reset 2017-01-22 22:53:38 +01:00
b2a49eaa23 Version++ 2017-01-22 22:14:59 +01:00
211a4e4cef Create gpxsee_sv.ts 2017-01-21 09:49:51 +01:00
8ff8d4bf16 Code cleanup 2017-01-20 01:17:22 +01:00
46598a85fc Fixed redirect loop handling logic 2017-01-17 10:37:02 +01:00
32cbd33c91 Fixed tile area computation 2017-01-16 21:45:50 +01:00
0e356d0222 Added redirect loop check 2017-01-16 21:45:27 +01:00
1a29ab6304 Enabled free map scroll. 2017-01-16 09:54:12 +01:00
5581cff55b Fixed download error handling in case of redirects
Do not download tiles multiple times.
2017-01-16 09:53:01 +01:00
a458b82e37 Code cleanup 2017-01-11 22:14:01 +01:00
bd946fb477 Fixed bounding rect computation in special case (rect + 1 waypoint) 2017-01-09 00:20:06 +01:00
7e6ed0933c Code cleanup 2017-01-08 20:02:51 +01:00
1586a5e912 Optimization 2017-01-07 22:20:04 +01:00
3e340ab941 Improved error reporting.
Cosmetics.
2017-01-02 23:01:50 +01:00
ea178d1acb Fixed benign memory leak 2017-01-02 09:42:34 +01:00
f61488fcfa Version++ 2016-12-20 08:39:40 +01:00
b68ca92add OpenGL code cleanup 2016-12-20 00:11:30 +01:00
0448ae5eea Added basic print/export formating options 2016-12-16 02:30:58 +01:00
2bc112c7b4 Fixed broken latitude handling 2016-12-13 18:54:58 +01:00
ccd92edb8d More code cleanup 2016-12-10 11:52:18 +01:00
0cbf79870b Code cleanup 2016-12-10 11:50:53 +01:00
7e8530555d Unified AA samples count for QGLFormat and QSurfaceFormat. 2016-12-10 11:45:16 +01:00
45 changed files with 2026 additions and 508 deletions

View File

@ -1,6 +0,0 @@
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
set PATH=C:\qt\qtbase\bin;%PATH%
set PATH=C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin;%PATH%
set INCLUDE=C:\Program Files\Microsoft SDKs\Windows\v7.1\Include;%INCLUDE%
set LIB=C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib;%LIB%
set CL=/D_USING_V110_SDK71_

View File

@ -1,6 +0,0 @@
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
set PATH=C:\qt64\qtbase\bin;%PATH%
set PATH=C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin;%PATH%
set INCLUDE=C:\Program Files\Microsoft SDKs\Windows\v7.1\Include;%INCLUDE%
set LIB=C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64;%LIB%
set CL=/D_USING_V110_SDK71_

View File

@ -1,11 +1,12 @@
TARGET = GPXSee TARGET = GPXSee
VERSION = 3.4 VERSION = 3.9
QT += core \ QT += core \
gui \ gui \
network network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
greaterThan(QT_MAJOR_VERSION, 4): QT += printsupport greaterThan(QT_MAJOR_VERSION, 4): QT += printsupport
lessThan(QT_VERSION, 5.4) : QT += opengl lessThan(QT_VERSION, 5.4): QT += opengl
macx: QT += opengl
HEADERS += src/config.h \ HEADERS += src/config.h \
src/icons.h \ src/icons.h \
src/gui.h \ src/gui.h \
@ -74,7 +75,9 @@ HEADERS += src/config.h \
src/nmeaparser.h \ src/nmeaparser.h \
src/optionsdialog.h \ src/optionsdialog.h \
src/colorbox.h \ src/colorbox.h \
src/stylecombobox.h src/stylecombobox.h \
src/opengl.h \
src/timetype.h
SOURCES += src/main.cpp \ SOURCES += src/main.cpp \
src/gui.cpp \ src/gui.cpp \
src/poi.cpp \ src/poi.cpp \
@ -130,7 +133,8 @@ SOURCES += src/main.cpp \
src/colorbox.cpp \ src/colorbox.cpp \
src/stylecombobox.cpp src/stylecombobox.cpp
RESOURCES += gpxsee.qrc RESOURCES += gpxsee.qrc
TRANSLATIONS = lang/gpxsee_cs.ts TRANSLATIONS = lang/gpxsee_cs.ts \
lang/gpxsee_sv.ts
macx { macx {
ICON = icons/gpxsee.icns ICON = icons/gpxsee.icns
QMAKE_INFO_PLIST = Info.plist QMAKE_INFO_PLIST = Info.plist

View File

@ -18,6 +18,8 @@
<file>icons/preferences-desktop-display.png</file> <file>icons/preferences-desktop-display.png</file>
<file>icons/flag_48.png</file> <file>icons/flag_48.png</file>
<file>icons/system-run.png</file> <file>icons/system-run.png</file>
<file>icons/document-print-preview.png</file>
<file>lang/gpxsee_cs.qm</file> <file>lang/gpxsee_cs.qm</file>
<file>lang/gpxsee_sv.qm</file>
</qresource> </qresource>
</RCC> </RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -190,290 +190,301 @@
<context> <context>
<name>GUI</name> <name>GUI</name>
<message> <message>
<location filename="../src/gui.cpp" line="545"/> <location filename="../src/gui.cpp" line="569"/>
<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> <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>Program GPXSee je distribuován pod podmínkami licence GNU General Public License verze 3. Pro více informací navštivte stránky programu na adrese </translation> <translation>Program GPXSee je distribuován pod podmínkami licence GNU General Public License verze 3. Pro více informací navštivte stránky programu na adrese </translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="609"/> <location filename="../src/gui.cpp" line="633"/>
<source>Open file</source> <source>Open file</source>
<translation>Otevřít soubor</translation> <translation>Otevřít soubor</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="690"/> <location filename="../src/gui.cpp" line="723"/>
<source>Open POI file</source> <source>Open POI file</source>
<translation>Otevřít POI soubor</translation> <translation>Otevřít POI soubor</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="216"/> <location filename="../src/gui.cpp" line="227"/>
<source>Open</source> <source>Open</source>
<translation>Otevřít</translation> <translation>Otevřít</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="200"/> <location filename="../src/gui.cpp" line="211"/>
<source>Quit</source> <source>Quit</source>
<translation>Ukončit</translation> <translation>Ukončit</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="208"/> <location filename="../src/gui.cpp" line="219"/>
<location filename="../src/gui.cpp" line="561"/> <location filename="../src/gui.cpp" line="585"/>
<location filename="../src/gui.cpp" line="562"/> <location filename="../src/gui.cpp" line="586"/>
<source>Keyboard controls</source> <source>Keyboard controls</source>
<translation>Ovládací klávesy</translation> <translation>Ovládací klávesy</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="232"/> <location filename="../src/gui.cpp" line="243"/>
<source>Close</source> <source>Close</source>
<translation>Zavřít</translation> <translation>Zavřít</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="238"/> <location filename="../src/gui.cpp" line="249"/>
<source>Reload</source> <source>Reload</source>
<translation>Znovu načíst</translation> <translation>Znovu načíst</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="471"/> <location filename="../src/gui.cpp" line="497"/>
<source>Show</source> <source>Show</source>
<translation>Zobrazit</translation> <translation>Zobrazit</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="392"/> <location filename="../src/gui.cpp" line="415"/>
<location filename="../src/gui.cpp" line="465"/> <location filename="../src/gui.cpp" line="491"/>
<source>File</source> <source>File</source>
<translation>Soubor</translation> <translation>Soubor</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="102"/> <location filename="../src/gui.cpp" line="104"/>
<source>FIT files (*.fit)</source> <source>FIT files (*.fit)</source>
<translation>Soubory FIT (*.fit)</translation> <translation>Soubory FIT (*.fit)</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="103"/> <location filename="../src/gui.cpp" line="105"/>
<source>IGC files (*.igc)</source> <source>IGC files (*.igc)</source>
<translation>Soubory IGC (*.igc)</translation> <translation>Soubory IGC (*.igc)</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="104"/> <location filename="../src/gui.cpp" line="106"/>
<source>NMEA files (*.nmea)</source> <source>NMEA files (*.nmea)</source>
<translation>Soubory NMEA (*.nmea)</translation> <translation>Soubory NMEA (*.nmea)</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="206"/> <location filename="../src/gui.cpp" line="217"/>
<location filename="../src/gui.cpp" line="584"/> <location filename="../src/gui.cpp" line="608"/>
<location filename="../src/gui.cpp" line="585"/> <location filename="../src/gui.cpp" line="609"/>
<source>Data sources</source> <source>Data sources</source>
<translation>Zdroje dat</translation> <translation>Zdroje dat</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="246"/> <location filename="../src/gui.cpp" line="257"/>
<source>Load POI file</source> <source>Load POI file</source>
<translation>Nahrát POI soubor</translation> <translation>Nahrát POI soubor</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="249"/> <location filename="../src/gui.cpp" line="260"/>
<source>Close POI files</source> <source>Close POI files</source>
<translation>Zavřit POI soubory</translation> <translation>Zavřit POI soubory</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="251"/> <location filename="../src/gui.cpp" line="262"/>
<source>Overlap POIs</source> <source>Overlap POIs</source>
<translation>Překrývat POI</translation> <translation>Překrývat POI</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="255"/> <location filename="../src/gui.cpp" line="266"/>
<source>Show POI labels</source> <source>Show POI labels</source>
<translation>Zobrazovat názvy POI</translation> <translation>Zobrazit názvy POI</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="260"/> <location filename="../src/gui.cpp" line="271"/>
<source>Show POIs</source> <source>Show POIs</source>
<translation>Zobrazit POI</translation> <translation>Zobrazit POI</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="269"/> <location filename="../src/gui.cpp" line="280"/>
<source>Show map</source> <source>Show map</source>
<translation>Zobrazit mapu</translation> <translation>Zobrazit mapu</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="275"/> <location filename="../src/gui.cpp" line="286"/>
<source>Clear tile cache</source> <source>Clear tile cache</source>
<translation>Vymazat mezipaměť dlaždic</translation> <translation>Vymazat mezipaměť dlaždic</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="284"/> <location filename="../src/gui.cpp" line="295"/>
<location filename="../src/gui.cpp" line="288"/> <location filename="../src/gui.cpp" line="299"/>
<location filename="../src/gui.cpp" line="571"/> <location filename="../src/gui.cpp" line="597"/>
<source>Next map</source> <source>Next map</source>
<translation>Následující mapa</translation> <translation>Následující mapa</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="295"/> <location filename="../src/gui.cpp" line="306"/>
<source>Show tracks</source> <source>Show tracks</source>
<translation>Zobrazit cesty</translation> <translation>Zobrazit cesty</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="299"/> <location filename="../src/gui.cpp" line="310"/>
<source>Show routes</source> <source>Show routes</source>
<translation>Zobrazit trasy</translation> <translation>Zobrazit trasy</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="303"/> <location filename="../src/gui.cpp" line="314"/>
<source>Show waypoints</source> <source>Show waypoints</source>
<translation>Zobrazit navigační body</translation> <translation>Zobrazit navigační body</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="307"/> <location filename="../src/gui.cpp" line="318"/>
<source>Waypoint labels</source> <source>Waypoint labels</source>
<translation>Názvy navigačních bodů</translation> <translation>Názvy navigačních bodů</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="318"/> <location filename="../src/gui.cpp" line="329"/>
<source>Show graphs</source> <source>Show graphs</source>
<translation>Zobrazovat grafy</translation> <translation>Zobrazit grafy</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="340"/> <location filename="../src/gui.cpp" line="351"/>
<source>Show grid</source> <source>Show grid</source>
<translation>Zobrazit mřížku</translation> <translation>Zobrazit mřížku</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="346"/> <location filename="../src/gui.cpp" line="357"/>
<source>Show toolbars</source> <source>Show toolbars</source>
<translation>Zobrazovat nástrojové lišty</translation> <translation>Zobrazovat nástrojové lišty</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="352"/> <location filename="../src/gui.cpp" line="363"/>
<source>Total time</source>
<translation>Celkový čas</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="368"/>
<location filename="../src/gui.cpp" line="876"/>
<source>Moving time</source>
<translation>Čistý čas</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="375"/>
<source>Metric</source> <source>Metric</source>
<translation>Metrické</translation> <translation>Metrické</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="357"/> <location filename="../src/gui.cpp" line="380"/>
<source>Imperial</source> <source>Imperial</source>
<translation>Imperiální</translation> <translation>Imperiální</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="363"/> <location filename="../src/gui.cpp" line="386"/>
<source>Fullscreen mode</source> <source>Fullscreen mode</source>
<translation>Celoobrazovkový režim</translation> <translation>Celoobrazovkový režim</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="369"/> <location filename="../src/gui.cpp" line="392"/>
<source>Options...</source> <source>Options...</source>
<translation>Nastavení...</translation> <translation>Nastavení...</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="374"/> <location filename="../src/gui.cpp" line="397"/>
<source>Next</source> <source>Next</source>
<translation>Následující</translation> <translation>Následující</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="377"/> <location filename="../src/gui.cpp" line="400"/>
<source>Previous</source> <source>Previous</source>
<translation>Předchozí</translation> <translation>Předchozí</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="381"/> <location filename="../src/gui.cpp" line="404"/>
<source>Last</source> <source>Last</source>
<translation>Poslední</translation> <translation>Poslední</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="384"/> <location filename="../src/gui.cpp" line="407"/>
<source>First</source> <source>First</source>
<translation>První</translation> <translation>První</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="406"/> <location filename="../src/gui.cpp" line="429"/>
<source>Map</source> <source>Map</source>
<translation>Mapa</translation> <translation>Mapa</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="413"/> <location filename="../src/gui.cpp" line="436"/>
<source>Graph</source> <source>Graph</source>
<translation>Graf</translation> <translation>Graf</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="421"/> <location filename="../src/gui.cpp" line="444"/>
<source>POI</source> <source>POI</source>
<translation>POI</translation> <translation>POI</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="422"/> <location filename="../src/gui.cpp" line="445"/>
<source>POI files</source> <source>POI files</source>
<translation>POI soubory</translation> <translation>POI soubory</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="433"/> <location filename="../src/gui.cpp" line="456"/>
<source>Data</source> <source>Data</source>
<translation>Data</translation> <translation>Data</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="434"/> <location filename="../src/gui.cpp" line="457"/>
<source>Display</source> <source>Display</source>
<translation>Zobrazit</translation> <translation>Zobrazit</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="442"/> <location filename="../src/gui.cpp" line="465"/>
<source>Settings</source> <source>Settings</source>
<translation>Nastavení</translation> <translation>Nastavení</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="443"/> <location filename="../src/gui.cpp" line="469"/>
<source>Units</source> <source>Units</source>
<translation>Jednotky</translation> <translation>Jednotky</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="452"/> <location filename="../src/gui.cpp" line="478"/>
<source>Help</source> <source>Help</source>
<translation>Nápověda</translation> <translation>Nápověda</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="573"/> <location filename="../src/gui.cpp" line="598"/>
<source>Previous map</source> <source>Previous map</source>
<translation>Předchozí mapa</translation> <translation>Předchozí mapa</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="103"/> <location filename="../src/gui.cpp" line="1082"/>
<source>No files loaded</source>
<translation>Nejsou načteny žádné soubory</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="105"/>
<source>GPX files (*.gpx)</source> <source>GPX files (*.gpx)</source>
<translation>Soubory GPX (*.gpx)</translation> <translation>Soubory GPX (*.gpx)</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="105"/> <location filename="../src/gui.cpp" line="107"/>
<source>TCX files (*.tcx)</source> <source>TCX files (*.tcx)</source>
<translation>Soubory TCX (*.tcx)</translation> <translation>Soubory TCX (*.tcx)</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="104"/> <location filename="../src/gui.cpp" line="106"/>
<source>KML files (*.kml)</source> <source>KML files (*.kml)</source>
<translation>Soubory KML (*.kml)</translation> <translation>Soubory KML (*.kml)</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="102"/> <location filename="../src/gui.cpp" line="104"/>
<source>CSV files (*.csv)</source> <source>CSV files (*.csv)</source>
<translation>Soubory CSV (*.csv)</translation> <translation>Soubory CSV (*.csv)</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="105"/> <location filename="../src/gui.cpp" line="107"/>
<source>All files (*)</source> <source>All files (*)</source>
<translation>Všechny soubory (*)</translation> <translation>Všechny soubory (*)</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="817"/> <location filename="../src/gui.cpp" line="862"/>
<location filename="../src/gui.cpp" line="820"/> <location filename="../src/gui.cpp" line="865"/>
<source>Date</source> <source>Date</source>
<translation>Datum</translation> <translation>Datum</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="829"/> <location filename="../src/gui.cpp" line="854"/>
<source>Routes</source> <source>Routes</source>
<translation>Trasy</translation> <translation>Trasy</translation>
</message> </message>
<message>
<location filename="../src/gui.cpp" line="1017"/>
<source>No GPX files loaded</source>
<translation>Nejsou načteny žádné GPX soubory</translation>
</message>
<message numerus="yes"> <message numerus="yes">
<location filename="../src/gui.cpp" line="1021"/> <location filename="../src/gui.cpp" line="1086"/>
<source>%n files</source> <source>%n files</source>
<translation> <translation>
<numerusform>%n soubor</numerusform> <numerusform>%n soubor</numerusform>
@ -482,126 +493,132 @@
</translation> </translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="564"/> <location filename="../src/gui.cpp" line="588"/>
<source>Next file</source> <source>Next file</source>
<translation>Následující soubor</translation> <translation>Následující soubor</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="541"/> <location filename="../src/gui.cpp" line="566"/>
<source>Version </source> <source>Version </source>
<translation>Verze </translation> <translation>Verze </translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="221"/> <location filename="../src/gui.cpp" line="232"/>
<source>Print...</source> <source>Print...</source>
<translation>Tisknout...</translation> <translation>Tisknout...</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="226"/> <location filename="../src/gui.cpp" line="237"/>
<source>Export to PDF...</source> <source>Export to PDF...</source>
<translation>Exportovat do PDF...</translation> <translation>Exportovat do PDF...</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="831"/> <location filename="../src/gui.cpp" line="856"/>
<source>Waypoints</source> <source>Waypoints</source>
<translation>Navigační body</translation> <translation>Navigační body</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="565"/> <location filename="../src/gui.cpp" line="590"/>
<source>Previous file</source> <source>Previous file</source>
<translation>Předchozí soubor</translation> <translation>Předchozí soubor</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="101"/> <location filename="../src/gui.cpp" line="103"/>
<source>Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</source> <source>Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</source>
<translation>Podporované soubory (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</translation> <translation>Podporované soubory (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="311"/> <location filename="../src/gui.cpp" line="322"/>
<source>Route waypoints</source> <source>Route waypoints</source>
<translation>Body tras</translation> <translation>Body tras</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="567"/> <location filename="../src/gui.cpp" line="592"/>
<source>First file</source> <source>First file</source>
<translation>První soubor</translation> <translation>První soubor</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="568"/> <location filename="../src/gui.cpp" line="594"/>
<source>Last file</source> <source>Last file</source>
<translation>Poslední soubor</translation> <translation>Poslední soubor</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="569"/> <location filename="../src/gui.cpp" line="595"/>
<source>Append modifier</source> <source>Append modifier</source>
<translation>Modifikátor nahradit/přidat</translation> <translation>Modifikátor nahradit/přidat</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="588"/> <location filename="../src/gui.cpp" line="612"/>
<source>Map (tiles) source URLs are read on program startup from the following file:</source> <source>Map (tiles) source URLs are read on program startup from the following file:</source>
<translation>URL mapových zdrojů (dlaždic) jsou načteny při startu programu z následujícího souboru:</translation> <translation>URL mapových zdrojů (dlaždic) jsou načteny při startu programu z následujícího souboru:</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="591"/> <location filename="../src/gui.cpp" line="615"/>
<source>The file format is one map entry per line, consisting of the map name and tiles URL delimited by a TAB character. The tile X and Y coordinates are replaced with $x and $y in the URL and the zoom level is replaced with $z. An example map file could look like:</source> <source>The file format is one map entry per line, consisting of the map name and tiles URL delimited by a TAB character. The tile X and Y coordinates are replaced with $x and $y in the URL and the zoom level is replaced with $z. An example map file could look like:</source>
<translation>Formát souboru je jeden mapový záznam na řádku, kde mapový záznam sestává ze jména mapy a URL dlaždic navzájem oddělených tabulátorem. Souřadnice dlaždice jsou v URL nahrazeny řetězci $x a $y, úroven přiblížení (zoom) pak řetězcem $z. Příklad:</translation> <translation>Formát souboru je jeden mapový záznam na řádku, kde mapový záznam sestává ze jména mapy a URL dlaždic navzájem oddělených tabulátorem. Souřadnice dlaždice jsou v URL nahrazeny řetězci $x a $y, úroven přiblížení (zoom) pak řetězcem $z. Příklad:</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="599"/> <location filename="../src/gui.cpp" line="623"/>
<source>To make GPXSee load a POI file automatically on startup, add the file to the following directory:</source> <source>To make GPXSee load a POI file automatically on startup, add the file to the following directory:</source>
<translation>POI soubory, které se mají automaticky nahrát při startu programu jsou načítány z následujícího adresáře:</translation> <translation>POI soubory, které se mají automaticky nahrát při startu programu jsou načítány z následujícího adresáře:</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="679"/> <location filename="../src/gui.cpp" line="712"/>
<source>Error loading data file:</source> <source>Error loading data file:</source>
<translation>Datový soubor nelze načíst:</translation> <translation>Datový soubor nelze načíst:</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="682"/> <location filename="../src/gui.cpp" line="715"/>
<location filename="../src/gui.cpp" line="707"/> <location filename="../src/gui.cpp" line="740"/>
<source>Line: %1</source> <source>Line: %1</source>
<translation>Řádka: %1</translation> <translation>Řádka: %1</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="704"/> <location filename="../src/gui.cpp" line="737"/>
<source>Error loading POI file:</source> <source>Error loading POI file:</source>
<translation>Soubor POI nelze načíst:</translation> <translation>Soubor POI nelze načíst:</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="827"/> <location filename="../src/gui.cpp" line="848"/>
<source>Name</source>
<translation>Název</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="852"/>
<source>Tracks</source> <source>Tracks</source>
<translation>Cesty</translation> <translation>Cesty</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="211"/> <location filename="../src/gui.cpp" line="222"/>
<location filename="../src/gui.cpp" line="539"/> <location filename="../src/gui.cpp" line="565"/>
<source>About GPXSee</source> <source>About GPXSee</source>
<translation>O aplikaci GPXSee</translation> <translation>O aplikaci GPXSee</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="476"/> <location filename="../src/gui.cpp" line="502"/>
<source>Navigation</source> <source>Navigation</source>
<translation>Navigace</translation> <translation>Navigace</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="587"/> <location filename="../src/gui.cpp" line="611"/>
<source>Map sources</source> <source>Map sources</source>
<translation>Mapové zdroje</translation> <translation>Mapové zdroje</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="598"/> <location filename="../src/gui.cpp" line="622"/>
<source>POIs</source> <source>POIs</source>
<translation>POI body</translation> <translation>POI body</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="326"/> <location filename="../src/gui.cpp" line="337"/>
<location filename="../src/gui.cpp" line="834"/> <location filename="../src/gui.cpp" line="872"/>
<source>Distance</source> <source>Distance</source>
<translation>Vzdálenost</translation> <translation>Vzdálenost</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="333"/> <location filename="../src/gui.cpp" line="344"/>
<location filename="../src/gui.cpp" line="836"/> <location filename="../src/gui.cpp" line="466"/>
<location filename="../src/gui.cpp" line="874"/>
<source>Time</source> <source>Time</source>
<translation>Čas</translation> <translation>Čas</translation>
</message> </message>
@ -609,48 +626,48 @@
<context> <context>
<name>GraphView</name> <name>GraphView</name>
<message> <message>
<location filename="../src/graphview.cpp" line="112"/> <location filename="../src/graphview.cpp" line="108"/>
<source>m</source> <source>m</source>
<translation>m</translation> <translation>m</translation>
</message> </message>
<message> <message>
<location filename="../src/graphview.cpp" line="115"/> <location filename="../src/graphview.cpp" line="111"/>
<source>km</source> <source>km</source>
<translation>km</translation> <translation>km</translation>
</message> </message>
<message> <message>
<location filename="../src/graphview.cpp" line="120"/> <location filename="../src/graphview.cpp" line="116"/>
<source>ft</source> <source>ft</source>
<translation>ft</translation> <translation>ft</translation>
</message> </message>
<message> <message>
<location filename="../src/graphview.cpp" line="123"/> <location filename="../src/graphview.cpp" line="119"/>
<source>mi</source> <source>mi</source>
<translation>mi</translation> <translation>mi</translation>
</message> </message>
<message> <message>
<location filename="../src/graphview.cpp" line="129"/> <location filename="../src/graphview.cpp" line="125"/>
<source>s</source> <source>s</source>
<translation>s</translation> <translation>s</translation>
</message> </message>
<message> <message>
<location filename="../src/graphview.cpp" line="132"/> <location filename="../src/graphview.cpp" line="128"/>
<source>min</source> <source>min</source>
<translation>min</translation> <translation>min</translation>
</message> </message>
<message> <message>
<location filename="../src/graphview.cpp" line="135"/> <location filename="../src/graphview.cpp" line="131"/>
<source>h</source> <source>h</source>
<translation>h</translation> <translation>h</translation>
</message> </message>
<message> <message>
<location filename="../src/graphview.cpp" line="64"/> <location filename="../src/graphview.cpp" line="60"/>
<location filename="../src/graphview.cpp" line="161"/> <location filename="../src/graphview.cpp" line="157"/>
<source>Distance</source> <source>Distance</source>
<translation>Vzdálenost</translation> <translation>Vzdálenost</translation>
</message> </message>
<message> <message>
<location filename="../src/graphview.cpp" line="163"/> <location filename="../src/graphview.cpp" line="159"/>
<source>Time</source> <source>Time</source>
<translation>Čas</translation> <translation>Čas</translation>
</message> </message>
@ -684,12 +701,12 @@
<message> <message>
<location filename="../src/optionsdialog.cpp" line="34"/> <location filename="../src/optionsdialog.cpp" line="34"/>
<source>Base color:</source> <source>Base color:</source>
<translation>Základní barva</translation> <translation>Základní barva:</translation>
</message> </message>
<message> <message>
<location filename="../src/optionsdialog.cpp" line="35"/> <location filename="../src/optionsdialog.cpp" line="35"/>
<source>Palette shift:</source> <source>Palette shift:</source>
<translation>Posun palety</translation> <translation>Posun palety:</translation>
</message> </message>
<message> <message>
<location filename="../src/optionsdialog.cpp" line="47"/> <location filename="../src/optionsdialog.cpp" line="47"/>
@ -744,6 +761,7 @@
</message> </message>
<message> <message>
<location filename="../src/optionsdialog.cpp" line="115"/> <location filename="../src/optionsdialog.cpp" line="115"/>
<location filename="../src/optionsdialog.cpp" line="183"/>
<source>Graphs</source> <source>Graphs</source>
<translation>Grafy</translation> <translation>Grafy</translation>
</message> </message>
@ -760,32 +778,77 @@
<message> <message>
<location filename="../src/optionsdialog.cpp" line="134"/> <location filename="../src/optionsdialog.cpp" line="134"/>
<source>POI radius:</source> <source>POI radius:</source>
<translation>POI radius</translation> <translation>POI radius:</translation>
</message> </message>
<message> <message>
<location filename="../src/optionsdialog.cpp" line="140"/> <location filename="../src/optionsdialog.cpp" line="140"/>
<location filename="../src/optionsdialog.cpp" line="184"/> <location filename="../src/optionsdialog.cpp" line="224"/>
<source>POI</source> <source>POI</source>
<translation>POI</translation> <translation>POI</translation>
</message> </message>
<message> <message>
<location filename="../src/optionsdialog.cpp" line="147"/> <location filename="../src/optionsdialog.cpp" line="147"/>
<source>Name</source>
<translation>Název</translation>
</message>
<message>
<location filename="../src/optionsdialog.cpp" line="149"/>
<source>Date</source>
<translation>Datum</translation>
</message>
<message>
<location filename="../src/optionsdialog.cpp" line="151"/>
<source>Distance</source>
<translation>Vzdálenost</translation>
</message>
<message>
<location filename="../src/optionsdialog.cpp" line="153"/>
<source>Time</source>
<translation>Čas</translation>
</message>
<message>
<location filename="../src/optionsdialog.cpp" line="155"/>
<source>Moving time</source>
<translation>Čistý čas</translation>
</message>
<message>
<location filename="../src/optionsdialog.cpp" line="157"/>
<source>Item count (&gt;1)</source>
<translation>Počet objektů (&gt;1)</translation>
</message>
<message>
<location filename="../src/optionsdialog.cpp" line="172"/>
<source>Separate graph page</source>
<translation>Samostatná stránka s grafy</translation>
</message>
<message>
<location filename="../src/optionsdialog.cpp" line="182"/>
<source>Header</source>
<translation>Záhlaví</translation>
</message>
<message>
<location filename="../src/optionsdialog.cpp" line="190"/>
<source>Use OpenGL</source> <source>Use OpenGL</source>
<translation>Používat OpenGL</translation> <translation>Používat OpenGL</translation>
</message> </message>
<message> <message>
<location filename="../src/optionsdialog.cpp" line="167"/> <location filename="../src/optionsdialog.cpp" line="206"/>
<location filename="../src/optionsdialog.cpp" line="185"/> <location filename="../src/optionsdialog.cpp" line="227"/>
<source>System</source> <source>System</source>
<translation>Systém</translation> <translation>Systém</translation>
</message> </message>
<message> <message>
<location filename="../src/optionsdialog.cpp" line="182"/> <location filename="../src/optionsdialog.cpp" line="222"/>
<source>Appearance</source> <source>Appearance</source>
<translation>Vzhled</translation> <translation>Vzhled</translation>
</message> </message>
<message> <message>
<location filename="../src/optionsdialog.cpp" line="212"/> <location filename="../src/optionsdialog.cpp" line="225"/>
<source>Print &amp; Export</source>
<translation>Tisk a export</translation>
</message>
<message>
<location filename="../src/optionsdialog.cpp" line="254"/>
<source>Options</source> <source>Options</source>
<translation>Nastavení</translation> <translation>Nastavení</translation>
</message> </message>
@ -817,17 +880,17 @@
<context> <context>
<name>RouteItem</name> <name>RouteItem</name>
<message> <message>
<location filename="../src/routeitem.cpp" line="15"/> <location filename="../src/routeitem.cpp" line="14"/>
<source>Name</source> <source>Name</source>
<translation>Název</translation> <translation>Název</translation>
</message> </message>
<message> <message>
<location filename="../src/routeitem.cpp" line="17"/> <location filename="../src/routeitem.cpp" line="16"/>
<source>Description</source> <source>Description</source>
<translation>Popis</translation> <translation>Popis</translation>
</message> </message>
<message> <message>
<location filename="../src/routeitem.cpp" line="18"/> <location filename="../src/routeitem.cpp" line="17"/>
<source>Distance</source> <source>Distance</source>
<translation>Vzdálenost</translation> <translation>Vzdálenost</translation>
</message> </message>
@ -835,22 +898,22 @@
<context> <context>
<name>ScaleItem</name> <name>ScaleItem</name>
<message> <message>
<location filename="../src/scaleitem.cpp" line="90"/> <location filename="../src/scaleitem.cpp" line="81"/>
<source>mi</source> <source>mi</source>
<translation>mi</translation> <translation>mi</translation>
</message> </message>
<message> <message>
<location filename="../src/scaleitem.cpp" line="91"/> <location filename="../src/scaleitem.cpp" line="82"/>
<source>ft</source> <source>ft</source>
<translation>ft</translation> <translation>ft</translation>
</message> </message>
<message> <message>
<location filename="../src/scaleitem.cpp" line="93"/> <location filename="../src/scaleitem.cpp" line="84"/>
<source>km</source> <source>km</source>
<translation>km</translation> <translation>km</translation>
</message> </message>
<message> <message>
<location filename="../src/scaleitem.cpp" line="94"/> <location filename="../src/scaleitem.cpp" line="85"/>
<source>m</source> <source>m</source>
<translation>m</translation> <translation>m</translation>
</message> </message>
@ -864,7 +927,7 @@
<translation>Rychlost</translation> <translation>Rychlost</translation>
</message> </message>
<message> <message>
<location filename="../src/speedgraph.cpp" line="74"/> <location filename="../src/speedgraph.cpp" line="78"/>
<source>km/h</source> <source>km/h</source>
<translation>km/h</translation> <translation>km/h</translation>
</message> </message>
@ -879,7 +942,7 @@
<translation>Maximum</translation> <translation>Maximum</translation>
</message> </message>
<message> <message>
<location filename="../src/speedgraph.cpp" line="77"/> <location filename="../src/speedgraph.cpp" line="81"/>
<source>mi/h</source> <source>mi/h</source>
<translation>mi/h</translation> <translation>mi/h</translation>
</message> </message>
@ -921,27 +984,32 @@
<context> <context>
<name>TrackItem</name> <name>TrackItem</name>
<message> <message>
<location filename="../src/trackitem.cpp" line="14"/> <location filename="../src/trackitem.cpp" line="12"/>
<source>Name</source> <source>Name</source>
<translation>Název</translation> <translation>Název</translation>
</message> </message>
<message> <message>
<location filename="../src/trackitem.cpp" line="16"/> <location filename="../src/trackitem.cpp" line="14"/>
<source>Description</source> <source>Description</source>
<translation>Popis</translation> <translation>Popis</translation>
</message> </message>
<message> <message>
<location filename="../src/trackitem.cpp" line="17"/> <location filename="../src/trackitem.cpp" line="15"/>
<source>Distance</source> <source>Distance</source>
<translation>Vzdálenost</translation> <translation>Vzdálenost</translation>
</message> </message>
<message> <message>
<location filename="../src/trackitem.cpp" line="20"/> <location filename="../src/trackitem.cpp" line="17"/>
<source>Time</source> <source>Total time</source>
<translation>Čas</translation> <translation>Celkový čas</translation>
</message> </message>
<message> <message>
<location filename="../src/trackitem.cpp" line="23"/> <location filename="../src/trackitem.cpp" line="19"/>
<source>Moving time</source>
<translation>Čistý čas</translation>
</message>
<message>
<location filename="../src/trackitem.cpp" line="21"/>
<source>Date</source> <source>Date</source>
<translation>Datum</translation> <translation>Datum</translation>
</message> </message>

1044
lang/gpxsee_sv.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,11 @@
!include "MUI2.nsh" !include "MUI2.nsh"
!include "x64.nsh" !include "x64.nsh"
!include "WinVer.nsh"
; The name of the installer ; The name of the installer
Name "GPXSee" Name "GPXSee"
; Program version ; Program version
!define VERSION "3.4" !define VERSION "3.9"
; The file to write ; The file to write
OutFile "GPXSee-${VERSION}.exe" OutFile "GPXSee-${VERSION}.exe"
@ -55,9 +56,15 @@ Var StartMenuFolder
; Languages ; Languages
!insertmacro MUI_LANGUAGE "English" !insertmacro MUI_LANGUAGE "English"
Function .onInit
${IfNot} ${AtLeastWin7}
MessageBox MB_OK "GPXSee can only be installed on Windows 7 or later."
Abort
${EndIf}
FunctionEnd
; The stuff to install ; The stuff to install
Section "GPXSee (required)" SEC_APP Section "GPXSee" SEC_APP
SectionIn RO SectionIn RO
@ -122,16 +129,15 @@ Section "GPXSee (required)" SEC_APP
SectionEnd SectionEnd
Section "QT libs" SEC_QT Section "QT framework" SEC_QT
SectionIn RO
File "Qt5Core.dll" File "Qt5Core.dll"
File "Qt5Gui.dll" File "Qt5Gui.dll"
File "Qt5Widgets.dll" File "Qt5Widgets.dll"
File "Qt5PrintSupport.dll" File "Qt5PrintSupport.dll"
File "Qt5Network.dll" File "Qt5Network.dll"
File "libGLESv2.dll"
File "libEGL.dll"
File "D3DCompiler_47.dll"
File /r "platforms" File /r "platforms"
File /r "imageformats" File /r "imageformats"
File /r "printsupport" File /r "printsupport"
@ -140,6 +146,8 @@ SectionEnd
Section "MSVC runtime" SEC_MSVC Section "MSVC runtime" SEC_MSVC
SectionIn RO
DetailPrint "Checking whether Visual C++ 2015 Redistributable is already installed..." DetailPrint "Checking whether Visual C++ 2015 Redistributable is already installed..."
${If} ${RunningX64} ${If} ${RunningX64}
ReadRegDword $R0 HKLM "SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x86" "Installed" ReadRegDword $R0 HKLM "SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x86" "Installed"
@ -159,6 +167,21 @@ Section "MSVC runtime" SEC_MSVC
done: done:
SectionEnd SectionEnd
Section "OpenSSL" SEC_OPENSSL
File "libeay32.dll"
File "ssleay32.dll"
SectionEnd
Section "ANGLE" SEC_ANGLE
File "libGLESv2.dll"
File "libEGL.dll"
File "D3DCompiler_47.dll"
SectionEnd
;-------------------------------- ;--------------------------------
; Uninstaller ; Uninstaller
@ -201,15 +224,21 @@ SectionEnd
;Language strings ;Language strings
LangString DESC_QT ${LANG_ENGLISH} \ LangString DESC_QT ${LANG_ENGLISH} \
"QT Library. Unselct only if you have QT already installed!" "QT cross-platform application framework."
LangString DESC_MSVC ${LANG_ENGLISH} \ LangString DESC_MSVC ${LANG_ENGLISH} \
"Visual C++ 2015 runtime components. Unselct only if you have the runtime already installed!" "Visual C++ 2015 runtime components. If already installed, will be skipped."
LangString DESC_OPENSSL ${LANG_ENGLISH} \
"OpenSSL library. Required for HTTPS to work."
LangString DESC_ANGLE ${LANG_ENGLISH} \
"ANGLE (OpenGL via Direct3D). Enables OpenGL on systems without native OpenGL drivers."
LangString DESC_APP ${LANG_ENGLISH} \ LangString DESC_APP ${LANG_ENGLISH} \
"GPXSee application" "GPXSee application"
;Assign language strings to sections ;Assign language strings to sections
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_QT} $(DESC_QT) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_QT} $(DESC_QT)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_OPENSSL} $(DESC_OPENSSL)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_ANGLE} $(DESC_ANGLE)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP)
!insertmacro MUI_FUNCTION_DESCRIPTION_END !insertmacro MUI_FUNCTION_DESCRIPTION_END

View File

@ -1,10 +1,11 @@
!include "MUI2.nsh" !include "MUI2.nsh"
!include "x64.nsh" !include "x64.nsh"
!include "WinVer.nsh"
; The name of the installer ; The name of the installer
Name "GPXSee" Name "GPXSee"
; Program version ; Program version
!define VERSION "3.4" !define VERSION "3.9"
; The file to write ; The file to write
OutFile "GPXSee-${VERSION}_x64.exe" OutFile "GPXSee-${VERSION}_x64.exe"
@ -56,6 +57,11 @@ Var StartMenuFolder
!insertmacro MUI_LANGUAGE "English" !insertmacro MUI_LANGUAGE "English"
Function .onInit Function .onInit
${IfNot} ${AtLeastWin7}
MessageBox MB_OK "GPXSee can only be installed on Windows 7 or later."
Abort
${EndIf}
${If} ${RunningX64} ${If} ${RunningX64}
SetRegView 64 SetRegView 64
${Else} ${Else}
@ -65,7 +71,7 @@ Function .onInit
FunctionEnd FunctionEnd
; The stuff to install ; The stuff to install
Section "GPXSee (required)" SEC_APP Section "GPXSee" SEC_APP
SectionIn RO SectionIn RO
@ -130,16 +136,15 @@ Section "GPXSee (required)" SEC_APP
SectionEnd SectionEnd
Section "QT libs" SEC_QT Section "QT framework" SEC_QT
SectionIn RO
File "Qt5Core.dll" File "Qt5Core.dll"
File "Qt5Gui.dll" File "Qt5Gui.dll"
File "Qt5Widgets.dll" File "Qt5Widgets.dll"
File "Qt5PrintSupport.dll" File "Qt5PrintSupport.dll"
File "Qt5Network.dll" File "Qt5Network.dll"
File "libGLESv2.dll"
File "libEGL.dll"
File "D3DCompiler_47.dll"
File /r "platforms" File /r "platforms"
File /r "imageformats" File /r "imageformats"
File /r "printsupport" File /r "printsupport"
@ -148,6 +153,8 @@ SectionEnd
Section "MSVC runtime" SEC_MSVC Section "MSVC runtime" SEC_MSVC
SectionIn RO
DetailPrint "Checking whether Visual C++ 2015 Redistributable is already installed..." DetailPrint "Checking whether Visual C++ 2015 Redistributable is already installed..."
ReadRegDword $R0 HKLM "SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x64" "Installed" ReadRegDword $R0 HKLM "SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x64" "Installed"
StrCmp $R0 "1" 0 +3 StrCmp $R0 "1" 0 +3
@ -162,6 +169,21 @@ Section "MSVC runtime" SEC_MSVC
done: done:
SectionEnd SectionEnd
Section "OpenSSL" SEC_OPENSSL
File "libeay32.dll"
File "ssleay32.dll"
SectionEnd
Section "ANGLE" SEC_ANGLE
File "libGLESv2.dll"
File "libEGL.dll"
File "D3DCompiler_47.dll"
SectionEnd
;-------------------------------- ;--------------------------------
; Uninstaller ; Uninstaller
@ -205,15 +227,21 @@ SectionEnd
;Language strings ;Language strings
LangString DESC_QT ${LANG_ENGLISH} \ LangString DESC_QT ${LANG_ENGLISH} \
"QT Library. Unselct only if you have QT already installed!" "QT cross-platform application framework."
LangString DESC_MSVC ${LANG_ENGLISH} \ LangString DESC_MSVC ${LANG_ENGLISH} \
"Visual C++ 2015 runtime components. Unselct only if you have the runtime already installed!" "Visual C++ 2015 runtime components. If already installed, will be skipped."
LangString DESC_OPENSSL ${LANG_ENGLISH} \
"OpenSSL library. Required for HTTPS to work."
LangString DESC_ANGLE ${LANG_ENGLISH} \
"ANGLE (OpenGL via Direct3D). Enables OpenGL on systems without native OpenGL drivers."
LangString DESC_APP ${LANG_ENGLISH} \ LangString DESC_APP ${LANG_ENGLISH} \
"GPXSee application" "GPXSee application"
;Assign language strings to sections ;Assign language strings to sections
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_QT} $(DESC_QT) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_QT} $(DESC_QT)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_OPENSSL} $(DESC_OPENSSL)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_ANGLE} $(DESC_ANGLE)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP) !insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP)
!insertmacro MUI_FUNCTION_DESCRIPTION_END !insertmacro MUI_FUNCTION_DESCRIPTION_END

View File

@ -1,2 +1,3 @@
Open Topo Map https://a.tile.opentopomap.org/$z/$x/$y.png
Thunderforest http://tile.thunderforest.com/outdoors/$z/$x/$y.png Thunderforest http://tile.thunderforest.com/outdoors/$z/$x/$y.png
Open Street Map http://tile.openstreetmap.org/$z/$x/$y.png Open Street Map http://tile.openstreetmap.org/$z/$x/$y.png

View File

@ -4,11 +4,7 @@
#include <QFileOpenEvent> #include <QFileOpenEvent>
#include <QNetworkProxyFactory> #include <QNetworkProxyFactory>
#include <QPixmapCache> #include <QPixmapCache>
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) #include "opengl.h"
#include <QGLFormat>
#else // QT 5
#include <QSurfaceFormat>
#endif // QT 5
#include "gui.h" #include "gui.h"
#include "app.h" #include "app.h"
@ -26,18 +22,8 @@ App::App(int &argc, char **argv) : QApplication(argc, argv),
#endif // Q_OS_MAC #endif // Q_OS_MAC
QNetworkProxyFactory::setUseSystemConfiguration(true); QNetworkProxyFactory::setUseSystemConfiguration(true);
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
QGLFormat fmt;
fmt.setSamples(10);
QGLFormat::setDefaultFormat(fmt);
#else
QSurfaceFormat fmt;
fmt.setSamples(4);
QSurfaceFormat::setDefaultFormat(fmt);
#endif
QPixmapCache::setCacheLimit(65536); QPixmapCache::setCacheLimit(65536);
OPENGL_SET_SAMPLES(4);
_gui = new GUI(); _gui = new GUI();
} }

View File

@ -64,6 +64,7 @@ QPair<Coordinates, Coordinates> Coordinates::boundingRect(qreal distance) const
maxLon = MAX_LON; maxLon = MAX_LON;
} }
return QPair<Coordinates, Coordinates>(Coordinates(rad2deg(minLon), return QPair<Coordinates, Coordinates>(Coordinates(rad2deg(qMin(minLon,
rad2deg(minLat)), Coordinates(rad2deg(maxLon), rad2deg(maxLat))); maxLon)), rad2deg(qMin(minLat, maxLat))), Coordinates(rad2deg(qMax(minLon,
maxLon)), rad2deg(qMax(minLat, maxLat))));
} }

View File

@ -1,5 +1,7 @@
#include <QFile> #include <QFile>
#include <QFileInfo> #include <QFileInfo>
#include <QNetworkRequest>
#include <QNetworkReply>
#include "config.h" #include "config.h"
#include "downloader.h" #include "downloader.h"
@ -17,25 +19,39 @@
#define USER_AGENT \ #define USER_AGENT \
APP_NAME "/" APP_VERSION " (" PLATFORM_STR "; Qt " QT_VERSION_STR ")" APP_NAME "/" APP_VERSION " (" PLATFORM_STR "; Qt " QT_VERSION_STR ")"
Downloader::Downloader() #define ATTR_REDIRECT QNetworkRequest::RedirectionTargetAttribute
#define ATTR_FILE QNetworkRequest::User
#define ATTR_ORIGIN (QNetworkRequest::Attribute)(QNetworkRequest::User + 1)
#define ATTR_LEVEL (QNetworkRequest::Attribute)(QNetworkRequest::User + 2)
#define MAX_REDIRECT_LEVEL 5
Downloader::Downloader(QObject *parent) : QObject(parent)
{ {
connect(&_manager, SIGNAL(finished(QNetworkReply*)), connect(&_manager, SIGNAL(finished(QNetworkReply*)),
SLOT(downloadFinished(QNetworkReply*))); SLOT(downloadFinished(QNetworkReply*)));
} }
bool Downloader::doDownload(const Download &dl) bool Downloader::doDownload(const Download &dl, const Redirect &redirect)
{ {
QUrl url(dl.url()); QUrl url(dl.url());
if (_errorDownloads.contains(url)) if (_errorDownloads.contains(url))
return false; return false;
if (_currentDownloads.contains(url))
return false;
QNetworkRequest request(url); QNetworkRequest request(url);
request.setAttribute(QNetworkRequest::User, QVariant(dl.file())); request.setAttribute(ATTR_FILE, QVariant(dl.file()));
if (!redirect.isNull()) {
request.setAttribute(ATTR_ORIGIN, QVariant(redirect.origin()));
request.setAttribute(ATTR_LEVEL, QVariant(redirect.level()));
}
request.setRawHeader("User-Agent", USER_AGENT); request.setRawHeader("User-Agent", USER_AGENT);
QNetworkReply *reply = _manager.get(request); QNetworkReply *reply = _manager.get(request);
_currentDownloads.append(reply); _currentDownloads.insert(url, reply);
return true; return true;
} }
@ -58,26 +74,49 @@ bool Downloader::saveToDisk(const QString &filename, QIODevice *data)
void Downloader::downloadFinished(QNetworkReply *reply) void Downloader::downloadFinished(QNetworkReply *reply)
{ {
QUrl url = reply->url(); QUrl url = reply->request().url();
if (reply->error()) { if (reply->error()) {
QUrl origin = reply->request().attribute(ATTR_ORIGIN).toUrl();
if (origin.isEmpty()) {
_errorDownloads.insert(url); _errorDownloads.insert(url);
fprintf(stderr, "Error downloading map tile: %s: %s\n", fprintf(stderr, "Error downloading map tile: %s: %s\n",
url.toEncoded().constData(), qPrintable(reply->errorString())); url.toEncoded().constData(), qPrintable(reply->errorString()));
} else { } else {
QUrl redirect = reply->attribute( _errorDownloads.insert(origin);
QNetworkRequest::RedirectionTargetAttribute).toUrl(); fprintf(stderr, "Error downloading map tile: %s -> %s: %s\n",
QString filename = reply->request().attribute(QNetworkRequest::User) origin.toEncoded().constData(), url.toEncoded().constData(),
qPrintable(reply->errorString()));
}
} else {
QUrl location = reply->attribute(ATTR_REDIRECT).toUrl();
QString filename = reply->request().attribute(ATTR_FILE)
.toString(); .toString();
if (!redirect.isEmpty()) { if (!location.isEmpty()) {
Download dl(redirect, filename); QUrl origin = reply->request().attribute(ATTR_ORIGIN).toUrl();
doDownload(dl); int level = reply->request().attribute(ATTR_LEVEL).toInt();
if (location == url) {
_errorDownloads.insert(url);
fprintf(stderr, "Error downloading map tile: %s: "
"redirect loop\n", url.toEncoded().constData());
} else if (level >= MAX_REDIRECT_LEVEL) {
_errorDownloads.insert(origin);
fprintf(stderr, "Error downloading map tile: %s: "
"redirect level limit reached\n",
origin.toEncoded().constData());
} else {
Redirect redirect(origin.isEmpty() ? url : origin, level + 1);
Download dl(location, filename);
doDownload(dl, redirect);
}
} else } else
if (!saveToDisk(filename, reply)) if (!saveToDisk(filename, reply))
_errorDownloads.insert(url); _errorDownloads.insert(url);
} }
_currentDownloads.removeAll(reply); _currentDownloads.remove(url);
reply->deleteLater(); reply->deleteLater();
if (_currentDownloads.isEmpty()) if (_currentDownloads.isEmpty())

View File

@ -2,13 +2,14 @@
#define DOWNLOADER_H #define DOWNLOADER_H
#include <QNetworkAccessManager> #include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QUrl> #include <QUrl>
#include <QList> #include <QList>
#include <QMap>
#include <QSet> #include <QSet>
class QNetworkReply;
class Download class Download
{ {
public: public:
@ -28,8 +29,8 @@ class Downloader : public QObject
Q_OBJECT Q_OBJECT
public: public:
static Downloader& instance() Downloader(QObject *parent = 0);
{static Downloader i; return i;}
bool get(const QList<Download> &list); bool get(const QList<Download> &list);
signals: signals:
@ -39,15 +40,28 @@ private slots:
void downloadFinished(QNetworkReply *reply); void downloadFinished(QNetworkReply *reply);
private: private:
Downloader(); class Redirect
Downloader(Downloader const&); {
void operator=(Downloader const&); public:
Redirect() : _level(0) {}
Redirect(const QUrl &origin, int level) :
_origin(origin), _level(level) {}
bool doDownload(const Download &dl); const QUrl &origin() const {return _origin;}
int level() const {return _level;}
bool isNull() const {return (_level == 0);}
private:
QUrl _origin;
int _level;
};
bool doDownload(const Download &dl, const Redirect &redirect = Redirect());
bool saveToDisk(const QString &filename, QIODevice *data); bool saveToDisk(const QString &filename, QIODevice *data);
QNetworkAccessManager _manager; QNetworkAccessManager _manager;
QList<QNetworkReply *> _currentDownloads; QMap<QUrl, QNetworkReply *> _currentDownloads;
QSet<QUrl> _errorDownloads; QSet<QUrl> _errorDownloads;
}; };

View File

@ -4,6 +4,7 @@
#include <QList> #include <QList>
#include "graphview.h" #include "graphview.h"
#include "units.h" #include "units.h"
#include "timetype.h"
class Data; class Data;
class PathItem; class PathItem;
@ -18,10 +19,11 @@ public:
virtual QString label() const = 0; virtual QString label() const = 0;
virtual void loadData(const Data &data, const QList<PathItem *> &paths) = 0; virtual void loadData(const Data &data, const QList<PathItem *> &paths) = 0;
virtual void clear() = 0; virtual void clear() {}
virtual void setUnits(enum Units units) = 0; virtual void setUnits(enum Units units) {Q_UNUSED(units)}
virtual void showTracks(bool show) = 0; virtual void setTimeType(enum TimeType type) {Q_UNUSED(type)}
virtual void showRoutes(bool show) = 0; virtual void showTracks(bool show) {Q_UNUSED(show)}
virtual void showRoutes(bool show) {Q_UNUSED(show)}
}; };
#endif // GRAPHTAB_H #endif // GRAPHTAB_H

View File

@ -3,12 +3,7 @@
#include <QMouseEvent> #include <QMouseEvent>
#include <QPaintEngine> #include <QPaintEngine>
#include <QPaintDevice> #include <QPaintDevice>
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) #include "opengl.h"
#include <QGLWidget>
#else // QT 5
#include <QOpenGLWidget>
#endif // QT 5
#include <QSysInfo>
#include "config.h" #include "config.h"
#include "axisitem.h" #include "axisitem.h"
#include "slideritem.h" #include "slideritem.h"
@ -26,9 +21,10 @@
GraphView::GraphView(QWidget *parent) GraphView::GraphView(QWidget *parent)
: QGraphicsView(parent) : QGraphicsView(parent)
{ {
_scene = new QGraphicsScene(); _scene = new QGraphicsScene(this);
setScene(_scene); setScene(_scene);
setBackgroundBrush(QBrush(Qt::white));
setViewportUpdateMode(QGraphicsView::FullViewportUpdate); setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
setRenderHint(QPainter::Antialiasing, true); setRenderHint(QPainter::Antialiasing, true);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
@ -462,15 +458,8 @@ void GraphView::setGraphWidth(int width)
void GraphView::useOpenGL(bool use) void GraphView::useOpenGL(bool use)
{ {
if (use) { if (use)
#ifdef Q_OS_WIN32 setViewport(new OPENGL_WIDGET);
if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA) else
#endif // Q_OS_WIN32
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
setViewport(new QGLWidget);
#else // QT 5
setViewport(new QOpenGLWidget);
#endif // QT 5
} else
setViewport(new QWidget); setViewport(new QWidget);
} }

View File

@ -36,6 +36,7 @@
#include "powergraph.h" #include "powergraph.h"
#include "pathview.h" #include "pathview.h"
#include "trackinfo.h" #include "trackinfo.h"
#include "downloader.h"
#include "filebrowser.h" #include "filebrowser.h"
#include "cpuarch.h" #include "cpuarch.h"
#include "graphtab.h" #include "graphtab.h"
@ -78,6 +79,7 @@ GUI::GUI(QWidget *parent) : QMainWindow(parent)
_trackDistance = 0; _trackDistance = 0;
_routeDistance = 0; _routeDistance = 0;
_time = 0; _time = 0;
_movingTime = 0;
_sliderPos = 0; _sliderPos = 0;
@ -116,10 +118,12 @@ void GUI::createBrowser()
void GUI::loadMaps() void GUI::loadMaps()
{ {
MapList ml(new Downloader(this));
if (QFile::exists(USER_MAP_FILE)) if (QFile::exists(USER_MAP_FILE))
_maps = MapList::load(this, USER_MAP_FILE); _maps = ml.load(USER_MAP_FILE, this);
else else
_maps = MapList::load(this, GLOBAL_MAP_FILE); _maps = ml.load(GLOBAL_MAP_FILE, this);
} }
void GUI::loadPOIs() void GUI::loadPOIs()
@ -135,8 +139,15 @@ void GUI::loadPOIs()
else else
list = globalDir.entryInfoList(QStringList(), QDir::Files); list = globalDir.entryInfoList(QStringList(), QDir::Files);
for (int i = 0; i < list.size(); ++i) for (int i = 0; i < list.size(); ++i) {
_poi->loadFile(list.at(i).absoluteFilePath()); if (!_poi->loadFile(list.at(i).absoluteFilePath())) {
fprintf(stderr, "Error loading POI file: %s: %s\n",
qPrintable(list.at(i).fileName()),
qPrintable(_poi->errorString()));
if (_poi->errorLine())
fprintf(stderr, "Line: %d\n", _poi->errorLine());
}
}
} }
void GUI::createMapActions() void GUI::createMapActions()
@ -349,6 +360,18 @@ void GUI::createActions()
SLOT(showToolbars(bool))); SLOT(showToolbars(bool)));
ag = new QActionGroup(this); ag = new QActionGroup(this);
ag->setExclusive(true); ag->setExclusive(true);
_totalTimeAction = new QAction(tr("Total time"), this);
_totalTimeAction->setCheckable(true);
_totalTimeAction->setActionGroup(ag);
connect(_totalTimeAction, SIGNAL(triggered()), this,
SLOT(setTotalTime()));
_movingTimeAction = new QAction(tr("Moving time"), this);
_movingTimeAction->setCheckable(true);
_movingTimeAction->setActionGroup(ag);
connect(_movingTimeAction, SIGNAL(triggered()), this,
SLOT(setMovingTime()));
ag = new QActionGroup(this);
ag->setExclusive(true);
_metricUnitsAction = new QAction(tr("Metric"), this); _metricUnitsAction = new QAction(tr("Metric"), this);
_metricUnitsAction->setCheckable(true); _metricUnitsAction->setCheckable(true);
_metricUnitsAction->setActionGroup(ag); _metricUnitsAction->setActionGroup(ag);
@ -440,6 +463,9 @@ void GUI::createMenus()
dataMenu->addAction(_showWaypointsAction); dataMenu->addAction(_showWaypointsAction);
QMenu *settingsMenu = menuBar()->addMenu(tr("Settings")); QMenu *settingsMenu = menuBar()->addMenu(tr("Settings"));
QMenu *timeMenu = settingsMenu->addMenu(tr("Time"));
timeMenu->addAction(_totalTimeAction);
timeMenu->addAction(_movingTimeAction);
QMenu *unitsMenu = settingsMenu->addMenu(tr("Units")); QMenu *unitsMenu = settingsMenu->addMenu(tr("Units"));
unitsMenu->addAction(_metricUnitsAction); unitsMenu->addAction(_metricUnitsAction);
unitsMenu->addAction(_imperialUnitsAction); unitsMenu->addAction(_imperialUnitsAction);
@ -537,15 +563,13 @@ void GUI::about()
QMessageBox msgBox(this); QMessageBox msgBox(this);
msgBox.setWindowTitle(tr("About GPXSee")); msgBox.setWindowTitle(tr("About GPXSee"));
msgBox.setText(QString("<h2>") + QString(APP_NAME) + QString("</h2><p>") msgBox.setText("<h2>" + QString(APP_NAME) + "</h2><p><p>" + tr("Version ")
+ QString("<p>") + tr("Version ") + APP_VERSION + QString(" (") + APP_VERSION + " (" + CPU_ARCH + ", Qt " + QT_VERSION_STR + ")</p>");
+ CPU_ARCH + QString(", Qt ") + QString(QT_VERSION_STR) msgBox.setInformativeText("<table width=\"300\"><tr><td>"
+ QString(")</p>"));
msgBox.setInformativeText(QString("<table width=\"300\"><tr><td>")
+ tr("GPXSee is distributed under the terms of the GNU General Public " + tr("GPXSee is distributed under the terms of the GNU General Public "
"License version 3. For more info about GPXSee visit the project " "License version 3. For more info about GPXSee visit the project "
"homepage at ") + QString("<a href=\"" APP_HOMEPAGE "\">" APP_HOMEPAGE "homepage at ") + "<a href=\"" + APP_HOMEPAGE + "\">" + APP_HOMEPAGE
"</a>.</td></tr></table>")); + "</a>.</td></tr></table>");
QIcon icon = msgBox.windowIcon(); QIcon icon = msgBox.windowIcon();
QSize size = icon.actualSize(QSize(64, 64)); QSize size = icon.actualSize(QSize(64, 64));
@ -559,20 +583,20 @@ void GUI::keys()
QMessageBox msgBox(this); QMessageBox msgBox(this);
msgBox.setWindowTitle(tr("Keyboard controls")); msgBox.setWindowTitle(tr("Keyboard controls"));
msgBox.setText(QString("<h3>") + tr("Keyboard controls") + QString("</h3>")); msgBox.setText("<h3>" + tr("Keyboard controls") + "</h3>");
msgBox.setInformativeText( msgBox.setInformativeText(
QString("<div><table width=\"300\"><tr><td>") + tr("Next file") "<div><table width=\"300\"><tr><td>" + tr("Next file")
+ QString("</td><td><i>SPACE</i></td></tr><tr><td>") + tr("Previous file") + "</td><td><i>" + QKeySequence(NEXT_KEY).toString()
+ QString("</td><td><i>BACKSPACE</i></td></tr><tr><td>") + "</i></td></tr><tr><td>" + tr("Previous file")
+ tr("First file") + QString("</td><td><i>HOME</i></td></tr><tr><td>") + "</td><td><i>" + QKeySequence(PREV_KEY).toString()
+ tr("Last file") + QString("</td><td><i>END</i></td></tr><tr><td>") + "</i></td></tr><tr><td>" + tr("First file") + "</td><td><i>"
+ tr("Append modifier") + QString("</td><td><i>SHIFT</i></td></tr>" + QKeySequence(FIRST_KEY).toString() + "</i></td></tr><tr><td>"
"<tr><td></td><td></td></tr><tr><td>") + tr("Last file") + "</td><td><i>" + QKeySequence(LAST_KEY).toString()
+ tr("Next map") + QString("</td><td><i>") + "</i></td></tr><tr><td>" + tr("Append modifier")
+ _nextMapAction->shortcut().toString() + QString("</i></td></tr><tr><td>") + "</td><td><i>SHIFT</i></td></tr><tr><td></td><td></td></tr><tr><td>"
+ tr("Previous map") + QString("</td><td><i>") + tr("Next map") + "</td><td><i>" + NEXT_MAP_SHORTCUT.toString()
+ _prevMapAction->shortcut().toString() + QString("</i></td></tr>" + "</i></td></tr><tr><td>" + tr("Previous map") + "</td><td><i>"
"</table></div>")); + PREV_MAP_SHORTCUT.toString() + "</i></td></tr></table></div>");
msgBox.exec(); msgBox.exec();
} }
@ -582,23 +606,23 @@ void GUI::dataSources()
QMessageBox msgBox(this); QMessageBox msgBox(this);
msgBox.setWindowTitle(tr("Data sources")); msgBox.setWindowTitle(tr("Data sources"));
msgBox.setText(QString("<h3>") + tr("Data sources") + QString("</h3>")); msgBox.setText("<h3>" + tr("Data sources") + "</h3>");
msgBox.setInformativeText( msgBox.setInformativeText(
QString("<h4>") + tr("Map sources") + QString("</h4><p>") "<h4>" + tr("Map sources") + "</h4><p>"
+ tr("Map (tiles) source URLs are read on program startup from the " + tr("Map (tiles) source URLs are read on program startup from the "
"following file:") "following file:")
+ QString("</p><p><code>") + USER_MAP_FILE + QString("</code></p><p>") + "</p><p><code>" + USER_MAP_FILE + "</code></p><p>"
+ tr("The file format is one map entry per line, consisting of the map " + tr("The file format is one map entry per line, consisting of the map "
"name and tiles URL delimited by a TAB character. The tile X and Y " "name and tiles URL delimited by a TAB character. The tile X and Y "
"coordinates are replaced with $x and $y in the URL and the zoom " "coordinates are replaced with $x and $y in the URL and the zoom "
"level is replaced with $z. An example map file could look like:") "level is replaced with $z. An example map file could look like:")
+ QString("</p><p><code>Map1 http://tile.server.com/map/$z/$x/$y.png" + "</p><p><code>Map1 http://tile.server.com/map/$z/$x/$y.png"
"<br/>Map2 http://mapserver.org/map/$z-$x-$y</code></p>") "<br/>Map2 http://mapserver.org/map/$z-$x-$y</code></p>"
+ QString("<h4>") + tr("POIs") + QString("</h4><p>") + "<h4>" + tr("POIs") + "</h4><p>"
+ tr("To make GPXSee load a POI file automatically on startup, add " + tr("To make GPXSee load a POI file automatically on startup, add "
"the file to the following directory:") "the file to the following directory:")
+ QString("</p><p><code>") + USER_POI_DIR + QString("</code></p>") + "</p><p><code>" + USER_POI_DIR + "</code></p>"
); );
msgBox.exec(); msgBox.exec();
@ -654,6 +678,7 @@ bool GUI::loadFile(const QString &fileName)
for (int i = 0; i < data.tracks().count(); i++) { for (int i = 0; i < data.tracks().count(); i++) {
_trackDistance += data.tracks().at(i)->distance(); _trackDistance += data.tracks().at(i)->distance();
_time += data.tracks().at(i)->time(); _time += data.tracks().at(i)->time();
_movingTime += data.tracks().at(i)->movingTime();
const QDate &date = data.tracks().at(i)->date().date(); const QDate &date = data.tracks().at(i)->date().date();
if (_dateRange.first.isNull() || _dateRange.first > date) if (_dateRange.first.isNull() || _dateRange.first > date)
_dateRange.first = date; _dateRange.first = date;
@ -668,6 +693,14 @@ bool GUI::loadFile(const QString &fileName)
_waypointCount += data.waypoints().count(); _waypointCount += data.waypoints().count();
if (_pathName.isNull()) {
if (data.tracks().count() == 1 && !data.routes().count())
_pathName = data.tracks().first()->name();
else if (data.routes().count() == 1 && !data.tracks().count())
_pathName = data.routes().first()->routeData().name();
} else
_pathName = QString();
return true; return true;
} else { } else {
updateNavigationActions(); updateNavigationActions();
@ -807,11 +840,23 @@ void GUI::plot(QPrinter *printer)
QPainter p(printer); QPainter p(printer);
TrackInfo info; TrackInfo info;
qreal ih, gh, mh, ratio; qreal ih, gh, mh, ratio;
Units units = _imperialUnitsAction->isChecked() ? Imperial : Metric;
qreal d = distance(); qreal d = distance();
qreal t = time(); qreal t = time();
qreal tm = movingTime();
if (_dateRange.first.isValid()) { if (!_pathName.isNull() && _options.printName)
info.insert(tr("Name"), _pathName);
if (_options.printItemCount) {
if (_trackCount > 1)
info.insert(tr("Tracks"), QString::number(_trackCount));
if (_routeCount > 1)
info.insert(tr("Routes"), QString::number(_routeCount));
if (_waypointCount > 2)
info.insert(tr("Waypoints"), QString::number(_waypointCount));
}
if (_dateRange.first.isValid() && _options.printDate) {
if (_dateRange.first == _dateRange.second) { if (_dateRange.first == _dateRange.second) {
QString format = QLocale::system().dateFormat(QLocale::LongFormat); QString format = QLocale::system().dateFormat(QLocale::LongFormat);
info.insert(tr("Date"), _dateRange.first.toString(format)); info.insert(tr("Date"), _dateRange.first.toString(format));
@ -823,17 +868,12 @@ void GUI::plot(QPrinter *printer)
} }
} }
if (_trackCount > 1) if (d > 0 && _options.printDistance)
info.insert(tr("Tracks"), QString::number(_trackCount)); info.insert(tr("Distance"), Format::distance(d, units()));
if (_routeCount > 1) if (t > 0 && _options.printTime)
info.insert(tr("Routes"), QString::number(_routeCount));
if (_waypointCount > 2)
info.insert(tr("Waypoints"), QString::number(_waypointCount));
if (d > 0)
info.insert(tr("Distance"), Format::distance(d, units));
if (t > 0)
info.insert(tr("Time"), Format::timeSpan(t)); info.insert(tr("Time"), Format::timeSpan(t));
if (tm > 0 && _options.printMovingTime)
info.insert(tr("Moving time"), Format::timeSpan(tm));
ratio = p.paintEngine()->paintDevice()->logicalDpiX() / SCREEN_DPI; ratio = p.paintEngine()->paintDevice()->logicalDpiX() / SCREEN_DPI;
@ -845,7 +885,7 @@ void GUI::plot(QPrinter *printer)
mh = ih / 2; mh = ih / 2;
info.plot(&p, QRectF(0, 0, printer->width(), ih)); info.plot(&p, QRectF(0, 0, printer->width(), ih));
} }
if (_graphTabWidget->isVisible()) { if (_graphTabWidget->isVisible() && !_options.separateGraphPage) {
qreal r = (((qreal)(printer)->width()) / (qreal)(printer->height())); qreal r = (((qreal)(printer)->width()) / (qreal)(printer->height()));
gh = (printer->width() > printer->height()) gh = (printer->width() > printer->height())
? 0.15 * r * (printer->height() - ih - 2*mh) ? 0.15 * r * (printer->height() - ih - 2*mh)
@ -857,6 +897,27 @@ void GUI::plot(QPrinter *printer)
gh = 0; gh = 0;
_pathView->plot(&p, QRectF(0, ih + mh, printer->width(), printer->height() _pathView->plot(&p, QRectF(0, ih + mh, printer->width(), printer->height()
- (ih + 2*mh + gh))); - (ih + 2*mh + gh)));
if (_graphTabWidget->isVisible() && _options.separateGraphPage) {
printer->newPage();
int cnt = 0;
for (int i = 0; i < _tabs.size(); i++)
if (_tabs.at(i)->count())
cnt++;
qreal sp = ratio * 20;
gh = qMin((printer->height() - ((cnt - 1) * sp))/(qreal)cnt,
0.20 * printer->height());
qreal y = 0;
for (int i = 0; i < _tabs.size(); i++) {
if (_tabs.at(i)->count()) {
_tabs.at(i)->plot(&p, QRectF(0, y, printer->width(), gh));
y += gh + sp;
}
}
}
} }
void GUI::reloadFile() void GUI::reloadFile()
@ -867,7 +928,9 @@ void GUI::reloadFile()
_trackDistance = 0; _trackDistance = 0;
_routeDistance = 0; _routeDistance = 0;
_time = 0; _time = 0;
_movingTime = 0;
_dateRange = DateRange(QDate(), QDate()); _dateRange = DateRange(QDate(), QDate());
_pathName = QString();
for (int i = 0; i < _tabs.count(); i++) for (int i = 0; i < _tabs.count(); i++)
_tabs.at(i)->clear(); _tabs.at(i)->clear();
@ -900,7 +963,9 @@ void GUI::closeFiles()
_trackDistance = 0; _trackDistance = 0;
_routeDistance = 0; _routeDistance = 0;
_time = 0; _time = 0;
_movingTime = 0;
_dateRange = DateRange(QDate(), QDate()); _dateRange = DateRange(QDate(), QDate());
_pathName = QString();
_sliderPos = 0; _sliderPos = 0;
@ -1014,31 +1079,36 @@ void GUI::clearMapCache()
void GUI::updateStatusBarInfo() void GUI::updateStatusBarInfo()
{ {
if (_files.count() == 0) if (_files.count() == 0)
_fileNameLabel->setText(tr("No GPX files loaded")); _fileNameLabel->setText(tr("No files loaded"));
else if (_files.count() == 1) else if (_files.count() == 1)
_fileNameLabel->setText(_files.at(0)); _fileNameLabel->setText(_files.at(0));
else else
_fileNameLabel->setText(tr("%n files", "", _files.count())); _fileNameLabel->setText(tr("%n files", "", _files.count()));
qreal d = distance(); if (distance() > 0)
Units units = _imperialUnitsAction->isChecked() ? Imperial : Metric; _distanceLabel->setText(Format::distance(distance(), units()));
if (d > 0)
_distanceLabel->setText(Format::distance(distance(), units));
else else
_distanceLabel->clear(); _distanceLabel->clear();
qreal t = time(); if (time() > 0) {
if (t > 0) if (_movingTimeAction->isChecked()) {
_timeLabel->setText(Format::timeSpan(movingTime())
+ "<sub>M</sub>");
_timeLabel->setToolTip(Format::timeSpan(time()));
} else {
_timeLabel->setText(Format::timeSpan(time())); _timeLabel->setText(Format::timeSpan(time()));
else _timeLabel->setToolTip(Format::timeSpan(movingTime()));
}
} else {
_timeLabel->clear(); _timeLabel->clear();
_timeLabel->setToolTip(QString());
}
} }
void GUI::updateWindowTitle() void GUI::updateWindowTitle()
{ {
if (_files.count() == 1) if (_files.count() == 1)
setWindowTitle(QFileInfo(_files.at(0)).fileName() setWindowTitle(QFileInfo(_files.at(0)).fileName() + " - " + APP_NAME);
+ QString(" - " APP_NAME));
else else
setWindowTitle(APP_NAME); setWindowTitle(APP_NAME);
} }
@ -1141,6 +1211,14 @@ void GUI::updatePathView()
+ _pathView->waypointCount())); + _pathView->waypointCount()));
} }
void GUI::setTimeType(TimeType type)
{
for (int i = 0; i <_tabs.count(); i++)
_tabs.at(i)->setTimeType(type);
updateStatusBarInfo();
}
void GUI::setUnits(Units units) void GUI::setUnits(Units units)
{ {
_export.units = units; _export.units = units;
@ -1276,6 +1354,10 @@ void GUI::writeSettings()
settings.endGroup(); settings.endGroup();
settings.beginGroup(SETTINGS_SETTINGS_GROUP); settings.beginGroup(SETTINGS_SETTINGS_GROUP);
if ((_movingTimeAction->isChecked() ? Moving : Total) !=
TIME_TYPE_DEFAULT)
settings.setValue(TIME_TYPE_SETTING, _movingTimeAction->isChecked()
? Moving : Total);
if ((_imperialUnitsAction->isChecked() ? Imperial : Metric) != if ((_imperialUnitsAction->isChecked() ? Imperial : Metric) !=
UNITS_DEFAULT) UNITS_DEFAULT)
settings.setValue(UNITS_SETTING, _imperialUnitsAction->isChecked() settings.setValue(UNITS_SETTING, _imperialUnitsAction->isChecked()
@ -1378,6 +1460,21 @@ void GUI::writeSettings()
settings.setValue(POI_RADIUS_SETTING, _options.poiRadius); settings.setValue(POI_RADIUS_SETTING, _options.poiRadius);
if (_options.useOpenGL != USE_OPENGL_DEFAULT) if (_options.useOpenGL != USE_OPENGL_DEFAULT)
settings.setValue(USE_OPENGL_SETTING, _options.useOpenGL); settings.setValue(USE_OPENGL_SETTING, _options.useOpenGL);
if (_options.printName != PRINT_NAME_DEFAULT)
settings.setValue(PRINT_NAME_SETTING, _options.printName);
if (_options.printDate != PRINT_DATE_DEFAULT)
settings.setValue(PRINT_DATE_SETTING, _options.printDate);
if (_options.printDistance != PRINT_DISTANCE_DEFAULT)
settings.setValue(PRINT_DISTANCE_SETTING, _options.printDistance);
if (_options.printTime != PRINT_TIME_DEFAULT)
settings.setValue(PRINT_TIME_SETTING, _options.printTime);
if (_options.printMovingTime != PRINT_MOVING_TIME_DEFAULT)
settings.setValue(PRINT_MOVING_TIME_SETTING, _options.printMovingTime);
if (_options.printItemCount != PRINT_ITEM_COUNT_DEFAULT)
settings.setValue(PRINT_ITEM_COUNT_SETTING, _options.printItemCount);
if (_options.separateGraphPage != SEPARATE_GRAPH_PAGE_DEFAULT)
settings.setValue(SEPARATE_GRAPH_PAGE_SETTING,
_options.separateGraphPage);
settings.endGroup(); settings.endGroup();
} }
@ -1391,6 +1488,14 @@ void GUI::readSettings()
settings.endGroup(); settings.endGroup();
settings.beginGroup(SETTINGS_SETTINGS_GROUP); settings.beginGroup(SETTINGS_SETTINGS_GROUP);
if (settings.value(TIME_TYPE_SETTING, TIME_TYPE_DEFAULT).toInt()
== Moving) {
setTimeType(Moving);
_movingTimeAction->setChecked(true);
} else {
setTimeType(Total);
_totalTimeAction->setChecked(true);
}
if (settings.value(UNITS_SETTING, UNITS_DEFAULT).toInt() == Imperial) { if (settings.value(UNITS_SETTING, UNITS_DEFAULT).toInt() == Imperial) {
setUnits(Imperial); setUnits(Imperial);
_imperialUnitsAction->setChecked(true); _imperialUnitsAction->setChecked(true);
@ -1534,6 +1639,20 @@ void GUI::readSettings()
.toInt(); .toInt();
_options.useOpenGL = settings.value(USE_OPENGL_SETTING, USE_OPENGL_DEFAULT) _options.useOpenGL = settings.value(USE_OPENGL_SETTING, USE_OPENGL_DEFAULT)
.toBool(); .toBool();
_options.printName = settings.value(PRINT_NAME_SETTING, PRINT_NAME_DEFAULT)
.toBool();
_options.printDate = settings.value(PRINT_DATE_SETTING, PRINT_DATE_DEFAULT)
.toBool();
_options.printDistance = settings.value(PRINT_DISTANCE_SETTING,
PRINT_DISTANCE_DEFAULT).toBool();
_options.printTime = settings.value(PRINT_TIME_SETTING, PRINT_TIME_DEFAULT)
.toBool();
_options.printMovingTime = settings.value(PRINT_MOVING_TIME_SETTING,
PRINT_MOVING_TIME_DEFAULT).toBool();
_options.printItemCount = settings.value(PRINT_ITEM_COUNT_SETTING,
PRINT_ITEM_COUNT_DEFAULT).toBool();
_options.separateGraphPage = settings.value(SEPARATE_GRAPH_PAGE_SETTING,
SEPARATE_GRAPH_PAGE_DEFAULT).toBool();
_pathView->setPalette(_options.palette); _pathView->setPalette(_options.palette);
_pathView->setTrackWidth(_options.trackWidth); _pathView->setTrackWidth(_options.trackWidth);
@ -1567,6 +1686,11 @@ int GUI::mapIndex(const QString &name)
return 0; return 0;
} }
Units GUI::units() const
{
return _imperialUnitsAction->isChecked() ? Imperial : Metric;
}
qreal GUI::distance() const qreal GUI::distance() const
{ {
qreal dist = 0; qreal dist = 0;
@ -1583,3 +1707,8 @@ qreal GUI::time() const
{ {
return (_showTracksAction->isChecked()) ? _time : 0; return (_showTracksAction->isChecked()) ? _time : 0;
} }
qreal GUI::movingTime() const
{
return (_showTracksAction->isChecked()) ? _movingTime : 0;
}

View File

@ -7,6 +7,7 @@
#include <QDate> #include <QDate>
#include <QPrinter> #include <QPrinter>
#include "units.h" #include "units.h"
#include "timetype.h"
#include "graph.h" #include "graph.h"
#include "poi.h" #include "poi.h"
#include "exportdialog.h" #include "exportdialog.h"
@ -67,6 +68,8 @@ private slots:
void last(); void last();
void first(); void first();
void setTotalTime() {setTimeType(Total);}
void setMovingTime() {setTimeType(Moving);}
void setMetricUnits() {setUnits(Metric);} void setMetricUnits() {setUnits(Metric);}
void setImperialUnits() {setUnits(Imperial);} void setImperialUnits() {setUnits(Imperial);}
void setDistanceGraph() {setGraphType(Distance);} void setDistanceGraph() {setGraphType(Distance);}
@ -102,11 +105,15 @@ private:
void updateGraphTabs(); void updateGraphTabs();
void updatePathView(); void updatePathView();
TimeType timeType() const;
Units units() const;
void setTimeType(TimeType type);
void setUnits(Units units); void setUnits(Units units);
void setGraphType(GraphType type); void setGraphType(GraphType type);
qreal distance() const; qreal distance() const;
qreal time() const; qreal time() const;
qreal movingTime() const;
int mapIndex(const QString &name); int mapIndex(const QString &name);
void readSettings(); void readSettings();
void writeSettings(); void writeSettings();
@ -154,6 +161,8 @@ private:
QAction *_firstAction; QAction *_firstAction;
QAction *_metricUnitsAction; QAction *_metricUnitsAction;
QAction *_imperialUnitsAction; QAction *_imperialUnitsAction;
QAction *_totalTimeAction;
QAction *_movingTimeAction;
QAction *_nextMapAction; QAction *_nextMapAction;
QAction *_prevMapAction; QAction *_prevMapAction;
QAction *_showTracksAction; QAction *_showTracksAction;
@ -188,7 +197,9 @@ private:
qreal _trackDistance; qreal _trackDistance;
qreal _routeDistance; qreal _routeDistance;
qreal _time; qreal _time;
qreal _movingTime;
DateRange _dateRange; DateRange _dateRange;
QString _pathName;
qreal _sliderPos; qreal _sliderPos;

View File

@ -13,9 +13,7 @@ public:
QString label() const {return tr("Heart rate");} QString label() const {return tr("Heart rate");}
void loadData(const Data &data, const QList<PathItem *> &paths); void loadData(const Data &data, const QList<PathItem *> &paths);
void clear(); void clear();
void setUnits(enum Units) {}
void showTracks(bool show); void showTracks(bool show);
void showRoutes(bool show) {Q_UNUSED(show);}
private: private:
qreal avg() const; qreal avg() const;

View File

@ -23,5 +23,6 @@
#define APPEARANCE_ICON ":/icons/preferences-desktop-display.png" #define APPEARANCE_ICON ":/icons/preferences-desktop-display.png"
#define POI_ICON ":/icons/flag_48.png" #define POI_ICON ":/icons/flag_48.png"
#define SYSTEM_ICON ":/icons/system-run.png" #define SYSTEM_ICON ":/icons/system-run.png"
#define PRINT_EXPORT_ICON ":/icons/document-print-preview.png"
#endif /* ICONS_H */ #endif /* ICONS_H */

View File

@ -78,6 +78,7 @@ void InfoItem::insert(const QString &key, const QString &value)
_list[i] = kv; _list[i] = kv;
updateBoundingRect(); updateBoundingRect();
update();
} }
void InfoItem::clear() void InfoItem::clear()

View File

@ -10,15 +10,15 @@
#define LAST_KEY Qt::Key_End #define LAST_KEY Qt::Key_End
#define MODIFIER Qt::ShiftModifier #define MODIFIER Qt::ShiftModifier
#define QUIT_SHORTCUT QKeySequence::Quit #define QUIT_SHORTCUT QKeySequence(QKeySequence::Quit)
#define OPEN_SHORTCUT QKeySequence::Open #define OPEN_SHORTCUT QKeySequence(QKeySequence::Open)
#define CLOSE_SHORTCUT QKeySequence::Close #define CLOSE_SHORTCUT QKeySequence(QKeySequence::Close)
#define RELOAD_SHORTCUT QKeySequence::Refresh #define RELOAD_SHORTCUT QKeySequence(QKeySequence::Refresh)
#define EXPORT_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_E) #define EXPORT_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_E)
#define SHOW_POI_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_P) #define SHOW_POI_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_P)
#define SHOW_MAP_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_M) #define SHOW_MAP_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_M)
#define NEXT_MAP_SHORTCUT QKeySequence::Forward #define NEXT_MAP_SHORTCUT QKeySequence(QKeySequence::Forward)
#define PREV_MAP_SHORTCUT QKeySequence::Back #define PREV_MAP_SHORTCUT QKeySequence(QKeySequence::Back)
#define SHOW_GRAPHS_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_G) #define SHOW_GRAPHS_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_G)
#define DISTANCE_GRAPH_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_D) #define DISTANCE_GRAPH_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_D)
#define TIME_GRAPH_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_T) #define TIME_GRAPH_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_T)

View File

@ -5,14 +5,16 @@
#include "map.h" #include "map.h"
Map::Map(QObject *parent, const QString &name, const QString &url) Map::Map(const QString &name, const QString &url, Downloader *downloader,
: QObject(parent) QObject *parent) : QObject(parent)
{ {
_name = name; _name = name;
_url = url; _url = url;
connect(&Downloader::instance(), SIGNAL(finished()), this, _downloader = downloader;
SLOT(emitLoaded()));
connect(_downloader, SIGNAL(finished()), this, SLOT(emitLoaded()));
QString path = TILES_DIR + QString("/") + _name; QString path = TILES_DIR + QString("/") + _name;
if (!QDir().mkpath(path)) if (!QDir().mkpath(path))
@ -49,7 +51,7 @@ void Map::loadTilesAsync(QList<Tile> &list)
} }
if (!dl.empty()) if (!dl.empty())
Downloader::instance().get(dl); _downloader->get(dl);
} }
void Map::loadTilesSync(QList<Tile> &list) void Map::loadTilesSync(QList<Tile> &list)
@ -71,8 +73,8 @@ void Map::loadTilesSync(QList<Tile> &list)
return; return;
QEventLoop wait; QEventLoop wait;
connect(&Downloader::instance(), SIGNAL(finished()), &wait, SLOT(quit())); connect(_downloader, SIGNAL(finished()), &wait, SLOT(quit()));
if (Downloader::instance().get(dl)) if (_downloader->get(dl))
wait.exec(); wait.exec();
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {

View File

@ -3,13 +3,15 @@
#include "tile.h" #include "tile.h"
class Downloader;
class Map : public QObject class Map : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
Map(QObject *parent = 0, const QString &name = QString(), Map(const QString &name, const QString &url, Downloader *downloader,
const QString &url = QString()); QObject *parent = 0);
const QString &name() const {return _name;} const QString &name() const {return _name;}
void loadTiles(QList<Tile> &list, bool block); void loadTiles(QList<Tile> &list, bool block);
@ -30,6 +32,8 @@ private:
void loadTilesAsync(QList<Tile> &list); void loadTilesAsync(QList<Tile> &list);
void loadTilesSync(QList<Tile> &list); void loadTilesSync(QList<Tile> &list);
Downloader *_downloader;
QString _name; QString _name;
QString _url; QString _url;
}; };

View File

@ -4,7 +4,7 @@
#include "maplist.h" #include "maplist.h"
QList<Map*> MapList::load(QObject *parent, const QString &fileName) QList<Map*> MapList::load(const QString &fileName, QObject *parent)
{ {
QList<Map*> mapList; QList<Map*> mapList;
QFileInfo fi(fileName); QFileInfo fi(fileName);
@ -33,8 +33,8 @@ QList<Map*> MapList::load(QObject *parent, const QString &fileName)
QByteArray ba1 = list[0].trimmed(); QByteArray ba1 = list[0].trimmed();
QByteArray ba2 = list[1].trimmed(); QByteArray ba2 = list[1].trimmed();
mapList.append(new Map(parent, QString::fromUtf8(ba1.data(), ba1.size()), mapList.append(new Map(QString::fromUtf8(ba1.data(), ba1.size()),
QString::fromLatin1(ba2.data(), ba2.size()))); QString::fromLatin1(ba2.data(), ba2.size()), _downloader, parent));
} }
return mapList; return mapList;

View File

@ -6,12 +6,16 @@
#include <QObject> #include <QObject>
class Map; class Map;
class Downloader;
class MapList class MapList
{ {
public: public:
static QList<Map*> load(QObject *parent = 0, MapList(Downloader *downloader) : _downloader(downloader) {}
const QString &fileName = QString()); QList<Map*> load(const QString &fileName, QObject *parent = 0);
private:
Downloader *_downloader;
}; };
#endif // MAPLIST_H #endif // MAPLIST_H

View File

@ -313,7 +313,7 @@ bool NMEAParser::readGGA(const char *line, int len)
return false; return false;
break; break;
case 3: case 3:
if (!readNS(vp, lp - vp, lon)) if (!readNS(vp, lp - vp, lat))
return false; return false;
break; break;
case 4: case 4:

26
src/opengl.h Normal file
View File

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

View File

@ -142,19 +142,58 @@ QWidget *OptionsDialog::createPOIPage()
return poiPage; return poiPage;
} }
QWidget *OptionsDialog::createExportPage()
{
_name = new QCheckBox(tr("Name"));
_name->setChecked(_options->printName);
_date = new QCheckBox(tr("Date"));
_date->setChecked(_options->printDate);
_distance = new QCheckBox(tr("Distance"));
_distance->setChecked(_options->printDistance);
_time = new QCheckBox(tr("Time"));
_time->setChecked(_options->printTime);
_movingTime = new QCheckBox(tr("Moving time"));
_movingTime->setChecked(_options->printMovingTime);
_itemCount = new QCheckBox(tr("Item count (>1)"));
_itemCount->setChecked(_options->printItemCount);
QFormLayout *headerTabLayout = new QFormLayout();
headerTabLayout->addWidget(_name);
headerTabLayout->addWidget(_date);
headerTabLayout->addWidget(_distance);
headerTabLayout->addWidget(_time);
headerTabLayout->addWidget(_movingTime);
headerTabLayout->addItem(new QSpacerItem(10, 10));
headerTabLayout->addWidget(_itemCount);
QWidget *headerTab = new QWidget();
headerTab->setLayout(headerTabLayout);
_separateGraphPage = new QCheckBox(tr("Separate graph page"));
_separateGraphPage->setChecked(_options->separateGraphPage);
QFormLayout *graphTabLayout = new QFormLayout();
graphTabLayout->addWidget(_separateGraphPage);
QWidget *graphTab = new QWidget();
graphTab->setLayout(graphTabLayout);
QTabWidget *exportPage = new QTabWidget();
exportPage->addTab(headerTab, tr("Header"));
exportPage->addTab(graphTab, tr("Graphs"));
return exportPage;
}
QWidget *OptionsDialog::createSystemPage() QWidget *OptionsDialog::createSystemPage()
{ {
_useOpenGL = new QCheckBox(tr("Use OpenGL")); _useOpenGL = new QCheckBox(tr("Use OpenGL"));
#if defined(Q_OS_WIN32) || defined(Q_OS_MAC)
#ifdef Q_OS_WIN32 #ifdef Q_OS_WIN32
if (QSysInfo::WindowsVersion < QSysInfo::WV_VISTA) { if (QSysInfo::WindowsVersion < QSysInfo::WV_VISTA) {
#endif // Q_OS_WIN32
_useOpenGL->setChecked(false); _useOpenGL->setChecked(false);
_useOpenGL->setEnabled(false); _useOpenGL->setEnabled(false);
#ifdef Q_OS_WIN32
} else } else
#endif // Q_OS_WIN32 #endif // Q_OS_WIN32
#endif // Q_OS_WIN32 || Q_OS_MAC
_useOpenGL->setChecked(_options->useOpenGL); _useOpenGL->setChecked(_options->useOpenGL);
QFormLayout *systemLayout = new QFormLayout(); QFormLayout *systemLayout = new QFormLayout();
@ -175,6 +214,7 @@ OptionsDialog::OptionsDialog(Options *options, QWidget *parent)
QStackedWidget *pages = new QStackedWidget(); QStackedWidget *pages = new QStackedWidget();
pages->addWidget(createAppearancePage()); pages->addWidget(createAppearancePage());
pages->addWidget(createPOIPage()); pages->addWidget(createPOIPage());
pages->addWidget(createExportPage());
pages->addWidget(createSystemPage()); pages->addWidget(createSystemPage());
QListWidget *menu = new QListWidget(); QListWidget *menu = new QListWidget();
@ -182,6 +222,8 @@ OptionsDialog::OptionsDialog(Options *options, QWidget *parent)
new QListWidgetItem(QIcon(QPixmap(APPEARANCE_ICON)), tr("Appearance"), new QListWidgetItem(QIcon(QPixmap(APPEARANCE_ICON)), tr("Appearance"),
menu); menu);
new QListWidgetItem(QIcon(QPixmap(POI_ICON)), tr("POI"), menu); new QListWidgetItem(QIcon(QPixmap(POI_ICON)), tr("POI"), menu);
new QListWidgetItem(QIcon(QPixmap(PRINT_EXPORT_ICON)), tr("Print & Export"),
menu);
new QListWidgetItem(QIcon(QPixmap(SYSTEM_ICON)), tr("System"), menu); new QListWidgetItem(QIcon(QPixmap(SYSTEM_ICON)), tr("System"), menu);
QHBoxLayout *contentLayout = new QHBoxLayout(); QHBoxLayout *contentLayout = new QHBoxLayout();
@ -234,5 +276,13 @@ void OptionsDialog::accept()
_options->useOpenGL = _useOpenGL->isChecked(); _options->useOpenGL = _useOpenGL->isChecked();
_options->printName = _name->isChecked();
_options->printDate = _date->isChecked();
_options->printDistance = _distance->isChecked();
_options->printTime = _time->isChecked();
_options->printMovingTime = _movingTime->isChecked();
_options->printItemCount = _itemCount->isChecked();
_options->separateGraphPage = _separateGraphPage->isChecked();
QDialog::accept(); QDialog::accept();
} }

View File

@ -26,6 +26,14 @@ struct Options {
int poiRadius; int poiRadius;
// System // System
bool useOpenGL; bool useOpenGL;
// Print/Export
bool printName;
bool printDate;
bool printDistance;
bool printTime;
bool printMovingTime;
bool printItemCount;
bool separateGraphPage;
Units units; Units units;
}; };
@ -44,6 +52,7 @@ private:
QWidget *createAppearancePage(); QWidget *createAppearancePage();
QWidget *createPOIPage(); QWidget *createPOIPage();
QWidget *createSystemPage(); QWidget *createSystemPage();
QWidget *createExportPage();
Options *_options; Options *_options;
@ -58,6 +67,13 @@ private:
QCheckBox *_graphAA; QCheckBox *_graphAA;
QDoubleSpinBox *_poiRadius; QDoubleSpinBox *_poiRadius;
QCheckBox *_useOpenGL; QCheckBox *_useOpenGL;
QCheckBox *_name;
QCheckBox *_date;
QCheckBox *_distance;
QCheckBox *_time;
QCheckBox *_movingTime;
QCheckBox *_itemCount;
QCheckBox *_separateGraphPage;
}; };
#endif // OPTIONSDIALOG_H #endif // OPTIONSDIALOG_H

View File

@ -1,13 +1,9 @@
#include <QGraphicsView> #include <QGraphicsView>
#include <QGraphicsScene> #include <QGraphicsScene>
#include <QWheelEvent> #include <QWheelEvent>
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) #include "opengl.h"
#include <QGLWidget>
#else // QT 5
#include <QOpenGLWidget>
#endif // QT 5
#include <QSysInfo>
#include "rd.h" #include "rd.h"
#include "wgs84.h"
#include "poi.h" #include "poi.h"
#include "data.h" #include "data.h"
#include "map.h" #include "map.h"
@ -27,21 +23,20 @@ static QPoint mercator2tile(const QPointF &m, int z)
{ {
QPoint tile; QPoint tile;
tile.setX((int)(floor((m.x() + 180.0) / 360.0 * pow(2.0, z)))); tile.setX((int)(floor((m.x() + 180.0) / 360.0 * (1<<z))));
tile.setY((int)(floor((1.0 - (m.y() / 180.0)) / 2.0 * pow(2.0, z)))); tile.setY((int)(floor((1.0 - (m.y() / 180.0)) / 2.0 * (1<<z))));
return tile; return tile;
} }
static QPointF tile2mercator(const QPoint &tile, int z) static QPointF tile2mercator(const QPoint &tile, int z)
{ {
Coordinates m; QPointF m;
m.setLon(tile.x() / pow(2.0, z) * 360.0 - 180); m.setX(((360.0 * tile.x()) / (qreal)(1<<z)) - 180.0);
qreal n = M_PI - 2.0 * M_PI * tile.y() / pow(2.0, z); m.setY((1.0 - (2.0 * tile.y()) / (qreal)(1<<z)) * 180.0);
m.setLat(rad2deg(atan(0.5 * (exp(n) - exp(-n)))));
return m.toMercator(); return m;
} }
static int scale2zoom(qreal scale) static int scale2zoom(qreal scale)
@ -61,10 +56,15 @@ qreal mapScale(int zoom)
return ((360.0/(qreal)(1<<zoom))/(qreal)Tile::size()); return ((360.0/(qreal)(1<<zoom))/(qreal)Tile::size());
} }
static QRectF qrectf(const QPointF &p1, const QPointF &p2) static QRectF mapBounds()
{ {
return QRectF(QPointF(qMin(p1.x(), p2.x()), qMin(p1.y(), p2.y())), return QRectF(QPointF(-180, -180), QSizeF(360, 360));
QPointF(qMax(p1.x(), p2.x()), qMax(p1.y(), p2.y()))); }
static qreal zoom2resolution(int zoom, qreal y)
{
return (WGS84_RADIUS * 2 * M_PI / Tile::size()
* cos(2.0 * atan(exp(deg2rad(y))) - M_PI/2)) / (qreal)(1<<zoom);
} }
static void unite(QRectF &rect, const QPointF &p) static void unite(QRectF &rect, const QPointF &p)
@ -103,6 +103,7 @@ PathView::PathView(QWidget *parent)
_mapScale->setZValue(2.0); _mapScale->setZValue(2.0);
_zoom = ZOOM_MAX; _zoom = ZOOM_MAX;
_res = 1.0;
_map = 0; _map = 0;
_poi = 0; _poi = 0;
@ -122,6 +123,8 @@ PathView::PathView(QWidget *parent)
_routeStyle = Qt::DashLine; _routeStyle = Qt::DashLine;
_plot = false; _plot = false;
_scene->setSceneRect(scaled(mapBounds(), 1.0 / mapScale(_zoom)));
} }
PathView::~PathView() PathView::~PathView()
@ -188,21 +191,13 @@ void PathView::addWaypoints(const QList<Waypoint> &waypoints)
const Waypoint &w = waypoints.at(i); const Waypoint &w = waypoints.at(i);
WaypointItem *wi = new WaypointItem(w); WaypointItem *wi = new WaypointItem(w);
_waypoints.append(wi);
updateWaypointsBoundingRect(wi->coordinates());
wi->setScale(1.0/scale); wi->setScale(1.0/scale);
wi->setZValue(1); wi->setZValue(1);
wi->showLabel(_showWaypointLabels); wi->showLabel(_showWaypointLabels);
wi->setVisible(_showWaypoints); wi->setVisible(_showWaypoints);
_scene->addItem(wi); _scene->addItem(wi);
if (_wr.isNull()) {
if (_wp.isNull())
_wp = wi->coordinates();
else
_wr = qrectf(_wp, wi->coordinates());
} else
unite(_wr, wi->coordinates());
_waypoints.append(wi);
} }
if (_poi) if (_poi)
@ -219,33 +214,49 @@ QList<PathItem *> PathView::loadData(const Data &data)
for (int i = 0; i < data.tracks().count(); i++) for (int i = 0; i < data.tracks().count(); i++)
paths.append(addTrack(*(data.tracks().at(i)))); paths.append(addTrack(*(data.tracks().at(i))));
for (int i = 0; i < data.routes().count(); i++) for (int i = 0; i < data.routes().count(); i++)
paths.append(addRoute(*(data.routes().at(i)))); paths.append(addRoute(*(data.routes().at(i))));
addWaypoints(data.waypoints()); addWaypoints(data.waypoints());
if (_tracks.empty() && _routes.empty() && _waypoints.empty()) if (_tracks.empty() && _routes.empty() && _waypoints.empty())
return paths; return paths;
if ((_tracks.size() + _routes.size() > 1 && _zoom < zoom) if (_zoom < zoom)
|| (_waypoints.size() && _zoom < zoom))
rescale(_zoom); rescale(_zoom);
else else
updatePOIVisibility(); updatePOIVisibility();
QRectF sr = contentsSceneRect(); QPointF center = contentsCenter();
_scene->setSceneRect(sr); centerOn(center);
centerOn(sr.center());
_mapScale->setZoom(_zoom, -(sr.center().ry() * mapScale(_zoom))); _res = zoom2resolution(_zoom, -(center.y() * mapScale(_zoom)));
_mapScale->setResolution(_res);
if (_mapScale->scene() != _scene) if (_mapScale->scene() != _scene)
_scene->addItem(_mapScale); _scene->addItem(_mapScale);
return paths; return paths;
} }
void PathView::updateWaypointsBoundingRect(const QPointF &wp)
{
if (_wr.isNull()) {
if (_wp.isNull())
_wp = wp;
else {
_wr = QRectF(_wp, wp).normalized();
_wp = QPointF();
}
} else
unite(_wr, wp);
}
qreal PathView::contentsScale() const qreal PathView::contentsScale() const
{ {
QRectF br = _tr | _rr | _wr; QRectF br = _tr | _rr | _wr;
if (!br.isNull() && !_wp.isNull())
unite(br, _wp);
if (br.isNull()) if (br.isNull())
return mapScale(ZOOM_MAX); return mapScale(ZOOM_MAX);
@ -256,17 +267,18 @@ qreal PathView::contentsScale() const
return qMax(sc.x(), sc.y()); return qMax(sc.x(), sc.y());
} }
QRectF PathView::contentsSceneRect() const QPointF PathView::contentsCenter() const
{ {
QRectF br = _tr | _rr | _wr;
if (!br.isNull() && !_wp.isNull())
unite(br, _wp);
qreal scale = mapScale(_zoom); qreal scale = mapScale(_zoom);
QRectF br = scaled(_tr | _rr | _wr, 1.0/scale);
if (br.isNull()) if (br.isNull())
return QRectF(QPointF(_wp.x() / scale - Tile::size()/2, return _wp / scale;
_wp.y() /scale - Tile::size()/2), QSizeF(Tile::size(), Tile::size()));
else else
return br.adjusted(-Tile::size(), -Tile::size(), Tile::size(), return scaled(br, 1.0/scale).center();
Tile::size());
} }
void PathView::updatePOIVisibility() void PathView::updatePOIVisibility()
@ -295,6 +307,8 @@ void PathView::rescale(int zoom)
_zoom = zoom; _zoom = zoom;
qreal scale = mapScale(zoom); qreal scale = mapScale(zoom);
_scene->setSceneRect(scaled(mapBounds(), 1.0 / scale));
for (int i = 0; i < _tracks.size(); i++) for (int i = 0; i < _tracks.size(); i++)
_tracks.at(i)->setScale(1.0/scale); _tracks.at(i)->setScale(1.0/scale);
@ -414,16 +428,6 @@ void PathView::redraw()
resetCachedContent(); resetCachedContent();
} }
void PathView::rescale()
{
int zoom = scale2zoom(contentsScale());
if (zoom != _zoom) {
rescale(zoom);
_mapScale->setZoom(zoom);
}
}
void PathView::zoom(int z, const QPoint &pos) void PathView::zoom(int z, const QPoint &pos)
{ {
if (_tracks.isEmpty() && _routes.isEmpty() && _waypoints.isEmpty()) if (_tracks.isEmpty() && _routes.isEmpty() && _waypoints.isEmpty())
@ -437,16 +441,11 @@ void PathView::zoom(int z, const QPoint &pos)
rescale(_zoom); rescale(_zoom);
QRectF sr = contentsSceneRect(); QPointF center = (spos * (os/mapScale(_zoom))) - offset;
_scene->setSceneRect(sr); centerOn(center);
if (sr.width() < viewport()->size().width() _res = zoom2resolution(_zoom, -(center.y() * mapScale(_zoom)));
&& sr.height() < viewport()->size().height()) _mapScale->setResolution(_res);
centerOn(sr.center());
else
centerOn((spos * (os/mapScale(_zoom))) - offset);
_mapScale->setZoom(_zoom);
resetCachedContent(); resetCachedContent();
} }
@ -532,10 +531,11 @@ void PathView::clear()
_palette.reset(); _palette.reset();
_zoom = ZOOM_MAX; _zoom = ZOOM_MAX;
_res = 1.0;
_tr = QRectF(); _rr = QRectF(); _wr = QRectF(); _tr = QRectF(); _rr = QRectF(); _wr = QRectF();
_wp = QPointF(); _wp = QPointF();
_scene->setSceneRect(QRectF()); _scene->setSceneRect(scaled(mapBounds(), 1.0 / mapScale(_zoom)));
} }
void PathView::showTracks(bool show) void PathView::showTracks(bool show)
@ -655,15 +655,14 @@ void PathView::drawBackground(QPainter *painter, const QRectF &rect)
QPoint tile = mercator2tile(QPointF(rr.topLeft().x(), -rr.topLeft().y()), QPoint tile = mercator2tile(QPointF(rr.topLeft().x(), -rr.topLeft().y()),
_zoom); _zoom);
QPointF tm = tile2mercator(tile, _zoom); QPointF tm = tile2mercator(tile, _zoom);
QPoint tl = mapToScene(mapFromScene(QPointF(tm.x() / scale, QPoint tl = QPoint((int)(tm.x() / scale), (int)(-tm.y() / scale));
-tm.y() / scale))).toPoint();
QList<Tile> tiles; QList<Tile> tiles;
for (int i = 0; i <= rr.size().width() / Tile::size() + 1; i++) { QSizeF s(rect.right() - tl.x(), rect.bottom() - tl.y());
for (int j = 0; j <= rr.size().height() / Tile::size() + 1; j++) { for (int i = 0; i < ceil(s.width() / Tile::size()); i++)
for (int j = 0; j < ceil(s.height() / Tile::size()); j++)
tiles.append(Tile(QPoint(tile.x() + i, tile.y() + j), _zoom)); tiles.append(Tile(QPoint(tile.x() + i, tile.y() + j), _zoom));
}
}
_map->loadTiles(tiles, _plot); _map->loadTiles(tiles, _plot);
@ -677,24 +676,20 @@ void PathView::drawBackground(QPainter *painter, const QRectF &rect)
void PathView::resizeEvent(QResizeEvent *event) void PathView::resizeEvent(QResizeEvent *event)
{ {
Q_UNUSED(event);
if (_tracks.isEmpty() && _routes.isEmpty() && _waypoints.isEmpty()) if (_tracks.isEmpty() && _routes.isEmpty() && _waypoints.isEmpty())
return; return;
rescale(); int zoom = scale2zoom(contentsScale());
if (zoom != _zoom)
rescale(zoom);
QRectF sr = contentsSceneRect(); QPointF center = contentsCenter();
centerOn(center);
if (sr.width() < event->size().width()) { _res = zoom2resolution(_zoom, -(center.y() * mapScale(_zoom)));
qreal diff = event->size().width() - sr.width(); _mapScale->setResolution(_res);
sr.adjust(-diff/2, 0, diff/2, 0);
}
if (sr.height() < event->size().height()) {
qreal diff = event->size().height() - sr.height();
sr.adjust(0, -diff/2, 0, diff/2);
}
_scene->setSceneRect(sr);
centerOn(sr.center());
resetCachedContent(); resetCachedContent();
} }
@ -710,17 +705,23 @@ void PathView::paintEvent(QPaintEvent *event)
QGraphicsView::paintEvent(event); QGraphicsView::paintEvent(event);
} }
void PathView::scrollContentsBy(int dx, int dy)
{
QGraphicsView::scrollContentsBy(dx, dy);
QPointF center = mapToScene(viewport()->rect().center());
qreal res = zoom2resolution(_zoom, -(center.y() * mapScale(_zoom)));
if (qMax(res, _res) / qMin(res, _res) > 1.1) {
_mapScale->setResolution(res);
_res = res;
}
}
void PathView::useOpenGL(bool use) void PathView::useOpenGL(bool use)
{ {
if (use) { if (use)
#ifdef Q_OS_WIN32 setViewport(new OPENGL_WIDGET);
if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA) else
#endif // Q_OS_WIN32
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
setViewport(new QGLWidget);
#else // QT 5
setViewport(new QOpenGLWidget);
#endif // QT 5
} else
setViewport(new QWidget); setViewport(new QWidget);
} }

View File

@ -73,11 +73,11 @@ private:
void clearPOI(); void clearPOI();
qreal contentsScale() const; qreal contentsScale() const;
QRectF contentsSceneRect() const; QPointF contentsCenter() const;
void rescale(int zoom); void rescale(int zoom);
void rescale();
void zoom(int z, const QPoint &pos); void zoom(int z, const QPoint &pos);
void updatePOIVisibility(); void updatePOIVisibility();
void updateWaypointsBoundingRect(const QPointF &wp);
void mouseDoubleClickEvent(QMouseEvent *event); void mouseDoubleClickEvent(QMouseEvent *event);
void wheelEvent(QWheelEvent *event); void wheelEvent(QWheelEvent *event);
@ -85,6 +85,7 @@ private:
void drawBackground(QPainter *painter, const QRectF &rect); void drawBackground(QPainter *painter, const QRectF &rect);
void resizeEvent(QResizeEvent *event); void resizeEvent(QResizeEvent *event);
void paintEvent(QPaintEvent *event); void paintEvent(QPaintEvent *event);
void scrollContentsBy(int dx, int dy);
QGraphicsScene *_scene; QGraphicsScene *_scene;
ScaleItem *_mapScale; ScaleItem *_mapScale;
@ -96,6 +97,7 @@ private:
int _zoom; int _zoom;
QRectF _tr, _rr, _wr; QRectF _tr, _rr, _wr;
QPointF _wp; QPointF _wp;
qreal _res;
Map *_map; Map *_map;
POI *_poi; POI *_poi;

View File

@ -13,9 +13,7 @@ public:
QString label() const {return tr("Power");} QString label() const {return tr("Power");}
void loadData(const Data &data, const QList<PathItem *> &paths); void loadData(const Data &data, const QList<PathItem *> &paths);
void clear(); void clear();
void setUnits(enum Units) {}
void showTracks(bool show); void showTracks(bool show);
void showRoutes(bool show) {Q_UNUSED(show);}
private: private:
qreal avg() const; qreal avg() const;

View File

@ -1,4 +1,3 @@
#include <QApplication>
#include <QPainter> #include <QPainter>
#include "format.h" #include "format.h"
#include "waypoint.h" #include "waypoint.h"
@ -12,11 +11,10 @@ QString RouteItem::toolTip()
ToolTip tt; ToolTip tt;
if (!_name.isEmpty()) if (!_name.isEmpty())
tt.insert(qApp->translate("RouteItem", "Name"), _name); tt.insert(tr("Name"), _name);
if (!_desc.isEmpty()) if (!_desc.isEmpty())
tt.insert(qApp->translate("RouteItem", "Description"), _desc); tt.insert(tr("Description"), _desc);
tt.insert(qApp->translate("RouteItem", "Distance"), tt.insert(tr("Distance"), Format::distance(_distance.last(), _units));
Format::distance(_distance.last(), _units));
return tt.toString(); return tt.toString();
} }

View File

@ -1,8 +1,5 @@
#include <QPainter> #include <QPainter>
#include "config.h" #include "config.h"
#include "rd.h"
#include "wgs84.h"
#include "tile.h"
#include "misc.h" #include "misc.h"
#include "scaleitem.h" #include "scaleitem.h"
@ -13,17 +10,11 @@
#define SEGMENTS 3 #define SEGMENTS 3
#define PADDING 4 #define PADDING 4
static qreal zoom2resolution(int zoom, qreal y)
{
return (WGS84_RADIUS * 2 * M_PI / Tile::size()
* cos(2 * atan(exp(deg2rad(y))) - M_PI/2)) / pow(2.0, zoom);
}
ScaleItem::ScaleItem(QGraphicsItem *parent) : QGraphicsItem(parent) ScaleItem::ScaleItem(QGraphicsItem *parent) : QGraphicsItem(parent)
{ {
_units = Metric; _units = Metric;
_zoom = 0; _res = 1.0;
_lat = 0;
#ifndef Q_OS_MAC #ifndef Q_OS_MAC
setCacheMode(QGraphicsItem::DeviceCoordinateCache); setCacheMode(QGraphicsItem::DeviceCoordinateCache);
@ -96,45 +87,33 @@ QString ScaleItem::units() const
void ScaleItem::computeScale() void ScaleItem::computeScale()
{ {
qreal res = zoom2resolution(_zoom, _lat);
if (_units == Imperial) { if (_units == Imperial) {
_length = niceNum((res * M2FT * SCALE_WIDTH) / SEGMENTS, 1); _length = niceNum((_res * M2FT * SCALE_WIDTH) / SEGMENTS, 1);
if (_length >= MIINFT) { if (_length >= MIINFT) {
_length = niceNum((res * M2FT * FT2MI * SCALE_WIDTH) / SEGMENTS, 1); _length = niceNum((_res * M2FT * FT2MI * SCALE_WIDTH) / SEGMENTS, 1);
_width = (_length / (res * M2FT * FT2MI)); _width = (_length / (_res * M2FT * FT2MI));
_scale = true; _scale = true;
} else { } else {
_width = (_length / (res * M2FT)); _width = (_length / (_res * M2FT));
_scale = false; _scale = false;
} }
} else { } else {
_length = niceNum((res * SCALE_WIDTH) / SEGMENTS, 1); _length = niceNum((_res * SCALE_WIDTH) / SEGMENTS, 1);
if (_length >= KMINM) { if (_length >= KMINM) {
_length *= M2KM; _length *= M2KM;
_width = (_length / (res * M2KM)); _width = (_length / (_res * M2KM));
_scale = true; _scale = true;
} else { } else {
_width = (_length / res); _width = (_length / _res);
_scale = false; _scale = false;
} }
} }
} }
void ScaleItem::setZoom(int z, qreal lat) void ScaleItem::setResolution(qreal res)
{ {
prepareGeometryChange(); prepareGeometryChange();
_zoom = z; _res = res;
_lat = lat;
computeScale();
updateBoundingRect();
update();
}
void ScaleItem::setZoom(int z)
{
prepareGeometryChange();
_zoom = z;
computeScale(); computeScale();
updateBoundingRect(); updateBoundingRect();
update(); update();

View File

@ -13,8 +13,7 @@ public:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget); QWidget *widget);
void setZoom(int z); void setResolution(qreal res);
void setZoom(int z, qreal lat);
void setUnits(enum Units units); void setUnits(enum Units units);
private: private:
@ -22,8 +21,7 @@ private:
void computeScale(); void computeScale();
QString units() const; QString units() const;
int _zoom; qreal _res;
qreal _lat;
qreal _width; qreal _width;
qreal _length; qreal _length;
Units _units; Units _units;

View File

@ -11,6 +11,8 @@
#define WINDOW_POS_DEFAULT QPoint(10, 10) #define WINDOW_POS_DEFAULT QPoint(10, 10)
#define SETTINGS_SETTINGS_GROUP "Settings" #define SETTINGS_SETTINGS_GROUP "Settings"
#define TIME_TYPE_SETTING "timeType"
#define TIME_TYPE_DEFAULT Total
#define UNITS_SETTING "units" #define UNITS_SETTING "units"
#define UNITS_DEFAULT (IMPERIAL_UNITS() ? Imperial : Metric) #define UNITS_DEFAULT (IMPERIAL_UNITS() ? Imperial : Metric)
#define SHOW_TOOLBARS_SETTING "toolbar" #define SHOW_TOOLBARS_SETTING "toolbar"
@ -92,5 +94,19 @@
#define POI_RADIUS_DEFAULT (IMPERIAL_UNITS() ? MIINM : KMINM) #define POI_RADIUS_DEFAULT (IMPERIAL_UNITS() ? MIINM : KMINM)
#define USE_OPENGL_SETTING "useOpenGL" #define USE_OPENGL_SETTING "useOpenGL"
#define USE_OPENGL_DEFAULT false #define USE_OPENGL_DEFAULT false
#define PRINT_NAME_SETTING "printName"
#define PRINT_NAME_DEFAULT true
#define PRINT_DATE_SETTING "printDate"
#define PRINT_DATE_DEFAULT true
#define PRINT_DISTANCE_SETTING "printDistance"
#define PRINT_DISTANCE_DEFAULT true
#define PRINT_TIME_SETTING "printTime"
#define PRINT_TIME_DEFAULT true
#define PRINT_MOVING_TIME_SETTING "printMovingTime"
#define PRINT_MOVING_TIME_DEFAULT false
#define PRINT_ITEM_COUNT_SETTING "printItemCount"
#define PRINT_ITEM_COUNT_DEFAULT true
#define SEPARATE_GRAPH_PAGE_SETTING "separateGraphPage"
#define SEPARATE_GRAPH_PAGE_DEFAULT false
#endif // SETTINGS_H #endif // SETTINGS_H

View File

@ -36,6 +36,8 @@ void SpeedGraph::loadData(const Data &data, const QList<PathItem *> &paths)
_avg.append(QPointF(data.tracks().at(i)->distance(), _avg.append(QPointF(data.tracks().at(i)->distance(),
data.tracks().at(i)->distance() / data.tracks().at(i)->time())); data.tracks().at(i)->distance() / data.tracks().at(i)->time()));
_avgM.append(QPointF(data.tracks().at(i)->distance(),
data.tracks().at(i)->distance() / data.tracks().at(i)->movingTime()));
GraphView::loadGraph(graph, paths.at(i)); GraphView::loadGraph(graph, paths.at(i));
} }
@ -52,8 +54,9 @@ qreal SpeedGraph::avg() const
{ {
qreal sum = 0, w = 0; qreal sum = 0, w = 0;
QList<QPointF>::const_iterator it; QList<QPointF>::const_iterator it;
const QList<QPointF> &list = (_timeType == Moving) ? _avgM : _avg;
for (it = _avg.begin(); it != _avg.end(); it++) { for (it = list.begin(); it != list.end(); it++) {
sum += it->y() * it->x(); sum += it->y() * it->x();
w += it->x(); w += it->x();
} }
@ -64,6 +67,7 @@ qreal SpeedGraph::avg() const
void SpeedGraph::clear() void SpeedGraph::clear()
{ {
_avg.clear(); _avg.clear();
_avgM.clear();
GraphView::clear(); GraphView::clear();
} }
@ -90,6 +94,14 @@ void SpeedGraph::setUnits(enum Units units)
redraw(); redraw();
} }
void SpeedGraph::setTimeType(enum TimeType type)
{
_timeType = type;
setInfo();
redraw();
}
void SpeedGraph::showTracks(bool show) void SpeedGraph::showTracks(bool show)
{ {
_showTracks = show; _showTracks = show;

View File

@ -15,8 +15,8 @@ public:
void loadData(const Data &data, const QList<PathItem *> &paths); void loadData(const Data &data, const QList<PathItem *> &paths);
void clear(); void clear();
void setUnits(enum Units units); void setUnits(enum Units units);
void setTimeType(enum TimeType type);
void showTracks(bool show); void showTracks(bool show);
void showRoutes(bool show) {Q_UNUSED(show);}
private: private:
qreal avg() const; qreal avg() const;
@ -25,8 +25,10 @@ private:
void setInfo(); void setInfo();
QList<QPointF> _avg; QList<QPointF> _avg;
QList<QPointF> _avgM;
enum Units _units; enum Units _units;
enum TimeType _timeType;
bool _showTracks; bool _showTracks;
}; };

View File

@ -15,7 +15,6 @@ public:
void clear(); void clear();
void setUnits(enum Units units); void setUnits(enum Units units);
void showTracks(bool show); void showTracks(bool show);
void showRoutes(bool show) {Q_UNUSED(show);}
private: private:
qreal avg() const; qreal avg() const;

9
src/timetype.h Normal file
View File

@ -0,0 +1,9 @@
#ifndef TIMETYPE_H
#define TIMETYPE_H
enum TimeType {
Total,
Moving
};
#endif // TIMETYPE_H

View File

@ -9,6 +9,9 @@
#define WINDOW_CF 3 #define WINDOW_CF 3
#define WINDOW_PF 3 #define WINDOW_PF 3
#define PAUSE_SPEED 0.5
#define PAUSE_TIME_DIFF 10
static qreal median(QVector<qreal> v) static qreal median(QVector<qreal> v)
{ {
@ -43,30 +46,31 @@ static QSet<int> eliminate(const QVector<qreal> &v, int window)
return rm; return rm;
} }
static Graph filter(const Graph &v, int window) static Graph filter(const Graph &g, int window)
{ {
qreal acc = 0; qreal acc = 0;
Graph ret; Graph ret;
if (v.size() < window) if (g.size() < window)
return ret; return ret;
for (int i = 0; i < window; i++) for (int i = 0; i < window; i++)
acc += v.at(i).y(); acc += g.at(i).y();
for (int i = 0; i <= window/2; i++) for (int i = 0; i <= window/2; i++)
ret.append(GraphPoint(v.at(i).s(), v.at(i).t(), acc/window)); ret.append(GraphPoint(g.at(i).s(), g.at(i).t(), acc/window));
for (int i = window/2 + 1; i < v.size() - window/2; i++) { for (int i = window/2 + 1; i < g.size() - window/2; i++) {
acc += v.at(i + window/2).y() - v.at(i - (window/2 + 1)).y(); acc += g.at(i + window/2).y() - g.at(i - (window/2 + 1)).y();
ret.append(GraphPoint(v.at(i).s(), v.at(i).t(), acc/window)); ret.append(GraphPoint(g.at(i).s(), g.at(i).t(), acc/window));
} }
for (int i = v.size() - window/2; i < v.size(); i++) for (int i = g.size() - window/2; i < g.size(); i++)
ret.append(GraphPoint(v.at(i).s(), v.at(i).t(), acc/window)); ret.append(GraphPoint(g.at(i).s(), g.at(i).t(), acc/window));
return ret; return ret;
} }
Track::Track(const TrackData &data) : _data(data) Track::Track(const TrackData &data) : _data(data)
{ {
qreal dt, ds, total; qreal dt, ds, total;
@ -98,12 +102,27 @@ Track::Track(const TrackData &data) : _data(data)
} }
} }
_pause = 0;
for (int i = 1; i < data.count(); i++) {
if (_time.at(i) > _time.at(i-1) + PAUSE_TIME_DIFF
&& _speed.at(i) < PAUSE_SPEED) {
_pause += _time.at(i) - _time.at(i-1);
_stop.insert(i-1);
_stop.insert(i);
}
}
_outliers = eliminate(_speed, WINDOW_OE); _outliers = eliminate(_speed, WINDOW_OE);
QSet<int>::const_iterator it;
for (it = _stop.constBegin(); it != _stop.constEnd(); ++it)
_outliers.remove(*it);
total = 0; total = 0;
for (int i = 0; i < _data.size(); i++) { for (int i = 0; i < _data.size(); i++) {
if (_outliers.contains(i)) if (_outliers.contains(i))
continue; continue;
if (!discardStopPoint(i))
total += _distance.at(i); total += _distance.at(i);
_distance[i] = total; _distance[i] = total;
} }
@ -113,9 +132,6 @@ Graph Track::elevation() const
{ {
Graph raw; Graph raw;
if (!_data.size())
return raw;
for (int i = 0; i < _data.size(); i++) for (int i = 0; i < _data.size(); i++)
if (_data.at(i).hasElevation() && !_outliers.contains(i)) if (_data.at(i).hasElevation() && !_outliers.contains(i))
raw.append(GraphPoint(_distance.at(i), _time.at(i), raw.append(GraphPoint(_distance.at(i), _time.at(i),
@ -126,14 +142,16 @@ Graph Track::elevation() const
Graph Track::speed() const Graph Track::speed() const
{ {
Graph raw; Graph raw, filtered;
qreal v; qreal v;
QSet<int> stop;
if (!_data.size())
return raw;
for (int i = 0; i < _data.size(); i++) { for (int i = 0; i < _data.size(); i++) {
if (_data.at(i).hasSpeed() && !_outliers.contains(i)) if (_stop.contains(i) && (!std::isnan(_speed.at(i))
|| _data.at(i).hasSpeed())) {
v = 0;
stop.insert(raw.size());
} else if (_data.at(i).hasSpeed() && !_outliers.contains(i))
v = _data.at(i).speed(); v = _data.at(i).speed();
else if (!std::isnan(_speed.at(i)) && !_outliers.contains(i)) else if (!std::isnan(_speed.at(i)) && !_outliers.contains(i))
v = _speed.at(i); v = _speed.at(i);
@ -143,16 +161,19 @@ Graph Track::speed() const
raw.append(GraphPoint(_distance.at(i), _time.at(i), v)); raw.append(GraphPoint(_distance.at(i), _time.at(i), v));
} }
return filter(raw, WINDOW_SF); filtered = filter(raw, WINDOW_SF);
QSet<int>::const_iterator it;
for (it = stop.constBegin(); it != stop.constEnd(); ++it)
filtered[*it].setY(0);
return filtered;
} }
Graph Track::heartRate() const Graph Track::heartRate() const
{ {
Graph raw; Graph raw;
if (!_data.size())
return raw;
for (int i = 0; i < _data.count(); i++) for (int i = 0; i < _data.count(); i++)
if (_data.at(i).hasHeartRate() && !_outliers.contains(i)) if (_data.at(i).hasHeartRate() && !_outliers.contains(i))
raw.append(GraphPoint(_distance.at(i), _time.at(i), raw.append(GraphPoint(_distance.at(i), _time.at(i),
@ -175,26 +196,56 @@ Graph Track::temperature() const
Graph Track::cadence() const Graph Track::cadence() const
{ {
Graph raw; Graph raw, filtered;
QSet<int> stop;
qreal c;
for (int i = 0; i < _data.size(); i++) for (int i = 0; i < _data.size(); i++) {
if (_data.at(i).hasCadence() && !_outliers.contains(i)) if (_data.at(i).hasCadence() && _stop.contains(i)) {
raw.append(GraphPoint(_distance.at(i), _time.at(i), c = 0;
_data.at(i).cadence())); stop.insert(raw.size());
} else if (_data.at(i).hasCadence() && !_outliers.contains(i))
c = _data.at(i).cadence();
else
continue;
return filter(raw, WINDOW_CF); raw.append(GraphPoint(_distance.at(i), _time.at(i), c));
}
filtered = filter(raw, WINDOW_CF);
QSet<int>::const_iterator it;
for (it = stop.constBegin(); it != stop.constEnd(); ++it)
filtered[*it].setY(0);
return filtered;
} }
Graph Track::power() const Graph Track::power() const
{ {
Graph raw; Graph raw, filtered;
QSet<int> stop;
qreal p;
for (int i = 0; i < _data.size(); i++) for (int i = 0; i < _data.size(); i++) {
if (_data.at(i).hasPower() && !_outliers.contains(i)) if (_data.at(i).hasPower() && _stop.contains(i)) {
raw.append(GraphPoint(_distance.at(i), _time.at(i), p = 0;
_data.at(i).power())); stop.insert(raw.size());
} else if (_data.at(i).hasPower() && !_outliers.contains(i))
p = _data.at(i).power();
else
continue;
return filter(raw, WINDOW_PF); raw.append(GraphPoint(_distance.at(i), _time.at(i), p));
}
filtered = filter(raw, WINDOW_PF);
QSet<int>::const_iterator it;
for (it = stop.constBegin(); it != stop.constEnd(); ++it)
filtered[*it].setY(0);
return filtered;
} }
qreal Track::distance() const qreal Track::distance() const
@ -208,6 +259,11 @@ qreal Track::time() const
(_data.first().timestamp().msecsTo(_data.last().timestamp()) / 1000.0); (_data.first().timestamp().msecsTo(_data.last().timestamp()) / 1000.0);
} }
qreal Track::movingTime() const
{
return (time() - _pause);
}
QDateTime Track::date() const QDateTime Track::date() const
{ {
return (_data.size()) ? _data.first().timestamp() : QDateTime(); return (_data.size()) ? _data.first().timestamp() : QDateTime();
@ -218,8 +274,14 @@ Path Track::path() const
Path ret; Path ret;
for (int i = 0; i < _data.size(); i++) for (int i = 0; i < _data.size(); i++)
if (!_outliers.contains(i)) if (!_outliers.contains(i) && !discardStopPoint(i))
ret.append(PathPoint(_data.at(i).coordinates(), _distance.at(i))); ret.append(PathPoint(_data.at(i).coordinates(), _distance.at(i)));
return ret; return ret;
} }
bool Track::discardStopPoint(int i) const
{
return (_stop.contains(i) && i > 0 && _stop.contains(i-1)
&& i < _data.size() - 1 && _stop.contains(i+1));
}

View File

@ -24,6 +24,7 @@ public:
qreal distance() const; qreal distance() const;
qreal time() const; qreal time() const;
qreal movingTime() const;
QDateTime date() const; QDateTime date() const;
const QString &name() const {return _data.name();} const QString &name() const {return _data.name();}
@ -32,6 +33,8 @@ public:
bool isNull() const {return (_data.size() < 2);} bool isNull() const {return (_data.size() < 2);}
private: private:
bool discardStopPoint(int i) const;
const TrackData &_data; const TrackData &_data;
QVector<qreal> _distance; QVector<qreal> _distance;
@ -39,6 +42,9 @@ private:
QVector<qreal> _speed; QVector<qreal> _speed;
QSet<int> _outliers; QSet<int> _outliers;
QSet<int> _stop;
qreal _pause;
}; };
#endif // TRACK_H #endif // TRACK_H

View File

@ -1,5 +1,3 @@
#include <QApplication>
#include <QCursor>
#include <QPainter> #include <QPainter>
#include "format.h" #include "format.h"
#include "tooltip.h" #include "tooltip.h"
@ -11,17 +9,16 @@ QString TrackItem::toolTip()
ToolTip tt; ToolTip tt;
if (!_name.isEmpty()) if (!_name.isEmpty())
tt.insert(qApp->translate("TrackItem", "Name"), _name); tt.insert(tr("Name"), _name);
if (!_desc.isEmpty()) if (!_desc.isEmpty())
tt.insert(qApp->translate("TrackItem", "Description"), _desc); tt.insert(tr("Description"), _desc);
tt.insert(qApp->translate("TrackItem", "Distance"), tt.insert(tr("Distance"), Format::distance(_distance.last(), _units));
Format::distance(_distance.last(), _units));
if (_time > 0) if (_time > 0)
tt.insert(qApp->translate("TrackItem", "Time"), tt.insert(tr("Total time"), Format::timeSpan(_time));
Format::timeSpan(_time)); if (_movingTime > 0)
tt.insert(tr("Moving time"), Format::timeSpan(_movingTime));
if (!_date.isNull()) if (!_date.isNull())
tt.insert(qApp->translate("TrackItem", "Date"), tt.insert(tr("Date"), _date.toString(Qt::SystemLocaleShortDate));
_date.toString(Qt::SystemLocaleShortDate));
return tt.toString(); return tt.toString();
} }
@ -50,6 +47,7 @@ TrackItem::TrackItem(const Track &track, QGraphicsItem *parent)
_desc = track.description(); _desc = track.description();
_date = track.date(); _date = track.date();
_time = track.time(); _time = track.time();
_movingTime = track.movingTime();
_marker->setPos(_path.elementAt(0)); _marker->setPos(_path.elementAt(0));

View File

@ -23,6 +23,7 @@ private:
QString _desc; QString _desc;
QDateTime _date; QDateTime _date;
qreal _time; qreal _time;
qreal _movingTime;
}; };
#endif // TRACKITEM_H #endif // TRACKITEM_H