This commit is contained in:
Klaus Basan
2018-08-12 02:40:07 +02:00
parent 9894ec59b8
commit 9bb3f98489
18 changed files with 45 additions and 71 deletions

View File

@@ -91,7 +91,7 @@ namespace BlackCore
static IContextApplication *create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &connection); static IContextApplication *create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &connection);
//! Destructor //! Destructor
virtual ~IContextApplication() {} virtual ~IContextApplication() override {}
signals: signals:
//! A component changes //! A component changes

View File

@@ -147,10 +147,7 @@ namespace BlackCore
out << content; out << content;
return true; return true;
} }
else return false;
{
return false;
}
} }
CIdentifier CContextApplication::registerApplication(const CIdentifier &application) CIdentifier CContextApplication::registerApplication(const CIdentifier &application)

View File

@@ -12,18 +12,18 @@
#ifndef BLACKCORE_CONTEXT_CONTEXTAPPLICATION_PROXY_H #ifndef BLACKCORE_CONTEXT_CONTEXTAPPLICATION_PROXY_H
#define BLACKCORE_CONTEXT_CONTEXTAPPLICATION_PROXY_H #define BLACKCORE_CONTEXT_CONTEXTAPPLICATION_PROXY_H
#include <QObject>
#include <QString>
#include <QStringList>
#include "blackcore/blackcoreexport.h" #include "blackcore/blackcoreexport.h"
#include "blackcore/context/contextapplication.h" #include "blackcore/context/contextapplication.h"
#include "blackcore/corefacadeconfig.h" #include "blackcore/corefacadeconfig.h"
#include "blackmisc/identifier.h"
#include "blackmisc/identifierlist.h" #include "blackmisc/identifierlist.h"
#include "blackmisc/statusmessage.h" #include "blackmisc/statusmessage.h"
#include "blackmisc/valuecache.h" #include "blackmisc/valuecache.h"
#include <QObject>
#include <QString>
#include <QStringList>
#include <QTimer>
class QDBusConnection; class QDBusConnection;
namespace BlackMisc namespace BlackMisc
@@ -46,7 +46,7 @@ namespace BlackCore
public: public:
//! Destructor //! Destructor
virtual ~CContextApplicationProxy() {} virtual ~CContextApplicationProxy() override {}
public slots: public slots:
//! @{ //! @{

View File

