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:
Klaus Basan
2015-03-23 19:50:15 +01:00
parent 66da4d7353
commit 70670b74c6
38 changed files with 557 additions and 78 deletions

View File

@@ -32,6 +32,13 @@ namespace BlackGui
this->setSortIndicator();
}
void CSimulatedAircraftView::configureMenu(bool menuHighlight, bool menuEnable, bool menufastPositionUpdates)
{
this->m_withMenuEnable = menuEnable;
this->m_withMenuFastPosition = menufastPositionUpdates;
this->m_withMenuHighlight = menuHighlight;
}
void CSimulatedAircraftView::customMenu(QMenu &menu) const
{
if (BlackMisc::CProject::isDebugBuild())
@@ -44,8 +51,9 @@ namespace BlackGui
CSimulatedAircraft aircraft(selectedObject());
Q_ASSERT(!aircraft.getCallsign().isEmpty());
menu.addAction(CIcons::appTextMessages16(), "Show text messages", this, SLOT(ps_requestTextMessage()));
menu.addAction(CIcons::appAircrafts16(), aircraft.isEnabled() ? "Disable aircraft" : "Enabled aircraft", this, SLOT(ps_enableAircraft()));
menu.addAction(CIcons::globe16(), aircraft.fastPositionUpdates() ? "Normal updates" : "Fast position updates", this, SLOT(ps_fastPositionUpdates()));
if (m_withMenuEnable) { menu.addAction(CIcons::appAircrafts16(), aircraft.isEnabled() ? "Disable aircraft" : "Enabled aircraft", this, SLOT(ps_enableAircraft())); }
if (m_withMenuHighlight) { menu.addAction(CIcons::appSimulator16(), "Highlight in simulator", this, SLOT(ps_highlightInSimulator())); }
if (m_withMenuFastPosition) { menu.addAction(CIcons::globe16(), aircraft.fastPositionUpdates() ? "Normal updates" : "Fast position updates", this, SLOT(ps_fastPositionUpdates())); }
menu.addSeparator();
}
CViewBase::customMenu(menu);
@@ -74,5 +82,12 @@ namespace BlackGui
emit requestFastPositionUpdates(aircraft);
}
void CSimulatedAircraftView::ps_highlightInSimulator()
{
CSimulatedAircraft aircraft(selectedObject());
if (aircraft.getCallsign().isEmpty()) { return; }
emit requestHighlightInSimulator(aircraft);
}
} // ns
} // ns