1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-01 05:19:15 +02:00

Compare commits

...

32 Commits
3.4 ... 3.8

Author SHA1 Message Date
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
26 changed files with 1589 additions and 338 deletions

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -190,55 +190,55 @@
<context>
<name>GUI</name>
<message>
<location filename="../src/gui.cpp" line="545"/>
<location filename="../src/gui.cpp" line="552"/>
<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>
</message>
<message>
<location filename="../src/gui.cpp" line="609"/>
<location filename="../src/gui.cpp" line="616"/>
<source>Open file</source>
<translation>Otevřít soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="690"/>
<location filename="../src/gui.cpp" line="705"/>
<source>Open POI file</source>
<translation>Otevřít POI soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="216"/>
<location filename="../src/gui.cpp" line="223"/>
<source>Open</source>
<translation>Otevřít</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="200"/>
<location filename="../src/gui.cpp" line="207"/>
<source>Quit</source>
<translation>Ukončit</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="208"/>
<location filename="../src/gui.cpp" line="561"/>
<location filename="../src/gui.cpp" line="562"/>
<location filename="../src/gui.cpp" line="215"/>
<location filename="../src/gui.cpp" line="568"/>
<location filename="../src/gui.cpp" line="569"/>
<source>Keyboard controls</source>
<translation>Ovládací klávesy</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="232"/>
<location filename="../src/gui.cpp" line="239"/>
<source>Close</source>
<translation>Zavřít</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="238"/>
<location filename="../src/gui.cpp" line="245"/>
<source>Reload</source>
<translation>Znovu načíst</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="471"/>
<location filename="../src/gui.cpp" line="478"/>
<source>Show</source>
<translation>Zobrazit</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="392"/>
<location filename="../src/gui.cpp" line="465"/>
<location filename="../src/gui.cpp" line="399"/>
<location filename="../src/gui.cpp" line="472"/>
<source>File</source>
<translation>Soubor</translation>
</message>
@ -258,179 +258,184 @@
<translation>Soubory NMEA (*.nmea)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="206"/>
<location filename="../src/gui.cpp" line="584"/>
<location filename="../src/gui.cpp" line="585"/>
<location filename="../src/gui.cpp" line="213"/>
<location filename="../src/gui.cpp" line="591"/>
<location filename="../src/gui.cpp" line="592"/>
<source>Data sources</source>
<translation>Zdroje dat</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="246"/>
<location filename="../src/gui.cpp" line="253"/>
<source>Load POI file</source>
<translation>Nahrát POI soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="249"/>
<location filename="../src/gui.cpp" line="256"/>
<source>Close POI files</source>
<translation>Zavřit POI soubory</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="251"/>
<location filename="../src/gui.cpp" line="258"/>
<source>Overlap POIs</source>
<translation>Překrývat POI</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="255"/>
<location filename="../src/gui.cpp" line="262"/>
<source>Show POI labels</source>
<translation>Zobrazovat názvy POI</translation>
<translation>Zobrazit názvy POI</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="260"/>
<location filename="../src/gui.cpp" line="267"/>
<source>Show POIs</source>
<translation>Zobrazit POI</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="269"/>
<location filename="../src/gui.cpp" line="276"/>
<source>Show map</source>
<translation>Zobrazit mapu</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="275"/>
<location filename="../src/gui.cpp" line="282"/>
<source>Clear tile cache</source>
<translation>Vymazat mezipaměť dlaždic</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="284"/>
<location filename="../src/gui.cpp" line="288"/>
<location filename="../src/gui.cpp" line="571"/>
<location filename="../src/gui.cpp" line="291"/>
<location filename="../src/gui.cpp" line="295"/>
<location filename="../src/gui.cpp" line="578"/>
<source>Next map</source>
<translation>Následující mapa</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="295"/>
<location filename="../src/gui.cpp" line="302"/>
<source>Show tracks</source>
<translation>Zobrazit cesty</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="299"/>
<location filename="../src/gui.cpp" line="306"/>
<source>Show routes</source>
<translation>Zobrazit trasy</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="303"/>
<location filename="../src/gui.cpp" line="310"/>
<source>Show waypoints</source>
<translation>Zobrazit navigační body</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="307"/>
<location filename="../src/gui.cpp" line="314"/>
<source>Waypoint labels</source>
<translation>Názvy navigačních bodů</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="318"/>
<location filename="../src/gui.cpp" line="325"/>
<source>Show graphs</source>
<translation>Zobrazovat grafy</translation>
<translation>Zobrazit grafy</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="340"/>
<location filename="../src/gui.cpp" line="347"/>
<source>Show grid</source>
<translation>Zobrazit mřížku</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="346"/>
<location filename="../src/gui.cpp" line="353"/>
<source>Show toolbars</source>
<translation>Zobrazovat nástrojové lišty</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="352"/>
<location filename="../src/gui.cpp" line="359"/>
<source>Metric</source>
<translation>Metrické</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="357"/>
<location filename="../src/gui.cpp" line="364"/>
<source>Imperial</source>
<translation>Imperiální</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="363"/>
<location filename="../src/gui.cpp" line="370"/>
<source>Fullscreen mode</source>
<translation>Celoobrazovkový režim</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="369"/>
<location filename="../src/gui.cpp" line="376"/>
<source>Options...</source>
<translation>Nastavení...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="374"/>
<location filename="../src/gui.cpp" line="381"/>
<source>Next</source>
<translation>Následující</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="377"/>
<location filename="../src/gui.cpp" line="384"/>
<source>Previous</source>
<translation>Předchozí</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="381"/>
<location filename="../src/gui.cpp" line="388"/>
<source>Last</source>
<translation>Poslední</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="384"/>
<location filename="../src/gui.cpp" line="391"/>
<source>First</source>
<translation>První</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="406"/>
<location filename="../src/gui.cpp" line="413"/>
<source>Map</source>
<translation>Mapa</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="413"/>
<location filename="../src/gui.cpp" line="420"/>
<source>Graph</source>
<translation>Graf</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="421"/>
<location filename="../src/gui.cpp" line="428"/>
<source>POI</source>
<translation>POI</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="422"/>
<location filename="../src/gui.cpp" line="429"/>
<source>POI files</source>
<translation>POI soubory</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="433"/>
<location filename="../src/gui.cpp" line="440"/>
<source>Data</source>
<translation>Data</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="434"/>
<location filename="../src/gui.cpp" line="441"/>
<source>Display</source>
<translation>Zobrazit</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="442"/>
<location filename="../src/gui.cpp" line="449"/>
<source>Settings</source>
<translation>Nastavení</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="443"/>
<location filename="../src/gui.cpp" line="450"/>
<source>Units</source>
<translation>Jednotky</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="452"/>
<location filename="../src/gui.cpp" line="459"/>
<source>Help</source>
<translation>Nápověda</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="573"/>
<location filename="../src/gui.cpp" line="580"/>
<source>Previous map</source>
<translation>Předchozí mapa</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="1060"/>
<source>No files loaded</source>
<translation>Nejsou načteny žádné soubory</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="103"/>
<source>GPX files (*.gpx)</source>
@ -457,23 +462,18 @@
<translation>Všechny soubory (*)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="817"/>
<location filename="../src/gui.cpp" line="820"/>
<location filename="../src/gui.cpp" line="844"/>
<location filename="../src/gui.cpp" line="847"/>
<source>Date</source>
<translation>Datum</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="829"/>
<location filename="../src/gui.cpp" line="836"/>
<source>Routes</source>
<translation>Trasy</translation>
</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">
<location filename="../src/gui.cpp" line="1021"/>
<location filename="../src/gui.cpp" line="1064"/>
<source>%n files</source>
<translation>
<numerusform>%n soubor</numerusform>
@ -482,32 +482,32 @@
</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="564"/>
<location filename="../src/gui.cpp" line="571"/>
<source>Next file</source>
<translation>Následující soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="541"/>
<location filename="../src/gui.cpp" line="548"/>
<source>Version </source>
<translation>Verze </translation>
</message>
<message>
<location filename="../src/gui.cpp" line="221"/>
<location filename="../src/gui.cpp" line="228"/>
<source>Print...</source>
<translation>Tisknout...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="226"/>
<location filename="../src/gui.cpp" line="233"/>
<source>Export to PDF...</source>
<translation>Exportovat do PDF...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="831"/>
<location filename="../src/gui.cpp" line="838"/>
<source>Waypoints</source>
<translation>Navigační body</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="565"/>
<location filename="../src/gui.cpp" line="572"/>
<source>Previous file</source>
<translation>Předchozí soubor</translation>
</message>
@ -517,91 +517,96 @@
<translation>Podporované soubory (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="311"/>
<location filename="../src/gui.cpp" line="318"/>
<source>Route waypoints</source>
<translation>Body tras</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="567"/>
<location filename="../src/gui.cpp" line="574"/>
<source>First file</source>
<translation>První soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="568"/>
<location filename="../src/gui.cpp" line="575"/>
<source>Last file</source>
<translation>Poslední soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="569"/>
<location filename="../src/gui.cpp" line="576"/>
<source>Append modifier</source>
<translation>Modifikátor nahradit/přidat</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="588"/>
<location filename="../src/gui.cpp" line="595"/>
<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>
</message>
<message>
<location filename="../src/gui.cpp" line="591"/>
<location filename="../src/gui.cpp" line="598"/>
<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>
</message>
<message>
<location filename="../src/gui.cpp" line="599"/>
<location filename="../src/gui.cpp" line="606"/>
<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>
</message>
<message>
<location filename="../src/gui.cpp" line="679"/>
<location filename="../src/gui.cpp" line="694"/>
<source>Error loading data file:</source>
<translation>Datový soubor nelze načíst:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="682"/>
<location filename="../src/gui.cpp" line="707"/>
<location filename="../src/gui.cpp" line="697"/>
<location filename="../src/gui.cpp" line="722"/>
<source>Line: %1</source>
<translation>Řádka: %1</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="704"/>
<location filename="../src/gui.cpp" line="719"/>
<source>Error loading POI file:</source>
<translation>Soubor POI nelze načíst:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="827"/>
<location filename="../src/gui.cpp" line="830"/>
<source>Name</source>
<translation>Název</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="834"/>
<source>Tracks</source>
<translation>Cesty</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="211"/>
<location filename="../src/gui.cpp" line="539"/>
<location filename="../src/gui.cpp" line="218"/>
<location filename="../src/gui.cpp" line="546"/>
<source>About GPXSee</source>
<translation>O aplikaci GPXSee</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="476"/>
<location filename="../src/gui.cpp" line="483"/>
<source>Navigation</source>
<translation>Navigace</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="587"/>
<location filename="../src/gui.cpp" line="594"/>
<source>Map sources</source>
<translation>Mapové zdroje</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="598"/>
<location filename="../src/gui.cpp" line="605"/>
<source>POIs</source>
<translation>POI body</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="326"/>
<location filename="../src/gui.cpp" line="834"/>
<location filename="../src/gui.cpp" line="333"/>
<location filename="../src/gui.cpp" line="854"/>
<source>Distance</source>
<translation>Vzdálenost</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="333"/>
<location filename="../src/gui.cpp" line="836"/>
<location filename="../src/gui.cpp" line="340"/>
<location filename="../src/gui.cpp" line="856"/>
<source>Time</source>
<translation>Čas</translation>
</message>
@ -609,48 +614,48 @@
<context>
<name>GraphView</name>
<message>
<location filename="../src/graphview.cpp" line="112"/>
<location filename="../src/graphview.cpp" line="108"/>
<source>m</source>
<translation>m</translation>
</message>
<message>
<location filename="../src/graphview.cpp" line="115"/>
<location filename="../src/graphview.cpp" line="111"/>
<source>km</source>
<translation>km</translation>
</message>
<message>
<location filename="../src/graphview.cpp" line="120"/>
<location filename="../src/graphview.cpp" line="116"/>
<source>ft</source>
<translation>ft</translation>
</message>
<message>
<location filename="../src/graphview.cpp" line="123"/>
<location filename="../src/graphview.cpp" line="119"/>
<source>mi</source>
<translation>mi</translation>
</message>
<message>
<location filename="../src/graphview.cpp" line="129"/>
<location filename="../src/graphview.cpp" line="125"/>
<source>s</source>
<translation>s</translation>
</message>
<message>
<location filename="../src/graphview.cpp" line="132"/>
<location filename="../src/graphview.cpp" line="128"/>
<source>min</source>
<translation>min</translation>
</message>
<message>
<location filename="../src/graphview.cpp" line="135"/>
<location filename="../src/graphview.cpp" line="131"/>
<source>h</source>
<translation>h</translation>
</message>
<message>
<location filename="../src/graphview.cpp" line="64"/>
<location filename="../src/graphview.cpp" line="161"/>
<location filename="../src/graphview.cpp" line="60"/>
<location filename="../src/graphview.cpp" line="157"/>
<source>Distance</source>
<translation>Vzdálenost</translation>
</message>
<message>
<location filename="../src/graphview.cpp" line="163"/>
<location filename="../src/graphview.cpp" line="159"/>
<source>Time</source>
<translation>Čas</translation>
</message>
@ -684,12 +689,12 @@
<message>
<location filename="../src/optionsdialog.cpp" line="34"/>
<source>Base color:</source>
<translation>Základní barva</translation>
<translation>Základní barva:</translation>
</message>
<message>
<location filename="../src/optionsdialog.cpp" line="35"/>
<source>Palette shift:</source>
<translation>Posun palety</translation>
<translation>Posun palety:</translation>
</message>
<message>
<location filename="../src/optionsdialog.cpp" line="47"/>
@ -744,6 +749,7 @@
</message>
<message>
<location filename="../src/optionsdialog.cpp" line="115"/>
<location filename="../src/optionsdialog.cpp" line="180"/>
<source>Graphs</source>
<translation>Grafy</translation>
</message>
@ -760,32 +766,72 @@
<message>
<location filename="../src/optionsdialog.cpp" line="134"/>
<source>POI radius:</source>
<translation>POI radius</translation>
<translation>POI radius:</translation>
</message>
<message>
<location filename="../src/optionsdialog.cpp" line="140"/>
<location filename="../src/optionsdialog.cpp" line="184"/>
<location filename="../src/optionsdialog.cpp" line="221"/>
<source>POI</source>
<translation>POI</translation>
</message>
<message>
<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>Item count (&gt;1)</source>
<translation>Počet objektů (&gt;1)</translation>
</message>
<message>
<location filename="../src/optionsdialog.cpp" line="169"/>
<source>Separate graph page</source>
<translation>Samostatná stránka s grafy</translation>
</message>
<message>
<location filename="../src/optionsdialog.cpp" line="179"/>
<source>Header</source>
<translation>Záhlaví</translation>
</message>
<message>
<location filename="../src/optionsdialog.cpp" line="187"/>
<source>Use OpenGL</source>
<translation>Používat OpenGL</translation>
</message>
<message>
<location filename="../src/optionsdialog.cpp" line="167"/>
<location filename="../src/optionsdialog.cpp" line="185"/>
<location filename="../src/optionsdialog.cpp" line="203"/>
<location filename="../src/optionsdialog.cpp" line="224"/>
<source>System</source>
<translation>Systém</translation>
</message>
<message>
<location filename="../src/optionsdialog.cpp" line="182"/>
<location filename="../src/optionsdialog.cpp" line="219"/>
<source>Appearance</source>
<translation>Vzhled</translation>
</message>
<message>
<location filename="../src/optionsdialog.cpp" line="212"/>
<location filename="../src/optionsdialog.cpp" line="222"/>
<source>Print &amp; Export</source>
<translation>Tisk a export</translation>
</message>
<message>
<location filename="../src/optionsdialog.cpp" line="251"/>
<source>Options</source>
<translation>Nastavení</translation>
</message>
@ -817,17 +863,17 @@
<context>
<name>RouteItem</name>
<message>
<location filename="../src/routeitem.cpp" line="15"/>
<location filename="../src/routeitem.cpp" line="14"/>
<source>Name</source>
<translation>Název</translation>
</message>
<message>
<location filename="../src/routeitem.cpp" line="17"/>
<location filename="../src/routeitem.cpp" line="16"/>
<source>Description</source>
<translation>Popis</translation>
</message>
<message>
<location filename="../src/routeitem.cpp" line="18"/>
<location filename="../src/routeitem.cpp" line="17"/>
<source>Distance</source>
<translation>Vzdálenost</translation>
</message>
@ -835,22 +881,22 @@
<context>
<name>ScaleItem</name>
<message>
<location filename="../src/scaleitem.cpp" line="90"/>
<location filename="../src/scaleitem.cpp" line="81"/>
<source>mi</source>
<translation>mi</translation>
</message>
<message>
<location filename="../src/scaleitem.cpp" line="91"/>
<location filename="../src/scaleitem.cpp" line="82"/>
<source>ft</source>
<translation>ft</translation>
</message>
<message>
<location filename="../src/scaleitem.cpp" line="93"/>
<location filename="../src/scaleitem.cpp" line="84"/>
<source>km</source>
<translation>km</translation>
</message>
<message>
<location filename="../src/scaleitem.cpp" line="94"/>
<location filename="../src/scaleitem.cpp" line="85"/>
<source>m</source>
<translation>m</translation>
</message>
@ -921,27 +967,27 @@
<context>
<name>TrackItem</name>
<message>
<location filename="../src/trackitem.cpp" line="14"/>
<location filename="../src/trackitem.cpp" line="12"/>
<source>Name</source>
<translation>Název</translation>
</message>
<message>
<location filename="../src/trackitem.cpp" line="16"/>
<location filename="../src/trackitem.cpp" line="14"/>
<source>Description</source>
<translation>Popis</translation>
</message>
<message>
<location filename="../src/trackitem.cpp" line="17"/>
<location filename="../src/trackitem.cpp" line="15"/>
<source>Distance</source>
<translation>Vzdálenost</translation>
</message>
<message>
<location filename="../src/trackitem.cpp" line="20"/>
<location filename="../src/trackitem.cpp" line="17"/>
<source>Time</source>
<translation>Čas</translation>
</message>
<message>
<location filename="../src/trackitem.cpp" line="23"/>
<location filename="../src/trackitem.cpp" line="19"/>
<source>Date</source>
<translation>Datum</translation>
</message>

1022
lang/gpxsee_sv.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
; The name of the installer
Name "GPXSee"
; Program version
!define VERSION "3.4"
!define VERSION "3.8"
; The file to write
OutFile "GPXSee-${VERSION}.exe"

View File

@ -4,7 +4,7 @@
; The name of the installer
Name "GPXSee"
; Program version
!define VERSION "3.4"
!define VERSION "3.8"
; The file to write
OutFile "GPXSee-${VERSION}_x64.exe"

View File

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

View File

@ -17,25 +17,39 @@
#define USER_AGENT \
APP_NAME "/" APP_VERSION " (" PLATFORM_STR "; Qt " QT_VERSION_STR ")"
#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()
{
connect(&_manager, SIGNAL(finished(QNetworkReply*)),
SLOT(downloadFinished(QNetworkReply*)));
}
bool Downloader::doDownload(const Download &dl)
bool Downloader::doDownload(const Download &dl, const Redirect &redirect)
{
QUrl url(dl.url());
if (_errorDownloads.contains(url))
return false;
if (_currentDownloads.contains(url))
return false;
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);
QNetworkReply *reply = _manager.get(request);
_currentDownloads.append(reply);
_currentDownloads.insert(url, reply);
return true;
}
@ -58,26 +72,49 @@ bool Downloader::saveToDisk(const QString &filename, QIODevice *data)
void Downloader::downloadFinished(QNetworkReply *reply)
{
QUrl url = reply->url();
QUrl url = reply->request().url();
if (reply->error()) {
_errorDownloads.insert(url);
fprintf(stderr, "Error downloading map tile: %s: %s\n",
url.toEncoded().constData(), qPrintable(reply->errorString()));
QUrl origin = reply->request().attribute(ATTR_ORIGIN).toUrl();
if (origin.isEmpty()) {
_errorDownloads.insert(url);
fprintf(stderr, "Error downloading map tile: %s: %s\n",
url.toEncoded().constData(), qPrintable(reply->errorString()));
} else {
_errorDownloads.insert(origin);
fprintf(stderr, "Error downloading map tile: %s -> %s: %s\n",
origin.toEncoded().constData(), url.toEncoded().constData(),
qPrintable(reply->errorString()));
}
} else {
QUrl redirect = reply->attribute(
QNetworkRequest::RedirectionTargetAttribute).toUrl();
QString filename = reply->request().attribute(QNetworkRequest::User)
QUrl location = reply->attribute(ATTR_REDIRECT).toUrl();
QString filename = reply->request().attribute(ATTR_FILE)
.toString();
if (!redirect.isEmpty()) {
Download dl(redirect, filename);
doDownload(dl);
if (!location.isEmpty()) {
QUrl origin = reply->request().attribute(ATTR_ORIGIN).toUrl();
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
if (!saveToDisk(filename, reply))
_errorDownloads.insert(url);
}
_currentDownloads.removeAll(reply);
_currentDownloads.remove(url);
reply->deleteLater();
if (_currentDownloads.isEmpty())

View File

@ -5,7 +5,7 @@
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QUrl>
#include <QList>
#include <QMap>
#include <QSet>
@ -39,15 +39,32 @@ private slots:
void downloadFinished(QNetworkReply *reply);
private:
class Redirect
{
public:
Redirect() : _level(0) {}
Redirect(const QUrl &origin, int level) :
_origin(origin), _level(level) {}
const QUrl &origin() const {return _origin;}
int level() const {return _level;}
bool isNull() const {return (_level == 0);}
private:
QUrl _origin;
int _level;
};
Downloader();
Downloader(Downloader const&);
void operator=(Downloader const&);
bool doDownload(const Download &dl);
bool doDownload(const Download &dl, const Redirect &redirect = Redirect());
bool saveToDisk(const QString &filename, QIODevice *data);
QNetworkAccessManager _manager;
QList<QNetworkReply *> _currentDownloads;
QMap<QUrl, QNetworkReply *> _currentDownloads;
QSet<QUrl> _errorDownloads;
};

View File

@ -3,12 +3,8 @@
#include <QMouseEvent>
#include <QPaintEngine>
#include <QPaintDevice>
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
#include <QGLWidget>
#else // QT 5
#include <QOpenGLWidget>
#endif // QT 5
#include <QSysInfo>
#include "opengl.h"
#include "config.h"
#include "axisitem.h"
#include "slideritem.h"
@ -26,7 +22,7 @@
GraphView::GraphView(QWidget *parent)
: QGraphicsView(parent)
{
_scene = new QGraphicsScene();
_scene = new QGraphicsScene(this);
setScene(_scene);
setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
@ -466,11 +462,7 @@ void GraphView::useOpenGL(bool use)
#ifdef Q_OS_WIN32
if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA)
#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
setViewport(new OPENGL_WIDGET);
} else
setViewport(new QWidget);
}

