1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 03:35:53 +01:00

Added graph grid option

Code cleanup
This commit is contained in:
Martin Tůma 2016-10-17 23:14:07 +02:00
parent a6b2a477a1
commit 1160c6d385
15 changed files with 265 additions and 142 deletions

View File

@ -52,7 +52,8 @@ HEADERS += src/config.h \
src/graphitem.h \ src/graphitem.h \
src/graph.h \ src/graph.h \
src/pathitem.h \ src/pathitem.h \
src/pathview.h src/pathview.h \
src/griditem.h
SOURCES += src/main.cpp \ SOURCES += src/main.cpp \
src/gui.cpp \ src/gui.cpp \
src/gpx.cpp \ src/gpx.cpp \
@ -91,7 +92,8 @@ SOURCES += src/main.cpp \
src/routeitem.cpp \ src/routeitem.cpp \
src/graphitem.cpp \ src/graphitem.cpp \
src/pathitem.cpp \ src/pathitem.cpp \
src/pathview.cpp src/pathview.cpp \
src/griditem.cpp
RESOURCES += gpxsee.qrc RESOURCES += gpxsee.qrc
TRANSLATIONS = lang/gpxsee_cs.ts TRANSLATIONS = lang/gpxsee_cs.ts
macx { macx {

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.1" language="cs_CZ"> <TS version="2.0" language="cs_CZ">
<context> <context>
<name>ElevationGraph</name> <name>ElevationGraph</name>
<message> <message>
@ -43,7 +43,7 @@
<context> <context>
<name>ExportDialog</name> <name>ExportDialog</name>
<message> <message>
<location filename="../src/exportdialog.cpp" line="121"/> <location filename="../src/exportdialog.cpp" line="122"/>
<source>Export to PDF</source> <source>Export to PDF</source>
<translation>Exportovat do PDF</translation> <translation>Exportovat do PDF</translation>
</message> </message>
@ -98,34 +98,34 @@
<translation>Soubor:</translation> <translation>Soubor:</translation>
</message> </message>
<message> <message>
<location filename="../src/exportdialog.cpp" line="99"/> <location filename="../src/exportdialog.cpp" line="100"/>
<source>Output file</source> <source>Output file</source>
<translation>Výstupní soubor</translation> <translation>Výstupní soubor</translation>
</message> </message>
<message> <message>
<location filename="../src/exportdialog.cpp" line="106"/> <location filename="../src/exportdialog.cpp" line="107"/>
<source>Export</source> <source>Export</source>
<translation>Exportovat</translation> <translation>Exportovat</translation>
</message> </message>
<message> <message>
<location filename="../src/exportdialog.cpp" line="128"/> <location filename="../src/exportdialog.cpp" line="129"/>
<location filename="../src/exportdialog.cpp" line="138"/> <location filename="../src/exportdialog.cpp" line="139"/>
<location filename="../src/exportdialog.cpp" line="143"/> <location filename="../src/exportdialog.cpp" line="144"/>
<source>Error</source> <source>Error</source>
<translation>Chyba</translation> <translation>Chyba</translation>
</message> </message>
<message> <message>
<location filename="../src/exportdialog.cpp" line="128"/> <location filename="../src/exportdialog.cpp" line="129"/>
<source>No output file selected.</source> <source>No output file selected.</source>
<translation>Nebyl zvolen žádný výstupní soubor.</translation> <translation>Nebyl zvolen žádný výstupní soubor.</translation>
</message> </message>
<message> <message>
<location filename="../src/exportdialog.cpp" line="138"/> <location filename="../src/exportdialog.cpp" line="139"/>
<source>%1 is a directory.</source> <source>%1 is a directory.</source>
<translation>%1 je adresář.</translation> <translation>%1 je adresář.</translation>
</message> </message>
<message> <message>
<location filename="../src/exportdialog.cpp" line="143"/> <location filename="../src/exportdialog.cpp" line="144"/>
<source>%1 is not writable.</source> <source>%1 is not writable.</source>
<translation>%1 nelze zapsat.</translation> <translation>%1 nelze zapsat.</translation>
</message> </message>
@ -133,12 +133,11 @@
<context> <context>
<name>FileSelectWidget</name> <name>FileSelectWidget</name>
<message> <message>
<location filename="../src/fileselectwidget.cpp" line="15"/>
<source>Browse...</source> <source>Browse...</source>
<translation>Procházet...</translation> <translation type="obsolete">Procházet...</translation>
</message> </message>
<message> <message>
<location filename="../src/fileselectwidget.cpp" line="28"/> <location filename="../src/fileselectwidget.cpp" line="38"/>
<source>Select file</source> <source>Select file</source>
<translation>Vybrat soubor</translation> <translation>Vybrat soubor</translation>
</message> </message>
@ -146,392 +145,397 @@
<context> <context>
<name>GUI</name> <name>GUI</name>
<message> <message>
<location filename="../src/gui.cpp" line="518"/> <location filename="../src/gui.cpp" line="529"/>
<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="582"/> <location filename="../src/gui.cpp" line="593"/>
<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="661"/> <location filename="../src/gui.cpp" line="672"/>
<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="206"/> <location filename="../src/gui.cpp" line="209"/>
<source>Open</source> <source>Open</source>
<translation>Otevřít</translation> <translation>Otevřít</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="190"/> <location filename="../src/gui.cpp" line="193"/>
<source>Quit</source> <source>Quit</source>
<translation>Ukončit</translation> <translation>Ukončit</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="198"/> <location filename="../src/gui.cpp" line="201"/>
<location filename="../src/gui.cpp" line="534"/> <location filename="../src/gui.cpp" line="545"/>
<location filename="../src/gui.cpp" line="535"/> <location filename="../src/gui.cpp" line="546"/>
<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="222"/> <location filename="../src/gui.cpp" line="225"/>
<source>Close</source> <source>Close</source>
<translation>Zavřít</translation> <translation>Zavřít</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="228"/> <location filename="../src/gui.cpp" line="231"/>
<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="449"/> <location filename="../src/gui.cpp" line="460"/>
<source>Show</source> <source>Show</source>
<translation>Zobrazit</translation> <translation>Zobrazit</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="373"/> <location filename="../src/gui.cpp" line="382"/>
<location filename="../src/gui.cpp" line="443"/> <location filename="../src/gui.cpp" line="454"/>
<source>File</source> <source>File</source>
<translation>Soubor</translation> <translation>Soubor</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="196"/> <location filename="../src/gui.cpp" line="199"/>
<location filename="../src/gui.cpp" line="557"/> <location filename="../src/gui.cpp" line="568"/>
<location filename="../src/gui.cpp" line="558"/> <location filename="../src/gui.cpp" line="569"/>
<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="236"/> <location filename="../src/gui.cpp" line="239"/>
<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="239"/> <location filename="../src/gui.cpp" line="242"/>
<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="241"/> <location filename="../src/gui.cpp" line="244"/>
<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="245"/> <location filename="../src/gui.cpp" line="248"/>
<source>Show POI labels</source> <source>Show POI labels</source>
<translation>Zobrazovat názvy POI</translation> <translation>Zobrazovat názvy POI</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="250"/> <location filename="../src/gui.cpp" line="253"/>
<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="259"/> <location filename="../src/gui.cpp" line="262"/>
<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="265"/> <location filename="../src/gui.cpp" line="268"/>
<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="274"/> <location filename="../src/gui.cpp" line="277"/>
<location filename="../src/gui.cpp" line="278"/> <location filename="../src/gui.cpp" line="281"/>
<location filename="../src/gui.cpp" line="544"/> <location filename="../src/gui.cpp" line="555"/>
<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="285"/> <location filename="../src/gui.cpp" line="288"/>
<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="289"/> <location filename="../src/gui.cpp" line="292"/>
<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="293"/> <location filename="../src/gui.cpp" line="296"/>
<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="297"/> <location filename="../src/gui.cpp" line="300"/>
<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="308"/> <location filename="../src/gui.cpp" line="311"/>
<source>Show graphs</source> <source>Show graphs</source>
<translation>Zobrazovat grafy</translation> <translation>Zobrazovat grafy</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="330"/> <location filename="../src/gui.cpp" line="333"/>
<source>Show grid</source>
<translation>Zobrazit mřížku</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="339"/>
<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="336"/> <location filename="../src/gui.cpp" line="345"/>
<source>Metric</source> <source>Metric</source>
<translation>Metrické</translation> <translation>Metrické</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="341"/> <location filename="../src/gui.cpp" line="350"/>
<source>Imperial</source> <source>Imperial</source>
<translation>Imperiální</translation> <translation>Imperiální</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="347"/> <location filename="../src/gui.cpp" line="356"/>
<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="355"/> <location filename="../src/gui.cpp" line="364"/>
<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="358"/> <location filename="../src/gui.cpp" line="367"/>
<source>Previous</source> <source>Previous</source>
<translation>Předchozí</translation> <translation>Předchozí</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="362"/> <location filename="../src/gui.cpp" line="371"/>
<source>Last</source> <source>Last</source>
<translation>Poslední</translation> <translation>Poslední</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="365"/> <location filename="../src/gui.cpp" line="374"/>
<source>First</source> <source>First</source>
<translation>První</translation> <translation>První</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="387"/> <location filename="../src/gui.cpp" line="396"/>
<source>Map</source> <source>Map</source>
<translation>Mapa</translation> <translation>Mapa</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="394"/> <location filename="../src/gui.cpp" line="403"/>
<source>Graph</source> <source>Graph</source>
<translation>Graf</translation> <translation>Graf</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="400"/> <location filename="../src/gui.cpp" line="411"/>
<source>POI</source> <source>POI</source>
<translation>POI</translation> <translation>POI</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="401"/> <location filename="../src/gui.cpp" line="412"/>
<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="412"/> <location filename="../src/gui.cpp" line="423"/>
<source>Data</source> <source>Data</source>
<translation>Data</translation> <translation>Data</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="413"/> <location filename="../src/gui.cpp" line="424"/>
<source>Display</source> <source>Display</source>
<translation>Zobrazit</translation> <translation>Zobrazit</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="421"/> <location filename="../src/gui.cpp" line="432"/>
<source>Settings</source> <source>Settings</source>
<translation>Nastavení</translation> <translation>Nastavení</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="422"/> <location filename="../src/gui.cpp" line="433"/>
<source>Units</source> <source>Units</source>
<translation>Jednotky</translation> <translation>Jednotky</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="430"/> <location filename="../src/gui.cpp" line="441"/>
<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="546"/> <location filename="../src/gui.cpp" line="557"/>
<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="663"/> <location filename="../src/gui.cpp" line="674"/>
<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="663"/> <location filename="../src/gui.cpp" line="674"/>
<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="664"/> <location filename="../src/gui.cpp" line="675"/>
<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="752"/> <location filename="../src/gui.cpp" line="761"/>
<location filename="../src/gui.cpp" line="755"/> <location filename="../src/gui.cpp" line="764"/>
<source>Date</source> <source>Date</source>
<translation>Datum</translation> <translation>Datum</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="764"/> <location filename="../src/gui.cpp" line="773"/>
<source>Routes</source> <source>Routes</source>
<translation>Trasy</translation> <translation>Trasy</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="946"/> <location filename="../src/gui.cpp" line="961"/>
<source>No GPX files loaded</source> <source>No GPX files loaded</source>
<translation>Nejsou načteny žádné GPX soubory</translation> <translation>Nejsou načteny žádné GPX soubory</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="950"/> <location filename="../src/gui.cpp" line="965"/>
<source>%1 files</source> <source>%1 files</source>
<translation>%1 souborů</translation> <translation>%1 souborů</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="537"/> <location filename="../src/gui.cpp" line="548"/>
<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="514"/> <location filename="../src/gui.cpp" line="525"/>
<source>Version </source> <source>Version </source>
<translation>Verze </translation> <translation>Verze </translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="211"/> <location filename="../src/gui.cpp" line="214"/>
<source>Print...</source> <source>Print...</source>
<translation>Tisknout...</translation> <translation>Tisknout...</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="216"/> <location filename="../src/gui.cpp" line="219"/>
<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="662"/> <location filename="../src/gui.cpp" line="673"/>
<source>All POI files (*.gpx *.csv)</source> <source>All POI files (*.gpx *.csv)</source>
<translation>Všechny POI soubory (*.gpx *.csv)</translation> <translation>Všechny POI soubory (*.gpx *.csv)</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="766"/> <location filename="../src/gui.cpp" line="775"/>
<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="538"/> <location filename="../src/gui.cpp" line="549"/>
<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="301"/> <location filename="../src/gui.cpp" line="304"/>
<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="540"/> <location filename="../src/gui.cpp" line="551"/>
<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="541"/> <location filename="../src/gui.cpp" line="552"/>
<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="542"/> <location filename="../src/gui.cpp" line="553"/>
<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="561"/> <location filename="../src/gui.cpp" line="572"/>
<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="564"/> <location filename="../src/gui.cpp" line="575"/>
<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="572"/> <location filename="../src/gui.cpp" line="583"/>
<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="583"/> <location filename="../src/gui.cpp" line="594"/>
<source>GPX files (*.gpx);;All files (*)</source> <source>GPX files (*.gpx);;All files (*)</source>
<translation>Soubory GPX (*.gpx);;Všechny soubory (*)</translation> <translation>Soubory GPX (*.gpx);;Všechny soubory (*)</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="652"/> <location filename="../src/gui.cpp" line="663"/>
<location filename="../src/gui.cpp" line="680"/> <location filename="../src/gui.cpp" line="692"/>
<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="762"/> <location filename="../src/gui.cpp" line="771"/>
<source>Tracks</source> <source>Tracks</source>
<translation>Cesty</translation> <translation>Cesty</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="201"/> <location filename="../src/gui.cpp" line="204"/>
<location filename="../src/gui.cpp" line="512"/> <location filename="../src/gui.cpp" line="523"/>
<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="454"/> <location filename="../src/gui.cpp" line="465"/>
<source>Navigation</source> <source>Navigation</source>
<translation>Navigace</translation> <translation>Navigace</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="560"/> <location filename="../src/gui.cpp" line="571"/>
<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="571"/> <location filename="../src/gui.cpp" line="582"/>
<source>POIs</source> <source>POIs</source>
<translation>POI body</translation> <translation>POI body</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="316"/> <location filename="../src/gui.cpp" line="319"/>
<location filename="../src/gui.cpp" line="769"/> <location filename="../src/gui.cpp" line="778"/>
<source>Distance</source> <source>Distance</source>
<translation>Vzdálenost</translation> <translation>Vzdálenost</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="322"/> <location filename="../src/gui.cpp" line="326"/>
<location filename="../src/gui.cpp" line="771"/> <location filename="../src/gui.cpp" line="780"/>
<source>Time</source> <source>Time</source>
<translation>Čas</translation> <translation>Čas</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="654"/> <location filename="../src/gui.cpp" line="665"/>
<location filename="../src/gui.cpp" line="681"/> <location filename="../src/gui.cpp" line="693"/>
<source>Error</source> <source>Error</source>
<translation>Chyba</translation> <translation>Chyba</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="649"/> <location filename="../src/gui.cpp" line="660"/>
<source>Error loading GPX file: <source>Error loading GPX file:
%1</source> %1</source>
<translation>Soubor GPX nelze otevřít: <translation>Soubor GPX nelze otevřít:
%1</translation> %1</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="677"/> <location filename="../src/gui.cpp" line="689"/>
<source>Error loading POI file: <source>Error loading POI file:
%1</source> %1</source>
<translation>Soubor POI nelze otevřít: <translation>Soubor POI nelze otevřít:
@ -541,47 +545,48 @@
<context> <context>
<name>GraphView</name> <name>GraphView</name>
<message> <message>
<location filename="../src/graphview.cpp" line="111"/> <location filename="../src/graphview.cpp" line="113"/>
<source>m</source> <source>m</source>
<translation>m</translation> <translation>m</translation>
</message> </message>
<message> <message>
<location filename="../src/graphview.cpp" line="114"/> <location filename="../src/graphview.cpp" line="116"/>
<source>km</source> <source>km</source>
<translation>km</translation> <translation>km</translation>
</message> </message>
<message> <message>
<location filename="../src/graphview.cpp" line="119"/> <location filename="../src/graphview.cpp" line="121"/>
<source>ft</source> <source>ft</source>
<translation>ft</translation> <translation>ft</translation>
</message> </message>
<message> <message>
<location filename="../src/graphview.cpp" line="122"/> <location filename="../src/graphview.cpp" line="124"/>
<source>mi</source> <source>mi</source>
<translation>mi</translation> <translation>mi</translation>
</message> </message>
<message> <message>
<location filename="../src/graphview.cpp" line="128"/> <location filename="../src/graphview.cpp" line="130"/>
<source>s</source> <source>s</source>
<translation>s</translation> <translation>s</translation>
</message> </message>
<message> <message>
<location filename="../src/graphview.cpp" line="131"/> <location filename="../src/graphview.cpp" line="133"/>
<source>min</source> <source>min</source>
<translation>min</translation> <translation>min</translation>
</message> </message>
<message> <message>
<location filename="../src/graphview.cpp" line="134"/> <location filename="../src/graphview.cpp" line="136"/>
<source>h</source> <source>h</source>
<translation>h</translation> <translation>h</translation>
</message> </message>
<message> <message>
<location filename="../src/graphview.cpp" line="160"/> <location filename="../src/graphview.cpp" line="65"/>
<location filename="../src/graphview.cpp" line="162"/>
<source>Distance</source> <source>Distance</source>
<translation>Vzdálenost</translation> <translation>Vzdálenost</translation>
</message> </message>
<message> <message>
<location filename="../src/graphview.cpp" line="162"/> <location filename="../src/graphview.cpp" line="164"/>
<source>Time</source> <source>Time</source>
<translation>Čas</translation> <translation>Čas</translation>
</message> </message>

View File

@ -118,6 +118,7 @@ void AxisItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QPen pen = QPen(Qt::black, AXIS_WIDTH); QPen pen = QPen(Qt::black, AXIS_WIDTH);
painter->setRenderHint(QPainter::Antialiasing, false);
painter->setFont(font); painter->setFont(font);
painter->setPen(pen); painter->setPen(pen);
@ -202,3 +203,16 @@ QSizeF AxisItem::margin() const
+ TICK/2, es.height()/2 + fm.descent()); + TICK/2, es.height()/2 + fm.descent());
} }
} }
QList<qreal> AxisItem::ticks() const
{
struct Label l;
QList<qreal> list;
l = label(_range.min(), _range.max(), (_type == X) ? XTICKS : YTICKS);
for (int i = 0; i < ((l.max - l.min) / l.d) + 1; i++)
list.append(((_size/_range.size()) * ((l.min + i * l.d)
- _range.min())));
return list;
}

