mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 00:25:35 +08:00
Style
This commit is contained in:
@@ -28,12 +28,12 @@ namespace BlackGui
|
||||
//! Airports view
|
||||
class BLACKGUI_EXPORT CAirportView : public CViewBase<Models::CAirportListModel, BlackMisc::Aviation::CAirportList, BlackMisc::Aviation::CAirport>
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//! Constructor
|
||||
explicit CAirportView(QWidget *parent = nullptr);
|
||||
};
|
||||
}
|
||||
}
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
|
||||
@@ -56,36 +56,36 @@ namespace BlackGui
|
||||
if (BlackConfig::CBuildConfig::isDebugBuild())
|
||||
{
|
||||
if (this->m_debugActions.isEmpty()) { this->m_actions = QList<QAction *>({nullptr, nullptr}); }
|
||||
this->m_actions[0] = menuActions.addAction(this->m_actions[0], CIcons::tableSheet16(), "Test: 1k ATC online stations", CMenuAction::pathClientCom(), { this, &CAtcStationView::ps_testRequest1kAtcOnlineDummies });
|
||||
this->m_actions[1] = menuActions.addAction(this->m_actions[1], CIcons::tableSheet16(), "Test: 3k ATC online stations", CMenuAction::pathClientCom(), { this, &CAtcStationView::ps_testRequest1kAtcOnlineDummies });
|
||||
this->m_actions[0] = menuActions.addAction(this->m_actions[0], CIcons::tableSheet16(), "Test: 1k ATC online stations", CMenuAction::pathClientCom(), { this, &CAtcStationView::emitTestRequest1kAtcOnlineDummies });
|
||||
this->m_actions[1] = menuActions.addAction(this->m_actions[1], CIcons::tableSheet16(), "Test: 3k ATC online stations", CMenuAction::pathClientCom(), { this, &CAtcStationView::emitTestRequest3kAtcOnlineDummies });
|
||||
}
|
||||
|
||||
if (this->hasSelection())
|
||||
{
|
||||
if (this->m_debugActions.isEmpty()) { this->m_debugActions = QList<QAction *>({nullptr, nullptr, nullptr}); }
|
||||
|
||||
this->m_debugActions[0] = menuActions.addAction(this->m_debugActions[0], CIcons::appCockpit16(), "Tune in COM1", CMenuAction::pathClientCom(), { this, &CAtcStationView::ps_tuneInAtcCom1 });
|
||||
this->m_debugActions[1] = menuActions.addAction(this->m_debugActions[1], CIcons::appCockpit16(), "Tune in COM2", CMenuAction::pathClientCom(), { this, &CAtcStationView::ps_tuneInAtcCom2 });
|
||||
this->m_debugActions[2] = menuActions.addAction(this->m_debugActions[2], CIcons::appTextMessages16(), "Show text messages", CMenuAction::pathClientCom(), { this, &CAtcStationView::ps_requestTextMessage });
|
||||
this->m_debugActions[0] = menuActions.addAction(this->m_debugActions[0], CIcons::appCockpit16(), "Tune in COM1", CMenuAction::pathClientCom(), { this, &CAtcStationView::tuneInAtcCom1 });
|
||||
this->m_debugActions[1] = menuActions.addAction(this->m_debugActions[1], CIcons::appCockpit16(), "Tune in COM2", CMenuAction::pathClientCom(), { this, &CAtcStationView::tuneInAtcCom2 });
|
||||
this->m_debugActions[2] = menuActions.addAction(this->m_debugActions[2], CIcons::appTextMessages16(), "Show text messages", CMenuAction::pathClientCom(), { this, &CAtcStationView::requestTextMessage });
|
||||
}
|
||||
CViewBase::customMenu(menuActions);
|
||||
}
|
||||
|
||||
void CAtcStationView::ps_tuneInAtcCom1()
|
||||
void CAtcStationView::tuneInAtcCom1()
|
||||
{
|
||||
const CAtcStation s(this->selectedObject());
|
||||
if (s.getCallsign().isEmpty()) { return; }
|
||||
emit this->requestComFrequency(s.getFrequency(), CComSystem::Com1);
|
||||
}
|
||||
|
||||
void CAtcStationView::ps_tuneInAtcCom2()
|
||||
void CAtcStationView::tuneInAtcCom2()
|
||||
{
|
||||
const CAtcStation s(this->selectedObject());
|
||||
if (s.getCallsign().isEmpty()) { return; }
|
||||
emit this->requestComFrequency(s.getFrequency(), CComSystem::Com2);
|
||||
}
|
||||
|
||||
void CAtcStationView::ps_requestTextMessage()
|
||||
void CAtcStationView::requestTextMessage()
|
||||
{
|
||||
const CAtcStation s(this->selectedObject());
|
||||
if (s.getCallsign().isEmpty()) { return; }
|
||||
|
||||
@@ -44,6 +44,9 @@ namespace BlackGui
|
||||
//! Set station mode
|
||||
void setStationMode(BlackGui::Models::CAtcStationListModel::AtcStationMode stationMode);
|
||||
|
||||
//! \copydoc Models::CAtcStationListModel::changedAtcStationConnectionStatus
|
||||
void changedAtcStationConnectionStatus(const BlackMisc::Aviation::CAtcStation &station, bool added);
|
||||
|
||||
signals:
|
||||
//! Request some dummy ATC stations
|
||||
void testRequestDummyAtcOnlineStations(int number);
|
||||
@@ -54,25 +57,21 @@ namespace BlackGui
|
||||
//! Request a text message to
|
||||
void requestTextMessageWidget(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
|
||||
public slots:
|
||||
//! \copydoc Models::CAtcStationListModel::changedAtcStationConnectionStatus
|
||||
void changedAtcStationConnectionStatus(const BlackMisc::Aviation::CAtcStation &station, bool added);
|
||||
|
||||
protected:
|
||||
//! \copydoc CViewBase::customMenu
|
||||
virtual void customMenu(BlackGui::Menus::CMenuActions &menuActions) override;
|
||||
|
||||
private slots:
|
||||
void ps_testRequest1kAtcOnlineDummies() { emit this->testRequestDummyAtcOnlineStations(1000); }
|
||||
void ps_testRequest3kAtcOnlineDummies() { emit this->testRequestDummyAtcOnlineStations(3000); }
|
||||
void ps_tuneInAtcCom1();
|
||||
void ps_tuneInAtcCom2();
|
||||
void ps_requestTextMessage();
|
||||
|
||||
private:
|
||||
void emitTestRequest1kAtcOnlineDummies() { emit this->testRequestDummyAtcOnlineStations(1000); }
|
||||
void emitTestRequest3kAtcOnlineDummies() { emit this->testRequestDummyAtcOnlineStations(3000); }
|
||||
void tuneInAtcCom1();
|
||||
void tuneInAtcCom2();
|
||||
void requestTextMessage();
|
||||
|
||||
QList<QAction *> m_actions;
|
||||
QList<QAction *> m_debugActions;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace BlackGui
|
||||
|
||||
protected:
|
||||
//! \copydoc CViewBase::customMenu
|
||||
virtual void customMenu(BlackGui::Menus::CMenuActions &menuActions) override;
|
||||
virtual void customMenu(Menus::CMenuActions &menuActions) override;
|
||||
|
||||
private:
|
||||
//! Request text message for selected aircraft
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
class QWidget;
|
||||
|
||||
namespace BlackMisc { namespace Network { class CTextMessage; } }
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Views
|
||||
@@ -28,7 +27,6 @@ namespace BlackGui
|
||||
//! Airports view
|
||||
class BLACKGUI_EXPORT CTextMessageView : public CViewBase<Models::CTextMessageListModel, BlackMisc::Network::CTextMessageList, BlackMisc::Network::CTextMessage>
|
||||
{
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
explicit CTextMessageView(QWidget *parent = nullptr);
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
class QWidget;
|
||||
|
||||
namespace BlackMisc { namespace Weather { class CWindLayer; } }
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Views
|
||||
@@ -29,7 +28,6 @@ namespace BlackGui
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//! Constructor
|
||||
explicit CWindLayerView(QWidget *parent = nullptr);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user