diff --git a/src/blackgui/components/aircraftcomponent.cpp b/src/blackgui/components/aircraftcomponent.cpp index c5cd9b0ee..715e4dfaf 100644 --- a/src/blackgui/components/aircraftcomponent.cpp +++ b/src/blackgui/components/aircraftcomponent.cpp @@ -9,7 +9,7 @@ #include "aircraftcomponent.h" #include "ui_aircraftcomponent.h" -#include "dockwidgetinfoareacomponent.h" +#include "enablefordockwidgetinfoarea.h" #include "../guiutility.h" #include "blackcore/context_network.h" #include "blackcore/context_simulator.h" @@ -24,14 +24,14 @@ namespace BlackGui CAircraftComponent::CAircraftComponent(QWidget *parent) : QTabWidget(parent), - CDockWidgetInfoAreaComponent(this), - CRuntimeBasedComponent(nullptr, false), - ui(new Ui::CAircraftComponent), m_timerComponent(nullptr) + CEnableForDockWidgetInfoArea(this), + CEnableForRuntime(nullptr, false), + ui(new Ui::CAircraftComponent), m_updateTimer(nullptr) { ui->setupUi(this); this->tabBar()->setExpanding(false); this->ui->tvp_AirportsInRange->setResizeMode(CAirportView::ResizingOnce); - m_timerComponent = new CTimerBasedComponent(SLOT(update()), this); + m_updateTimer = new CUpdateTimer(SLOT(update()), this); connect(this->ui->tvp_AircraftsInRange, &CAircraftView::countChanged, this, &CAircraftComponent::ps_countChanged); connect(this->ui->tvp_AirportsInRange, &CAircraftView::countChanged, this, &CAircraftComponent::ps_countChanged); diff --git a/src/blackgui/components/aircraftcomponent.h b/src/blackgui/components/aircraftcomponent.h index ccde6b12f..38a021168 100644 --- a/src/blackgui/components/aircraftcomponent.h +++ b/src/blackgui/components/aircraftcomponent.h @@ -12,9 +12,9 @@ #ifndef BLACKGUI_AIRCRAFTCOMPONENT_H #define BLACKGUI_AIRCRAFTCOMPONENT_H -#include "blackgui/components/runtimebasedcomponent.h" -#include "blackgui/components/timerbasedcomponent.h" -#include "blackgui/components/dockwidgetinfoareacomponent.h" +#include "blackgui/components/enableforruntime.h" +#include "blackgui/components/enablefordockwidgetinfoarea.h" +#include "blackgui/components/updatetimer.h" #include "blackmisc/avaircraft.h" #include @@ -28,8 +28,8 @@ namespace BlackGui //! Aircraft widget class CAircraftComponent : public QTabWidget, - public CDockWidgetInfoAreaComponent, - public CRuntimeBasedComponent + public CEnableForDockWidgetInfoArea, + public CEnableForRuntime { Q_OBJECT @@ -41,7 +41,7 @@ namespace BlackGui ~CAircraftComponent(); //! Timer for updating - CTimerBasedComponent *getTimerComponent() { return this->m_timerComponent; } + CUpdateTimer *getTimerComponent() { return this->m_updateTimer; } //! Aircrafts in range int countAircrafts() const; @@ -54,13 +54,13 @@ namespace BlackGui void update(); //! \copydoc CTimerBasedComponent::setUpdateIntervalSeconds - void setUpdateIntervalSeconds(int seconds) { Q_ASSERT(this->m_timerComponent); this->m_timerComponent->setUpdateIntervalSeconds(seconds); } + void setUpdateIntervalSeconds(int seconds) { Q_ASSERT(this->m_updateTimer); this->m_updateTimer->setUpdateIntervalSeconds(seconds); } //! \copydoc CTimerBasedComponent::setUpdateInterval - void setUpdateInterval(int milliSeconds) { Q_ASSERT(this->m_timerComponent); this->m_timerComponent->setUpdateInterval(milliSeconds); } + void setUpdateInterval(int milliSeconds) { Q_ASSERT(this->m_updateTimer); this->m_updateTimer->setUpdateInterval(milliSeconds); } //! \copydoc CTimerBasedComponent::stopTimer - void stopTimer() { Q_ASSERT(this->m_timerComponent); this->m_timerComponent->stopTimer(); } + void stopTimer() { Q_ASSERT(this->m_updateTimer); this->m_updateTimer->stopTimer(); } protected: //! \copydoc CRuntimeBasedComponent::runtimeHasBeenSet @@ -75,7 +75,7 @@ namespace BlackGui private: QScopedPointer ui; - CTimerBasedComponent *m_timerComponent; + CUpdateTimer *m_updateTimer; }; } } diff --git a/src/blackgui/components/atcstationcomponent.cpp b/src/blackgui/components/atcstationcomponent.cpp index bca92fa7e..f9e7fe46f 100644 --- a/src/blackgui/components/atcstationcomponent.cpp +++ b/src/blackgui/components/atcstationcomponent.cpp @@ -29,13 +29,13 @@ namespace BlackGui { CAtcStationComponent::CAtcStationComponent(QWidget *parent) : QTabWidget(parent), - CDockWidgetInfoAreaComponent(this), - CRuntimeBasedComponent(nullptr, false), - ui(new Ui::CAtcStationComponent), m_timerComponent(nullptr) + CEnableForDockWidgetInfoArea(this), + CEnableForRuntime(nullptr, false), + ui(new Ui::CAtcStationComponent), m_updateTimer(nullptr) { ui->setupUi(this); this->tabBar()->setExpanding(false); - this->m_timerComponent = new CTimerBasedComponent(SLOT(update()), this); + this->m_updateTimer = new CUpdateTimer(SLOT(update()), this); // some icons this->ui->pb_AtcStationsAtisReload->setIcon(CIcons::atis()); @@ -217,8 +217,8 @@ namespace BlackGui void CAtcStationComponent::ps_requestOnlineStationsUpdate() { - this->m_timerComponent->fireTimer(); - this->m_timestampLastReadOnlineStations = CTimerBasedComponent::epoch(); + this->m_updateTimer->fireTimer(); + this->m_timestampLastReadOnlineStations = CUpdateTimer::epoch(); } void CAtcStationComponent::ps_infoAreaTabBarChanged(int index) diff --git a/src/blackgui/components/atcstationcomponent.h b/src/blackgui/components/atcstationcomponent.h index 9c1530669..0399051dd 100644 --- a/src/blackgui/components/atcstationcomponent.h +++ b/src/blackgui/components/atcstationcomponent.h @@ -12,9 +12,9 @@ #ifndef BLACKGUI_ATCSTATIONCOMPONENT_H #define BLACKGUI_ATCSTATIONCOMPONENT_H -#include "blackgui/components/runtimebasedcomponent.h" -#include "blackgui/components/timerbasedcomponent.h" -#include "blackgui/components/dockwidgetinfoareacomponent.h" +#include "blackgui/components/enableforruntime.h" +#include "blackgui/components/enablefordockwidgetinfoarea.h" +#include "blackgui/components/updatetimer.h" #include "blackmisc/avatcstation.h" @@ -33,8 +33,8 @@ namespace BlackGui */ class CAtcStationComponent : public QTabWidget, - public CDockWidgetInfoAreaComponent, - public CRuntimeBasedComponent + public CEnableForDockWidgetInfoArea, + public CEnableForRuntime { Q_OBJECT @@ -46,7 +46,7 @@ namespace BlackGui ~CAtcStationComponent(); //! Timer for updating - CTimerBasedComponent *getTimerComponent() { return this->m_timerComponent; } + CUpdateTimer *getTimerComponent() { return this->m_updateTimer; } //! Number of booked stations int countBookedStations() const; @@ -59,13 +59,13 @@ namespace BlackGui void update(); //! \copydoc CTimerBasedComponent::setUpdateIntervalSeconds - void setUpdateIntervalSeconds(int seconds) { Q_ASSERT(this->m_timerComponent); this->m_timerComponent->setUpdateIntervalSeconds(seconds); } + void setUpdateIntervalSeconds(int seconds) { Q_ASSERT(this->m_updateTimer); this->m_updateTimer->setUpdateIntervalSeconds(seconds); } //! \copydoc CTimerBasedComponent::setUpdateInterval - void setUpdateInterval(int milliSeconds) { Q_ASSERT(this->m_timerComponent); this->m_timerComponent->setUpdateInterval(milliSeconds); } + void setUpdateInterval(int milliSeconds) { Q_ASSERT(this->m_updateTimer); this->m_updateTimer->setUpdateInterval(milliSeconds); } //! \copydoc CTimerBasedComponent::stopTimer - void stopTimer() { Q_ASSERT(this->m_timerComponent); this->m_timerComponent->stopTimer(); } + void stopTimer() { Q_ASSERT(this->m_updateTimer); this->m_updateTimer->stopTimer(); } //! Get METAR for given ICAO airport code void getMetar(const QString &airportIcaoCode = ""); @@ -113,11 +113,11 @@ namespace BlackGui private: QScopedPointer ui; - CTimerBasedComponent *m_timerComponent; - QDateTime m_timestampLastReadOnlineStations = CTimerBasedComponent::epoch(); //!< stations read - QDateTime m_timestampOnlineStationsChanged = CTimerBasedComponent::epoch(); //!< stations marked as changed - QDateTime m_timestampLastReadBookedStations = CTimerBasedComponent::epoch(); //!< stations read - QDateTime m_timestampBookedStationsChanged = CTimerBasedComponent::epoch(); //!< stations marked as changed + CUpdateTimer *m_updateTimer; + QDateTime m_timestampLastReadOnlineStations = CUpdateTimer::epoch(); //!< stations read + QDateTime m_timestampOnlineStationsChanged = CUpdateTimer::epoch(); //!< stations marked as changed + QDateTime m_timestampLastReadBookedStations = CUpdateTimer::epoch(); //!< stations read + QDateTime m_timestampBookedStationsChanged = CUpdateTimer::epoch(); //!< stations marked as changed }; } } diff --git a/src/blackgui/components/cockpitcomcomponent.cpp b/src/blackgui/components/cockpitcomcomponent.cpp index 74ae36831..dd2a1c736 100644 --- a/src/blackgui/components/cockpitcomcomponent.cpp +++ b/src/blackgui/components/cockpitcomcomponent.cpp @@ -19,7 +19,7 @@ namespace BlackGui { CCockpitComComponent::CCockpitComComponent(QWidget *parent) : QFrame(parent), - CDockWidgetInfoAreaComponent(this), + CEnableForDockWidgetInfoArea(this), ui(new Ui::CCockpitMainComponent) { ui->setupUi(this); diff --git a/src/blackgui/components/cockpitcomcomponent.h b/src/blackgui/components/cockpitcomcomponent.h index a915d435c..4f432f730 100644 --- a/src/blackgui/components/cockpitcomcomponent.h +++ b/src/blackgui/components/cockpitcomcomponent.h @@ -10,7 +10,7 @@ #ifndef BLACKGUI_COCKPITCOMCOMPONENT_H #define BLACKGUI_COCKPITCOMCOMPONENT_H -#include "dockwidgetinfoareacomponent.h" +#include "enablefordockwidgetinfoarea.h" #include #include @@ -23,7 +23,7 @@ namespace BlackGui //! The main cockpit area class CCockpitComComponent : public QFrame, - public CDockWidgetInfoAreaComponent + public CEnableForDockWidgetInfoArea { Q_OBJECT @@ -34,6 +34,7 @@ namespace BlackGui //! Destructor ~CCockpitComComponent(); + protected: //! \copydoc QWidget::paintEvent virtual void paintEvent(QPaintEvent *event) override; diff --git a/src/blackgui/components/cockpitv1component.cpp b/src/blackgui/components/cockpitv1component.cpp index 82e7ddae0..c6a8e3266 100644 --- a/src/blackgui/components/cockpitv1component.cpp +++ b/src/blackgui/components/cockpitv1component.cpp @@ -35,7 +35,7 @@ namespace BlackGui namespace Components { CCockpitV1Component::CCockpitV1Component(QWidget *parent) : - QWidget(parent), CRuntimeBasedComponent(nullptr, false), ui(new Ui::CCockpitV1Component), m_externalCockpitIdentButton(nullptr), m_voiceRoomMembersTimer(nullptr) + QWidget(parent), CEnableForRuntime(nullptr, false), ui(new Ui::CCockpitV1Component), m_externalCockpitIdentButton(nullptr), m_voiceRoomMembersTimer(nullptr) { ui->setupUi(this); diff --git a/src/blackgui/components/cockpitv1component.h b/src/blackgui/components/cockpitv1component.h index 1e941f907..d02f38024 100644 --- a/src/blackgui/components/cockpitv1component.h +++ b/src/blackgui/components/cockpitv1component.h @@ -13,6 +13,7 @@ #define BLACKGUI_COCKPITV1COMPONENT_H #include "blackgui/components/runtimebasedcomponent.h" +#include "blackgui/components/enableforruntime.h" #include "blackmisc/avaircraft.h" #include "blackmisc/aviocomsystem.h" #include "blackmisc/voiceroomlist.h" @@ -29,7 +30,7 @@ namespace BlackGui //! Cockpit component class CCockpitV1Component : public QWidget, - public CRuntimeBasedComponent + public CEnableForRuntime { Q_OBJECT diff --git a/src/blackgui/components/dockwidgetinfoareacomponent.cpp b/src/blackgui/components/enablefordockwidgetinfoarea.cpp similarity index 83% rename from src/blackgui/components/dockwidgetinfoareacomponent.cpp rename to src/blackgui/components/enablefordockwidgetinfoarea.cpp index 354e6bb4d..46820ae42 100644 --- a/src/blackgui/components/dockwidgetinfoareacomponent.cpp +++ b/src/blackgui/components/enablefordockwidgetinfoarea.cpp @@ -7,14 +7,14 @@ * contained in the LICENSE file. */ -#include "dockwidgetinfoareacomponent.h" +#include "enablefordockwidgetinfoarea.h" namespace BlackGui { namespace Components { - CDockWidgetInfoAreaComponent::CDockWidgetInfoAreaComponent(QWidget *parent) + CEnableForDockWidgetInfoArea::CEnableForDockWidgetInfoArea(QWidget *parent) { // it the parent is already an info area at this time, we keep it // otherwise we expect the info area to set it later @@ -25,7 +25,7 @@ namespace BlackGui } } - bool CDockWidgetInfoAreaComponent::setParentDockWidgetInfoArea(CDockWidgetInfoArea *parentDockableWidget) + bool CEnableForDockWidgetInfoArea::setParentDockWidgetInfoArea(CDockWidgetInfoArea *parentDockableWidget) { // sanity check if (this->m_parentDockableInfoArea) @@ -40,28 +40,28 @@ namespace BlackGui return true; } - const CInfoArea *CDockWidgetInfoAreaComponent::getParentInfoArea() const + const CInfoArea *CEnableForDockWidgetInfoArea::getParentInfoArea() const { Q_ASSERT(this->m_parentDockableInfoArea); if (!this->m_parentDockableInfoArea) return nullptr; return this->m_parentDockableInfoArea->getParentInfoArea(); } - CInfoArea *CDockWidgetInfoAreaComponent::getParentInfoArea() + CInfoArea *CEnableForDockWidgetInfoArea::getParentInfoArea() { Q_ASSERT(this->m_parentDockableInfoArea); if (!this->m_parentDockableInfoArea) return nullptr; return this->m_parentDockableInfoArea->getParentInfoArea(); } - bool CDockWidgetInfoAreaComponent::isParentDockWidgetFloating() const + bool CEnableForDockWidgetInfoArea::isParentDockWidgetFloating() const { Q_ASSERT(this->m_parentDockableInfoArea); if (!this->m_parentDockableInfoArea) return false; return this->m_parentDockableInfoArea->isFloating(); } - bool CDockWidgetInfoAreaComponent::isVisibleWidget() const + bool CEnableForDockWidgetInfoArea::isVisibleWidget() const { Q_ASSERT(this->m_parentDockableInfoArea); if (!this->m_parentDockableInfoArea) return false; diff --git a/src/blackgui/components/dockwidgetinfoareacomponent.h b/src/blackgui/components/enablefordockwidgetinfoarea.h similarity index 77% rename from src/blackgui/components/dockwidgetinfoareacomponent.h rename to src/blackgui/components/enablefordockwidgetinfoarea.h index d9ef3544c..9e81dc2aa 100644 --- a/src/blackgui/components/dockwidgetinfoareacomponent.h +++ b/src/blackgui/components/enablefordockwidgetinfoarea.h @@ -9,8 +9,8 @@ //! \file -#ifndef BLACKGUI_DOCKWIDGETINFOAREACOMPONENT_H -#define BLACKGUI_DOCKWIDGETINFOAREACOMPONENT_H +#ifndef BLACKGUI_ENABLEFORDOCKWIDGETINFOAREA_H +#define BLACKGUI_ENABLEFORDOCKWIDGETINFOAREA_H #include "../dockwidgetinfoarea.h" #include "../infoarea.h" @@ -21,16 +21,16 @@ namespace BlackGui namespace Components { - //! Helper class: Component is residing in an dockable widget. + //! Helper class: If a component is residing in an dockable widget. //! This class provides access to its info area and dockable widget. - class CDockWidgetInfoAreaComponent + class CEnableForDockWidgetInfoArea { public: //! Corresponding dockable widget in info area - BlackGui::CDockWidgetInfoArea *getDockWidget() { return m_parentDockableInfoArea; } + BlackGui::CDockWidgetInfoArea *getDockWidgetInfoArea() { return m_parentDockableInfoArea; } //! Corresponding dockable widget in info area - const BlackGui::CDockWidgetInfoArea *getDockWidget() const { return m_parentDockableInfoArea; } + const BlackGui::CDockWidgetInfoArea *getDockWidgetInfoArea() const { return m_parentDockableInfoArea; } //! Corresponding dockable widget in info area //! \remarks Usually set from CDockWidgetInfoArea when it is fully initialized @@ -50,7 +50,7 @@ namespace BlackGui protected: //! Constructor - CDockWidgetInfoAreaComponent(QWidget *parent); + CEnableForDockWidgetInfoArea(QWidget *parent); private: BlackGui::CDockWidgetInfoArea *m_parentDockableInfoArea = nullptr; //!< my parent dockable widget diff --git a/src/blackgui/components/runtimebasedcomponent.cpp b/src/blackgui/components/enableforruntime.cpp similarity index 64% rename from src/blackgui/components/runtimebasedcomponent.cpp rename to src/blackgui/components/enableforruntime.cpp index 3fded1059..a2d01c62f 100644 --- a/src/blackgui/components/runtimebasedcomponent.cpp +++ b/src/blackgui/components/enableforruntime.cpp @@ -7,7 +7,7 @@ * contained in the LICENSE file. */ -#include "runtimebasedcomponent.h" +#include "enableforruntime.h" #include "blackcore/context_all_interfaces.h" #include @@ -15,7 +15,7 @@ namespace BlackGui { namespace Components { - void CRuntimeBasedComponent::setRuntime(BlackCore::CRuntime *runtime, bool runtimeOwner) + void CEnableForRuntime::setRuntime(BlackCore::CRuntime *runtime, bool runtimeOwner) { Q_ASSERT(runtime); this->m_runtime = runtime; @@ -23,7 +23,7 @@ namespace BlackGui this->runtimeHasBeenSet(); } - void CRuntimeBasedComponent::setRuntimeForComponents(BlackCore::CRuntime *runtime, QWidget *parent) + void CEnableForRuntime::setRuntimeForComponents(BlackCore::CRuntime *runtime, QWidget *parent) { if (!parent) return; @@ -32,90 +32,90 @@ namespace BlackGui foreach(QWidget * widget, children) { if (widget->objectName().isEmpty()) continue; // rule out unamed widgets - CRuntimeBasedComponent *rbc = dynamic_cast(widget); + CEnableForRuntime *rbc = dynamic_cast(widget); if (rbc) rbc->setRuntime(runtime, false); } } - void CRuntimeBasedComponent::createRuntime(const BlackCore::CRuntimeConfig &config, QObject *parent) + void CEnableForRuntime::createRuntime(const BlackCore::CRuntimeConfig &config, QObject *parent) { this->m_runtime = new BlackCore::CRuntime(config, parent); this->m_runtimeOwner = true; } - const BlackCore::IContextApplication *CRuntimeBasedComponent::getIContextApplication() const + const BlackCore::IContextApplication *CEnableForRuntime::getIContextApplication() const { if (!this->m_runtime) return nullptr; return this->m_runtime->getIContextApplication(); } - BlackCore::IContextApplication *CRuntimeBasedComponent::getIContextApplication() + BlackCore::IContextApplication *CEnableForRuntime::getIContextApplication() { if (!this->m_runtime) return nullptr; return this->m_runtime->getIContextApplication(); } - BlackCore::IContextAudio *CRuntimeBasedComponent::getIContextAudio() + BlackCore::IContextAudio *CEnableForRuntime::getIContextAudio() { if (!this->m_runtime) return nullptr; return this->m_runtime->getIContextAudio(); } - const BlackCore::IContextAudio *CRuntimeBasedComponent::getIContextAudio() const + const BlackCore::IContextAudio *CEnableForRuntime::getIContextAudio() const { if (!this->m_runtime) return nullptr; return this->m_runtime->getIContextAudio(); } - BlackCore::IContextNetwork *CRuntimeBasedComponent::getIContextNetwork() + BlackCore::IContextNetwork *CEnableForRuntime::getIContextNetwork() { if (!this->m_runtime) return nullptr; return this->m_runtime->getIContextNetwork(); } - const BlackCore::IContextNetwork *CRuntimeBasedComponent::getIContextNetwork() const + const BlackCore::IContextNetwork *CEnableForRuntime::getIContextNetwork() const { if (!this->m_runtime) return nullptr; return this->m_runtime->getIContextNetwork(); } - BlackCore::IContextOwnAircraft *CRuntimeBasedComponent::getIContextOwnAircraft() + BlackCore::IContextOwnAircraft *CEnableForRuntime::getIContextOwnAircraft() { if (!this->m_runtime) return nullptr; return this->m_runtime->getIContextOwnAircraft(); } - const BlackCore::IContextOwnAircraft *CRuntimeBasedComponent::getIContextOwnAircraft() const + const BlackCore::IContextOwnAircraft *CEnableForRuntime::getIContextOwnAircraft() const { if (!this->m_runtime) return nullptr; return this->m_runtime->getIContextOwnAircraft(); } - BlackCore::IContextSettings *CRuntimeBasedComponent::getIContextSettings() + BlackCore::IContextSettings *CEnableForRuntime::getIContextSettings() { if (!this->m_runtime) return nullptr; return this->m_runtime->getIContextSettings(); } - const BlackCore::IContextSettings *CRuntimeBasedComponent::getIContextSettings() const + const BlackCore::IContextSettings *CEnableForRuntime::getIContextSettings() const { if (!this->m_runtime) return nullptr; return this->m_runtime->getIContextSettings(); } - const BlackCore::IContextSimulator *CRuntimeBasedComponent::getIContextSimulator() const + const BlackCore::IContextSimulator *CEnableForRuntime::getIContextSimulator() const { if (!this->m_runtime) return nullptr; return this->m_runtime->getIContextSimulator(); } - BlackCore::IContextSimulator *CRuntimeBasedComponent::getIContextSimulator() + BlackCore::IContextSimulator *CEnableForRuntime::getIContextSimulator() { if (!this->m_runtime) return nullptr; return this->m_runtime->getIContextSimulator(); } - void CRuntimeBasedComponent::playNotifcationSound(BlackSound::CNotificationSounds::Notification notification) const + void CEnableForRuntime::playNotifcationSound(BlackSound::CNotificationSounds::Notification notification) const { if (!this->getIContextAudio()) return; this->getIContextAudio()->playNotification(static_cast(notification), true); diff --git a/src/blackgui/components/runtimebasedcomponent.h b/src/blackgui/components/enableforruntime.h similarity index 95% rename from src/blackgui/components/runtimebasedcomponent.h rename to src/blackgui/components/enableforruntime.h index a27c3a009..0c6ff09d8 100644 --- a/src/blackgui/components/runtimebasedcomponent.h +++ b/src/blackgui/components/enableforruntime.h @@ -9,8 +9,8 @@ //! \file -#ifndef BLACKGUI_RUNTIMEBASEDCOMPONENT_H -#define BLACKGUI_RUNTIMEBASEDCOMPONENT_H +#ifndef BLACKGUI_ENABLEFORRUNTIME_H +#define BLACKGUI_ENABLEFORRUNTIME_H #include "blackcore/context_runtime.h" #include "blackmisc/notificationsounds.h" @@ -39,7 +39,7 @@ namespace BlackGui * the component widely independent from a central data provideer * \sa BlackCore::CRuntime */ - class CRuntimeBasedComponent + class CEnableForRuntime { public: //! Set runtime, usually set by runtime owner (must only be one, usually main window) @@ -59,7 +59,7 @@ namespace BlackGui //! Constructor //! \remarks Usually runtime will be provided later, not at initialization time. //! If runtime is provided right now, make sure to call runtimeHasBeenSet afterwards - CRuntimeBasedComponent(BlackCore::CRuntime *runtime = nullptr, bool runtimeOwner = false) : + CEnableForRuntime(BlackCore::CRuntime *runtime = nullptr, bool runtimeOwner = false) : m_runtime(runtime), m_runtimeOwner(runtimeOwner) {} diff --git a/src/blackgui/components/flightplancomponent.cpp b/src/blackgui/components/flightplancomponent.cpp index 76cd38769..be06e1198 100644 --- a/src/blackgui/components/flightplancomponent.cpp +++ b/src/blackgui/components/flightplancomponent.cpp @@ -25,7 +25,7 @@ namespace BlackGui { CFlightPlanComponent::CFlightPlanComponent(QWidget *parent) : QTabWidget(parent), - CRuntimeBasedComponent(nullptr, false), + CEnableForRuntime(nullptr, false), ui(new Ui::CFlightPlanComponent) { ui->setupUi(this); diff --git a/src/blackgui/components/flightplancomponent.h b/src/blackgui/components/flightplancomponent.h index 30619aa4d..97146d832 100644 --- a/src/blackgui/components/flightplancomponent.h +++ b/src/blackgui/components/flightplancomponent.h @@ -12,7 +12,7 @@ #ifndef BLACKGUI_FLIGHTPLANCOMPONENT_H #define BLACKGUI_FLIGHTPLANCOMPONENT_H -#include "blackgui/components/runtimebasedcomponent.h" +#include "blackgui/components/enableforruntime.h" #include "blackmisc/avaircraft.h" #include "blackmisc/avflightplan.h" @@ -27,7 +27,7 @@ namespace BlackGui //! Flight plan widget class CFlightPlanComponent : public QTabWidget, - public CRuntimeBasedComponent + public CEnableForRuntime { Q_OBJECT diff --git a/src/blackgui/components/infobarstatuscomponent.h b/src/blackgui/components/infobarstatuscomponent.h index a54742b80..e4fff2f61 100644 --- a/src/blackgui/components/infobarstatuscomponent.h +++ b/src/blackgui/components/infobarstatuscomponent.h @@ -12,7 +12,7 @@ #ifndef BLACKGUI_INFOBARSTATUSCOMPONENT_H #define BLACKGUI_INFOBARSTATUSCOMPONENT_H -#include "runtimebasedcomponent.h" +#include "enableforruntime.h" #include "../led.h" #include @@ -24,7 +24,7 @@ namespace BlackGui //! Info bar displaying status (Network, Simulator, DBus) class CInfoBarStatusComponent : public QFrame, - public CRuntimeBasedComponent + public CEnableForRuntime { Q_OBJECT diff --git a/src/blackgui/components/logcomponent.h b/src/blackgui/components/logcomponent.h index ed38c7faa..21bb0c0c4 100644 --- a/src/blackgui/components/logcomponent.h +++ b/src/blackgui/components/logcomponent.h @@ -12,7 +12,7 @@ #ifndef BLACKGUI_LOGCOMPONENT_H #define BLACKGUI_LOGCOMPONENT_H -#include "runtimebasedcomponent.h" +#include "enableforruntime.h" #include "blackmisc/statusmessagelist.h" #include @@ -28,7 +28,7 @@ namespace BlackGui //! GUI displaying log and status messages class CLogComponent : public QFrame, - public CRuntimeBasedComponent + public CEnableForRuntime { Q_OBJECT diff --git a/src/blackgui/components/settingscomponent.cpp b/src/blackgui/components/settingscomponent.cpp index ef41ba2c1..76184acb9 100644 --- a/src/blackgui/components/settingscomponent.cpp +++ b/src/blackgui/components/settingscomponent.cpp @@ -42,7 +42,7 @@ namespace BlackGui */ CSettingsComponent::CSettingsComponent(QWidget *parent) : QTabWidget(parent), - CRuntimeBasedComponent(nullptr, false), + CEnableForRuntime(nullptr, false), ui(new Ui::CSettingsComponent), m_audioTestRunning(NoAudioTest) { diff --git a/src/blackgui/components/settingscomponent.h b/src/blackgui/components/settingscomponent.h index a15c9df76..83fbb00e7 100644 --- a/src/blackgui/components/settingscomponent.h +++ b/src/blackgui/components/settingscomponent.h @@ -12,7 +12,7 @@ #ifndef BLACKGUI_SETTINGSCOMPONENT_H #define BLACKGUI_SETTINGSCOMPONENT_H -#include "blackgui/components/runtimebasedcomponent.h" +#include "blackgui/components/enableforruntime.h" #include "blackmisc/nwserver.h" #include "blackmisc/avaircrafticao.h" #include @@ -30,7 +30,7 @@ namespace BlackGui //! Settings component class CSettingsComponent : public QTabWidget, - public CRuntimeBasedComponent + public CEnableForRuntime { Q_OBJECT diff --git a/src/blackgui/components/settingsfsxcomponent.cpp b/src/blackgui/components/settingsfsxcomponent.cpp index 153de5b1f..73a82cfc9 100644 --- a/src/blackgui/components/settingsfsxcomponent.cpp +++ b/src/blackgui/components/settingsfsxcomponent.cpp @@ -30,7 +30,7 @@ namespace BlackGui namespace Components { CSettingsFsxComponent::CSettingsFsxComponent(QWidget *parent) : - QFrame(parent), CRuntimeBasedComponent(nullptr, false), ui(new Ui::CSettingsFsxComponent) + QFrame(parent), CEnableForRuntime(nullptr, false), ui(new Ui::CSettingsFsxComponent) { ui->setupUi(this); diff --git a/src/blackgui/components/settingsfsxcomponent.h b/src/blackgui/components/settingsfsxcomponent.h index 32dd78a34..be816c533 100644 --- a/src/blackgui/components/settingsfsxcomponent.h +++ b/src/blackgui/components/settingsfsxcomponent.h @@ -12,7 +12,7 @@ #ifndef BLACKGUI_SETTINGSFSXCOMPONENT_H #define BLACKGUI_SETTINGSFSXCOMPONENT_H -#include "blackgui/components/runtimebasedcomponent.h" +#include "blackgui/components/enableforruntime.h" #include namespace Ui { class CSettingsFsxComponent; } @@ -22,7 +22,7 @@ namespace BlackGui namespace Components { //! Settings for FSX - class CSettingsFsxComponent : public QFrame, public CRuntimeBasedComponent + class CSettingsFsxComponent : public QFrame, public CEnableForRuntime { Q_OBJECT diff --git a/src/blackgui/components/settingssimulatorcomponent.cpp b/src/blackgui/components/settingssimulatorcomponent.cpp index 6f34fcfb2..eb25b50da 100644 --- a/src/blackgui/components/settingssimulatorcomponent.cpp +++ b/src/blackgui/components/settingssimulatorcomponent.cpp @@ -23,7 +23,7 @@ namespace BlackGui { CSettingsSimulatorComponent::CSettingsSimulatorComponent(QWidget *parent) : QFrame(parent), - CRuntimeBasedComponent(nullptr, false), + CEnableForRuntime(nullptr, false), ui(new Ui::CSettingsSimulatorComponent) { ui->setupUi(this); diff --git a/src/blackgui/components/settingssimulatorcomponent.h b/src/blackgui/components/settingssimulatorcomponent.h index b9536ed9e..83e94c7c1 100644 --- a/src/blackgui/components/settingssimulatorcomponent.h +++ b/src/blackgui/components/settingssimulatorcomponent.h @@ -1,8 +1,18 @@ +/* Copyright (C) 2013 + * swift project Community / Contributors + * + * This file is part of swift Project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ + #ifndef BLACKGUI_SETTINGSSIMULATORCOMPONENT_H #define BLACKGUI_SETTINGSSIMULATORCOMPONENT_H -#include "runtimebasedcomponent.h" #include "blacksim/setsimulator.h" +#include "enableforruntime.h" +#include "enableforruntime.h" #include namespace Ui { class CSettingsSimulatorComponent; } @@ -14,7 +24,7 @@ namespace BlackGui /*! * All simulator settings component (GUI) */ - class CSettingsSimulatorComponent : public QFrame, public CRuntimeBasedComponent + class CSettingsSimulatorComponent : public QFrame, public CEnableForRuntime { Q_OBJECT diff --git a/src/blackgui/components/simulatorcomponent.cpp b/src/blackgui/components/simulatorcomponent.cpp index c6265f7c1..2126ce868 100644 --- a/src/blackgui/components/simulatorcomponent.cpp +++ b/src/blackgui/components/simulatorcomponent.cpp @@ -17,7 +17,7 @@ namespace BlackGui { CSimulatorComponent::CSimulatorComponent(QWidget *parent) : QTabWidget(parent), - CDockWidgetInfoAreaComponent(this), + CEnableForDockWidgetInfoArea(this), ui(new Ui::CSimulatorComponent) { ui->setupUi(this); diff --git a/src/blackgui/components/simulatorcomponent.h b/src/blackgui/components/simulatorcomponent.h index 68d28b64a..b3db3b647 100644 --- a/src/blackgui/components/simulatorcomponent.h +++ b/src/blackgui/components/simulatorcomponent.h @@ -12,9 +12,9 @@ #ifndef BLACKGUI_SIMULATORCOMPONENT_H #define BLACKGUI_SIMULATORCOMPONENT_H -#include "runtimebasedcomponent.h" +#include "enableforruntime.h" #include "blackmisc/icon.h" -#include "blackgui/components/dockwidgetinfoareacomponent.h" +#include "blackgui/components/enablefordockwidgetinfoarea.h" #include #include @@ -28,8 +28,8 @@ namespace BlackGui //! Simulator component class CSimulatorComponent : public QTabWidget, - public CDockWidgetInfoAreaComponent, - public CRuntimeBasedComponent + public CEnableForDockWidgetInfoArea, + public CEnableForRuntime { Q_OBJECT diff --git a/src/blackgui/components/textmessagecomponent.cpp b/src/blackgui/components/textmessagecomponent.cpp index 567a36a1e..471e35fab 100644 --- a/src/blackgui/components/textmessagecomponent.cpp +++ b/src/blackgui/components/textmessagecomponent.cpp @@ -31,7 +31,7 @@ namespace BlackGui { CTextMessageComponent::CTextMessageComponent(QWidget *parent) : - QTabWidget(parent), CRuntimeBasedComponent(nullptr, false), ui(new Ui::CTextMessageComponent), m_selcalCallback(nullptr), m_clearTextEditAction(nullptr), m_currentTextEdit(nullptr) + QTabWidget(parent), CEnableForRuntime(nullptr, false), ui(new Ui::CTextMessageComponent), m_selcalCallback(nullptr), m_clearTextEditAction(nullptr), m_currentTextEdit(nullptr) { ui->setupUi(this); this->m_clearTextEditAction = new QAction("Clear", this); diff --git a/src/blackgui/components/textmessagecomponent.h b/src/blackgui/components/textmessagecomponent.h index 3dfddee0f..453fd50b9 100644 --- a/src/blackgui/components/textmessagecomponent.h +++ b/src/blackgui/components/textmessagecomponent.h @@ -12,7 +12,7 @@ #ifndef BLACKGUI_TEXTMESSAGECOMPONENT_H #define BLACKGUI_TEXTMESSAGECOMPONENT_H -#include "blackgui/components/runtimebasedcomponent.h" +#include "blackgui/components/enableforruntime.h" #include "blackmisc/nwtextmessage.h" #include "blackmisc/avaircraft.h" #include "blackmisc/nwtextmessagelist.h" @@ -30,7 +30,7 @@ namespace BlackGui //! Text message widget class CTextMessageComponent : public QTabWidget, - public CRuntimeBasedComponent + public CEnableForRuntime { Q_OBJECT diff --git a/src/blackgui/components/timerbasedcomponent.cpp b/src/blackgui/components/updatetimer.cpp similarity index 83% rename from src/blackgui/components/timerbasedcomponent.cpp rename to src/blackgui/components/updatetimer.cpp index d6aeaa2b4..df468f245 100644 --- a/src/blackgui/components/timerbasedcomponent.cpp +++ b/src/blackgui/components/updatetimer.cpp @@ -7,13 +7,13 @@ * contained in the LICENSE file. */ -#include "timerbasedcomponent.h" +#include "updatetimer.h" namespace BlackGui { namespace Components { - CTimerBasedComponent::CTimerBasedComponent(const char *slot, QObject *parent) : + CUpdateTimer::CUpdateTimer(const char *slot, QObject *parent) : QObject(parent) { Q_ASSERT(parent); @@ -24,13 +24,14 @@ namespace BlackGui this->connect(this->m_timerSingleShot, SIGNAL(timeout()), parent, slot); } - CTimerBasedComponent::~CTimerBasedComponent() + CUpdateTimer::~CUpdateTimer() { this->m_timer->stop(); + this->m_timerSingleShot->stop(); if (this->parent()) this->disconnect(this->parent()); } - void CTimerBasedComponent::setUpdateInterval(int milliSeconds) + void CUpdateTimer::setUpdateInterval(int milliSeconds) { if (milliSeconds < 100) { @@ -43,11 +44,11 @@ namespace BlackGui } } - void CTimerBasedComponent::fireTimer() + void CUpdateTimer::fireTimer() { Q_ASSERT(this->m_timerSingleShot); this->m_timer->start(); // restart other timer this->m_timerSingleShot->start(10); } } -} // guard +} // namespace diff --git a/src/blackgui/components/timerbasedcomponent.h b/src/blackgui/components/updatetimer.h similarity index 78% rename from src/blackgui/components/timerbasedcomponent.h rename to src/blackgui/components/updatetimer.h index 1dc883371..138f6737f 100644 --- a/src/blackgui/components/timerbasedcomponent.h +++ b/src/blackgui/components/updatetimer.h @@ -9,8 +9,8 @@ //! \file -#ifndef BLACKGUI_TIMERBASEDCOMPONENT_H -#define BLACKGUI_TIMERBASEDCOMPONENT_H +#ifndef BLACKGUI_UPDATETIMER_H +#define BLACKGUI_UPDATETIMER_H #include #include @@ -19,17 +19,17 @@ namespace BlackGui { namespace Components { - //! Helper class: Timer based componenet - class CTimerBasedComponent: public QObject + //! Timer used in components for updates + class CUpdateTimer: public QObject { Q_OBJECT public: //! Constructor - CTimerBasedComponent(const char *slot, QObject *parent); + CUpdateTimer(const char *slot, QObject *parent); //! Destructor - ~CTimerBasedComponent(); + ~CUpdateTimer(); //! Date/time of 1/1/1970, used to init timestamp values as "outdated" static const QDateTime &epoch() @@ -52,8 +52,8 @@ namespace BlackGui void fireTimer(); private: - QTimer *m_timer = nullptr; - QTimer *m_timerSingleShot = nullptr; + QTimer *m_timer = nullptr; //!< periodically updating + QTimer *m_timerSingleShot = nullptr; //!< single update }; } } diff --git a/src/blackgui/components/usercomponent.cpp b/src/blackgui/components/usercomponent.cpp index 02662b353..3651563f7 100644 --- a/src/blackgui/components/usercomponent.cpp +++ b/src/blackgui/components/usercomponent.cpp @@ -22,13 +22,13 @@ namespace BlackGui { CUserComponent::CUserComponent(QWidget *parent) : QTabWidget(parent), - CDockWidgetInfoAreaComponent(this), - CRuntimeBasedComponent(nullptr, false), - ui(new Ui::CUserComponent), m_timerComponent(nullptr) + CEnableForDockWidgetInfoArea(this), + CEnableForRuntime(nullptr, false), + ui(new Ui::CUserComponent), m_updateTimer(nullptr) { ui->setupUi(this); this->tabBar()->setExpanding(false); - this->m_timerComponent = new CTimerBasedComponent(SLOT(update()), this); + this->m_updateTimer = new CUpdateTimer(SLOT(update()), this); connect(this->ui->tvp_AllUsers, &CUserView::countChanged, this, &CUserComponent::ps_countChanged); connect(this->ui->tvp_Clients, &CClientView::countChanged, this, &CUserComponent::ps_countChanged); diff --git a/src/blackgui/components/usercomponent.h b/src/blackgui/components/usercomponent.h index 4c2643789..9e1145dc5 100644 --- a/src/blackgui/components/usercomponent.h +++ b/src/blackgui/components/usercomponent.h @@ -12,9 +12,9 @@ #ifndef BLACKGUI_USERCOMPONENT_H #define BLACKGUI_USERCOMPONENT_H -#include "blackgui/components/runtimebasedcomponent.h" -#include "blackgui/components/timerbasedcomponent.h" -#include "blackgui/components/dockwidgetinfoareacomponent.h" +#include "blackgui/components/enableforruntime.h" +#include "blackgui/components/enablefordockwidgetinfoarea.h" +#include "blackgui/components/updatetimer.h" #include #include @@ -29,8 +29,8 @@ namespace BlackGui //! User componenet (users, clients) class CUserComponent : public QTabWidget, - public CDockWidgetInfoAreaComponent, - public CRuntimeBasedComponent + public CEnableForDockWidgetInfoArea, + public CEnableForRuntime { Q_OBJECT @@ -42,7 +42,7 @@ namespace BlackGui ~CUserComponent(); //! Timer for updating - CTimerBasedComponent *getTimerComponent() { return this->m_timerComponent; } + CUpdateTimer *getTimerComponent() { return this->m_updateTimer; } //! Number of clients int countClients() const; @@ -55,13 +55,13 @@ namespace BlackGui void update(); //! \copydoc CTimerBasedComponent::setUpdateIntervalSeconds - void setUpdateIntervalSeconds(int seconds) { Q_ASSERT(this->m_timerComponent); this->m_timerComponent->setUpdateIntervalSeconds(seconds); } + void setUpdateIntervalSeconds(int seconds) { Q_ASSERT(this->m_updateTimer); this->m_updateTimer->setUpdateIntervalSeconds(seconds); } //! \copydoc CTimerBasedComponent::setUpdateInterval - void setUpdateInterval(int milliSeconds) { Q_ASSERT(this->m_timerComponent); this->m_timerComponent->setUpdateInterval(milliSeconds); } + void setUpdateInterval(int milliSeconds) { Q_ASSERT(this->m_updateTimer); this->m_updateTimer->setUpdateInterval(milliSeconds); } //! \copydoc CTimerBasedComponent::stopTimer - void stopTimer() { Q_ASSERT(this->m_timerComponent); this->m_timerComponent->stopTimer(); } + void stopTimer() { Q_ASSERT(this->m_updateTimer); this->m_updateTimer->stopTimer(); } private slots: //! Number of elements changed @@ -69,7 +69,7 @@ namespace BlackGui private: QScopedPointer ui; - CTimerBasedComponent *m_timerComponent; + CUpdateTimer *m_updateTimer; }; } } diff --git a/src/blackgui/dockwidget.h b/src/blackgui/dockwidget.h index 08cec1f6d..e6ce90a26 100644 --- a/src/blackgui/dockwidget.h +++ b/src/blackgui/dockwidget.h @@ -12,7 +12,7 @@ #ifndef BLACKGUI_DOCKWIDGET_H #define BLACKGUI_DOCKWIDGET_H -#include "components/runtimebasedcomponent.h" +#include "components/enableforruntime.h" #include #include #include diff --git a/src/blackgui/dockwidgetinfoarea.cpp b/src/blackgui/dockwidgetinfoarea.cpp index 4309dd6e9..742421d40 100644 --- a/src/blackgui/dockwidgetinfoarea.cpp +++ b/src/blackgui/dockwidgetinfoarea.cpp @@ -77,8 +77,8 @@ namespace BlackGui void CDockWidgetInfoArea::initalFloating() { CDockWidget::initalFloating(); // initial floating to init position & size - QList infoAreaDockWidgets = this->findEmbeddedDockWidgetInfoAreaComponents(); - foreach(CDockWidgetInfoAreaComponent * dwia, infoAreaDockWidgets) + QList infoAreaDockWidgets = this->findEmbeddedDockWidgetInfoAreaComponents(); + foreach(CEnableForDockWidgetInfoArea * dwia, infoAreaDockWidgets) { // KWB: potentially a risk when this object is deleted // put under normal situations the child object will be deleted as well, and we have @@ -87,13 +87,13 @@ namespace BlackGui } } - QList CDockWidgetInfoArea::findEmbeddedDockWidgetInfoAreaComponents() + QList CDockWidgetInfoArea::findEmbeddedDockWidgetInfoAreaComponents() { QList widgets = this->findChildren(); - QList widgetsWithDockWidgetInfoAreaComponent; + QList widgetsWithDockWidgetInfoAreaComponent; foreach(QWidget * w, widgets) { - CDockWidgetInfoAreaComponent *dwc = dynamic_cast(w); + CEnableForDockWidgetInfoArea *dwc = dynamic_cast(w); if (dwc) { widgetsWithDockWidgetInfoAreaComponent.append(dwc); @@ -105,9 +105,9 @@ namespace BlackGui // we have to exclude the nested embedded areas foreach(CDockWidgetInfoArea * ia, nestedInfoAreas) { - QList nestedInfoAreaComponents = ia->findEmbeddedDockWidgetInfoAreaComponents(); + QList nestedInfoAreaComponents = ia->findEmbeddedDockWidgetInfoAreaComponents(); if (nestedInfoAreaComponents.isEmpty()) continue; - foreach(CDockWidgetInfoAreaComponent * iac, nestedInfoAreaComponents) + foreach(CEnableForDockWidgetInfoArea * iac, nestedInfoAreaComponents) { bool r = widgetsWithDockWidgetInfoAreaComponent.removeOne(iac); Q_ASSERT(r); // why is the nested component not in the child list? diff --git a/src/blackgui/dockwidgetinfoarea.h b/src/blackgui/dockwidgetinfoarea.h index b90031b66..12e3f664b 100644 --- a/src/blackgui/dockwidgetinfoarea.h +++ b/src/blackgui/dockwidgetinfoarea.h @@ -18,9 +18,9 @@ namespace BlackGui { //! Forward declarations class CInfoArea; - namespace Components { class CDockWidgetInfoAreaComponent; } + namespace Components { class CEnableForDockWidgetInfoArea; } - //! Specialized class for dock widgets serving as info area + //! Specialized class for dock widgets serving as info area. //! \sa CDockWidgetInfoBar //! \sa CInfoArea class CDockWidgetInfoArea : public CDockWidget @@ -53,7 +53,7 @@ namespace BlackGui private: //! Find all embedded dock widget components. These are components marked as CDockWidgetInfoAreaComponent //! \remarks Only directly embedded info area components, not those of nested info areas - QList findEmbeddedDockWidgetInfoAreaComponents(); + QList findEmbeddedDockWidgetInfoAreaComponents(); //! Nested info areas QList findNestedInfoAreas(); diff --git a/src/blackgui/dockwidgetinfobar.cpp b/src/blackgui/dockwidgetinfobar.cpp index 392b9b3f2..4547d5760 100644 --- a/src/blackgui/dockwidgetinfobar.cpp +++ b/src/blackgui/dockwidgetinfobar.cpp @@ -26,7 +26,7 @@ namespace BlackGui this->setMarginsWhenDocked(0, 0, 0, -1); this->setWindowTitle("Info bar"); this->setWindowIcon(CIcons::swift24()); - this->onStyleSheetsChanged(); + this->ps_onStyleSheetsChanged(); } void CDockWidgetInfoBar::addToContextMenu(QMenu *contextMenu) const @@ -35,7 +35,7 @@ namespace BlackGui CDockWidget::addToContextMenu(contextMenu); } - void CDockWidgetInfoBar::onStyleSheetsChanged() + void CDockWidgetInfoBar::ps_onStyleSheetsChanged() { QString st = CStyleSheetUtility::instance().style(CStyleSheetUtility::fileNameInfoBar()); this->setStyleSheet(st); diff --git a/src/blackgui/dockwidgetinfobar.h b/src/blackgui/dockwidgetinfobar.h index e7ed0a4d2..b6082dad6 100644 --- a/src/blackgui/dockwidgetinfobar.h +++ b/src/blackgui/dockwidgetinfobar.h @@ -34,7 +34,7 @@ namespace BlackGui protected slots: //! \copydoc CDockWidget::ps_onStyleSheetsChanged - virtual void onStyleSheetsChanged() override; + virtual void ps_onStyleSheetsChanged() override; }; diff --git a/src/blackgui/infoarea.h b/src/blackgui/infoarea.h index 7cb5f5181..b8cdcfbdf 100644 --- a/src/blackgui/infoarea.h +++ b/src/blackgui/infoarea.h @@ -25,7 +25,6 @@ namespace BlackGui //! \sa CDockWidgetInfoArea class CInfoArea : public QMainWindow { - // KB: TODO, make this an interface, IInfoArea? Q_OBJECT public: @@ -92,9 +91,9 @@ namespace BlackGui QList m_dockableWidgets ; QTabBar *m_tabBar = nullptr; bool m_showTabTexts = true; //!< texts for tabs - bool m_infoAreaFloating = false; //!< whole info area floating - bool m_showTabBar = true; //!< auto ajdust the floating widgets - bool m_lockTabBar = false; //!< locked means no double clicks possible + bool m_infoAreaFloating = false; //!< whole info area floating? + bool m_showTabBar = true; //!< show the tab bar? + bool m_lockTabBar = false; //!< locked: means double clicks ignored //! Tabify the widgets void tabifyAllWidgets(); diff --git a/src/swiftgui_standard/mainwindow.h b/src/swiftgui_standard/mainwindow.h index 72ae1b29e..8395fe79f 100644 --- a/src/swiftgui_standard/mainwindow.h +++ b/src/swiftgui_standard/mainwindow.h @@ -22,7 +22,7 @@ #include "blackcore/context_simulator.h" #include "blackcore/context_runtime.h" #include "blackcore/input_manager.h" -#include "blackgui/components/runtimebasedcomponent.h" +#include "blackgui/components/enableforruntime.h" #include "blackgui/components/infowindowcomponent.h" #include "blackgui/transpondermodeselector.h" #include "blackgui/models/atcstationlistmodel.h" @@ -44,7 +44,7 @@ namespace Ui { class MainWindow; } //! swift GUI -class MainWindow : public QMainWindow, public BlackGui::Components::CRuntimeBasedComponent +class MainWindow : public QMainWindow, public BlackGui::Components::CEnableForRuntime { Q_OBJECT diff --git a/src/swiftgui_standard/mainwindow_init.cpp b/src/swiftgui_standard/mainwindow_init.cpp index 6b9394244..fb8714e55 100644 --- a/src/swiftgui_standard/mainwindow_init.cpp +++ b/src/swiftgui_standard/mainwindow_init.cpp @@ -75,7 +75,7 @@ void MainWindow::init(const CRuntimeConfig &runtimeConfig) // context this->createRuntime(runtimeConfig, this); - CRuntimeBasedComponent::setRuntimeForComponents(this->getRuntime(), this); + CEnableForRuntime::setRuntimeForComponents(this->getRuntime(), this); // wire GUI signals this->initGuiSignals();