mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 11:05:33 +08:00
Fix for context menu of aircraft view as reported in slack
* reported: https://swift-project.slack.com/archives/G7GD2UP9C/p1533749013000483 * logic moved to view * removed no longer required code
This commit is contained in:
@@ -53,7 +53,6 @@ namespace BlackGui
|
||||
|
||||
connect(ui->tvp_AircraftInRange, &CSimulatedAircraftView::modelDataChangedDigest, this, &CAircraftComponent::onRowCountChanged);
|
||||
connect(ui->tvp_AircraftInRange, &CSimulatedAircraftView::requestTextMessageWidget, this, &CAircraftComponent::requestTextMessageWidget);
|
||||
connect(ui->tvp_AircraftInRange, &CSimulatedAircraftView::requestHighlightInSimulator, this, &CAircraftComponent::onMenuHighlightInSimulator);
|
||||
connect(ui->tvp_AirportsInRange, &CSimulatedAircraftView::modelDataChangedDigest, this, &CAircraftComponent::onRowCountChanged);
|
||||
connect(sGui->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CAircraftComponent::onConnectionStatusChanged);
|
||||
connect(&m_updateTimer, &QTimer::timeout, this, &CAircraftComponent::update);
|
||||
@@ -166,14 +165,6 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
void CAircraftComponent::onMenuHighlightInSimulator(const CSimulatedAircraft &aircraft)
|
||||
{
|
||||
if (sGui->getIContextSimulator())
|
||||
{
|
||||
sGui->getIContextSimulator()->highlightAircraft(aircraft, true, IContextSimulator::HighlightTime());
|
||||
}
|
||||
}
|
||||
|
||||
void CAircraftComponent::onSettingsChanged()
|
||||
{
|
||||
const CViewUpdateSettings settings = m_settings.get();
|
||||
|
||||
@@ -85,9 +85,6 @@ namespace BlackGui
|
||||
//! Connection status has been changed
|
||||
void onConnectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to);
|
||||
|
||||
//! Highlight in simulator
|
||||
void onMenuHighlightInSimulator(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
|
||||
|
||||
//! Settings have been changed
|
||||
void onSettingsChanged();
|
||||
|
||||
|
||||
@@ -93,12 +93,6 @@ namespace BlackGui
|
||||
connect(ui->tvp_RenderedAircraft, &CSimulatedAircraftView::requestUpdate, this, &CMappingComponent::tokenBucketUpdate);
|
||||
connect(ui->tvp_RenderedAircraft, &CSimulatedAircraftView::requestTextMessageWidget, this, &CMappingComponent::requestTextMessageWidget);
|
||||
|
||||
connect(ui->tvp_RenderedAircraft, &CSimulatedAircraftView::requestEnableAircraft, this, &CMappingComponent::onMenuToggleEnableAircraft);
|
||||
connect(ui->tvp_RenderedAircraft, &CSimulatedAircraftView::requestFastPositionUpdates, this, &CMappingComponent::onMenuChangeFastPositionUpdates);
|
||||
connect(ui->tvp_RenderedAircraft, &CSimulatedAircraftView::requestHighlightInSimulator, this, &CMappingComponent::onMenuHighlightInSimulator);
|
||||
connect(ui->tvp_RenderedAircraft, &CSimulatedAircraftView::requestFollowInSimulator, this, &CMappingComponent::onMenuFollowAircraftInSimulator);
|
||||
connect(ui->tvp_RenderedAircraft, &CSimulatedAircraftView::requestSupportingGndFlag, this, &CMappingComponent::onMenuSupportGndFLag);
|
||||
|
||||
connect(ui->pb_SaveAircraft, &QPushButton::clicked, this, &CMappingComponent::onSaveAircraft);
|
||||
connect(ui->pb_ResetAircraft, &QPushButton::clicked, this, &CMappingComponent::onResetAircraft);
|
||||
connect(ui->pb_LoadModels, &QPushButton::clicked, this, &CMappingComponent::onModelsUpdateRequested);
|
||||
@@ -406,38 +400,6 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
void CMappingComponent::onMenuChangeFastPositionUpdates(const CSimulatedAircraft &aircraft)
|
||||
{
|
||||
if (sGui && sGui->getIContextNetwork())
|
||||
{
|
||||
sGui->getIContextNetwork()->updateFastPositionEnabled(aircraft.getCallsign(), aircraft.fastPositionUpdates());
|
||||
}
|
||||
}
|
||||
|
||||
void CMappingComponent::onMenuFollowAircraftInSimulator(const CSimulatedAircraft &aircraft)
|
||||
{
|
||||
if (sGui && sGui->getIContextSimulator())
|
||||
{
|
||||
sGui->getIContextSimulator()->followAircraft(aircraft.getCallsign());
|
||||
}
|
||||
}
|
||||
|
||||
void CMappingComponent::onMenuSupportGndFLag(const CSimulatedAircraft &aircraft)
|
||||
{
|
||||
if (sGui && sGui->getIContextNetwork())
|
||||
{
|
||||
sGui->getIContextNetwork()->updateAircraftSupportingGndFLag(aircraft.getCallsign(), aircraft.isSupportingGndFlag());
|
||||
}
|
||||
}
|
||||
|
||||
void CMappingComponent::onMenuHighlightInSimulator(const CSimulatedAircraft &aircraft)
|
||||
{
|
||||
if (sGui && sGui->getIContextSimulator())
|
||||
{
|
||||
sGui->getIContextSimulator()->highlightAircraft(aircraft, true, IContextSimulator::HighlightTime());
|
||||
}
|
||||
}
|
||||
|
||||
CSimulatorInfo CMappingComponent::getConnectedOrSelectedSimulator() const
|
||||
{
|
||||
if (this->isSimulatorAvailable()) { return sGui->getIContextSimulator()->isSimulatorAvailable(); }
|
||||
@@ -458,8 +420,8 @@ namespace BlackGui
|
||||
QList<int> newSizes({0, 0});
|
||||
if (show)
|
||||
{
|
||||
newSizes[0] = total * 0.8;
|
||||
newSizes[1] = total * 0.2;
|
||||
newSizes[0] = qRound(total * 0.8);
|
||||
newSizes[1] = qRound(total * 0.2);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -476,14 +438,6 @@ namespace BlackGui
|
||||
Q_UNUSED(message);
|
||||
}
|
||||
|
||||
void CMappingComponent::onMenuToggleEnableAircraft(const CSimulatedAircraft &aircraft)
|
||||
{
|
||||
if (sGui->getIContextNetwork())
|
||||
{
|
||||
sGui->getIContextNetwork()->updateAircraftEnabled(aircraft.getCallsign(), aircraft.isEnabled());
|
||||
}
|
||||
}
|
||||
|
||||
void CMappingComponent::onTabWidgetChanged(int index)
|
||||
{
|
||||
Q_UNUSED(index);
|
||||
|
||||
@@ -126,24 +126,9 @@ namespace BlackGui
|
||||
//! Connection status has been changed
|
||||
void onConnectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to);
|
||||
|
||||
//! Fast position updates onf/off
|
||||
void onMenuChangeFastPositionUpdates(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
|
||||
|
||||
//! Follow aircrft in simulator
|
||||
void onMenuFollowAircraftInSimulator(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
|
||||
|
||||
//! Support gnd.flag
|
||||
void onMenuSupportGndFLag(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
|
||||
|
||||
//! Enable / disable aircraft
|
||||
void onMenuToggleEnableAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
|
||||
|
||||
//! Widget changed
|
||||
void onTabWidgetChanged(int index);
|
||||
|
||||
//! Highlight in simulator
|
||||
void onMenuHighlightInSimulator(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
|
||||
|
||||
//! Selected or connected simulator
|
||||
BlackMisc::Simulation::CSimulatorInfo getConnectedOrSelectedSimulator() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user