1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-30 22:51:16 +01:00

Improved error handling

Added file filters to open dialogs
This commit is contained in:
Martin Tůma 2016-02-12 20:12:37 +01:00
parent 580289e533
commit 932f817496
8 changed files with 149 additions and 120 deletions

View File

@ -1,57 +1,57 @@
<?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>
<location filename="../src/elevationgraph.cpp" line="13"/> <location filename="../src/elevationgraph.cpp" line="14"/>
<source>Distance</source> <source>Distance</source>
<translation>Vzdálenost</translation> <translation>Vzdálenost</translation>
</message> </message>
<message> <message>
<location filename="../src/elevationgraph.cpp" line="14"/> <location filename="../src/elevationgraph.cpp" line="15"/>
<source>Elevation</source> <source>Elevation</source>
<translation>Výška</translation> <translation>Výška</translation>
</message> </message>
<message> <message>
<location filename="../src/elevationgraph.cpp" line="15"/> <location filename="../src/elevationgraph.cpp" line="16"/>
<location filename="../src/elevationgraph.cpp" line="82"/> <location filename="../src/elevationgraph.cpp" line="83"/>
<source>km</source> <source>km</source>
<translation>km</translation> <translation>km</translation>
</message> </message>
<message> <message>
<location filename="../src/elevationgraph.cpp" line="16"/> <location filename="../src/elevationgraph.cpp" line="17"/>
<location filename="../src/elevationgraph.cpp" line="83"/> <location filename="../src/elevationgraph.cpp" line="84"/>
<source>m</source> <source>m</source>
<translation>m</translation> <translation>m</translation>
</message> </message>
<message> <message>
<location filename="../src/elevationgraph.cpp" line="22"/> <location filename="../src/elevationgraph.cpp" line="23"/>
<source>Ascent</source> <source>Ascent</source>
<translation>Stoupání</translation> <translation>Stoupání</translation>
</message> </message>
<message> <message>
<location filename="../src/elevationgraph.cpp" line="24"/> <location filename="../src/elevationgraph.cpp" line="25"/>
<source>Descent</source> <source>Descent</source>
<translation>Klesání</translation> <translation>Klesání</translation>
</message> </message>
<message> <message>
<location filename="../src/elevationgraph.cpp" line="28"/> <location filename="../src/elevationgraph.cpp" line="29"/>
<source>Minimum</source> <source>Minimum</source>
<translation>Minimum</translation> <translation>Minimum</translation>
</message> </message>
<message> <message>
<location filename="../src/elevationgraph.cpp" line="87"/> <location filename="../src/elevationgraph.cpp" line="88"/>
<source>mi</source> <source>mi</source>
<translation>mi</translation> <translation>mi</translation>
</message> </message>
<message> <message>
<location filename="../src/elevationgraph.cpp" line="88"/> <location filename="../src/elevationgraph.cpp" line="89"/>
<source>ft</source> <source>ft</source>
<translation>ft</translation> <translation>ft</translation>
</message> </message>
<message> <message>
<location filename="../src/elevationgraph.cpp" line="26"/> <location filename="../src/elevationgraph.cpp" line="27"/>
<source>Maximum</source> <source>Maximum</source>
<translation>Maximum</translation> <translation>Maximum</translation>
</message> </message>
@ -59,326 +59,336 @@
<context> <context>
<name>GUI</name> <name>GUI</name>
<message> <message>
<location filename="../src/gui.cpp" line="139"/> <location filename="../src/gui.cpp" line="140"/>
<source>About Qt</source> <source>About Qt</source>
<translation>O Qt</translation> <translation>O Qt</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="349"/> <location filename="../src/gui.cpp" line="350"/>
<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="410"/> <location filename="../src/gui.cpp" line="411"/>
<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="153"/> <location filename="../src/gui.cpp" line="154"/>
<source>Save as</source> <source>Save as</source>
<translation>Uložit jako</translation> <translation>Uložit jako</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="469"/> <location filename="../src/gui.cpp" line="471"/>
<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="144"/> <location filename="../src/gui.cpp" line="145"/>
<source>Open</source> <source>Open</source>
<translation>Otevřít</translation> <translation>Otevřít</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="127"/> <location filename="../src/gui.cpp" line="128"/>
<source>Quit</source> <source>Quit</source>
<translation>Ukončit</translation> <translation>Ukončit</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="134"/> <location filename="../src/gui.cpp" line="135"/>
<location filename="../src/gui.cpp" line="365"/>
<location filename="../src/gui.cpp" line="366"/> <location filename="../src/gui.cpp" line="366"/>
<location filename="../src/gui.cpp" line="367"/>
<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="148"/> <location filename="../src/gui.cpp" line="149"/>
<source>Save</source> <source>Save</source>
<translation>Uložit</translation> <translation>Uložit</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="158"/> <location filename="../src/gui.cpp" line="159"/>
<source>Close</source> <source>Close</source>
<translation>Zavřít</translation> <translation>Zavřít</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="163"/> <location filename="../src/gui.cpp" line="164"/>
<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="286"/> <location filename="../src/gui.cpp" line="287"/>
<source>Show</source> <source>Show</source>
<translation>Zobrazit</translation> <translation>Zobrazit</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="236"/> <location filename="../src/gui.cpp" line="237"/>
<location filename="../src/gui.cpp" line="277"/> <location filename="../src/gui.cpp" line="278"/>
<source>File</source> <source>File</source>
<translation>Soubor</translation> <translation>Soubor</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="132"/> <location filename="../src/gui.cpp" line="133"/>
<location filename="../src/gui.cpp" line="383"/>
<location filename="../src/gui.cpp" line="384"/> <location filename="../src/gui.cpp" line="384"/>
<location filename="../src/gui.cpp" line="385"/>
<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="170"/> <location filename="../src/gui.cpp" line="171"/>
<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="173"/> <location filename="../src/gui.cpp" line="174"/>
<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="179"/> <location filename="../src/gui.cpp" line="180"/>
<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="192"/> <location filename="../src/gui.cpp" line="193"/>
<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="198"/> <location filename="../src/gui.cpp" line="199"/>
<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="205"/> <location filename="../src/gui.cpp" line="206"/>
<source>Metric</source> <source>Metric</source>
<translation>Metrické</translation> <translation>Metrické</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="211"/> <location filename="../src/gui.cpp" line="212"/>
<source>Imperial</source> <source>Imperial</source>
<translation>Imperiální</translation> <translation>Imperiální</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="218"/> <location filename="../src/gui.cpp" line="219"/>
<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="221"/> <location filename="../src/gui.cpp" line="222"/>
<source>Previous</source> <source>Previous</source>
<translation>Předchozí</translation> <translation>Předchozí</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="225"/> <location filename="../src/gui.cpp" line="226"/>
<source>Last</source> <source>Last</source>
<translation>Poslední</translation> <translation>Poslední</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="228"/> <location filename="../src/gui.cpp" line="229"/>
<source>First</source> <source>First</source>
<translation>První</translation> <translation>První</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="250"/> <location filename="../src/gui.cpp" line="251"/>
<source>Map</source> <source>Map</source>
<translation>Mapa</translation> <translation>Mapa</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="255"/> <location filename="../src/gui.cpp" line="256"/>
<source>POI</source> <source>POI</source>
<translation>POI</translation> <translation>POI</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="259"/> <location filename="../src/gui.cpp" line="260"/>
<source>Settings</source> <source>Settings</source>
<translation>Nastavení</translation> <translation>Nastavení</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="260"/> <location filename="../src/gui.cpp" line="261"/>
<source>Units</source> <source>Units</source>
<translation>Jednotky</translation> <translation>Jednotky</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="267"/> <location filename="../src/gui.cpp" line="268"/>
<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="317"/> <location filename="../src/gui.cpp" line="318"/>
<source>Elevation</source> <source>Elevation</source>
<translation>Výška</translation> <translation>Výška</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="318"/> <location filename="../src/gui.cpp" line="319"/>
<source>Speed</source> <source>Speed</source>
<translation>Rychlost</translation> <translation>Rychlost</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="368"/> <location filename="../src/gui.cpp" line="369"/>
<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="369"/> <location filename="../src/gui.cpp" line="370"/>
<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="371"/> <location filename="../src/gui.cpp" line="372"/>
<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="372"/> <location filename="../src/gui.cpp" line="373"/>
<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="373"/> <location filename="../src/gui.cpp" line="374"/>
<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="387"/> <location filename="../src/gui.cpp" line="388"/>
<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="391"/> <location filename="../src/gui.cpp" line="392"/>
<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="399"/> <location filename="../src/gui.cpp" line="400"/>
<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="460"/> <location filename="../src/gui.cpp" line="412"/>
<location filename="../src/gui.cpp" line="476"/> <source>GPX files (*.gpx);;All files (*)</source>
<translation>soubory GPX (*.gpx);;všechny soubory (*)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="462"/>
<location filename="../src/gui.cpp" line="479"/>
<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="523"/> <location filename="../src/gui.cpp" line="472"/>
<location filename="../src/gui.cpp" line="642"/> <source>GPX files (*.gpx);;CSV files (*.csv);;All files (*)</source>
<translation>soubory GPX (*.gpx);;soubory CSV (*.csv);;všechny soubory (*)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="526"/>
<location filename="../src/gui.cpp" line="645"/>
<source>mi</source> <source>mi</source>
<translation>mi</translation> <translation>mi</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="526"/> <location filename="../src/gui.cpp" line="529"/>
<location filename="../src/gui.cpp" line="528"/> <location filename="../src/gui.cpp" line="531"/>
<location filename="../src/gui.cpp" line="530"/> <location filename="../src/gui.cpp" line="533"/>
<location filename="../src/gui.cpp" line="532"/> <location filename="../src/gui.cpp" line="535"/>
<source>ft</source> <source>ft</source>
<translation>ft</translation> <translation>ft</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="529"/> <location filename="../src/gui.cpp" line="532"/>
<location filename="../src/gui.cpp" line="541"/> <location filename="../src/gui.cpp" line="544"/>
<source>Maximum</source> <source>Maximum</source>
<translation>Maximum</translation> <translation>Maximum</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="531"/> <location filename="../src/gui.cpp" line="534"/>
<location filename="../src/gui.cpp" line="543"/> <location filename="../src/gui.cpp" line="546"/>
<source>Minimum</source> <source>Minimum</source>
<translation>Minimum</translation> <translation>Minimum</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="137"/> <location filename="../src/gui.cpp" line="138"/>
<location filename="../src/gui.cpp" line="345"/> <location filename="../src/gui.cpp" line="346"/>
<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="293"/> <location filename="../src/gui.cpp" line="294"/>
<source>Navigation</source> <source>Navigation</source>
<translation>Navigace</translation> <translation>Navigace</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="347"/> <location filename="../src/gui.cpp" line="348"/>
<source>GPX viewer and analyzer</source> <source>GPX viewer and analyzer</source>
<translation>Prohlížeč a analyzátor GPX</translation> <translation>Prohlížeč a analyzátor GPX</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="386"/> <location filename="../src/gui.cpp" line="387"/>
<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="398"/> <location filename="../src/gui.cpp" line="399"/>
<source>POIs</source> <source>POIs</source>
<translation>POI body</translation> <translation>POI body</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="522"/> <location filename="../src/gui.cpp" line="525"/>
<location filename="../src/gui.cpp" line="534"/> <location filename="../src/gui.cpp" line="537"/>
<source>Distance</source> <source>Distance</source>
<translation>Vzdálenost</translation> <translation>Vzdálenost</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="524"/> <location filename="../src/gui.cpp" line="527"/>
<location filename="../src/gui.cpp" line="536"/> <location filename="../src/gui.cpp" line="539"/>
<source>Time</source> <source>Time</source>
<translation>Čas</translation> <translation>Čas</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="525"/> <location filename="../src/gui.cpp" line="528"/>
<location filename="../src/gui.cpp" line="537"/> <location filename="../src/gui.cpp" line="540"/>
<source>Ascent</source> <source>Ascent</source>
<translation>Stoupání</translation> <translation>Stoupání</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="538"/> <location filename="../src/gui.cpp" line="541"/>
<location filename="../src/gui.cpp" line="540"/> <location filename="../src/gui.cpp" line="543"/>
<location filename="../src/gui.cpp" line="542"/> <location filename="../src/gui.cpp" line="545"/>
<location filename="../src/gui.cpp" line="544"/> <location filename="../src/gui.cpp" line="547"/>
<source>m</source> <source>m</source>
<translation>m</translation> <translation>m</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="527"/> <location filename="../src/gui.cpp" line="530"/>
<location filename="../src/gui.cpp" line="539"/> <location filename="../src/gui.cpp" line="542"/>
<source>Descent</source> <source>Descent</source>
<translation>Klesání</translation> <translation>Klesání</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="638"/> <location filename="../src/gui.cpp" line="641"/>
<source>%1 tracks</source> <source>%1 tracks</source>
<translation>Počet tras: %1</translation> <translation>Počet tras: %1</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="535"/> <location filename="../src/gui.cpp" line="538"/>
<location filename="../src/gui.cpp" line="645"/> <location filename="../src/gui.cpp" line="648"/>
<source>km</source> <source>km</source>
<translation>km</translation> <translation>km</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="462"/> <location filename="../src/gui.cpp" line="464"/>
<location filename="../src/gui.cpp" line="477"/> <location filename="../src/gui.cpp" line="480"/>
<source>Error</source> <source>Error</source>
<translation>Chyba</translation> <translation>Chyba</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="457"/> <location filename="../src/gui.cpp" line="459"/>
<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="473"/> <location filename="../src/gui.cpp" line="476"/>
<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:
@ -411,44 +421,44 @@
<context> <context>
<name>SpeedGraph</name> <name>SpeedGraph</name>
<message> <message>
<location filename="../src/speedgraph.cpp" line="9"/> <location filename="../src/speedgraph.cpp" line="10"/>
<source>Distance</source> <source>Distance</source>
<translation>Vzdálenost</translation> <translation>Vzdálenost</translation>
</message> </message>
<message> <message>
<location filename="../src/speedgraph.cpp" line="10"/> <location filename="../src/speedgraph.cpp" line="11"/>
<source>Speed</source> <source>Speed</source>
<translation>Rychlost</translation> <translation>Rychlost</translation>
</message> </message>
<message> <message>
<location filename="../src/speedgraph.cpp" line="11"/> <location filename="../src/speedgraph.cpp" line="12"/>
<location filename="../src/speedgraph.cpp" line="71"/> <location filename="../src/speedgraph.cpp" line="73"/>
<source>km</source> <source>km</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/speedgraph.cpp" line="12"/> <location filename="../src/speedgraph.cpp" line="13"/>
<location filename="../src/speedgraph.cpp" line="72"/> <location filename="../src/speedgraph.cpp" line="74"/>
<source>km/h</source> <source>km/h</source>
<translation>km/h</translation> <translation>km/h</translation>
</message> </message>
<message> <message>
<location filename="../src/speedgraph.cpp" line="20"/> <location filename="../src/speedgraph.cpp" line="21"/>
<source>Average</source> <source>Average</source>
<translation>Průměr</translation> <translation>Průměr</translation>
</message> </message>
<message> <message>
<location filename="../src/speedgraph.cpp" line="22"/> <location filename="../src/speedgraph.cpp" line="23"/>
<source>Maximum</source> <source>Maximum</source>
<translation>Maximum</translation> <translation>Maximum</translation>
</message> </message>
<message> <message>
<location filename="../src/speedgraph.cpp" line="76"/> <location filename="../src/speedgraph.cpp" line="78"/>
<source>mi</source> <source>mi</source>
<translation>mi</translation> <translation>mi</translation>
</message> </message>
<message> <message>
<location filename="../src/speedgraph.cpp" line="77"/> <location filename="../src/speedgraph.cpp" line="79"/>
<source>mi/h</source> <source>mi/h</source>
<translation>mi/h</translation> <translation>mi/h</translation>
</message> </message>

