mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-27 21:24:47 +01:00
Added support for show/hide the graphs and the toolbars
This commit is contained in:
parent
a9b3d2595e
commit
f93b54aab0
@ -52,12 +52,12 @@
|
|||||||
<translation>O Qt</translation>
|
<translation>O Qt</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="268"/>
|
<location filename="../src/gui.cpp" line="284"/>
|
||||||
<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="298"/>
|
<location filename="../src/gui.cpp" line="314"/>
|
||||||
<source>Open file</source>
|
<source>Open file</source>
|
||||||
<translation>Otevřít soubor</translation>
|
<translation>Otevřít soubor</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -67,7 +67,7 @@
|
|||||||
<translation>Uložit jako</translation>
|
<translation>Uložit jako</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="344"/>
|
<location filename="../src/gui.cpp" line="360"/>
|
||||||
<source>Open POI file</source>
|
<source>Open POI file</source>
|
||||||
<translation>Otevřít POI soubor</translation>
|
<translation>Otevřít POI soubor</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -83,8 +83,8 @@
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="120"/>
|
<location filename="../src/gui.cpp" line="120"/>
|
||||||
<location filename="../src/gui.cpp" line="284"/>
|
<location filename="../src/gui.cpp" line="300"/>
|
||||||
<location filename="../src/gui.cpp" line="285"/>
|
<location filename="../src/gui.cpp" line="301"/>
|
||||||
<source>Keyboard controls</source>
|
<source>Keyboard controls</source>
|
||||||
<translation>Ovládací klávesy</translation>
|
<translation>Ovládací klávesy</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -104,13 +104,13 @@
|
|||||||
<translation>Znovu načíst</translation>
|
<translation>Znovu načíst</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="217"/>
|
<location filename="../src/gui.cpp" line="233"/>
|
||||||
<source>Show</source>
|
<source>Show</source>
|
||||||
<translation>Zobrazit</translation>
|
<translation>Zobrazit</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="176"/>
|
<location filename="../src/gui.cpp" line="188"/>
|
||||||
<location filename="../src/gui.cpp" line="208"/>
|
<location filename="../src/gui.cpp" line="224"/>
|
||||||
<source>File</source>
|
<source>File</source>
|
||||||
<translation>Soubor</translation>
|
<translation>Soubor</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -130,120 +130,135 @@
|
|||||||
<translation>Zobrazit mapu</translation>
|
<translation>Zobrazit mapu</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="190"/>
|
<location filename="../src/gui.cpp" line="174"/>
|
||||||
|
<source>Show graphs</source>
|
||||||
|
<translation>Zobrazovat grafy</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/gui.cpp" line="179"/>
|
||||||
|
<source>Show toolbars</source>
|
||||||
|
<translation>Zobrazovat nástrojové lišty</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/gui.cpp" line="202"/>
|
||||||
<source>Map</source>
|
<source>Map</source>
|
||||||
<translation>Mapa</translation>
|
<translation>Mapa</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="195"/>
|
<location filename="../src/gui.cpp" line="207"/>
|
||||||
<source>POI</source>
|
<source>POI</source>
|
||||||
<translation>POI</translation>
|
<translation>POI</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="199"/>
|
<location filename="../src/gui.cpp" line="211"/>
|
||||||
|
<source>Settings</source>
|
||||||
|
<translation>Nastavení</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/gui.cpp" line="215"/>
|
||||||
<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="236"/>
|
<location filename="../src/gui.cpp" line="252"/>
|
||||||
<source>Elevation</source>
|
<source>Elevation</source>
|
||||||
<translation>Výška</translation>
|
<translation>Výška</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="237"/>
|
<location filename="../src/gui.cpp" line="253"/>
|
||||||
<source>Speed</source>
|
<source>Speed</source>
|
||||||
<translation>Rychlost</translation>
|
<translation>Rychlost</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="287"/>
|
<location filename="../src/gui.cpp" line="303"/>
|
||||||
<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="288"/>
|
<location filename="../src/gui.cpp" line="304"/>
|
||||||
<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="290"/>
|
<location filename="../src/gui.cpp" line="306"/>
|
||||||
<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="400"/>
|
<location filename="../src/gui.cpp" line="416"/>
|
||||||
<source>Maximum</source>
|
<source>Maximum</source>
|
||||||
<translation>Maximum</translation>
|
<translation>Maximum</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="402"/>
|
<location filename="../src/gui.cpp" line="418"/>
|
||||||
<source>Minimum</source>
|
<source>Minimum</source>
|
||||||
<translation>Minimum</translation>
|
<translation>Minimum</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="123"/>
|
<location filename="../src/gui.cpp" line="123"/>
|
||||||
<location filename="../src/gui.cpp" line="264"/>
|
<location filename="../src/gui.cpp" line="280"/>
|
||||||
<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="266"/>
|
<location filename="../src/gui.cpp" line="282"/>
|
||||||
<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="393"/>
|
<location filename="../src/gui.cpp" line="409"/>
|
||||||
<source>Distance</source>
|
<source>Distance</source>
|
||||||
<translation>Vzdálenost</translation>
|
<translation>Vzdálenost</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="395"/>
|
<location filename="../src/gui.cpp" line="411"/>
|
||||||
<source>Time</source>
|
<source>Time</source>
|
||||||
<translation>Čas</translation>
|
<translation>Čas</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="396"/>
|
<location filename="../src/gui.cpp" line="412"/>
|
||||||
<source>Ascent</source>
|
<source>Ascent</source>
|
||||||
<translation>Stoupání</translation>
|
<translation>Stoupání</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="397"/>
|
<location filename="../src/gui.cpp" line="413"/>
|
||||||
<location filename="../src/gui.cpp" line="399"/>
|
<location filename="../src/gui.cpp" line="415"/>
|
||||||
<location filename="../src/gui.cpp" line="401"/>
|
<location filename="../src/gui.cpp" line="417"/>
|
||||||
<location filename="../src/gui.cpp" line="403"/>
|
<location filename="../src/gui.cpp" line="419"/>
|
||||||
<source>m</source>
|
<source>m</source>
|
||||||
<translation>m</translation>
|
<translation>m</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="398"/>
|
<location filename="../src/gui.cpp" line="414"/>
|
||||||
<source>Descent</source>
|
<source>Descent</source>
|
||||||
<translation>Klesání</translation>
|
<translation>Klesání</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="476"/>
|
<location filename="../src/gui.cpp" line="510"/>
|
||||||
<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="394"/>
|
<location filename="../src/gui.cpp" line="410"/>
|
||||||
<location filename="../src/gui.cpp" line="479"/>
|
<location filename="../src/gui.cpp" line="513"/>
|
||||||
<source>km</source>
|
<source>km</source>
|
||||||
<translation>km</translation>
|
<translation>km</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="336"/>
|
<location filename="../src/gui.cpp" line="352"/>
|
||||||
<location filename="../src/gui.cpp" line="348"/>
|
<location filename="../src/gui.cpp" line="364"/>
|
||||||
<source>Error</source>
|
<source>Error</source>
|
||||||
<translation>Chyba</translation>
|
<translation>Chyba</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="337"/>
|
<location filename="../src/gui.cpp" line="353"/>
|
||||||
<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="349"/>
|
<location filename="../src/gui.cpp" line="365"/>
|
||||||
<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:
|
||||||
|
46
src/gui.cpp
46
src/gui.cpp
@ -158,17 +158,29 @@ void GUI::createActions()
|
|||||||
_showPOIAction = new QAction(QIcon(QPixmap(SHOW_POI_ICON)),
|
_showPOIAction = new QAction(QIcon(QPixmap(SHOW_POI_ICON)),
|
||||||
tr("Show POIs"), this);
|
tr("Show POIs"), this);
|
||||||
_showPOIAction->setCheckable(true);
|
_showPOIAction->setCheckable(true);
|
||||||
connect(_showPOIAction, SIGNAL(triggered()), this, SLOT(showPOI()));
|
connect(_showPOIAction, SIGNAL(triggered(bool)), this, SLOT(showPOI(bool)));
|
||||||
|
|
||||||
// Map actions
|
// Map actions
|
||||||
_showMapAction = new QAction(QIcon(QPixmap(SHOW_MAP_ICON)), tr("Show map"),
|
_showMapAction = new QAction(QIcon(QPixmap(SHOW_MAP_ICON)), tr("Show map"),
|
||||||
this);
|
this);
|
||||||
_showMapAction->setCheckable(true);
|
_showMapAction->setCheckable(true);
|
||||||
connect(_showMapAction, SIGNAL(triggered()), this, SLOT(showMap()));
|
connect(_showMapAction, SIGNAL(triggered(bool)), this, SLOT(showMap(bool)));
|
||||||
if (_maps.empty())
|
if (_maps.empty())
|
||||||
_showMapAction->setEnabled(false);
|
_showMapAction->setEnabled(false);
|
||||||
else
|
else
|
||||||
createMapActions();
|
createMapActions();
|
||||||
|
|
||||||
|
// Settings actions
|
||||||
|
_showGraphsAction = new QAction(tr("Show graphs"), this);
|
||||||
|
_showGraphsAction->setCheckable(true);
|
||||||
|
_showGraphsAction->setChecked(true);
|
||||||
|
connect(_showGraphsAction, SIGNAL(triggered(bool)), this,
|
||||||
|
SLOT(showGraphs(bool)));
|
||||||
|
_showToolbarsAction = new QAction(tr("Show toolbars"), this);
|
||||||
|
_showToolbarsAction->setCheckable(true);
|
||||||
|
_showToolbarsAction->setChecked(true);
|
||||||
|
connect(_showToolbarsAction, SIGNAL(triggered(bool)), this,
|
||||||
|
SLOT(showToolbars(bool)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI::createMenus()
|
void GUI::createMenus()
|
||||||
@ -196,6 +208,10 @@ void GUI::createMenus()
|
|||||||
_poiMenu->addAction(_openPOIAction);
|
_poiMenu->addAction(_openPOIAction);
|
||||||
_poiMenu->addAction(_showPOIAction);
|
_poiMenu->addAction(_showPOIAction);
|
||||||
|
|
||||||
|
_settingsMenu = menuBar()->addMenu(tr("Settings"));
|
||||||
|
_settingsMenu->addAction(_showToolbarsAction);
|
||||||
|
_settingsMenu->addAction(_showGraphsAction);
|
||||||
|
|
||||||
_helpMenu = menuBar()->addMenu(tr("Help"));
|
_helpMenu = menuBar()->addMenu(tr("Help"));
|
||||||
_helpMenu->addAction(_keysAction);
|
_helpMenu->addAction(_keysAction);
|
||||||
_helpMenu->addSeparator();
|
_helpMenu->addSeparator();
|
||||||
@ -445,22 +461,40 @@ void GUI::closeFile()
|
|||||||
updateStatusBarInfo();
|
updateStatusBarInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI::showPOI()
|
void GUI::showPOI(bool checked)
|
||||||
{
|
{
|
||||||
if (_showPOIAction->isChecked())
|
if (checked)
|
||||||
_track->loadPOI(_poi);
|
_track->loadPOI(_poi);
|
||||||
else
|
else
|
||||||
_track->clearPOI();
|
_track->clearPOI();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI::showMap()
|
void GUI::showMap(bool checked)
|
||||||
{
|
{
|
||||||
if (_showMapAction->isChecked())
|
if (checked)
|
||||||
_track->setMap(_currentMap);
|
_track->setMap(_currentMap);
|
||||||
else
|
else
|
||||||
_track->setMap(0);
|
_track->setMap(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GUI::showGraphs(bool checked)
|
||||||
|
{
|
||||||
|
_trackGraphs->setHidden(!checked);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GUI::showToolbars(bool checked)
|
||||||
|
{
|
||||||
|
if (checked) {
|
||||||
|
addToolBar(_fileToolBar);
|
||||||
|
addToolBar(_showToolBar);
|
||||||
|
_fileToolBar->show();
|
||||||
|
_showToolBar->show();
|
||||||
|
} else {
|
||||||
|
removeToolBar(_fileToolBar);
|
||||||
|
removeToolBar(_showToolBar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GUI::updateStatusBarInfo()
|
void GUI::updateStatusBarInfo()
|
||||||
{
|
{
|
||||||
int files = _files.size();
|
int files = _files.size();
|
||||||
|
@ -36,8 +36,10 @@ private slots:
|
|||||||
void closeFile();
|
void closeFile();
|
||||||
void reloadFile();
|
void reloadFile();
|
||||||
void openPOIFile();
|
void openPOIFile();
|
||||||
void showPOI();
|
void showPOI(bool checked);
|
||||||
void showMap();
|
void showMap(bool checked);
|
||||||
|
void showGraphs(bool checked);
|
||||||
|
void showToolbars(bool checked);
|
||||||
|
|
||||||
void mapChanged(int);
|
void mapChanged(int);
|
||||||
void graphChanged(int);
|
void graphChanged(int);
|
||||||
@ -63,6 +65,7 @@ private:
|
|||||||
QMenu *_helpMenu;
|
QMenu *_helpMenu;
|
||||||
QMenu *_poiMenu;
|
QMenu *_poiMenu;
|
||||||
QMenu *_mapMenu;
|
QMenu *_mapMenu;
|
||||||
|
QMenu *_settingsMenu;
|
||||||
|
|
||||||
QToolBar *_fileToolBar;
|
QToolBar *_fileToolBar;
|
||||||
QToolBar *_showToolBar;
|
QToolBar *_showToolBar;
|
||||||
@ -81,6 +84,8 @@ private:
|
|||||||
QAction *_openPOIAction;
|
QAction *_openPOIAction;
|
||||||
QAction *_showPOIAction;
|
QAction *_showPOIAction;
|
||||||
QAction *_showMapAction;
|
QAction *_showMapAction;
|
||||||
|
QAction *_showGraphsAction;
|
||||||
|
QAction *_showToolbarsAction;
|
||||||
QList<QAction*> _mapActions;
|
QList<QAction*> _mapActions;
|
||||||
|
|
||||||
QLabel *_fileNameLabel;
|
QLabel *_fileNameLabel;
|
||||||
|
Loading…
Reference in New Issue
Block a user