Skip to content

Commit

Permalink
Implemented: Disable aircraft tracking on double click #28
Browse files Browse the repository at this point in the history
  • Loading branch information
albar965 committed Oct 15, 2016
1 parent 535d86e commit 07d54f9
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 3 deletions.
37 changes: 35 additions & 2 deletions help/en/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="language" content="EN" />
<meta name="author" content="Alexander Barthel" />
<meta name="date" content="2016-10-14T22:20:00+01:00" />
<meta name="date" content="2016-10-15T22:20:00+01:00" />
<meta content="Little Navmap User Manual" name="description" />
<title>
Little Navmap User Manual
Expand Down Expand Up @@ -1008,6 +1008,39 @@ <h4>
distance.
</p>

<p>
The aircraft centering will be switched off when using one of the following functions:
<br />
</p>

<ul>
<li>Double click into a table view or map display to zoom to an airport or a navaid.
</li>

<li>Context menu item <code>Show on map</code>.
</li>

<li>
<code>Goto Home</code> or <code>Goto Center for Distance Search</code>.
</li>

<li>
<code>Map</code> link in <code>Information</code> dock window.
</li>

<li>
<code>Show Flight Plan</code> plan. Either manually in a menu item or after loading.
</li>

<li>Centering a Google Earth KML/KMZ file after loading
</li>
</ul>

<p>
This allows to have a quick look at an airport or navaid during flight. To get back to the aircraft use <code>Map
Position Back</code> and enable <code>Show Aircraft</code> again.
</p>

<h4>
<img class="textimg" alt="Show Aircraft Trail" title="Show Aircraft Trail" src=
"images/icons/aircrafttrail.png" /> Show Aircraft Trail
Expand Down Expand Up @@ -3066,7 +3099,7 @@ <h2 id="h2license">
<br />
<br />
<br />
Last update 2016-10-14
Last update 2016-10-15
</p>
</body>
</html>
15 changes: 14 additions & 1 deletion src/mapgui/mapwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ void MapWidget::historyNext()
centerOn(entry.getPos().getLonX(), entry.getPos().getLatY(), false);
changedByHistory = true;
mainWindow->setStatusMessage(tr("Map position history next."));
showAircraft(false);
}
}

Expand All @@ -312,6 +313,7 @@ void MapWidget::historyBack()
centerOn(entry.getPos().getLonX(), entry.getPos().getLatY(), false);
changedByHistory = true;
mainWindow->setStatusMessage(tr("Map position history back."));
showAircraft(false);
}
}

Expand Down Expand Up @@ -440,6 +442,7 @@ void MapWidget::showPos(const atools::geo::Pos& pos, int distanceNm)
{
// qDebug() << "NavMapWidget::showPoint" << pos;
hideTooltip();
showAircraft(false);

if(distanceNm == -1)
setDistance(atools::geo::nmToKm(OptionData::instance().getMapZoomShow()));
Expand All @@ -452,6 +455,7 @@ void MapWidget::showRect(const atools::geo::Rect& rect)
{
// qDebug() << "NavMapWidget::showRect" << rect;
hideTooltip();
showAircraft(false);

qDebug() << "rect w" << QString::number(rect.getWidthDegree(), 'f')
<< "h" << QString::number(rect.getHeightDegree(), 'f');
Expand All @@ -468,6 +472,7 @@ void MapWidget::showSearchMark()
qDebug() << "NavMapWidget::showMark" << searchMarkPos;

hideTooltip();
showAircraft(false);

if(searchMarkPos.isValid())
{
Expand All @@ -481,6 +486,11 @@ void MapWidget::showAircraft(bool centerAircraftChecked)
{
qDebug() << "NavMapWidget::showAircraft" << searchMarkPos;

// Adapt the menu item status if this method was not called by the action
mainWindow->getUi()->actionMapAircraftCenter->blockSignals(true);
mainWindow->getUi()->actionMapAircraftCenter->setChecked(centerAircraftChecked);
mainWindow->getUi()->actionMapAircraftCenter->blockSignals(false);

if(centerAircraftChecked && simData.getPosition().isValid())
centerOn(simData.getPosition().getLonX(), simData.getPosition().getLatY(), false);
}
Expand All @@ -490,7 +500,7 @@ void MapWidget::showHome()
qDebug() << "NavMapWidget::showHome" << searchMarkPos;

hideTooltip();

showAircraft(false);
if(!atools::almostEqual(homeDistance, 0.))
// Only center position is valid
setDistance(homeDistance);
Expand Down Expand Up @@ -1951,8 +1961,11 @@ bool MapWidget::loadKml(const QString& filename, bool center)
if(!kmlString.isEmpty() && kmlString.startsWith("<?xml") && kmlString.endsWith("</kml>"))
{
if(center && OptionData::instance().getFlags() & opts::GUI_CENTER_KML)
{
// add file always centers
model()->addGeoDataFile(filename);
showAircraft(false);
}
else
// Have to read the data ourselves to avoid centering on startup
model()->addGeoDataString(kmlString, filename);
Expand Down

0 comments on commit 07d54f9

Please sign in to comment.