View File

@ -35,7 +35,7 @@ static QString timeSpan(qreal time)
} }
GUI::GUI() GUI::GUI(QWidget *parent) : QMainWindow(parent)
{ {
loadFiles(); loadFiles();
@ -75,18 +75,15 @@ GUI::GUI()
void GUI::loadFiles() void GUI::loadFiles()
{ {
// Maps // Maps
_maps = MapList::load(QString("%1/" MAP_LIST_FILE).arg(QDir::homePath())); _maps = MapList::load(this, QString("%1/" MAP_LIST_FILE)
_maps += MapList::load(":/maps.txt"); .arg(QDir::homePath()));
_maps += MapList::load(this, ":/maps.txt");
// POI files // POI files
QDir dir(QString("%1/" POI_DIR).arg(QDir::homePath())); QDir dir(QString("%1/" POI_DIR).arg(QDir::homePath()));
QFileInfoList list = dir.entryInfoList(QStringList(), QDir::Files); QFileInfoList list = dir.entryInfoList(QStringList(), QDir::Files);
for (int i = 0; i < list.size(); ++i) { for (int i = 0; i < list.size(); ++i)
if (!_poi.loadFile(list.at(i).absoluteFilePath())) _poi.loadFile(list.at(i).absoluteFilePath());
fprintf(stderr, "Error loading POI file: %s: %s",
qPrintable(list.at(i).absoluteFilePath()),
qPrintable(_poi.errorString()));
}
} }
void GUI::createMapActions() void GUI::createMapActions()
@ -407,7 +404,8 @@ void GUI::dataSources()
void GUI::openFile() void GUI::openFile()
{ {
QStringList files = QFileDialog::getOpenFileNames(this, tr("Open file")); QStringList files = QFileDialog::getOpenFileNames(this, tr("Open file"),
QString(), tr("GPX files (*.gpx);;All files (*)"));
QStringList list = files; QStringList list = files;
for (QStringList::Iterator it = list.begin(); it != list.end(); it++) for (QStringList::Iterator it = list.begin(); it != list.end(); it++)
@ -466,7 +464,8 @@ bool GUI::loadFile(const QString &fileName)
void GUI::openPOIFile() void GUI::openPOIFile()
{ {
QString fileName = QFileDialog::getOpenFileName(this, tr("Open POI file")); QString fileName = QFileDialog::getOpenFileName(this, tr("Open POI file"),
QString(), tr("GPX files (*.gpx);;CSV files (*.csv);;All files (*)"));
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
if (!_poi.loadFile(fileName)) { if (!_poi.loadFile(fileName)) {

View File

@ -23,7 +23,7 @@ class GUI : public QMainWindow
Q_OBJECT Q_OBJECT
public: public:
GUI(); GUI(QWidget *parent = 0);
bool openFile(const QString &fileName); bool openFile(const QString &fileName);

View File

@ -6,7 +6,7 @@
#include "map.h" #include "map.h"
Map::Map(const QString &name, const QString &url, QObject *parent) Map::Map(QObject *parent, const QString &name, const QString &url)
: QObject(parent) : QObject(parent)
{ {
_name = name; _name = name;

View File

@ -28,7 +28,8 @@ signals:
void loaded(); void loaded();
public: public:
Map(const QString &name, const QString &url, QObject *parent = 0); Map(QObject *parent = 0, const QString &name = QString(),
const QString &url = QString());
const QString &name() const {return _name;} const QString &name() const {return _name;}
void loadTiles(QList<Tile> &list); void loadTiles(QList<Tile> &list);

View File

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

View File

@ -3,13 +3,15 @@
#include <QList> #include <QList>
#include <QString> #include <QString>
#include <QObject>
class Map; class Map;
class MapList class MapList
{ {
public: public:
static QList<Map*> load(const QString &fileName); static QList<Map*> load(QObject *parent = 0,
const QString &fileName = QString());
}; };
#endif // MAPLIST_H #endif // MAPLIST_H

View File

@ -10,14 +10,31 @@
bool POI::loadFile(const QString &fileName) bool POI::loadFile(const QString &fileName)
{ {
QString error;
int errorLine;
_error.clear(); _error.clear();
_errorLine = 0; _errorLine = 0;
if (loadCSVFile(fileName)) if (loadCSVFile(fileName))
return true; return true;
else {
error = _error;
errorLine = _errorLine;
}
if (loadGPXFile(fileName)) if (loadGPXFile(fileName))
return true; return true;
fprintf(stderr, "Error loading POI file: %s:\n", qPrintable(fileName));
fprintf(stderr, "CSV: line %d: %s\n", errorLine, qPrintable(error));
fprintf(stderr, "GPX: line %d: %s\n", _errorLine, qPrintable(_error));
if (errorLine > _errorLine) {
_errorLine = errorLine;
_error = error;
}
return false; return false;
} }