mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-15 09:15:34 +08:00
Style
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user