mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-02 23:35:40 +08:00
Style
This commit is contained in:
@@ -91,7 +91,7 @@ namespace BlackCore
|
||||
static IContextApplication *create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &connection);
|
||||
|
||||
//! Destructor
|
||||
virtual ~IContextApplication() {}
|
||||
virtual ~IContextApplication() override {}
|
||||
|
||||
signals:
|
||||
//! A component changes
|
||||
|
||||
@@ -147,10 +147,7 @@ namespace BlackCore
|
||||
out << content;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
CIdentifier CContextApplication::registerApplication(const CIdentifier &application)
|
||||
|
||||
@@ -12,18 +12,18 @@
|
||||
#ifndef BLACKCORE_CONTEXT_CONTEXTAPPLICATION_PROXY_H
|
||||
#define BLACKCORE_CONTEXT_CONTEXTAPPLICATION_PROXY_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include "blackcore/context/contextapplication.h"
|
||||
#include "blackcore/corefacadeconfig.h"
|
||||
#include "blackmisc/identifier.h"
|
||||
#include "blackmisc/identifierlist.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
#include "blackmisc/valuecache.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QTimer>
|
||||
|
||||
class QDBusConnection;
|
||||
|
||||
namespace BlackMisc
|
||||
@@ -46,7 +46,7 @@ namespace BlackCore
|
||||
|
||||
public:
|
||||
//! Destructor
|
||||
virtual ~CContextApplicationProxy() {}
|
||||
virtual ~CContextApplicationProxy() override {}
|
||||
|
||||
public slots:
|
||||
//! @{
|
||||
|
||||
@@ -49,17 +49,17 @@ namespace BlackGui
|
||||
{
|
||||
QWidget *w = qobject_cast<QWidget *>(QObject::sender());
|
||||
if (!w) { return; }
|
||||
if (!sGui->getIContextOwnAircraft()) { return; }
|
||||
if (!sGui || sGui->isShuttingDown() || !sGui->getIContextOwnAircraft()) { return; }
|
||||
CTransponder::TransponderMode mode;
|
||||
if (this->m_ledStandby.data() == w)
|
||||
if (m_ledStandby.data() == w)
|
||||
{
|
||||
mode = CTransponder::StateStandby;
|
||||
}
|
||||
else if (this->m_ledIdent.data() == w)
|
||||
else if (m_ledIdent.data() == w)
|
||||
{
|
||||
mode = CTransponder::StateIdent;
|
||||
}
|
||||
else if (this->m_ledModes.data() == w)
|
||||
else if (m_ledModes.data() == w)
|
||||
{
|
||||
mode = CTransponder::ModeC;
|
||||
}
|
||||
@@ -86,9 +86,9 @@ namespace BlackGui
|
||||
ledLayout->addWidget(m_ledStandby.data());
|
||||
ledLayout->addWidget(m_ledModes.data());
|
||||
ledLayout->addWidget(m_ledIdent.data());
|
||||
connect(this->m_ledIdent.data(), &CLedWidget::clicked, this, &CCockpitTransponderModeLedsComponent::ps_onLedClicked);
|
||||
connect(this->m_ledModes.data(), &CLedWidget::clicked, this, &CCockpitTransponderModeLedsComponent::ps_onLedClicked);
|
||||
connect(this->m_ledStandby.data(), &CLedWidget::clicked, this, &CCockpitTransponderModeLedsComponent::ps_onLedClicked);
|
||||
connect(m_ledIdent.data(), &CLedWidget::clicked, this, &CCockpitTransponderModeLedsComponent::onLedClicked);
|
||||
connect(m_ledModes.data(), &CLedWidget::clicked, this, &CCockpitTransponderModeLedsComponent::onLedClicked);
|
||||
connect(m_ledStandby.data(), &CLedWidget::clicked, this, &CCockpitTransponderModeLedsComponent::onLedClicked);
|
||||
this->setLayout(ledLayout);
|
||||
|
||||
// if context is already available set mode
|
||||
|
||||
@@ -23,13 +23,10 @@
|
||||
#include <QObject>
|
||||
#include <QScopedPointer>
|
||||
|
||||
class QWidget;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
|
||||
//! LEDs representing transponder mode state
|
||||
class BLACKGUI_EXPORT CCockpitTransponderModeLedsComponent :
|
||||
public QFrame,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>640</width>
|
||||
<height>400</height>
|
||||
<height>412</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -58,7 +58,7 @@
|
||||
<property name="verticalSpacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<item row="0" column="1" alignment="Qt::AlignLeft">
|
||||
<widget class="BlackGui::Components::CSimulatorSelector" name="comp_SimulatorSelector"/>
|
||||
</item>
|
||||
<item row="4" column="1" colspan="4">
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <QString>
|
||||
|
||||
class QPoint;
|
||||
class QWidget;
|
||||
|
||||
namespace Ui { class CInfoBarStatusComponent; }
|
||||
namespace BlackGui
|
||||
@@ -41,10 +40,7 @@ namespace BlackGui
|
||||
//!Destructor
|
||||
virtual ~CInfoBarStatusComponent();
|
||||
|
||||
//! Init the LEDs
|
||||
void initLeds();
|
||||
|
||||
//! DBus used
|
||||
//! DBus used?
|
||||
void setDBusStatus(bool dbus);
|
||||
|
||||
//! Tooltip for DBus
|
||||
|
||||
@@ -34,9 +34,6 @@
|
||||
#include <QScopedPointer>
|
||||
#include <QString>
|
||||
|
||||
class QTimer;
|
||||
class QWidget;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Simulation
|
||||
@@ -219,7 +216,7 @@ namespace BlackGui
|
||||
bool m_autoPopupWizard = false; //!< automatically popup wizard if mapping is needed
|
||||
bool m_visible = false; //!< is this component selected?
|
||||
bool m_updatePilotOnServerChanges = true;
|
||||
const QIcon m_iconPlay {":/famfamfam/icons/famfamfam/icons/silk/control_play_blue.png"};
|
||||
const QIcon m_iconPlay {":/famfamfam/icons/famfamfam/icons/silk/control_play_blue.png"};
|
||||
const QIcon m_iconPause {":/famfamfam/icons/famfamfam/icons/silk/control_pause_blue.png"};
|
||||
const int LogoffIntervalSeconds = 20; //!< time before logoff
|
||||
QTimer m_logoffCountdownTimer; //!< timer for logoff countdown
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
#include <QTimer>
|
||||
#include <QScopedPointer>
|
||||
|
||||
class QWidget;
|
||||
|
||||
namespace Ui { class CRegisterComponent; }
|
||||
namespace BlackGui
|
||||
{
|
||||
@@ -26,8 +24,7 @@ namespace BlackGui
|
||||
{
|
||||
//! Show registered applications (registered with core) in the GUI
|
||||
//! \sa BlackCore::Context::IContextApplication::getRegisteredApplications
|
||||
class BLACKGUI_EXPORT CRegisterComponent :
|
||||
public QFrame
|
||||
class BLACKGUI_EXPORT CRegisterComponent : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include <QTimer>
|
||||
|
||||
class QStringList;
|
||||
class QWidget;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
|
||||
@@ -41,6 +41,5 @@ namespace BlackGui
|
||||
(void)QT_TRANSLATE_NOOP("ModelIdentifierList", "lcl m.");
|
||||
(void)QT_TRANSLATE_NOOP("ModelIdentifierList", "same p.");
|
||||
}
|
||||
|
||||
} // class
|
||||
} // namespace
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
#include "blackmisc/identifier.h"
|
||||
#include "blackmisc/identifierlist.h"
|
||||
|
||||
class QObject;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Models
|
||||
@@ -27,7 +25,6 @@ namespace BlackGui
|
||||
class BLACKGUI_EXPORT CIdentifierListModel : public CListModelBase<BlackMisc::CIdentifier, BlackMisc::CIdentifierList>
|
||||
{
|
||||
public:
|
||||
|
||||
//! Constructor
|
||||
explicit CIdentifierListModel(QObject *parent = nullptr);
|
||||
|
||||
|
||||
@@ -30,19 +30,19 @@ namespace BlackGui
|
||||
CAtcStationView::CAtcStationView(QWidget *parent) : CViewWithCallsignObjects(parent)
|
||||
{
|
||||
this->standardInit(new CAtcStationListModel(CAtcStationListModel::StationsOnline, this));
|
||||
this->m_menus |= (MenuClear | MenuRefresh);
|
||||
m_menus |= (MenuClear | MenuRefresh);
|
||||
}
|
||||
|
||||
void CAtcStationView::setStationMode(CAtcStationListModel::AtcStationMode stationMode)
|
||||
{
|
||||
Q_ASSERT(this->m_model);
|
||||
this->m_model->setStationMode(stationMode);
|
||||
Q_ASSERT(m_model);
|
||||
m_model->setStationMode(stationMode);
|
||||
this->setSortIndicator();
|
||||
}
|
||||
|
||||
void CAtcStationView::changedAtcStationConnectionStatus(const CAtcStation &station, bool added)
|
||||
{
|
||||
this->m_model->changedAtcStationConnectionStatus(station, added);
|
||||
m_model->changedAtcStationConnectionStatus(station, added);
|
||||
|
||||
// resize the first, rest will be resized with normal updates
|
||||
if (this->rowCount() == 1)
|
||||
@@ -55,18 +55,18 @@ 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::emitTestRequest1kAtcOnlineDummies });
|
||||
this->m_actions[1] = menuActions.addAction(this->m_actions[1], CIcons::tableSheet16(), "Test: 3k ATC online stations", CMenuAction::pathClientCom(), { this, &CAtcStationView::emitTestRequest3kAtcOnlineDummies });
|
||||
if (m_debugActions.isEmpty()) { m_actions = QList<QAction *>({nullptr, nullptr}); }
|
||||
m_actions[0] = menuActions.addAction(m_actions[0], CIcons::tableSheet16(), "Test: 1k ATC online stations", CMenuAction::pathClientCom(), { this, &CAtcStationView::emitTestRequest1kAtcOnlineDummies });
|
||||
m_actions[1] = menuActions.addAction(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}); }
|
||||
if (m_debugActions.isEmpty()) { 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::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 });
|
||||
m_debugActions[0] = menuActions.addAction(m_debugActions[0], CIcons::appCockpit16(), "Tune in COM1", CMenuAction::pathClientCom(), { this, &CAtcStationView::tuneInAtcCom1 });
|
||||
m_debugActions[1] = menuActions.addAction(m_debugActions[1], CIcons::appCockpit16(), "Tune in COM2", CMenuAction::pathClientCom(), { this, &CAtcStationView::tuneInAtcCom2 });
|
||||
m_debugActions[2] = menuActions.addAction(m_debugActions[2], CIcons::appTextMessages16(), "Show text messages", CMenuAction::pathClientCom(), { this, &CAtcStationView::requestTextMessage });
|
||||
}
|
||||
CViewBase::customMenu(menuActions);
|
||||
}
|
||||
|
||||
@@ -17,10 +17,7 @@
|
||||
#include "blackgui/views/viewbase.h"
|
||||
#include "blackmisc/identifierlist.h"
|
||||
|
||||
class QWidget;
|
||||
|
||||
namespace BlackMisc { class CIdentifier; }
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Views
|
||||
@@ -28,9 +25,7 @@ namespace BlackGui
|
||||
//! Originator servers
|
||||
class BLACKGUI_EXPORT CIdentifierView : public CViewBase<Models::CIdentifierListModel, BlackMisc::CIdentifierList, BlackMisc::CIdentifier>
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//! Constructor
|
||||
explicit CIdentifierView(QWidget *parent = nullptr);
|
||||
};
|
||||
|
||||
@@ -382,7 +382,7 @@ namespace BlackGui
|
||||
CViewBaseNonTemplate(QWidget *parent);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CViewBaseNonTemplate();
|
||||
virtual ~CViewBaseNonTemplate() override;
|
||||
|
||||
//! Method creating the menu
|
||||
//! \remarks override this method to contribute to the menu
|
||||
|
||||
@@ -82,22 +82,22 @@ namespace BlackMisc
|
||||
bool isInNormalSendingMode() const;
|
||||
|
||||
//! Standby?
|
||||
bool isInStandby() const { return StateStandby == m_transponderMode; }
|
||||
bool isInStandby() const { return StateStandby == this->getTransponderMode(); }
|
||||
|
||||
//! Standby?
|
||||
bool isIdentifying() const { return StateIdent == m_transponderMode; }
|
||||
bool isIdentifying() const { return StateIdent == this->getTransponderMode(); }
|
||||
|
||||
//! Transponder mode as string
|
||||
void setModeAsString(const QString &mode) { this->setTransponderMode(CTransponder::modeFromString(mode)); }
|
||||
|
||||
//! Transponder mode
|
||||
TransponderMode getTransponderMode() const { return this->m_transponderMode; }
|
||||
TransponderMode getTransponderMode() const { return static_cast<TransponderMode>(m_transponderMode); }
|
||||
|
||||
//! Transponder mode as string
|
||||
static const QString &modeAsString(TransponderMode mode);
|
||||
|
||||
//! Transponder code
|
||||
int getTransponderCode() const { return this->m_transponderCode; }
|
||||
int getTransponderCode() const { return m_transponderCode; }
|
||||
|
||||
//! Transponder code
|
||||
QString getTransponderCodeFormatted() const;
|
||||
@@ -106,7 +106,7 @@ namespace BlackMisc
|
||||
QString getTransponderCodeAndModeFormatted() const;
|
||||
|
||||
//! Set transponder code
|
||||
void setTransponderCode(int transponderCode) { this->m_transponderCode = transponderCode; }
|
||||
void setTransponderCode(int transponderCode) { m_transponderCode = transponderCode; }
|
||||
|
||||
//! Set transponder code
|
||||
void setTransponderCode(const QString &transponderCode);
|
||||
@@ -115,16 +115,16 @@ namespace BlackMisc
|
||||
static TransponderMode modeFromString(const QString &modeString);
|
||||
|
||||
//! Set transponder mode
|
||||
void setTransponderMode(TransponderMode mode) { this->m_transponderMode = mode ; }
|
||||
void setTransponderMode(TransponderMode mode) { m_transponderMode = static_cast<int>(mode); }
|
||||
|
||||
//! Set emergency
|
||||
void setEmergency() { this->m_transponderCode = 7700; }
|
||||
void setEmergency() { m_transponderCode = 7700; }
|
||||
|
||||
//! Set VFR
|
||||
void setVFR() { this->m_transponderCode = 7000; }
|
||||
void setVFR() { m_transponderCode = 7000; }
|
||||
|
||||
//! Set IFR
|
||||
void setIFR() { this->m_transponderCode = 2000; }
|
||||
void setIFR() { m_transponderCode = 2000; }
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
@@ -146,7 +146,7 @@ namespace BlackMisc
|
||||
|
||||
private:
|
||||
//! Default value?
|
||||
bool isDefaultValue() const { return this->m_transponderCode == 0; }
|
||||
bool isDefaultValue() const { return m_transponderCode == 0; }
|
||||
|
||||
int m_transponderCode; //!< Transponder code
|
||||
TransponderMode m_transponderMode; //!< Transponder mode
|
||||
|
||||
@@ -28,8 +28,8 @@ namespace BlackMisc
|
||||
*/
|
||||
class BLACKMISC_EXPORT CIdentifierList :
|
||||
public CSequence<BlackMisc::CIdentifier>,
|
||||
public BlackMisc::Mixin::MetaType<CIdentifierList>,
|
||||
public BlackMisc::ITimestampObjectList<CIdentifier, CIdentifierList>
|
||||
public Mixin::MetaType<CIdentifierList>,
|
||||
public ITimestampObjectList<CIdentifier, CIdentifierList>
|
||||
{
|
||||
public:
|
||||
BLACKMISC_DECLARE_USING_MIXIN_METATYPE(CIdentifierList)
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace BlackSimPlugin
|
||||
|
||||
void CSimulatorXPlaneConfigWindow::settingsAccepted()
|
||||
{
|
||||
QString currentAddress = m_xswiftbusServerSetting.getThreadLocal();
|
||||
const QString currentAddress = m_xswiftbusServerSetting.getThreadLocal();
|
||||
if (currentAddress != ui->comp_SettingsXSwiftBus->getDBusAddress())
|
||||
{
|
||||
m_xswiftbusServerSetting.set(ui->comp_SettingsXSwiftBus->getDBusAddress());
|
||||
|
||||
Reference in New Issue
Block a user