mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
refs #393, allow to highlight a certain aircraft by blinking
* signatures in contexts * some specialized functions in aircraft list * context menus in aircraft view * default "blinking" implementation in driver common base class
This commit is contained in:
@@ -66,6 +66,60 @@ namespace BlackMisc
|
||||
return csl;
|
||||
}
|
||||
|
||||
void CSimulatedAircraftList::markAllAsNotRendered()
|
||||
{
|
||||
for (CSimulatedAircraft &aircraft : (*this))
|
||||
{
|
||||
if (!aircraft.isRendered()) { continue; }
|
||||
aircraft.setRendered(false);
|
||||
}
|
||||
}
|
||||
|
||||
int CSimulatedAircraftList::setRendered(const CCallsign &callsign, bool rendered)
|
||||
{
|
||||
int c = 0;
|
||||
for (CSimulatedAircraft &aircraft : (*this))
|
||||
{
|
||||
if (aircraft.getCallsign() != callsign) { continue; }
|
||||
aircraft.setRendered(rendered);
|
||||
c++;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
int CSimulatedAircraftList::setAircraftParts(const CCallsign &callsign, const CAircraftParts &parts)
|
||||
{
|
||||
int c = 0;
|
||||
for (CSimulatedAircraft &aircraft : (*this))
|
||||
{
|
||||
if (aircraft.getCallsign() != callsign) { continue; }
|
||||
aircraft.setParts(parts);
|
||||
aircraft.setPartsSynchronized(true);
|
||||
c++;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
bool CSimulatedAircraftList::isEnabled(const CCallsign &callsign) const
|
||||
{
|
||||
for (const CSimulatedAircraft &aircraft : (*this))
|
||||
{
|
||||
if (aircraft.getCallsign() != callsign) { continue; }
|
||||
return aircraft.isEnabled();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CSimulatedAircraftList::isRendered(const CCallsign &callsign) const
|
||||
{
|
||||
for (const CSimulatedAircraft &aircraft : (*this))
|
||||
{
|
||||
if (aircraft.getCallsign() != callsign) { continue; }
|
||||
return aircraft.isRendered();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
CAircraftList CSimulatedAircraftList::toAircraftList() const
|
||||
{
|
||||
CAircraftList al;
|
||||
|
||||
@@ -46,6 +46,21 @@ namespace BlackMisc
|
||||
//! Callsigns of aircraft with synchronized parts
|
||||
BlackMisc::Aviation::CCallsignList getCallsignsWithSyncronizedParts() const;
|
||||
|
||||
//! Mark all aircraft as unrendered
|
||||
void markAllAsNotRendered();
|
||||
|
||||
//! Mark as rendered
|
||||
int setRendered(const BlackMisc::Aviation::CCallsign &callsign, bool rendered);
|
||||
|
||||
//! Set aircraft parts
|
||||
int setAircraftParts(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CAircraftParts &parts);
|
||||
|
||||
//! Enabled?
|
||||
bool isEnabled(const BlackMisc::Aviation::CCallsign &callsign) const;
|
||||
|
||||
//! Rendered?
|
||||
bool isRendered(const BlackMisc::Aviation::CCallsign &callsign) const;
|
||||
|
||||
//! \copydoc CValueObject::toQVariant
|
||||
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user