mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 03:35:53 +01:00
Yet another bunch of print/PDF export improvements
This commit is contained in:
parent
eae8e23c6c
commit
daf4ef894c
@ -59,385 +59,358 @@
|
||||
<context>
|
||||
<name>GUI</name>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="455"/>
|
||||
<location filename="../src/gui.cpp" line="458"/>
|
||||
<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="519"/>
|
||||
<location filename="../src/gui.cpp" line="522"/>
|
||||
<source>Open file</source>
|
||||
<translation>Otevřít soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="591"/>
|
||||
<location filename="../src/gui.cpp" line="599"/>
|
||||
<source>Open POI file</source>
|
||||
<translation>Otevřít POI soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="195"/>
|
||||
<location filename="../src/gui.cpp" line="198"/>
|
||||
<source>Open</source>
|
||||
<translation>Otevřít</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="179"/>
|
||||
<location filename="../src/gui.cpp" line="182"/>
|
||||
<source>Quit</source>
|
||||
<translation>Ukončit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="187"/>
|
||||
<location filename="../src/gui.cpp" line="471"/>
|
||||
<location filename="../src/gui.cpp" line="472"/>
|
||||
<location filename="../src/gui.cpp" line="190"/>
|
||||
<location filename="../src/gui.cpp" line="474"/>
|
||||
<location filename="../src/gui.cpp" line="475"/>
|
||||
<source>Keyboard controls</source>
|
||||
<translation>Ovládací klávesy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="215"/>
|
||||
<location filename="../src/gui.cpp" line="218"/>
|
||||
<source>Close</source>
|
||||
<translation>Zavřít</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="221"/>
|
||||
<location filename="../src/gui.cpp" line="224"/>
|
||||
<source>Reload</source>
|
||||
<translation>Znovu načíst</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="378"/>
|
||||
<location filename="../src/gui.cpp" line="381"/>
|
||||
<source>Show</source>
|
||||
<translation>Zobrazit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="318"/>
|
||||
<location filename="../src/gui.cpp" line="372"/>
|
||||
<location filename="../src/gui.cpp" line="321"/>
|
||||
<location filename="../src/gui.cpp" line="375"/>
|
||||
<source>File</source>
|
||||
<translation>Soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="185"/>
|
||||
<location filename="../src/gui.cpp" line="494"/>
|
||||
<location filename="../src/gui.cpp" line="495"/>
|
||||
<location filename="../src/gui.cpp" line="188"/>
|
||||
<location filename="../src/gui.cpp" line="497"/>
|
||||
<location filename="../src/gui.cpp" line="498"/>
|
||||
<source>Data sources</source>
|
||||
<translation>Zdroje dat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="200"/>
|
||||
<location filename="../src/gui.cpp" line="203"/>
|
||||
<source>Print</source>
|
||||
<translation>Tisknout</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="205"/>
|
||||
<location filename="../src/gui.cpp" line="208"/>
|
||||
<source>Export</source>
|
||||
<translation>Exportovat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="211"/>
|
||||
<location filename="../src/gui.cpp" line="214"/>
|
||||
<source>Export as</source>
|
||||
<translation>Exportovat jako</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="229"/>
|
||||
<location filename="../src/gui.cpp" line="232"/>
|
||||
<source>Load POI file</source>
|
||||
<translation>Nahrát POI soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="232"/>
|
||||
<location filename="../src/gui.cpp" line="235"/>
|
||||
<source>Close POI files</source>
|
||||
<translation>Zavřit POI soubory</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="235"/>
|
||||
<location filename="../src/gui.cpp" line="238"/>
|
||||
<source>Show POIs</source>
|
||||
<translation>Zobrazit POI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="243"/>
|
||||
<location filename="../src/gui.cpp" line="246"/>
|
||||
<source>Show map</source>
|
||||
<translation>Zobrazit mapu</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="249"/>
|
||||
<location filename="../src/gui.cpp" line="252"/>
|
||||
<source>Clear tile cache</source>
|
||||
<translation>Vymazat mezipaměť dlaždic</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="258"/>
|
||||
<location filename="../src/gui.cpp" line="262"/>
|
||||
<location filename="../src/gui.cpp" line="481"/>
|
||||
<location filename="../src/gui.cpp" line="261"/>
|
||||
<location filename="../src/gui.cpp" line="265"/>
|
||||
<location filename="../src/gui.cpp" line="484"/>
|
||||
<source>Next map</source>
|
||||
<translation>Následující mapa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="269"/>
|
||||
<location filename="../src/gui.cpp" line="272"/>
|
||||
<source>Show graphs</source>
|
||||
<translation>Zobrazovat grafy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="275"/>
|
||||
<location filename="../src/gui.cpp" line="278"/>
|
||||
<source>Show toolbars</source>
|
||||
<translation>Zobrazovat nástrojové lišty</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="281"/>
|
||||
<location filename="../src/gui.cpp" line="284"/>
|
||||
<source>Metric</source>
|
||||
<translation>Metrické</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="286"/>
|
||||
<location filename="../src/gui.cpp" line="289"/>
|
||||
<source>Imperial</source>
|
||||
<translation>Imperiální</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="292"/>
|
||||
<location filename="../src/gui.cpp" line="295"/>
|
||||
<source>Fullscreen mode</source>
|
||||
<translation>Celoobrazovkový režim</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="300"/>
|
||||
<location filename="../src/gui.cpp" line="303"/>
|
||||
<source>Next</source>
|
||||
<translation>Následující</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="303"/>
|
||||
<location filename="../src/gui.cpp" line="306"/>
|
||||
<source>Previous</source>
|
||||
<translation>Předchozí</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="307"/>
|
||||
<location filename="../src/gui.cpp" line="310"/>
|
||||
<source>Last</source>
|
||||
<translation>Poslední</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="310"/>
|
||||
<location filename="../src/gui.cpp" line="313"/>
|
||||
<source>First</source>
|
||||
<translation>První</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="333"/>
|
||||
<location filename="../src/gui.cpp" line="336"/>
|
||||
<source>Map</source>
|
||||
<translation>Mapa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="340"/>
|
||||
<location filename="../src/gui.cpp" line="343"/>
|
||||
<source>POI</source>
|
||||
<translation>POI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="341"/>
|
||||
<location filename="../src/gui.cpp" line="344"/>
|
||||
<source>POI files</source>
|
||||
<translation>POI soubory</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="349"/>
|
||||
<location filename="../src/gui.cpp" line="352"/>
|
||||
<source>Settings</source>
|
||||
<translation>Nastavení</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="350"/>
|
||||
<location filename="../src/gui.cpp" line="353"/>
|
||||
<source>Units</source>
|
||||
<translation>Jednotky</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="359"/>
|
||||
<location filename="../src/gui.cpp" line="362"/>
|
||||
<source>Help</source>
|
||||
<translation>Nápověda</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="483"/>
|
||||
<location filename="../src/gui.cpp" line="486"/>
|
||||
<source>Previous map</source>
|
||||
<translation>Předchozí mapa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="646"/>
|
||||
<location filename="../src/gui.cpp" line="654"/>
|
||||
<source>Export to PDF</source>
|
||||
<translation>Exportovat do PDF</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="842"/>
|
||||
<location filename="../src/gui.cpp" line="690"/>
|
||||
<location filename="../src/gui.cpp" line="693"/>
|
||||
<source>Date</source>
|
||||
<translation>Datum</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="866"/>
|
||||
<source>No GPX files loaded</source>
|
||||
<translation>Nejsou načteny žádné GPX soubory</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="417"/>
|
||||
<location filename="../src/gui.cpp" line="420"/>
|
||||
<source>Elevation</source>
|
||||
<translation>Výška</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="418"/>
|
||||
<location filename="../src/gui.cpp" line="421"/>
|
||||
<source>Speed</source>
|
||||
<translation>Rychlost</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="419"/>
|
||||
<location filename="../src/gui.cpp" line="422"/>
|
||||
<source>Heart rate</source>
|
||||
<translation>Tep</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="474"/>
|
||||
<location filename="../src/gui.cpp" line="477"/>
|
||||
<source>Next file</source>
|
||||
<translation>Následující soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="451"/>
|
||||
<location filename="../src/gui.cpp" line="454"/>
|
||||
<source>Version </source>
|
||||
<translation>Verze </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="475"/>
|
||||
<location filename="../src/gui.cpp" line="478"/>
|
||||
<source>Previous file</source>
|
||||
<translation>Předchozí soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="477"/>
|
||||
<location filename="../src/gui.cpp" line="480"/>
|
||||
<source>First file</source>
|
||||
<translation>První soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="478"/>
|
||||
<location filename="../src/gui.cpp" line="481"/>
|
||||
<source>Last file</source>
|
||||
<translation>Poslední soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="479"/>
|
||||
<location filename="../src/gui.cpp" line="482"/>
|
||||
<source>Append modifier</source>
|
||||
<translation>Modifikátor nahradit/přidat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="498"/>
|
||||
<location filename="../src/gui.cpp" line="501"/>
|
||||
<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="501"/>
|
||||
<location filename="../src/gui.cpp" line="504"/>
|
||||
<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="509"/>
|
||||
<location filename="../src/gui.cpp" line="512"/>
|
||||
<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="520"/>
|
||||
<location filename="../src/gui.cpp" line="523"/>
|
||||
<source>GPX files (*.gpx);;All files (*)</source>
|
||||
<translation>soubory GPX (*.gpx);;všechny soubory (*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="582"/>
|
||||
<location filename="../src/gui.cpp" line="608"/>
|
||||
<location filename="../src/gui.cpp" line="590"/>
|
||||
<location filename="../src/gui.cpp" line="616"/>
|
||||
<source>Line: %1</source>
|
||||
<translation>Řádka: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="592"/>
|
||||
<location filename="../src/gui.cpp" line="600"/>
|
||||
<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="682"/>
|
||||
<location filename="../src/gui.cpp" line="857"/>
|
||||
<location filename="../src/gui.cpp" line="701"/>
|
||||
<location filename="../src/gui.cpp" line="881"/>
|
||||
<source>mi</source>
|
||||
<translation>mi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="685"/>
|
||||
<location filename="../src/gui.cpp" line="687"/>
|
||||
<location filename="../src/gui.cpp" line="689"/>
|
||||
<location filename="../src/gui.cpp" line="691"/>
|
||||
<location filename="../src/gui.cpp" line="854"/>
|
||||
<location filename="../src/gui.cpp" line="878"/>
|
||||
<source>ft</source>
|
||||
<translation>ft</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="688"/>
|
||||
<location filename="../src/gui.cpp" line="700"/>
|
||||
<source>Maximum</source>
|
||||
<translation>Maximum</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="690"/>
|
||||
<location filename="../src/gui.cpp" line="702"/>
|
||||
<source>Minimum</source>
|
||||
<translation>Minimum</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="190"/>
|
||||
<location filename="../src/gui.cpp" line="449"/>
|
||||
<location filename="../src/gui.cpp" line="193"/>
|
||||
<location filename="../src/gui.cpp" line="452"/>
|
||||
<source>About GPXSee</source>
|
||||
<translation>O aplikaci GPXSee</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="382"/>
|
||||
<location filename="../src/gui.cpp" line="385"/>
|
||||
<source>Navigation</source>
|
||||
<translation>Navigace</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="497"/>
|
||||
<location filename="../src/gui.cpp" line="500"/>
|
||||
<source>Map sources</source>
|
||||
<translation>Mapové zdroje</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="508"/>
|
||||
<location filename="../src/gui.cpp" line="511"/>
|
||||
<source>POIs</source>
|
||||
<translation>POI body</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="681"/>
|
||||
<location filename="../src/gui.cpp" line="693"/>
|
||||
<location filename="../src/gui.cpp" line="700"/>
|
||||
<location filename="../src/gui.cpp" line="703"/>
|
||||
<source>Distance</source>
|
||||
<translation>Vzdálenost</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="683"/>
|
||||
<location filename="../src/gui.cpp" line="695"/>
|
||||
<location filename="../src/gui.cpp" line="708"/>
|
||||
<source>Time</source>
|
||||
<translation>Čas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="684"/>
|
||||
<location filename="../src/gui.cpp" line="696"/>
|
||||
<source>Ascent</source>
|
||||
<translation>Stoupání</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="697"/>
|
||||
<location filename="../src/gui.cpp" line="699"/>
|
||||
<location filename="../src/gui.cpp" line="701"/>
|
||||
<location filename="../src/gui.cpp" line="703"/>
|
||||
<location filename="../src/gui.cpp" line="861"/>
|
||||
<location filename="../src/gui.cpp" line="885"/>
|
||||
<source>m</source>
|
||||
<translation>m</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="686"/>
|
||||
<location filename="../src/gui.cpp" line="698"/>
|
||||
<source>Descent</source>
|
||||
<translation>Klesání</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="849"/>
|
||||
<location filename="../src/gui.cpp" line="873"/>
|
||||
<source>%1 tracks</source>
|
||||
<translation>Počet tras: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="694"/>
|
||||
<location filename="../src/gui.cpp" line="864"/>
|
||||
<location filename="../src/gui.cpp" line="704"/>
|
||||
<location filename="../src/gui.cpp" line="888"/>
|
||||
<source>km</source>
|
||||
<translation>km</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="584"/>
|
||||
<location filename="../src/gui.cpp" line="609"/>
|
||||
<location filename="../src/gui.cpp" line="592"/>
|
||||
<location filename="../src/gui.cpp" line="617"/>
|
||||
<source>Error</source>
|
||||
<translation>Chyba</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="579"/>
|
||||
<location filename="../src/gui.cpp" line="587"/>
|
||||
<source>Error loading GPX file:
|
||||
%1</source>
|
||||
<translation>Soubor GPX nelze otevřít:
|
||||
%1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="605"/>
|
||||
<location filename="../src/gui.cpp" line="613"/>
|
||||
<source>Error loading POI file:
|
||||
%1</source>
|
||||
<translation>Soubor POI nelze otevřít:
|
||||
@ -495,22 +468,22 @@
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../src/scaleitem.cpp" line="83"/>
|
||||
<location filename="../src/scaleitem.cpp" line="81"/>
|
||||
<source>mi</source>
|
||||
<translation>mi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/scaleitem.cpp" line="83"/>
|
||||
<location filename="../src/scaleitem.cpp" line="81"/>
|
||||
<source>ft</source>
|
||||
<translation>ft</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/scaleitem.cpp" line="85"/>
|
||||
<location filename="../src/scaleitem.cpp" line="83"/>
|
||||
<source>km</source>
|
||||
<translation>km</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/scaleitem.cpp" line="85"/>
|
||||
<location filename="../src/scaleitem.cpp" line="83"/>
|
||||
<source>m</source>
|
||||
<translation>m</translation>
|
||||
</message>
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include <QGraphicsView>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <QEvent>
|
||||
#include <QGraphicsSimpleTextItem>
|
||||
#include "config.h"
|
||||
#include "axisitem.h"
|
||||
#include "slideritem.h"
|
||||
@ -244,10 +243,9 @@ void GraphView::plot(QPainter *painter, const QRectF &target)
|
||||
|
||||
setUpdatesEnabled(false);
|
||||
redraw(canvas);
|
||||
_slider->hide();
|
||||
_scene->removeItem(_info);
|
||||
if (_slider->pos().x() == _slider->area().left())
|
||||
_slider->hide();
|
||||
_scene->render(painter, target, _scene->itemsBoundingRect());
|
||||
_scene->addItem(_info);
|
||||
_slider->show();
|
||||
redraw();
|
||||
setUpdatesEnabled(true);
|
||||
|
92
src/gui.cpp
92
src/gui.cpp
@ -33,6 +33,10 @@
|
||||
#include "gui.h"
|
||||
|
||||
|
||||
#define PLOT_INFO_HEIGHT 200
|
||||
#define PLOT_MARGIN 100
|
||||
#define PLOT_GRAPH_RATIO 0.2
|
||||
|
||||
static QString timeSpan(qreal time)
|
||||
{
|
||||
unsigned h, m, s;
|
||||
@ -45,7 +49,6 @@ static QString timeSpan(qreal time)
|
||||
.arg(s, 2, 10, QChar('0'));
|
||||
}
|
||||
|
||||
|
||||
GUI::GUI(QWidget *parent) : QMainWindow(parent)
|
||||
{
|
||||
loadMaps();
|
||||
@ -569,6 +572,11 @@ bool GUI::loadFile(const QString &fileName)
|
||||
for (int i = 0; i < gpx.trackCount(); i++) {
|
||||
_distance += gpx.track(i).distance();
|
||||
_time += gpx.track(i).time();
|
||||
const QDate &date = gpx.track(i).date().date();
|
||||
if (_dateRange.first.isNull() || _dateRange.first > date)
|
||||
_dateRange.first = date;
|
||||
if (_dateRange.second.isNull() || _dateRange.second < date)
|
||||
_dateRange.second = date;
|
||||
}
|
||||
|
||||
_trackCount += gpx.trackCount();
|
||||
@ -674,45 +682,53 @@ void GUI::exportFile(const QString &fileName)
|
||||
void GUI::plot(QPrinter *printer)
|
||||
{
|
||||
QPainter p(printer);
|
||||
|
||||
TrackInfo info;
|
||||
|
||||
if (_imperialUnitsAction->isChecked()) {
|
||||
info.insert(tr("Distance"), QString::number(_distance * M2MI, 'f', 1)
|
||||
+ UNIT_SPACE + tr("mi"));
|
||||
info.insert(tr("Time"), timeSpan(_time));
|
||||
info.insert(tr("Ascent"), QString::number(_elevationGraph->ascent()
|
||||
* M2FT, 'f', 0) + UNIT_SPACE + tr("ft"));
|
||||
info.insert(tr("Descent"), QString::number(_elevationGraph->descent()
|
||||
* M2FT, 'f', 0) + UNIT_SPACE + tr("ft"));
|
||||
info.insert(tr("Maximum"), QString::number(_elevationGraph->max()
|
||||
* M2FT, 'f', 0) + UNIT_SPACE + tr("ft"));
|
||||
info.insert(tr("Minimum"), QString::number(_elevationGraph->min()
|
||||
* M2FT, 'f', 0) + UNIT_SPACE + tr("ft"));
|
||||
} else {
|
||||
info.insert(tr("Distance"), QString::number(_distance * M2KM, 'f', 1)
|
||||
+ UNIT_SPACE + tr("km"));
|
||||
info.insert(tr("Time"), timeSpan(_time));
|
||||
info.insert(tr("Ascent"), QString::number(_elevationGraph->ascent(),
|
||||
'f', 0) + UNIT_SPACE + tr("m"));
|
||||
info.insert(tr("Descent"), QString::number(_elevationGraph->descent(),
|
||||
'f', 0) + UNIT_SPACE + tr("m"));
|
||||
info.insert(tr("Maximum"), QString::number(_elevationGraph->max(), 'f',
|
||||
0) + UNIT_SPACE + tr("m"));
|
||||
info.insert(tr("Minimum"), QString::number(_elevationGraph->min(), 'f',
|
||||
0) + UNIT_SPACE + tr("m"));
|
||||
if (_dateRange.first.isValid()) {
|
||||
if (_dateRange.first == _dateRange.second) {
|
||||
QString format = QLocale::system().dateFormat(QLocale::LongFormat);
|
||||
info.insert(tr("Date"), _dateRange.first.toString(format));
|
||||
} else {
|
||||
QString format = QLocale::system().dateFormat(QLocale::ShortFormat);
|
||||
info.insert(tr("Date"), QString("%1 - %2")
|
||||
.arg(_dateRange.first.toString(format),
|
||||
_dateRange.second.toString(format)));
|
||||
}
|
||||
}
|
||||
if (_distance > 0) {
|
||||
if (_imperialUnitsAction->isChecked()) {
|
||||
info.insert(tr("Distance"), QString::number(_distance * M2MI, 'f',
|
||||
1) + UNIT_SPACE + tr("mi"));
|
||||
} else {
|
||||
info.insert(tr("Distance"), QString::number(_distance * M2KM, 'f',
|
||||
1) + UNIT_SPACE + tr("km"));
|
||||
}
|
||||
}
|
||||
if (_time > 0)
|
||||
info.insert(tr("Time"), timeSpan(_time));
|
||||
|
||||
if (_elevationGraph->count()) {
|
||||
_track->plot(&p, QRectF(0, 300, printer->width(),
|
||||
(0.80 * printer->height()) - 400));
|
||||
_elevationGraph->plot(&p, QRectF(0, 0.80 * printer->height(),
|
||||
printer->width(), printer->height() * 0.20));
|
||||
info.plot(&p, QRectF(0, 0, printer->width(), 200));
|
||||
|
||||
if (info.isEmpty()) {
|
||||
if (_trackGraphs->isVisible())
|
||||
_track->plot(&p, QRectF(0, 0, printer->width(),
|
||||
((1.0 - PLOT_GRAPH_RATIO) * printer->height())));
|
||||
else
|
||||
_track->plot(&p, QRectF(0, 0, printer->width(), printer->height()));
|
||||
} else {
|
||||
_track->plot(&p, QRectF(0, 300, printer->width(),
|
||||
printer->height() - 300));
|
||||
info.plot(&p, QRectF(0, 0, printer->width(), 200));
|
||||
info.plot(&p, QRectF(0, 0, printer->width(), PLOT_INFO_HEIGHT));
|
||||
if (_trackGraphs->isVisible())
|
||||
_track->plot(&p, QRectF(0, PLOT_INFO_HEIGHT + PLOT_MARGIN,
|
||||
printer->width(), ((1.0 - PLOT_GRAPH_RATIO) * printer->height())
|
||||
- (PLOT_INFO_HEIGHT + 2*PLOT_MARGIN)));
|
||||
else
|
||||
_track->plot(&p, QRectF(0, PLOT_INFO_HEIGHT + PLOT_MARGIN,
|
||||
printer->width(), printer->height()
|
||||
- (PLOT_INFO_HEIGHT + PLOT_MARGIN)));
|
||||
}
|
||||
if (_trackGraphs->isVisible()) {
|
||||
GraphView *gv = static_cast<GraphView*>(_trackGraphs->currentWidget());
|
||||
gv->plot(&p, QRectF(0, (1.0 - PLOT_GRAPH_RATIO) * printer->height(),
|
||||
printer->width(), printer->height() * PLOT_GRAPH_RATIO));
|
||||
}
|
||||
}
|
||||
|
||||
@ -720,6 +736,7 @@ void GUI::reloadFile()
|
||||
{
|
||||
_distance = 0;
|
||||
_time = 0;
|
||||
_dateRange = DateRange(QDate(), QDate());
|
||||
_trackCount = 0;
|
||||
|
||||
_elevationGraph->clear();
|
||||
@ -748,6 +765,7 @@ void GUI::closeFiles()
|
||||
{
|
||||
_distance = 0;
|
||||
_time = 0;
|
||||
_dateRange = DateRange(QDate(), QDate());
|
||||
_trackCount = 0;
|
||||
|
||||
_sliderPos = 0;
|
||||
@ -1127,7 +1145,9 @@ void GUI::readSettings()
|
||||
settings.endGroup();
|
||||
|
||||
settings.beginGroup(SETTINGS_SETTINGS_GROUP);
|
||||
if (settings.value(UNITS_SETTING, Metric).toInt() == Imperial) {
|
||||
Units u = QLocale::system().measurementSystem() == QLocale::ImperialSystem
|
||||
? Imperial : Metric;
|
||||
if (settings.value(UNITS_SETTING, u).toInt() == Imperial) {
|
||||
setImperialUnits();
|
||||
_imperialUnitsAction->setChecked(true);
|
||||
} else
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <QMainWindow>
|
||||
#include <QString>
|
||||
#include <QList>
|
||||
#include <QDate>
|
||||
#include "poi.h"
|
||||
|
||||
class QMenu;
|
||||
@ -69,6 +70,7 @@ private slots:
|
||||
|
||||
private:
|
||||
typedef QPair<GraphView *, QString> GraphTab;
|
||||
typedef QPair<QDate, QDate> DateRange;
|
||||
|
||||
void loadMaps();
|
||||
void loadPOIs();
|
||||
@ -166,9 +168,10 @@ private:
|
||||
QString _exportFileName;
|
||||
Map *_currentMap;
|
||||
|
||||
int _trackCount;
|
||||
qreal _distance;
|
||||
qreal _time;
|
||||
int _trackCount;
|
||||
DateRange _dateRange;
|
||||
|
||||
qreal _sliderPos;
|
||||
|
||||
|
@ -15,6 +15,7 @@ public:
|
||||
|
||||
void insert(const QString &key, const QString &value);
|
||||
void clear();
|
||||
bool isEmpty() {return _list.isEmpty();}
|
||||
|
||||
private:
|
||||
void updateBoundingRect();
|
||||
|
@ -16,3 +16,8 @@ void TrackInfo::plot(QPainter *painter, const QRectF &target)
|
||||
{
|
||||
render(painter, target);
|
||||
}
|
||||
|
||||
bool TrackInfo::isEmpty()
|
||||
{
|
||||
return _info->isEmpty();
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ public:
|
||||
|
||||
void insert(const QString &key, const QString &value);
|
||||
void plot(QPainter *painter, const QRectF &target);
|
||||
bool isEmpty();
|
||||
|
||||
private:
|
||||
InfoItem *_info;
|
||||
|
Loading…
Reference in New Issue
Block a user