Ref T397, do not show context menu for fast position updates if FSD has disabled it

This commit is contained in:
Klaus Basan
2018-10-27 02:04:19 +02:00
parent 53b3241483
commit 4370f2c614
4 changed files with 37 additions and 11 deletions

View File

@@ -7,9 +7,6 @@
* contained in the LICENSE file.
*/
#include "blackcore/context/contextnetwork.h"
#include "blackcore/context/contextsimulator.h"
#include "blackcore/network.h"
#include "blackgui/components/aircraftcomponent.h"
#include "blackgui/guiapplication.h"
#include "blackgui/guiutility.h"
@@ -18,6 +15,11 @@
#include "blackgui/views/airportview.h"
#include "blackgui/views/simulatedaircraftview.h"
#include "blackgui/views/viewbase.h"
#include "blackcore/context/contextnetwork.h"
#include "blackcore/context/contextsimulator.h"
#include "blackcore/network.h"
#include "blackmisc/network/server.h"
#include "blackmisc/network/fsdsetup.h"
#include "ui_aircraftcomponent.h"
#include <QString>
@@ -31,6 +33,7 @@ using namespace BlackGui::Models;
using namespace BlackGui::Settings;
using namespace BlackCore;
using namespace BlackCore::Context;
using namespace BlackMisc::Network;
using namespace BlackMisc::Simulation;
using namespace BlackMisc::PhysicalQuantities;
@@ -161,7 +164,12 @@ namespace BlackGui
}
else if (INetwork::isConnectedStatus(to))
{
// void
if (sGui && sGui->getIContextNetwork())
{
const CServer server = sGui->getIContextNetwork()->getConnectedServer();
const bool sendFast = server.getFsdSetup().sendInterimPositions();
ui->tvp_AircraftInRange->configureMenuFastPositionUpdates(sendFast);
}
}
}

View File

@@ -7,9 +7,6 @@
* contained in the LICENSE file.
*/
#include "blackcore/context/contextnetwork.h"
#include "blackcore/context/contextsimulator.h"
#include "blackcore/network.h"
#include "blackgui/components/mappingcomponent.h"
#include "blackgui/guiapplication.h"
#include "blackgui/guiutility.h"
@@ -19,13 +16,17 @@
#include "blackgui/views/checkboxdelegate.h"
#include "blackgui/views/simulatedaircraftview.h"
#include "blackgui/views/viewbase.h"
#include "blackcore/context/contextnetwork.h"
#include "blackcore/context/contextsimulator.h"
#include "blackcore/network.h"
#include "blackmisc/simulation/simulatedaircraft.h"
#include "blackmisc/simulation/simulatedaircraftlist.h"
#include "blackmisc/simulation/aircraftmodel.h"
#include "blackmisc/aviation/callsign.h"
#include "blackmisc/network/server.h"
#include "blackmisc/icons.h"
#include "blackmisc/logmessage.h"
#include "blackmisc/pixmap.h"
#include "blackmisc/simulation/aircraftmodel.h"
#include "blackmisc/simulation/simulatedaircraft.h"
#include "blackmisc/simulation/simulatedaircraftlist.h"
#include "blackmisc/statusmessage.h"
#include "mappingcomponent.h"
#include "ui_mappingcomponent.h"
@@ -426,6 +427,15 @@ namespace BlackGui
this->tokenBucketUpdate();
ui->tvp_RenderedAircraft->clear();
}
else if (INetwork::isConnectedStatus(to))
{
if (sGui && sGui->getIContextNetwork())
{
const CServer server = sGui->getIContextNetwork()->getConnectedServer();
const bool sendFast = server.getFsdSetup().sendInterimPositions();
ui->tvp_RenderedAircraft->configureMenuFastPositionUpdates(sendFast);
}
}
}
CSimulatorInfo CMappingComponent::getConnectedOrSelectedSimulator() const