@@ -49,17 +49,17 @@ namespace BlackGui
{ {
QWidget *w = qobject_cast<QWidget *>(QObject::sender()); QWidget *w = qobject_cast<QWidget *>(QObject::sender());
if (!w) { return; } if (!w) { return; }
if (!sGui->getIContextOwnAircraft()) { return; } if (!sGui || sGui->isShuttingDown() || !sGui->getIContextOwnAircraft()) { return; }
CTransponder::TransponderMode mode; CTransponder::TransponderMode mode;
if (this->m_ledStandby.data() == w) if (m_ledStandby.data() == w)
{ {
mode = CTransponder::StateStandby; mode = CTransponder::StateStandby;
} }
else if (this->m_ledIdent.data() == w) else if (m_ledIdent.data() == w)
{ {
mode = CTransponder::StateIdent; mode = CTransponder::StateIdent;
} }
else if (this->m_ledModes.data() == w) else if (m_ledModes.data() == w)
{ {
mode = CTransponder::ModeC; mode = CTransponder::ModeC;
} }
@@ -86,9 +86,9 @@ namespace BlackGui
ledLayout->addWidget(m_ledStandby.data()); ledLayout->addWidget(m_ledStandby.data());
ledLayout->addWidget(m_ledModes.data()); ledLayout->addWidget(m_ledModes.data());
ledLayout->addWidget(m_ledIdent.data()); ledLayout->addWidget(m_ledIdent.data());
connect(this->m_ledIdent.data(), &CLedWidget::clicked, this, &CCockpitTransponderModeLedsComponent::ps_onLedClicked); connect(m_ledIdent.data(), &CLedWidget::clicked, this, &CCockpitTransponderModeLedsComponent::onLedClicked);
connect(this->m_ledModes.data(), &CLedWidget::clicked, this, &CCockpitTransponderModeLedsComponent::ps_onLedClicked); connect(m_ledModes.data(), &CLedWidget::clicked, this, &CCockpitTransponderModeLedsComponent::onLedClicked);
connect(this->m_ledStandby.data(), &CLedWidget::clicked, this, &CCockpitTransponderModeLedsComponent::ps_onLedClicked); connect(m_ledStandby.data(), &CLedWidget::clicked, this, &CCockpitTransponderModeLedsComponent::onLedClicked);
this->setLayout(ledLayout); this->setLayout(ledLayout);
// if context is already available set mode // if context is already available set mode

View File

@@ -23,13 +23,10 @@
#include <QObject> #include <QObject>
#include <QScopedPointer> #include <QScopedPointer>
class QWidget;
namespace BlackGui namespace BlackGui
{ {
namespace Components namespace Components
{ {
//! LEDs representing transponder mode state //! LEDs representing transponder mode state
class BLACKGUI_EXPORT CCockpitTransponderModeLedsComponent : class BLACKGUI_EXPORT CCockpitTransponderModeLedsComponent :
public QFrame, public QFrame,

View File

@@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>640</width> <width>640</width>
<height>400</height> <height>412</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@@ -58,7 +58,7 @@
<property name="verticalSpacing"> <property name="verticalSpacing">
<number>10</number> <number>10</number>
</property> </property>
<item row="0" column="1"> <item row="0" column="1" alignment="Qt::AlignLeft">
<widget class="BlackGui::Components::CSimulatorSelector" name="comp_SimulatorSelector"/> <widget class="BlackGui::Components::CSimulatorSelector" name="comp_SimulatorSelector"/>
</item> </item>
<item row="4" column="1" colspan="4"> <item row="4" column="1" colspan="4">

View File

@@ -22,7 +22,6 @@
#include <QString> #include <QString>
class QPoint; class QPoint;
class QWidget;
namespace Ui { class CInfoBarStatusComponent; } namespace Ui { class CInfoBarStatusComponent; }
namespace BlackGui namespace BlackGui
@@ -41,10 +40,7 @@ namespace BlackGui
//!Destructor //!Destructor
virtual ~CInfoBarStatusComponent(); virtual ~CInfoBarStatusComponent();
//! Init the LEDs //! DBus used?
void initLeds();
//! DBus used
void setDBusStatus(bool dbus); void setDBusStatus(bool dbus);
//! Tooltip for DBus //! Tooltip for DBus

View File

@@ -34,9 +34,6 @@
#include <QScopedPointer> #include <QScopedPointer>
#include <QString> #include <QString>
class QTimer;
class QWidget;
namespace BlackMisc namespace BlackMisc
{ {
namespace Simulation namespace Simulation
@@ -219,7 +216,7 @@ namespace BlackGui
bool m_autoPopupWizard = false; //!< automatically popup wizard if mapping is needed bool m_autoPopupWizard = false; //!< automatically popup wizard if mapping is needed
bool m_visible = false; //!< is this component selected? bool m_visible = false; //!< is this component selected?
bool m_updatePilotOnServerChanges = true; 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 QIcon m_iconPause {":/famfamfam/icons/famfamfam/icons/silk/control_pause_blue.png"};
const int LogoffIntervalSeconds = 20; //!< time before logoff const int LogoffIntervalSeconds = 20; //!< time before logoff
QTimer m_logoffCountdownTimer; //!< timer for logoff countdown QTimer m_logoffCountdownTimer; //!< timer for logoff countdown

View File

@@ -17,8 +17,6 @@
#include <QTimer> #include <QTimer>
#include <QScopedPointer> #include <QScopedPointer>
class QWidget;
namespace Ui { class CRegisterComponent; } namespace Ui { class CRegisterComponent; }
namespace BlackGui namespace BlackGui
{ {
@@ -26,8 +24,7 @@ namespace BlackGui
{ {
//! Show registered applications (registered with core) in the GUI //! Show registered applications (registered with core) in the GUI
//! \sa BlackCore::Context::IContextApplication::getRegisteredApplications //! \sa BlackCore::Context::IContextApplication::getRegisteredApplications
class BLACKGUI_EXPORT CRegisterComponent : class BLACKGUI_EXPORT CRegisterComponent : public QFrame
public QFrame
{ {
Q_OBJECT Q_OBJECT

View File

@@ -21,7 +21,6 @@
#include <QTimer> #include <QTimer>
class QStringList; class QStringList;
class QWidget;
namespace BlackGui namespace BlackGui
{ {

View File

@@ -41,6 +41,5 @@ namespace BlackGui
(void)QT_TRANSLATE_NOOP("ModelIdentifierList", "lcl m."); (void)QT_TRANSLATE_NOOP("ModelIdentifierList", "lcl m.");
(void)QT_TRANSLATE_NOOP("ModelIdentifierList", "same p."); (void)QT_TRANSLATE_NOOP("ModelIdentifierList", "same p.");
} }
} // class } // class
} // namespace } // namespace

View File

@@ -17,8 +17,6 @@
#include "blackmisc/identifier.h" #include "blackmisc/identifier.h"
#include "blackmisc/identifierlist.h" #include "blackmisc/identifierlist.h"
class QObject;
namespace BlackGui namespace BlackGui
{ {
namespace Models namespace Models
@@ -27,7 +25,6 @@ namespace BlackGui
class BLACKGUI_EXPORT CIdentifierListModel : public CListModelBase<BlackMisc::CIdentifier, BlackMisc::CIdentifierList> class BLACKGUI_EXPORT CIdentifierListModel : public CListModelBase<BlackMisc::CIdentifier, BlackMisc::CIdentifierList>
{ {
public: public:
//! Constructor //! Constructor
explicit CIdentifierListModel(QObject *parent = nullptr); explicit CIdentifierListModel(QObject *parent = nullptr);

View File

@@ -30,19 +30,19 @@ namespace BlackGui
CAtcStationView::CAtcStationView(QWidget *parent) : CViewWithCallsignObjects(parent) CAtcStationView::CAtcStationView(QWidget *parent) : CViewWithCallsignObjects(parent)
{ {
this->standardInit(new CAtcStationListModel(CAtcStationListModel::StationsOnline, this)); this->standardInit(new CAtcStationListModel(CAtcStationListModel::StationsOnline, this));
this->m_menus |= (MenuClear | MenuRefresh); m_menus |= (MenuClear | MenuRefresh);
} }
void CAtcStationView::setStationMode(CAtcStationListModel::AtcStationMode stationMode) void CAtcStationView::setStationMode(CAtcStationListModel::AtcStationMode stationMode)
{ {
Q_ASSERT(this->m_model); Q_ASSERT(m_model);
this->m_model->setStationMode(stationMode); m_model->setStationMode(stationMode);
this->setSortIndicator(); this->setSortIndicator();
} }
void CAtcStationView::changedAtcStationConnectionStatus(const CAtcStation &station, bool added) 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 // resize the first, rest will be resized with normal updates
if (this->rowCount() == 1) if (this->rowCount() == 1)
@@ -55,18 +55,18 @@ namespace BlackGui
{ {
if (BlackConfig::CBuildConfig::isDebugBuild()) if (BlackConfig::CBuildConfig::isDebugBuild())
{ {
if (this->m_debugActions.isEmpty()) { this->m_actions = QList<QAction *>({nullptr, nullptr}); } if (m_debugActions.isEmpty()) { 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 }); m_actions[0] = menuActions.addAction(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 }); 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->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 }); m_debugActions[0] = menuActions.addAction(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 }); m_debugActions[1] = menuActions.addAction(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[2] = menuActions.addAction(m_debugActions[2], CIcons::appTextMessages16(), "Show text messages", CMenuAction::pathClientCom(), { this, &CAtcStationView::requestTextMessage });
} }
CViewBase::customMenu(menuActions); CViewBase::customMenu(menuActions);
} }

View File

@@ -17,10 +17,7 @@
#include "blackgui/views/viewbase.h" #include "blackgui/views/viewbase.h"
#include "blackmisc/identifierlist.h" #include "blackmisc/identifierlist.h"
class QWidget;
namespace BlackMisc { class CIdentifier; } namespace BlackMisc { class CIdentifier; }
namespace BlackGui namespace BlackGui
{ {
namespace Views namespace Views
@@ -28,9 +25,7 @@ namespace BlackGui
//! Originator servers //! Originator servers
class BLACKGUI_EXPORT CIdentifierView : public CViewBase<Models::CIdentifierListModel, BlackMisc::CIdentifierList, BlackMisc::CIdentifier> class BLACKGUI_EXPORT CIdentifierView : public CViewBase<Models::CIdentifierListModel, BlackMisc::CIdentifierList, BlackMisc::CIdentifier>
{ {
public: public:
//! Constructor //! Constructor
explicit CIdentifierView(QWidget *parent = nullptr); explicit CIdentifierView(QWidget *parent = nullptr);
}; };

View File

@@ -382,7 +382,7 @@ namespace BlackGui
CViewBaseNonTemplate(QWidget *parent); CViewBaseNonTemplate(QWidget *parent);
//! Destructor //! Destructor
virtual ~CViewBaseNonTemplate(); virtual ~CViewBaseNonTemplate() override;
//! Method creating the menu //! Method creating the menu
//! \remarks override this method to contribute to the menu //! \remarks override this method to contribute to the menu

View File

@@ -82,22 +82,22 @@ namespace BlackMisc
bool isInNormalSendingMode() const; bool isInNormalSendingMode() const;
//! Standby? //! Standby?
bool isInStandby() const { return StateStandby == m_transponderMode; } bool isInStandby() const { return StateStandby == this->getTransponderMode(); }
//! Standby? //! Standby?
bool isIdentifying() const { return StateIdent == m_transponderMode; } bool isIdentifying() const { return StateIdent == this->getTransponderMode(); }
//! Transponder mode as string //! Transponder mode as string
void setModeAsString(const QString &mode) { this->setTransponderMode(CTransponder::modeFromString(mode)); } void setModeAsString(const QString &mode) { this->setTransponderMode(CTransponder::modeFromString(mode)); }
//! Transponder mode //! Transponder mode
TransponderMode getTransponderMode() const { return this->m_transponderMode; } TransponderMode getTransponderMode() const { return static_cast<TransponderMode>(m_transponderMode); }
//! Transponder mode as string //! Transponder mode as string
static const QString &modeAsString(TransponderMode mode); static const QString &modeAsString(TransponderMode mode);
//! Transponder code //! Transponder code
int getTransponderCode() const { return this->m_transponderCode; } int getTransponderCode() const { return m_transponderCode; }
//! Transponder code //! Transponder code
QString getTransponderCodeFormatted() const; QString getTransponderCodeFormatted() const;
@@ -106,7 +106,7 @@ namespace BlackMisc
QString getTransponderCodeAndModeFormatted() const; QString getTransponderCodeAndModeFormatted() const;
//! Set transponder code //! Set transponder code
void setTransponderCode(int transponderCode) { this->m_transponderCode = transponderCode; } void setTransponderCode(int transponderCode) { m_transponderCode = transponderCode; }
//! Set transponder code //! Set transponder code
void setTransponderCode(const QString &transponderCode); void setTransponderCode(const QString &transponderCode);
@@ -115,16 +115,16 @@ namespace BlackMisc
static TransponderMode modeFromString(const QString &modeString); static TransponderMode modeFromString(const QString &modeString);
//! Set transponder mode //! Set transponder mode
void setTransponderMode(TransponderMode mode) { this->m_transponderMode = mode ; } void setTransponderMode(TransponderMode mode) { m_transponderMode = static_cast<int>(mode); }
//! Set emergency //! Set emergency
void setEmergency() { this->m_transponderCode = 7700; } void setEmergency() { m_transponderCode = 7700; }
//! Set VFR //! Set VFR
void setVFR() { this->m_transponderCode = 7000; } void setVFR() { m_transponderCode = 7000; }
//! Set IFR //! Set IFR
void setIFR() { this->m_transponderCode = 2000; } void setIFR() { m_transponderCode = 2000; }
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex //! \copydoc BlackMisc::Mixin::Index::propertyByIndex
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const; CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
@@ -146,7 +146,7 @@ namespace BlackMisc
private: private:
//! Default value? //! Default value?
bool isDefaultValue() const { return this->m_transponderCode == 0; } bool isDefaultValue() const { return m_transponderCode == 0; }
int m_transponderCode; //!< Transponder code int m_transponderCode; //!< Transponder code
TransponderMode m_transponderMode; //!< Transponder mode TransponderMode m_transponderMode; //!< Transponder mode

View File

@@ -28,8 +28,8 @@ namespace BlackMisc
*/ */
class BLACKMISC_EXPORT CIdentifierList : class BLACKMISC_EXPORT CIdentifierList :
public CSequence<BlackMisc::CIdentifier>, public CSequence<BlackMisc::CIdentifier>,
public BlackMisc::Mixin::MetaType<CIdentifierList>, public Mixin::MetaType<CIdentifierList>,
public BlackMisc::ITimestampObjectList<CIdentifier, CIdentifierList> public ITimestampObjectList<CIdentifier, CIdentifierList>
{ {
public: public:
BLACKMISC_DECLARE_USING_MIXIN_METATYPE(CIdentifierList) BLACKMISC_DECLARE_USING_MIXIN_METATYPE(CIdentifierList)

View File

@@ -38,7 +38,7 @@ namespace BlackSimPlugin
void CSimulatorXPlaneConfigWindow::settingsAccepted() void CSimulatorXPlaneConfigWindow::settingsAccepted()
{ {
QString currentAddress = m_xswiftbusServerSetting.getThreadLocal(); const QString currentAddress = m_xswiftbusServerSetting.getThreadLocal();
if (currentAddress != ui->comp_SettingsXSwiftBus->getDBusAddress()) if (currentAddress != ui->comp_SettingsXSwiftBus->getDBusAddress())
{ {
m_xswiftbusServerSetting.set(ui->comp_SettingsXSwiftBus->getDBusAddress()); m_xswiftbusServerSetting.set(ui->comp_SettingsXSwiftBus->getDBusAddress());