View File

@ -20,6 +20,7 @@ public:
void setLabel(const QString& label); void setLabel(const QString& label);
QSizeF margin() const; QSizeF margin() const;
QList<qreal> ticks() const;
private: private:
void updateBoundingRect(); void updateBoundingRect();

View File

@ -7,6 +7,7 @@
#include "slideritem.h" #include "slideritem.h"
#include "sliderinfoitem.h" #include "sliderinfoitem.h"
#include "infoitem.h" #include "infoitem.h"
#include "griditem.h"
#include "graph.h" #include "graph.h"
#include "graphitem.h" #include "graphitem.h"
#include "pathitem.h" #include "pathitem.h"
@ -43,6 +44,7 @@ GraphView::GraphView(QWidget *parent)
_sliderInfo = new SliderInfoItem(_slider); _sliderInfo = new SliderInfoItem(_slider);
_sliderInfo->setZValue(2.0); _sliderInfo->setZValue(2.0);
_info = new InfoItem(); _info = new InfoItem();
_grid = new GridItem();
connect(_slider, SIGNAL(positionChanged(const QPointF&)), this, connect(_slider, SIGNAL(positionChanged(const QPointF&)), this,
SLOT(emitSliderPositionChanged(const QPointF&))); SLOT(emitSliderPositionChanged(const QPointF&)));
@ -60,9 +62,7 @@ GraphView::GraphView(QWidget *parent)
_units = Metric; _units = Metric;
_graphType = Distance; _graphType = Distance;
_xLabel = tr("Distance");
setGraphType(_graphType);
setUnits(_units);
} }
GraphView::~GraphView() GraphView::~GraphView()
@ -75,6 +75,8 @@ GraphView::~GraphView()
delete _slider; delete _slider;
if (_info->scene() != _scene) if (_info->scene() != _scene)
delete _info; delete _info;
if (_grid->scene() != _scene)
delete _grid;
for (int i = 0; i < _graphs.count(); i++) for (int i = 0; i < _graphs.count(); i++)
if (_graphs.at(i)->scene() != _scene) if (_graphs.at(i)->scene() != _scene)
@ -165,6 +167,11 @@ void GraphView::setGraphType(GraphType type)
redraw(); redraw();
} }
void GraphView::showGrid(bool show)
{
_grid->setVisible(show);
}
void GraphView::loadGraph(const Graph &graph, PathItem *path, int id) void GraphView::loadGraph(const Graph &graph, PathItem *path, int id)
{ {
if (graph.size() < 2) if (graph.size() < 2)
@ -249,6 +256,7 @@ void GraphView::redraw(const QSizeF &size)
removeItem(_yAxis); removeItem(_yAxis);
removeItem(_slider); removeItem(_slider);
removeItem(_info); removeItem(_info);
removeItem(_grid);
_scene->setSceneRect(QRectF()); _scene->setSceneRect(QRectF());
return; return;
} }
@ -257,6 +265,7 @@ void GraphView::redraw(const QSizeF &size)
addItem(_yAxis); addItem(_yAxis);
addItem(_slider); addItem(_slider);
addItem(_info); addItem(_info);
addItem(_grid);
rx = RangeF(bounds().left() * _xScale, bounds().right() * _xScale); rx = RangeF(bounds().left() * _xScale, bounds().right() * _xScale);
ry = RangeF(bounds().top() * _yScale + _yOffset, bounds().bottom() * _yScale ry = RangeF(bounds().top() * _yScale + _yOffset, bounds().bottom() * _yScale
@ -293,6 +302,10 @@ void GraphView::redraw(const QSizeF &size)
_xAxis->setPos(r.bottomLeft()); _xAxis->setPos(r.bottomLeft());
_yAxis->setPos(r.bottomLeft()); _yAxis->setPos(r.bottomLeft());
_grid->setSize(r.size());
_grid->setTicks(_xAxis->ticks(), _yAxis->ticks());
_grid->setPos(r.bottomLeft());
_slider->setArea(r); _slider->setArea(r);
updateSliderPosition(); updateSliderPosition();

View File

@ -18,6 +18,7 @@ class SliderInfoItem;
class InfoItem; class InfoItem;
class GraphItem; class GraphItem;
class PathItem; class PathItem;
class GridItem;
class Scene : public QGraphicsScene class Scene : public QGraphicsScene
{ {
@ -47,6 +48,7 @@ public:
void showGraph(bool show, int id = 0); void showGraph(bool show, int id = 0);
void setGraphType(GraphType type); void setGraphType(GraphType type);
void setUnits(Units units); void setUnits(Units units);
void showGrid(bool show);
const QString &yLabel() const {return _yLabel;} const QString &yLabel() const {return _yLabel;}
const QString &yUnits() const {return _yUnits;} const QString &yUnits() const {return _yUnits;}
@ -103,6 +105,7 @@ private:
SliderItem *_slider; SliderItem *_slider;
SliderInfoItem *_sliderInfo; SliderInfoItem *_sliderInfo;
InfoItem *_info; InfoItem *_info;
GridItem *_grid;
QList<GraphItem*> _graphs; QList<GraphItem*> _graphs;
QList<GraphItem*> _visible; QList<GraphItem*> _visible;

48
src/griditem.cpp Normal file
View File

@ -0,0 +1,48 @@
#include <QPainter>
#include "griditem.h"
#define GRID_WIDTH 1
GridItem::GridItem(QGraphicsItem *parent) : QGraphicsItem(parent)
{
}
void GridItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget)
{
Q_UNUSED(option);
Q_UNUSED(widget);
QBrush brush(Qt::gray);
QPen pen = QPen(brush, GRID_WIDTH, Qt::DotLine);
painter->setRenderHint(QPainter::Antialiasing, false);
painter->setPen(pen);
for (int i = 0; i < _xTicks.size(); i++)
painter->drawLine(_xTicks.at(i), 0, _xTicks.at(i),
-_boundingRect.height());
for (int i = 0; i < _yTicks.size(); i++)
painter->drawLine(0, -_yTicks.at(i), boundingRect().width(),
-_yTicks.at(i));
/*
painter->setPen(Qt::red);
painter->drawRect(boundingRect());
*/
}
void GridItem::setTicks(const QList<qreal> &x, const QList<qreal> &y)
{
_xTicks = x; _yTicks = y;
update();
}
void GridItem::setSize(const QSizeF &size)
{
prepareGeometryChange();
_boundingRect = QRectF(QPointF(0, -size.height()), size);
}

23
src/griditem.h Normal file
View File

@ -0,0 +1,23 @@
#ifndef GRIDITEM_H
#define GRIDITEM_H
#include <QGraphicsItem>
class GridItem : public QGraphicsItem
{
public:
GridItem(QGraphicsItem *parent = 0);
QRectF boundingRect() const {return _boundingRect;}
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget);
void setTicks(const QList<qreal> &x, const QList<qreal> &y);
void setSize(const QSizeF &size);
private:
QRectF _boundingRect;
QList<qreal> _xTicks, _yTicks;
};
#endif // GRIDITEM_H

View File

@ -322,12 +322,18 @@ void GUI::createActions()
_distanceGraphAction->setShortcut(DISTANCE_GRAPH_SHORTCUT); _distanceGraphAction->setShortcut(DISTANCE_GRAPH_SHORTCUT);
connect(_distanceGraphAction, SIGNAL(triggered()), this, connect(_distanceGraphAction, SIGNAL(triggered()), this,
SLOT(setDistanceGraph())); SLOT(setDistanceGraph()));
addAction(_distanceGraphAction);
_timeGraphAction = new QAction(tr("Time"), this); _timeGraphAction = new QAction(tr("Time"), this);
_timeGraphAction->setCheckable(true); _timeGraphAction->setCheckable(true);
_timeGraphAction->setActionGroup(ag); _timeGraphAction->setActionGroup(ag);
_timeGraphAction->setShortcut(TIME_GRAPH_SHORTCUT); _timeGraphAction->setShortcut(TIME_GRAPH_SHORTCUT);
connect(_timeGraphAction, SIGNAL(triggered()), this, connect(_timeGraphAction, SIGNAL(triggered()), this,
SLOT(setTimeGraph())); SLOT(setTimeGraph()));
addAction(_timeGraphAction);
_showGraphGridAction = new QAction(tr("Show grid"), this);
_showGraphGridAction->setCheckable(true);
connect(_showGraphGridAction, SIGNAL(triggered(bool)), this,
SLOT(showGraphGrids(bool)));
// Settings actions // Settings actions
_showToolbarsAction = new QAction(tr("Show toolbars"), this); _showToolbarsAction = new QAction(tr("Show toolbars"), this);
@ -398,6 +404,8 @@ void GUI::createMenus()
graphMenu->addAction(_distanceGraphAction); graphMenu->addAction(_distanceGraphAction);
graphMenu->addAction(_timeGraphAction); graphMenu->addAction(_timeGraphAction);
graphMenu->addSeparator(); graphMenu->addSeparator();
graphMenu->addAction(_showGraphGridAction);
graphMenu->addSeparator();
graphMenu->addAction(_showGraphsAction); graphMenu->addAction(_showGraphsAction);
QMenu *poiMenu = menuBar()->addMenu(tr("POI")); QMenu *poiMenu = menuBar()->addMenu(tr("POI"));
@ -858,22 +866,22 @@ void GUI::closeAll()
updateTrackView(); updateTrackView();
} }
void GUI::showMap(bool checked) void GUI::showMap(bool show)
{ {
if (checked) if (show)
_pathView->setMap(_currentMap); _pathView->setMap(_currentMap);
else else
_pathView->setMap(0); _pathView->setMap(0);
} }
void GUI::showGraphs(bool checked) void GUI::showGraphs(bool show)
{ {
_graphTabWidget->setHidden(!checked); _graphTabWidget->setHidden(!show);
} }
void GUI::showToolbars(bool checked) void GUI::showToolbars(bool show)
{ {
if (checked) { if (show) {
addToolBar(_fileToolBar); addToolBar(_fileToolBar);
addToolBar(_showToolBar); addToolBar(_showToolBar);
addToolBar(_navigationToolBar); addToolBar(_navigationToolBar);
@ -887,9 +895,9 @@ void GUI::showToolbars(bool checked)
} }
} }
void GUI::showFullscreen(bool checked) void GUI::showFullscreen(bool show)
{ {
if (checked) { if (show) {
_frameStyle = _pathView->frameStyle(); _frameStyle = _pathView->frameStyle();
_showGraphs = _showGraphsAction->isChecked(); _showGraphs = _showGraphsAction->isChecked();
@ -935,6 +943,12 @@ void GUI::showRoutes(bool show)
updateStatusBarInfo(); updateStatusBarInfo();
} }
void GUI::showGraphGrids(bool show)
{
for (int i = 0; i < _tabs.size(); i++)
_tabs.at(i)->showGrid(show);
}
void GUI::clearMapCache() void GUI::clearMapCache()
{ {
_currentMap->clearCache(); _currentMap->clearCache();
@ -1215,6 +1229,8 @@ void GUI::writeSettings()
settings.setValue(SHOW_GRAPHS_SETTING, _showGraphsAction->isChecked()); settings.setValue(SHOW_GRAPHS_SETTING, _showGraphsAction->isChecked());
settings.setValue(GRAPH_TYPE_SETTING, _timeGraphAction->isChecked() settings.setValue(GRAPH_TYPE_SETTING, _timeGraphAction->isChecked()
? Time : Distance); ? Time : Distance);
settings.setValue(SHOW_GRAPH_GRIDS_SETTING,
_showGraphGridAction->isChecked());
settings.endGroup(); settings.endGroup();
settings.beginGroup(POI_SETTINGS_GROUP); settings.beginGroup(POI_SETTINGS_GROUP);
@ -1291,6 +1307,10 @@ void GUI::readSettings()
_timeGraphAction->setChecked(true); _timeGraphAction->setChecked(true);
} else } else
_distanceGraphAction->setChecked(true); _distanceGraphAction->setChecked(true);
if (settings.value(SHOW_GRAPH_GRIDS_SETTING, true).toBool() == false)
showGraphGrids(false);
else
_showGraphGridAction->setChecked(true);
settings.endGroup(); settings.endGroup();
settings.beginGroup(POI_SETTINGS_GROUP); settings.beginGroup(POI_SETTINGS_GROUP);

View File

@ -45,10 +45,11 @@ private slots:
void reloadFile(); void reloadFile();
void openPOIFile(); void openPOIFile();
void closePOIFiles(); void closePOIFiles();
void showMap(bool checked); void showMap(bool show);
void showGraphs(bool checked); void showGraphs(bool show);
void showToolbars(bool checked); void showGraphGrids(bool show);
void showFullscreen(bool checked); void showToolbars(bool show);
void showFullscreen(bool show);
void showTracks(bool show); void showTracks(bool show);
void showRoutes(bool show); void showRoutes(bool show);
void clearMapCache(); void clearMapCache();
@ -138,6 +139,7 @@ private:
QAction *_fullscreenAction; QAction *_fullscreenAction;
QAction *_clearMapCacheAction; QAction *_clearMapCacheAction;
QAction *_showGraphsAction; QAction *_showGraphsAction;
QAction *_showGraphGridAction;
QAction *_distanceGraphAction; QAction *_distanceGraphAction;
QAction *_timeGraphAction; QAction *_timeGraphAction;
QAction *_showToolbarsAction; QAction *_showToolbarsAction;

View File

@ -40,6 +40,9 @@ void InfoItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QList<KV>::const_iterator i; QList<KV>::const_iterator i;
int width = 0; int width = 0;
painter->setRenderHint(QPainter::Antialiasing, false);
for (i = _list.constBegin(); i != _list.constEnd(); i++) { for (i = _list.constBegin(); i != _list.constEnd(); i++) {
painter->drawText(width, fm.height() - fm.descent(), i->key + ": "); painter->drawText(width, fm.height() - fm.descent(), i->key + ": ");
width += fm.width(i->key + ": "); width += fm.width(i->key + ": ");

View File

@ -19,18 +19,11 @@ void MarkerItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option
{ {
Q_UNUSED(option); Q_UNUSED(option);
Q_UNUSED(widget); Q_UNUSED(widget);
bool aa;
if ((aa = painter->testRenderHint(QPainter::Antialiasing)))
painter->setRenderHint(QPainter::Antialiasing, false);
painter->setRenderHint(QPainter::Antialiasing, false);
painter->setPen(Qt::red); painter->setPen(Qt::red);
painter->drawLine(-SIZE/2, 0, SIZE/2, 0); painter->drawLine(-SIZE/2, 0, SIZE/2, 0);
painter->drawLine(0, -SIZE/2, 0, SIZE/2); painter->drawLine(0, -SIZE/2, 0, SIZE/2);
if (aa)
painter->setRenderHint(QPainter::Antialiasing, true);
// painter->drawRect(boundingRect()); // painter->drawRect(boundingRect());
} }

View File

@ -52,12 +52,9 @@ void ScaleItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QFontMetrics fm(font); QFontMetrics fm(font);
QRect br; QRect br;
QPen pen = QPen(Qt::black, BORDER_WIDTH); QPen pen = QPen(Qt::black, BORDER_WIDTH);
bool aa;
if ((aa = painter->testRenderHint(QPainter::Antialiasing))) painter->setRenderHint(QPainter::Antialiasing, false);
painter->setRenderHint(QPainter::Antialiasing, false);
painter->setFont(font); painter->setFont(font);
painter->setPen(pen); painter->setPen(pen);
@ -79,9 +76,6 @@ void ScaleItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
painter->setPen(Qt::red); painter->setPen(Qt::red);
painter->drawRect(boundingRect()); painter->drawRect(boundingRect());
*/ */
if (aa)
painter->setRenderHint(QPainter::Antialiasing, true);
} }
QString ScaleItem::units() const QString ScaleItem::units() const

View File

@ -12,6 +12,7 @@
#define GRAPH_SETTINGS_GROUP "Graph" #define GRAPH_SETTINGS_GROUP "Graph"
#define SHOW_GRAPHS_SETTING "show" #define SHOW_GRAPHS_SETTING "show"
#define GRAPH_TYPE_SETTING "type" #define GRAPH_TYPE_SETTING "type"
#define SHOW_GRAPH_GRIDS_SETTING "grid"
#define MAP_SETTINGS_GROUP "Map" #define MAP_SETTINGS_GROUP "Map"
#define CURRENT_MAP_SETTING "map" #define CURRENT_MAP_SETTING "map"

View File

@ -21,6 +21,7 @@ void SliderItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option
Q_UNUSED(option); Q_UNUSED(option);
Q_UNUSED(widget); Q_UNUSED(widget);
painter->setRenderHint(QPainter::Antialiasing, false);
painter->setPen(Qt::red); painter->setPen(Qt::red);
painter->drawLine(0, 0, 0, -_area.height()); painter->drawLine(0, 0, 0, -_area.height());