View File

@ -135,8 +135,15 @@ void GUI::loadPOIs()
else
list = globalDir.entryInfoList(QStringList(), QDir::Files);
for (int i = 0; i < list.size(); ++i)
_poi->loadFile(list.at(i).absoluteFilePath());
for (int i = 0; i < list.size(); ++i) {
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()
@ -668,6 +675,14 @@ bool GUI::loadFile(const QString &fileName)
_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;
} else {
updateNavigationActions();
@ -811,7 +826,19 @@ void GUI::plot(QPrinter *printer)
qreal d = distance();
qreal t = time();
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) {
QString format = QLocale::system().dateFormat(QLocale::LongFormat);
info.insert(tr("Date"), _dateRange.first.toString(format));
@ -823,16 +850,9 @@ void GUI::plot(QPrinter *printer)
}
}
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 (d > 0)
if (d > 0 && _options.printDistance)
info.insert(tr("Distance"), Format::distance(d, units));
if (t > 0)
if (t > 0 && _options.printTime)
info.insert(tr("Time"), Format::timeSpan(t));
@ -845,7 +865,7 @@ void GUI::plot(QPrinter *printer)
mh = ih / 2;
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()));
gh = (printer->width() > printer->height())
? 0.15 * r * (printer->height() - ih - 2*mh)
@ -857,6 +877,27 @@ void GUI::plot(QPrinter *printer)
gh = 0;
_pathView->plot(&p, QRectF(0, ih + mh, printer->width(), printer->height()
- (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()
@ -868,6 +909,7 @@ void GUI::reloadFile()
_routeDistance = 0;
_time = 0;
_dateRange = DateRange(QDate(), QDate());
_pathName = QString();
for (int i = 0; i < _tabs.count(); i++)
_tabs.at(i)->clear();
@ -901,6 +943,7 @@ void GUI::closeFiles()
_routeDistance = 0;
_time = 0;
_dateRange = DateRange(QDate(), QDate());
_pathName = QString();
_sliderPos = 0;
@ -1014,7 +1057,7 @@ void GUI::clearMapCache()
void GUI::updateStatusBarInfo()
{
if (_files.count() == 0)
_fileNameLabel->setText(tr("No GPX files loaded"));
_fileNameLabel->setText(tr("No files loaded"));
else if (_files.count() == 1)
_fileNameLabel->setText(_files.at(0));
else
@ -1378,6 +1421,19 @@ void GUI::writeSettings()
settings.setValue(POI_RADIUS_SETTING, _options.poiRadius);
if (_options.useOpenGL != USE_OPENGL_DEFAULT)
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.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();
}
@ -1534,6 +1590,18 @@ void GUI::readSettings()
.toInt();
_options.useOpenGL = settings.value(USE_OPENGL_SETTING, USE_OPENGL_DEFAULT)
.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.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->setTrackWidth(_options.trackWidth);

View File

@ -189,6 +189,7 @@ private:
qreal _routeDistance;
qreal _time;
DateRange _dateRange;
QString _pathName;
qreal _sliderPos;

View File

@ -4,24 +4,25 @@
#define APP_ICON ":/icons/gpxsee.png"
// Toolbar/menu icons
#define OPEN_FILE_ICON ":/icons/document-open.png"
#define EXPORT_FILE_ICON ":/icons/document-export.png"
#define PRINT_FILE_ICON ":/icons/document-print.png"
#define CLOSE_FILE_ICON ":/icons/dialog-close.png"
#define SHOW_POI_ICON ":/icons/flag.png"
#define SHOW_MAP_ICON ":/icons/applications-internet.png"
#define SHOW_GRAPHS_ICON ":/icons/office-chart-line-stacked.png"
#define QUIT_ICON ":/icons/application-exit.png"
#define RELOAD_FILE_ICON ":/icons/view-refresh.png"
#define NEXT_FILE_ICON ":/icons/arrow-right.png"
#define PREV_FILE_ICON ":/icons/arrow-left.png"
#define LAST_FILE_ICON ":/icons/arrow-right-double.png"
#define FIRST_FILE_ICON ":/icons/arrow-left-double.png"
#define FULLSCREEN_ICON ":/icons/view-fullscreen.png"
#define OPEN_FILE_ICON ":/icons/document-open.png"
#define EXPORT_FILE_ICON ":/icons/document-export.png"
#define PRINT_FILE_ICON ":/icons/document-print.png"
#define CLOSE_FILE_ICON ":/icons/dialog-close.png"
#define SHOW_POI_ICON ":/icons/flag.png"
#define SHOW_MAP_ICON ":/icons/applications-internet.png"
#define SHOW_GRAPHS_ICON ":/icons/office-chart-line-stacked.png"
#define QUIT_ICON ":/icons/application-exit.png"
#define RELOAD_FILE_ICON ":/icons/view-refresh.png"
#define NEXT_FILE_ICON ":/icons/arrow-right.png"
#define PREV_FILE_ICON ":/icons/arrow-left.png"
#define LAST_FILE_ICON ":/icons/arrow-right-double.png"
#define FIRST_FILE_ICON ":/icons/arrow-left-double.png"
#define FULLSCREEN_ICON ":/icons/view-fullscreen.png"
// Options dialog icons
#define APPEARANCE_ICON ":/icons/preferences-desktop-display.png"
#define POI_ICON ":/icons/flag_48.png"
#define SYSTEM_ICON ":/icons/system-run.png"
#define APPEARANCE_ICON ":/icons/preferences-desktop-display.png"
#define POI_ICON ":/icons/flag_48.png"
#define SYSTEM_ICON ":/icons/system-run.png"
#define PRINT_EXPORT_ICON ":/icons/document-print-preview.png"
#endif /* ICONS_H */

View File

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

View File

@ -313,7 +313,7 @@ bool NMEAParser::readGGA(const char *line, int len)
return false;
break;
case 3:
if (!readNS(vp, lp - vp, lon))
if (!readNS(vp, lp - vp, lat))
return false;
break;
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,55 @@ QWidget *OptionsDialog::createPOIPage()
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);
_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->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()
{
_useOpenGL = new QCheckBox(tr("Use OpenGL"));
#if defined(Q_OS_WIN32) || defined(Q_OS_MAC)
#ifdef Q_OS_WIN32
if (QSysInfo::WindowsVersion < QSysInfo::WV_VISTA) {
#endif // Q_OS_WIN32
_useOpenGL->setChecked(false);
_useOpenGL->setEnabled(false);
#ifdef Q_OS_WIN32
} else
#endif // Q_OS_WIN32
#endif // Q_OS_WIN32 || Q_OS_MAC
_useOpenGL->setChecked(_options->useOpenGL);
QFormLayout *systemLayout = new QFormLayout();
@ -175,6 +211,7 @@ OptionsDialog::OptionsDialog(Options *options, QWidget *parent)
QStackedWidget *pages = new QStackedWidget();
pages->addWidget(createAppearancePage());
pages->addWidget(createPOIPage());
pages->addWidget(createExportPage());
pages->addWidget(createSystemPage());
QListWidget *menu = new QListWidget();
@ -182,6 +219,8 @@ OptionsDialog::OptionsDialog(Options *options, QWidget *parent)
new QListWidgetItem(QIcon(QPixmap(APPEARANCE_ICON)), tr("Appearance"),
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);
QHBoxLayout *contentLayout = new QHBoxLayout();
@ -234,5 +273,12 @@ void OptionsDialog::accept()
_options->useOpenGL = _useOpenGL->isChecked();
_options->printName = _name->isChecked();
_options->printDate = _date->isChecked();
_options->printDistance = _distance->isChecked();
_options->printTime = _time->isChecked();
_options->printItemCount = _itemCount->isChecked();
_options->separateGraphPage = _separateGraphPage->isChecked();
QDialog::accept();
}

View File

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

View File

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

View File

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

View File

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

View File

@ -1,8 +1,5 @@
#include <QPainter>
#include "config.h"
#include "rd.h"
#include "wgs84.h"
#include "tile.h"
#include "misc.h"
#include "scaleitem.h"
@ -13,17 +10,11 @@
#define SEGMENTS 3
#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)
{
_units = Metric;
_zoom = 0;
_lat = 0;
_res = 1.0;
#ifndef Q_OS_MAC
setCacheMode(QGraphicsItem::DeviceCoordinateCache);
@ -96,45 +87,33 @@ QString ScaleItem::units() const
void ScaleItem::computeScale()
{
qreal res = zoom2resolution(_zoom, _lat);
if (_units == Imperial) {
_length = niceNum((res * M2FT * SCALE_WIDTH) / SEGMENTS, 1);
_length = niceNum((_res * M2FT * SCALE_WIDTH) / SEGMENTS, 1);
if (_length >= MIINFT) {
_length = niceNum((res * M2FT * FT2MI * SCALE_WIDTH) / SEGMENTS, 1);
_width = (_length / (res * M2FT * FT2MI));
_length = niceNum((_res * M2FT * FT2MI * SCALE_WIDTH) / SEGMENTS, 1);
_width = (_length / (_res * M2FT * FT2MI));
_scale = true;
} else {
_width = (_length / (res * M2FT));
_width = (_length / (_res * M2FT));
_scale = false;
}
} else {
_length = niceNum((res * SCALE_WIDTH) / SEGMENTS, 1);
_length = niceNum((_res * SCALE_WIDTH) / SEGMENTS, 1);
if (_length >= KMINM) {
_length *= M2KM;
_width = (_length / (res * M2KM));
_width = (_length / (_res * M2KM));
_scale = true;
} else {
_width = (_length / res);
_width = (_length / _res);
_scale = false;
}
}
}
void ScaleItem::setZoom(int z, qreal lat)
void ScaleItem::setResolution(qreal res)
{
prepareGeometryChange();
_zoom = z;
_lat = lat;
computeScale();
updateBoundingRect();
update();
}
void ScaleItem::setZoom(int z)
{
prepareGeometryChange();
_zoom = z;
_res = res;
computeScale();
updateBoundingRect();
update();

View File

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

View File

@ -92,5 +92,17 @@
#define POI_RADIUS_DEFAULT (IMPERIAL_UNITS() ? MIINM : KMINM)
#define USE_OPENGL_SETTING "useOpenGL"
#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_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

View File

@ -1,5 +1,3 @@
#include <QApplication>
#include <QCursor>
#include <QPainter>
#include "format.h"
#include "tooltip.h"
@ -11,17 +9,14 @@ QString TrackItem::toolTip()
ToolTip tt;
if (!_name.isEmpty())
tt.insert(qApp->translate("TrackItem", "Name"), _name);
tt.insert(tr("Name"), _name);
if (!_desc.isEmpty())
tt.insert(qApp->translate("TrackItem", "Description"), _desc);
tt.insert(qApp->translate("TrackItem", "Distance"),
Format::distance(_distance.last(), _units));
tt.insert(tr("Description"), _desc);
tt.insert(tr("Distance"), Format::distance(_distance.last(), _units));
if (_time > 0)
tt.insert(qApp->translate("TrackItem", "Time"),
Format::timeSpan(_time));
tt.insert(tr("Time"), Format::timeSpan(_time));
if (!_date.isNull())
tt.insert(qApp->translate("TrackItem", "Date"),
_date.toString(Qt::SystemLocaleShortDate));
tt.insert(tr("Date"), _date.toString(Qt::SystemLocaleShortDate));
return tt.toString();
}