10 #include "gui/menus/menuaction.h"
15 using namespace swift::config;
17 using namespace swift::misc::aviation;
19 using namespace swift::gui::menus;
32 m_model->setStationMode(stationMode);
38 m_model->changedAtcStationConnectionStatus(station, added);
47 if (CBuildConfig::isDebugBuild())
49 if (m_debugActions.isEmpty()) { m_debugActions = QList<QAction *>({
nullptr,
nullptr }); }
50 m_debugActions[0] = menuActions.
addAction(m_debugActions[0], CIcons::tableSheet16(),
51 "Test: 1k ATC online stations", CMenuAction::pathClientCom(),
52 {
this, &CAtcStationView::emitTestRequest1kAtcOnlineDummies });
53 m_debugActions[1] = menuActions.
addAction(m_debugActions[1], CIcons::tableSheet16(),
54 "Test: 3k ATC online stations", CMenuAction::pathClientCom(),
55 {
this, &CAtcStationView::emitTestRequest3kAtcOnlineDummies });
60 if (m_actions.isEmpty()) { m_actions = QList<QAction *>({
nullptr,
nullptr,
nullptr }); }
63 menuActions.
addAction(m_actions[0], CIcons::appCockpit16(),
"Tune in COM1",
64 CMenuAction::pathClientCom(), {
this, &CAtcStationView::tuneInAtcCom1 });
66 menuActions.
addAction(m_actions[1], CIcons::appCockpit16(),
"Tune in COM2",
67 CMenuAction::pathClientCom(), {
this, &CAtcStationView::tuneInAtcCom2 });
69 menuActions.
addAction(m_actions[2], CIcons::appTextMessages16(),
"Show text messages",
70 CMenuAction::pathClientCom(), {
this, &CAtcStationView::requestTextMessage });
75 void CAtcStationView::tuneInAtcCom1()
78 if (s.getCallsign().isEmpty()) {
return; }
82 void CAtcStationView::tuneInAtcCom2()
85 if (s.getCallsign().isEmpty()) {
return; }
89 void CAtcStationView::requestTextMessage()
92 if (s.getCallsign().isEmpty()) {
return; }
AtcStationMode
What kind of stations.
void setStationMode(swift::gui::models::CAtcStationListModel::AtcStationMode stationMode)
Set station mode.
virtual void customMenu(swift::gui::menus::CMenuActions &menuActions)
Method creating the menu.
void requestTextMessageWidget(const swift::misc::aviation::CCallsign &callsign)
Request a text message to.
void changedAtcStationConnectionStatus(const swift::misc::aviation::CAtcStation &station, bool added)
Used to quickly update single station (better response for the user)
void requestComFrequency(const swift::misc::physical_quantities::CFrequency &frequency, swift::misc::aviation::CComSystem::ComUnit unit)
Request COM frequency.
void standardInit(ModelClass *model=nullptr)
Standard initialization.
ModelClass * m_model
corresponding model
void setSortIndicator()
Set the search indicator based on model.
virtual int rowCount() const
Elements in container.
ObjectType selectedObject() const
Selected object (or default)
virtual void customMenu(menus::CMenuActions &menuActions)
Method creating the menu.
Menu m_menus
Default menu settings.
virtual void fullResizeToContents()
Full resizing to content, might be slow.
@ MenuClear
allow clearing the view via menu
@ MenuRefresh
allow refreshing the view via menu
bool hasSelection() const
Selection (selected rows)
Base class for views with DB objects.
Value object encapsulating information about an ATC station.
Models to be used with views, mainly QTableView.
Views, mainly QTableView.
Free functions in swift::misc.