1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-09 16:54:28 +02:00

Added support for vector maps projection setting

Removed obsolete "Always show the map" setting
This commit is contained in:
2019-05-14 23:01:24 +02:00
parent f0d71d667b
commit 37c971a720
15 changed files with 155 additions and 55 deletions

View File

@ -103,7 +103,6 @@ GUI::GUI()
readSettings();
updateGraphTabs();
updateMapView();
updateStatusBarInfo();
}
@ -805,7 +804,7 @@ bool GUI::loadFile(const QString &fileName)
for (int i = 0; i < _tabs.count(); i++)
graphs.append(_tabs.at(i)->loadData(data));
if (updateGraphTabs() | updateMapView())
if (updateGraphTabs())
_splitter->refresh();
paths = _mapView->loadData(data);
@ -828,7 +827,6 @@ bool GUI::loadFile(const QString &fileName)
updateStatusBarInfo();
updateWindowTitle();
updateGraphTabs();
updateMapView();
QString error = tr("Error loading data file:") + "\n\n"
+ fileName + "\n\n" + data.errorString();
@ -930,6 +928,7 @@ void GUI::openOptions()
SET_VIEW_OPTION(pathAntiAliasing, useAntiAliasing);
SET_VIEW_OPTION(useOpenGL, useOpenGL);
SET_VIEW_OPTION(sliderColor, setMarkerColor);
SET_VIEW_OPTION(projection, setProjection);
SET_TAB_OPTION(palette, setPalette);
SET_TAB_OPTION(graphWidth, setGraphWidth);
@ -974,8 +973,6 @@ void GUI::openOptions()
reloadFile();
_options = options;
updateMapView();
}
void GUI::printFile()
@ -1230,7 +1227,6 @@ void GUI::closeAll()
updateStatusBarInfo();
updateWindowTitle();
updateGraphTabs();
updateMapView();
}
void GUI::showGraphs(bool show)
@ -1473,19 +1469,6 @@ bool GUI::updateGraphTabs()
return (hidden != _graphTabWidget->isHidden());
}
bool GUI::updateMapView()
{
bool hidden = _mapView->isHidden();
if (_options.alwaysShowMap)
_mapView->setHidden(false);
else
_mapView->setHidden(!(_trackCount + _routeCount + _waypointCount
+ _areaCount));
return (hidden != _mapView->isHidden());
}
void GUI::setTimeType(TimeType type)
{
for (int i = 0; i <_tabs.count(); i++)
@ -1847,8 +1830,8 @@ void GUI::writeSettings()
_options.separateGraphPage);
if (_options.sliderColor != SLIDER_COLOR_DEFAULT)
settings.setValue(SLIDER_COLOR_SETTING, _options.sliderColor);
if (_options.alwaysShowMap != ALWAYS_SHOW_MAP_DEFAULT)
settings.setValue(ALWAYS_SHOW_MAP_SETTING, _options.alwaysShowMap);
if (_options.projection != PROJECTION_DEFAULT)
settings.setValue(PROJECTION_SETTING, _options.projection);
#ifdef ENABLE_HIDPI
if (_options.hidpiMap != HIDPI_MAP_DEFAULT)
settings.setValue(HIDPI_MAP_SETTING, _options.hidpiMap);
@ -2110,8 +2093,8 @@ void GUI::readSettings()
SEPARATE_GRAPH_PAGE_DEFAULT).toBool();
_options.sliderColor = settings.value(SLIDER_COLOR_SETTING,
SLIDER_COLOR_DEFAULT).value<QColor>();
_options.alwaysShowMap = settings.value(ALWAYS_SHOW_MAP_SETTING,
ALWAYS_SHOW_MAP_DEFAULT).toBool();
_options.projection = settings.value(PROJECTION_SETTING, PROJECTION_DEFAULT)
.toInt();
#ifdef ENABLE_HIDPI
_options.hidpiMap = settings.value(HIDPI_MAP_SETTING, HIDPI_MAP_SETTING)
.toBool();
@ -2139,6 +2122,7 @@ void GUI::readSettings()
_mapView->setDevicePixelRatio(devicePixelRatioF(),
_options.hidpiMap ? devicePixelRatioF() : 1.0);
#endif // ENABLE_HIDPI
_mapView->setProjection(_options.projection);
for (int i = 0; i < _tabs.count(); i++) {
_tabs.at(i)->setPalette(_options.palette);