mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-02-17 16:20:48 +01:00
Multiple settings handling fixes and enhancements
This commit is contained in:
parent
db45d3c659
commit
c77cf70f9f
@ -18,7 +18,6 @@ greaterThan(QT_MAJOR_VERSION, 5) {QT += openglwidgets}
|
|||||||
CONFIG += object_parallel_to_source
|
CONFIG += object_parallel_to_source
|
||||||
INCLUDEPATH += ./src
|
INCLUDEPATH += ./src
|
||||||
HEADERS += src/common/config.h \
|
HEADERS += src/common/config.h \
|
||||||
src/GUI/passwordedit.h \
|
|
||||||
src/common/garmin.h \
|
src/common/garmin.h \
|
||||||
src/common/coordinates.h \
|
src/common/coordinates.h \
|
||||||
src/common/range.h \
|
src/common/range.h \
|
||||||
@ -104,6 +103,7 @@ HEADERS += src/common/config.h \
|
|||||||
src/GUI/pdfexportdialog.h \
|
src/GUI/pdfexportdialog.h \
|
||||||
src/GUI/pngexportdialog.h \
|
src/GUI/pngexportdialog.h \
|
||||||
src/GUI/timezoneinfo.h \
|
src/GUI/timezoneinfo.h \
|
||||||
|
src/GUI/passwordedit.h \
|
||||||
src/map/proj/polyconic.h \
|
src/map/proj/polyconic.h \
|
||||||
src/map/proj/webmercator.h \
|
src/map/proj/webmercator.h \
|
||||||
src/map/proj/transversemercator.h \
|
src/map/proj/transversemercator.h \
|
||||||
@ -235,7 +235,6 @@ HEADERS += src/common/config.h \
|
|||||||
src/data/geojsonparser.h
|
src/data/geojsonparser.h
|
||||||
|
|
||||||
SOURCES += src/main.cpp \
|
SOURCES += src/main.cpp \
|
||||||
src/GUI/passwordedit.cpp \
|
|
||||||
src/common/coordinates.cpp \
|
src/common/coordinates.cpp \
|
||||||
src/common/rectc.cpp \
|
src/common/rectc.cpp \
|
||||||
src/common/range.cpp \
|
src/common/range.cpp \
|
||||||
@ -302,6 +301,7 @@ SOURCES += src/main.cpp \
|
|||||||
src/GUI/pdfexportdialog.cpp \
|
src/GUI/pdfexportdialog.cpp \
|
||||||
src/GUI/pngexportdialog.cpp \
|
src/GUI/pngexportdialog.cpp \
|
||||||
src/GUI/projectioncombobox.cpp \
|
src/GUI/projectioncombobox.cpp \
|
||||||
|
src/GUI/passwordedit.cpp \
|
||||||
src/map/proj/polyconic.cpp \
|
src/map/proj/polyconic.cpp \
|
||||||
src/map/proj/webmercator.cpp \
|
src/map/proj/webmercator.cpp \
|
||||||
src/map/proj/transversemercator.cpp \
|
src/map/proj/transversemercator.cpp \
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
#include <QNetworkProxyFactory>
|
#include <QNetworkProxyFactory>
|
||||||
#include <QNetworkAccessManager>
|
#include <QNetworkAccessManager>
|
||||||
#include <QLibraryInfo>
|
#include <QLibraryInfo>
|
||||||
#include <QSettings>
|
|
||||||
#include <QSurfaceFormat>
|
#include <QSurfaceFormat>
|
||||||
#include "common/programpaths.h"
|
#include "common/programpaths.h"
|
||||||
#include "common/config.h"
|
#include "common/config.h"
|
||||||
@ -60,14 +59,6 @@ App::App(int &argc, char **argv) : QApplication(argc, argv)
|
|||||||
loadDatums();
|
loadDatums();
|
||||||
loadPCSs();
|
loadPCSs();
|
||||||
|
|
||||||
QSettings settings(qApp->applicationName(), qApp->applicationName());
|
|
||||||
settings.beginGroup(OPTIONS_SETTINGS_GROUP);
|
|
||||||
Downloader::enableHTTP2(settings.value(ENABLE_HTTP2_SETTING,
|
|
||||||
ENABLE_HTTP2_DEFAULT).toBool());
|
|
||||||
Downloader::setTimeout(settings.value(CONNECTION_TIMEOUT_SETTING,
|
|
||||||
CONNECTION_TIMEOUT_DEFAULT).toInt());
|
|
||||||
settings.endGroup();
|
|
||||||
|
|
||||||
_gui = new GUI();
|
_gui = new GUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
152
src/GUI/gui.cpp
152
src/GUI/gui.cpp
@ -59,8 +59,8 @@
|
|||||||
|
|
||||||
GUI::GUI()
|
GUI::GUI()
|
||||||
{
|
{
|
||||||
TreeNode<MapAction*> mapActions;
|
QString activeMap;
|
||||||
TreeNode<POIAction*> poiActions;
|
QStringList disabledPOIs;
|
||||||
|
|
||||||
_poi = new POI(this);
|
_poi = new POI(this);
|
||||||
_dem = new DEMLoader(ProgramPaths::demDir(true), this);
|
_dem = new DEMLoader(ProgramPaths::demDir(true), this);
|
||||||
@ -69,8 +69,8 @@ GUI::GUI()
|
|||||||
createMapView();
|
createMapView();
|
||||||
createGraphTabs();
|
createGraphTabs();
|
||||||
createStatusBar();
|
createStatusBar();
|
||||||
createActions(mapActions, poiActions);
|
createActions();
|
||||||
createMenus(mapActions, poiActions);
|
createMenus();
|
||||||
createToolBars();
|
createToolBars();
|
||||||
createBrowser();
|
createBrowser();
|
||||||
|
|
||||||
@ -99,11 +99,10 @@ GUI::GUI()
|
|||||||
_movingTime = 0;
|
_movingTime = 0;
|
||||||
_lastTab = 0;
|
_lastTab = 0;
|
||||||
|
|
||||||
readSettings();
|
readSettings(activeMap, disabledPOIs);
|
||||||
|
|
||||||
_dataDir = _options.dataPath;
|
loadInitialMaps(activeMap);
|
||||||
_mapDir = _options.mapsPath;
|
loadInitialPOIs(disabledPOIs);
|
||||||
_poiDir = _options.poiPath;
|
|
||||||
|
|
||||||
updateGraphTabs();
|
updateGraphTabs();
|
||||||
updateStatusBarInfo();
|
updateStatusBarInfo();
|
||||||
@ -117,21 +116,6 @@ void GUI::createBrowser()
|
|||||||
&GUI::updateNavigationActions);
|
&GUI::updateNavigationActions);
|
||||||
}
|
}
|
||||||
|
|
||||||
TreeNode<MapAction*> GUI::createMapActions()
|
|
||||||
{
|
|
||||||
_mapsActionGroup = new QActionGroup(this);
|
|
||||||
_mapsActionGroup->setExclusive(true);
|
|
||||||
connect(_mapsActionGroup, &QActionGroup::triggered, this, &GUI::mapChanged);
|
|
||||||
|
|
||||||
QString mapDir(ProgramPaths::mapDir());
|
|
||||||
if (mapDir.isNull())
|
|
||||||
return TreeNode<MapAction*>();
|
|
||||||
|
|
||||||
TreeNode<Map*> maps(MapList::loadMaps(mapDir,
|
|
||||||
CRS::projection(_options.inputProjection)));
|
|
||||||
return createMapActionsNode(maps);
|
|
||||||
}
|
|
||||||
|
|
||||||
TreeNode<MapAction*> GUI::createMapActionsNode(const TreeNode<Map*> &node)
|
TreeNode<MapAction*> GUI::createMapActionsNode(const TreeNode<Map*> &node)
|
||||||
{
|
{
|
||||||
TreeNode<MapAction*> tree(node.name());
|
TreeNode<MapAction*> tree(node.name());
|
||||||
@ -171,21 +155,6 @@ void GUI::mapInitialized()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TreeNode<POIAction *> GUI::createPOIActions()
|
|
||||||
{
|
|
||||||
_poisActionGroup = new QActionGroup(this);
|
|
||||||
_poisActionGroup->setExclusive(false);
|
|
||||||
connect(_poisActionGroup, &QActionGroup::triggered, this,
|
|
||||||
&GUI::poiFileChecked);
|
|
||||||
|
|
||||||
TreeNode<QString> poiFiles;
|
|
||||||
QString poiDir(ProgramPaths::poiDir());
|
|
||||||
if (!poiDir.isNull())
|
|
||||||
poiFiles = _poi->loadDir(poiDir);
|
|
||||||
|
|
||||||
return createPOIActionsNode(poiFiles);
|
|
||||||
}
|
|
||||||
|
|
||||||
TreeNode<POIAction *> GUI::createPOIActionsNode(const TreeNode<QString> &node)
|
TreeNode<POIAction *> GUI::createPOIActionsNode(const TreeNode<QString> &node)
|
||||||
{
|
{
|
||||||
TreeNode<POIAction*> tree(node.name());
|
TreeNode<POIAction*> tree(node.name());
|
||||||
@ -198,8 +167,7 @@ TreeNode<POIAction *> GUI::createPOIActionsNode(const TreeNode<QString> &node)
|
|||||||
return tree;
|
return tree;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI::createActions(TreeNode<MapAction*> &mapActions,
|
void GUI::createActions()
|
||||||
TreeNode<POIAction*> &poiActions)
|
|
||||||
{
|
{
|
||||||
QActionGroup *ag;
|
QActionGroup *ag;
|
||||||
|
|
||||||
@ -277,7 +245,10 @@ void GUI::createActions(TreeNode<MapAction*> &mapActions,
|
|||||||
addAction(_statisticsAction);
|
addAction(_statisticsAction);
|
||||||
|
|
||||||
// POI actions
|
// POI actions
|
||||||
poiActions = createPOIActions();
|
_poisActionGroup = new QActionGroup(this);
|
||||||
|
_poisActionGroup->setExclusive(false);
|
||||||
|
connect(_poisActionGroup, &QActionGroup::triggered, this,
|
||||||
|
&GUI::poiFileChecked);
|
||||||
_openPOIAction = new QAction(QIcon(OPEN_FILE_ICON), tr("Load POI file..."),
|
_openPOIAction = new QAction(QIcon(OPEN_FILE_ICON), tr("Load POI file..."),
|
||||||
this);
|
this);
|
||||||
_openPOIAction->setMenuRole(QAction::NoRole);
|
_openPOIAction->setMenuRole(QAction::NoRole);
|
||||||
@ -285,12 +256,12 @@ void GUI::createActions(TreeNode<MapAction*> &mapActions,
|
|||||||
QOverload<>::of(&GUI::openPOIFile));
|
QOverload<>::of(&GUI::openPOIFile));
|
||||||
_selectAllPOIAction = new QAction(tr("Select all files"), this);
|
_selectAllPOIAction = new QAction(tr("Select all files"), this);
|
||||||
_selectAllPOIAction->setMenuRole(QAction::NoRole);
|
_selectAllPOIAction->setMenuRole(QAction::NoRole);
|
||||||
_selectAllPOIAction->setEnabled(!_poisActionGroup->actions().isEmpty());
|
_selectAllPOIAction->setEnabled(false);
|
||||||
connect(_selectAllPOIAction, &QAction::triggered, this,
|
connect(_selectAllPOIAction, &QAction::triggered, this,
|
||||||
&GUI::selectAllPOIs);
|
&GUI::selectAllPOIs);
|
||||||
_unselectAllPOIAction = new QAction(tr("Unselect all files"), this);
|
_unselectAllPOIAction = new QAction(tr("Unselect all files"), this);
|
||||||
_unselectAllPOIAction->setMenuRole(QAction::NoRole);
|
_unselectAllPOIAction->setMenuRole(QAction::NoRole);
|
||||||
_unselectAllPOIAction->setEnabled(_selectAllPOIAction->isEnabled());
|
_unselectAllPOIAction->setEnabled(false);
|
||||||
connect(_unselectAllPOIAction, &QAction::triggered, this,
|
connect(_unselectAllPOIAction, &QAction::triggered, this,
|
||||||
&GUI::unselectAllPOIs);
|
&GUI::unselectAllPOIs);
|
||||||
_overlapPOIAction = new QAction(tr("Overlap POIs"), this);
|
_overlapPOIAction = new QAction(tr("Overlap POIs"), this);
|
||||||
@ -311,7 +282,9 @@ void GUI::createActions(TreeNode<MapAction*> &mapActions,
|
|||||||
addAction(_showPOIAction);
|
addAction(_showPOIAction);
|
||||||
|
|
||||||
// Map actions
|
// Map actions
|
||||||
mapActions = createMapActions();
|
_mapsActionGroup = new QActionGroup(this);
|
||||||
|
_mapsActionGroup->setExclusive(true);
|
||||||
|
connect(_mapsActionGroup, &QActionGroup::triggered, this, &GUI::mapChanged);
|
||||||
_showMapAction = new QAction(QIcon(SHOW_MAP_ICON), tr("Show map"),
|
_showMapAction = new QAction(QIcon(SHOW_MAP_ICON), tr("Show map"),
|
||||||
this);
|
this);
|
||||||
_showMapAction->setEnabled(false);
|
_showMapAction->setEnabled(false);
|
||||||
@ -532,7 +505,8 @@ void GUI::createActions(TreeNode<MapAction*> &mapActions,
|
|||||||
connect(_firstAction, &QAction::triggered, this, &GUI::first);
|
connect(_firstAction, &QAction::triggered, this, &GUI::first);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI::createMapNodeMenu(const TreeNode<MapAction*> &node, QMenu *menu)
|
void GUI::createMapNodeMenu(const TreeNode<MapAction*> &node, QMenu *menu,
|
||||||
|
QAction *action)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < node.childs().size(); i++) {
|
for (int i = 0; i < node.childs().size(); i++) {
|
||||||
QMenu *cm = new QMenu(node.childs().at(i).name(), menu);
|
QMenu *cm = new QMenu(node.childs().at(i).name(), menu);
|
||||||
@ -541,10 +515,11 @@ void GUI::createMapNodeMenu(const TreeNode<MapAction*> &node, QMenu *menu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < node.items().size(); i++)
|
for (int i = 0; i < node.items().size(); i++)
|
||||||
menu->addAction(node.items().at(i));
|
menu->insertAction(action, node.items().at(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI::createPOINodeMenu(const TreeNode<POIAction*> &node, QMenu *menu)
|
void GUI::createPOINodeMenu(const TreeNode<POIAction*> &node, QMenu *menu,
|
||||||
|
QAction *action)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < node.childs().size(); i++) {
|
for (int i = 0; i < node.childs().size(); i++) {
|
||||||
QMenu *cm = new QMenu(node.childs().at(i).name(), menu);
|
QMenu *cm = new QMenu(node.childs().at(i).name(), menu);
|
||||||
@ -553,11 +528,10 @@ void GUI::createPOINodeMenu(const TreeNode<POIAction*> &node, QMenu *menu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < node.items().size(); i++)
|
for (int i = 0; i < node.items().size(); i++)
|
||||||
menu->addAction(node.items().at(i));
|
menu->insertAction(action, node.items().at(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI::createMenus(const TreeNode<MapAction*> &mapActions,
|
void GUI::createMenus()
|
||||||
const TreeNode<POIAction*> &poiActions)
|
|
||||||
{
|
{
|
||||||
QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
|
QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
|
||||||
fileMenu->addAction(_openFileAction);
|
fileMenu->addAction(_openFileAction);
|
||||||
@ -576,7 +550,6 @@ void GUI::createMenus(const TreeNode<MapAction*> &mapActions,
|
|||||||
#endif // Q_OS_MAC
|
#endif // Q_OS_MAC
|
||||||
|
|
||||||
_mapMenu = menuBar()->addMenu(tr("&Map"));
|
_mapMenu = menuBar()->addMenu(tr("&Map"));
|
||||||
createMapNodeMenu(mapActions, _mapMenu);
|
|
||||||
_mapsEnd = _mapMenu->addSeparator();
|
_mapsEnd = _mapMenu->addSeparator();
|
||||||
_mapMenu->addAction(_loadMapAction);
|
_mapMenu->addAction(_loadMapAction);
|
||||||
_mapMenu->addAction(_loadMapDirAction);
|
_mapMenu->addAction(_loadMapDirAction);
|
||||||
@ -611,7 +584,6 @@ void GUI::createMenus(const TreeNode<MapAction*> &mapActions,
|
|||||||
dataMenu->addAction(_showWaypointsAction);
|
dataMenu->addAction(_showWaypointsAction);
|
||||||
|
|
||||||
_poiMenu = menuBar()->addMenu(tr("&POI"));
|
_poiMenu = menuBar()->addMenu(tr("&POI"));
|
||||||
createPOINodeMenu(poiActions, _poiMenu);
|
|
||||||
_poisEnd = _poiMenu->addSeparator();
|
_poisEnd = _poiMenu->addSeparator();
|
||||||
_poiMenu->addAction(_openPOIAction);
|
_poiMenu->addAction(_openPOIAction);
|
||||||
_poiMenu->addAction(_selectAllPOIAction);
|
_poiMenu->addAction(_selectAllPOIAction);
|
||||||
@ -2363,7 +2335,7 @@ void GUI::writeSettings()
|
|||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI::readSettings()
|
void GUI::readSettings(QString &activeMap, QStringList &disabledPOIs)
|
||||||
{
|
{
|
||||||
int value;
|
int value;
|
||||||
QSettings settings(qApp->applicationName(), qApp->applicationName());
|
QSettings settings(qApp->applicationName(), qApp->applicationName());
|
||||||
@ -2406,17 +2378,12 @@ void GUI::readSettings()
|
|||||||
_showMapAction->setChecked(true);
|
_showMapAction->setChecked(true);
|
||||||
else
|
else
|
||||||
_mapView->showMap(false);
|
_mapView->showMap(false);
|
||||||
QAction *ma = mapAction(settings.value(CURRENT_MAP_SETTING).toString());
|
|
||||||
if (ma) {
|
|
||||||
ma->trigger();
|
|
||||||
_showMapAction->setEnabled(true);
|
|
||||||
_clearMapCacheAction->setEnabled(true);
|
|
||||||
}
|
|
||||||
if (settings.value(SHOW_COORDINATES_SETTING, SHOW_COORDINATES_DEFAULT)
|
if (settings.value(SHOW_COORDINATES_SETTING, SHOW_COORDINATES_DEFAULT)
|
||||||
.toBool()) {
|
.toBool()) {
|
||||||
_showCoordinatesAction->setChecked(true);
|
_showCoordinatesAction->setChecked(true);
|
||||||
_mapView->showCoordinates(true);
|
_mapView->showCoordinates(true);
|
||||||
}
|
}
|
||||||
|
activeMap = settings.value(CURRENT_MAP_SETTING).toString();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
settings.beginGroup(GRAPH_SETTINGS_GROUP);
|
settings.beginGroup(GRAPH_SETTINGS_GROUP);
|
||||||
@ -2456,18 +2423,11 @@ void GUI::readSettings()
|
|||||||
_showPOIAction->setChecked(true);
|
_showPOIAction->setChecked(true);
|
||||||
else
|
else
|
||||||
_mapView->showPOI(false);
|
_mapView->showPOI(false);
|
||||||
QList<QAction*> poiActions(_poisActionGroup->actions());
|
|
||||||
for (int i = 0; i < poiActions.count(); i++)
|
|
||||||
poiActions.at(i)->setChecked(true);
|
|
||||||
int size = settings.beginReadArray(DISABLED_POI_FILE_SETTINGS_PREFIX);
|
int size = settings.beginReadArray(DISABLED_POI_FILE_SETTINGS_PREFIX);
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
settings.setArrayIndex(i);
|
settings.setArrayIndex(i);
|
||||||
QString file(settings.value(DISABLED_POI_FILE_SETTING).toString());
|
disabledPOIs.append(settings.value(DISABLED_POI_FILE_SETTING).toString());
|
||||||
if (_poi->enableFile(file, false)) {
|
|
||||||
for (int j = 0; j < poiActions.size(); j++)
|
|
||||||
if (poiActions.at(j)->data().toString() == file)
|
|
||||||
poiActions.at(j)->setChecked(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
settings.endArray();
|
settings.endArray();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
@ -2730,6 +2690,11 @@ void GUI::readSettings()
|
|||||||
Waypoint::useDEM(_options.dataUseDEM);
|
Waypoint::useDEM(_options.dataUseDEM);
|
||||||
Waypoint::showSecondaryElevation(_options.showSecondaryElevation);
|
Waypoint::showSecondaryElevation(_options.showSecondaryElevation);
|
||||||
|
|
||||||
|
Downloader::enableHTTP2(_options.enableHTTP2);
|
||||||
|
Downloader::setTimeout(_options.connectionTimeout);
|
||||||
|
|
||||||
|
QPixmapCache::setCacheLimit(_options.pixmapCache * 1024);
|
||||||
|
|
||||||
_poi->setRadius(_options.poiRadius);
|
_poi->setRadius(_options.poiRadius);
|
||||||
|
|
||||||
_dem->setUrl(_options.demURL);
|
_dem->setUrl(_options.demURL);
|
||||||
@ -2737,11 +2702,60 @@ void GUI::readSettings()
|
|||||||
_dem->setAuthorization(Authorization(_options.demUsername,
|
_dem->setAuthorization(Authorization(_options.demUsername,
|
||||||
_options.demPassword));
|
_options.demPassword));
|
||||||
|
|
||||||
QPixmapCache::setCacheLimit(_options.pixmapCache * 1024);
|
_dataDir = _options.dataPath;
|
||||||
|
_mapDir = _options.mapsPath;
|
||||||
|
_poiDir = _options.poiPath;
|
||||||
|
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GUI::loadInitialMaps(const QString &selected)
|
||||||
|
{
|
||||||
|
// Load the maps
|
||||||
|
QString mapDir(ProgramPaths::mapDir());
|
||||||
|
if (mapDir.isNull())
|
||||||
|
return;
|
||||||
|
|
||||||
|
TreeNode<Map*> maps(MapList::loadMaps(mapDir,
|
||||||
|
CRS::projection(_options.inputProjection)));
|
||||||
|
createMapNodeMenu(createMapActionsNode(maps), _mapMenu, _mapsEnd);
|
||||||
|
|
||||||
|
// Select the active map according to the user settings
|
||||||
|
QAction *ma = mapAction(selected);
|
||||||
|
if (ma) {
|
||||||
|
ma->trigger();
|
||||||
|
_showMapAction->setEnabled(true);
|
||||||
|
_clearMapCacheAction->setEnabled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void GUI::loadInitialPOIs(const QStringList &disabled)
|
||||||
|
{
|
||||||
|
// Load the POI files
|
||||||
|
QString poiDir(ProgramPaths::poiDir());
|
||||||
|
if (poiDir.isNull())
|
||||||
|
return;
|
||||||
|
|
||||||
|
TreeNode<QString> poiFiles(_poi->loadDir(poiDir));
|
||||||
|
createPOINodeMenu(createPOIActionsNode(poiFiles), _poiMenu, _poisEnd);
|
||||||
|
|
||||||
|
// Enable/disable the files according to the user settings
|
||||||
|
QList<QAction*> poiActions(_poisActionGroup->actions());
|
||||||
|
for (int i = 0; i < poiActions.count(); i++)
|
||||||
|
poiActions.at(i)->setChecked(true);
|
||||||
|
for (int i = 0; i < disabled.size(); i++) {
|
||||||
|
const QString &file = disabled.at(i);
|
||||||
|
if (_poi->enableFile(file, false)) {
|
||||||
|
for (int j = 0; j < poiActions.size(); j++)
|
||||||
|
if (poiActions.at(j)->data().toString() == file)
|
||||||
|
poiActions.at(j)->setChecked(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_selectAllPOIAction->setEnabled(!poiActions.isEmpty());
|
||||||
|
_unselectAllPOIAction->setEnabled(!poiActions.isEmpty());
|
||||||
|
}
|
||||||
|
|
||||||
QAction *GUI::mapAction(const QString &name)
|
QAction *GUI::mapAction(const QString &name)
|
||||||
{
|
{
|
||||||
QList<QAction *> maps(_mapsActionGroup->actions());
|
QList<QAction *> maps(_mapsActionGroup->actions());
|
||||||
|
@ -119,16 +119,14 @@ private:
|
|||||||
void plotGraphsPage(QPainter *painter, const QRectF &rect, qreal ratio);
|
void plotGraphsPage(QPainter *painter, const QRectF &rect, qreal ratio);
|
||||||
qreal graphPlotHeight(const QRectF &rect, qreal ratio);
|
qreal graphPlotHeight(const QRectF &rect, qreal ratio);
|
||||||
|
|
||||||
TreeNode<POIAction*> createPOIActions();
|
|
||||||
TreeNode<POIAction*> createPOIActionsNode(const TreeNode<QString> &node);
|
TreeNode<POIAction*> createPOIActionsNode(const TreeNode<QString> &node);
|
||||||
TreeNode<MapAction*> createMapActions();
|
|
||||||
TreeNode<MapAction*> createMapActionsNode(const TreeNode<Map*> &node);
|
TreeNode<MapAction*> createMapActionsNode(const TreeNode<Map*> &node);
|
||||||
void createActions(TreeNode<MapAction*> &mapActions,
|
void createMapNodeMenu(const TreeNode<MapAction*> &node, QMenu *menu,
|
||||||
TreeNode<POIAction*> &poiActions);
|
QAction *action = 0);
|
||||||
void createMapNodeMenu(const TreeNode<MapAction*> &node, QMenu *menu);
|
void createPOINodeMenu(const TreeNode<POIAction*> &node, QMenu *menu,
|
||||||
void createPOINodeMenu(const TreeNode<POIAction*> &node, QMenu *menu);
|
QAction *action = 0);
|
||||||
void createMenus(const TreeNode<MapAction*> &mapActions,
|
void createActions();
|
||||||
const TreeNode<POIAction*> &poiActions);
|
void createMenus();
|
||||||
void createToolBars();
|
void createToolBars();
|
||||||
void createStatusBar();
|
void createStatusBar();
|
||||||
void createMapView();
|
void createMapView();
|
||||||
@ -158,9 +156,12 @@ private:
|
|||||||
qreal time() const;
|
qreal time() const;
|
||||||
qreal movingTime() const;
|
qreal movingTime() const;
|
||||||
QAction *mapAction(const QString &name);
|
QAction *mapAction(const QString &name);
|
||||||
void readSettings();
|
void readSettings(QString &activeMap, QStringList &disabledPOIs);
|
||||||
void writeSettings();
|
void writeSettings();
|
||||||
|
|
||||||
|
void loadInitialMaps(const QString &selected);
|
||||||
|
void loadInitialPOIs(const QStringList &disabled);
|
||||||
|
|
||||||
void keyPressEvent(QKeyEvent *event);
|
void keyPressEvent(QKeyEvent *event);
|
||||||
void closeEvent(QCloseEvent *event);
|
void closeEvent(QCloseEvent *event);
|
||||||
void dragEnterEvent(QDragEnterEvent *event);
|
void dragEnterEvent(QDragEnterEvent *event);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user