mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 18:35:35 +08:00
refs #485, renamed (CContextRuntime) to CCoreFacade
https://dev.vatsim-germany.org/issues/485#note-6
This commit is contained in:
committed by
Mathew Sutcliffe
parent
79cbcbc88f
commit
d9aac6427b
@@ -17,7 +17,7 @@ namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
void CEnableForRuntime::setRuntime(BlackCore::CRuntime *runtime, bool runtimeOwner)
|
||||
void CEnableForRuntime::setRuntime(BlackCore::CCoreFacade *runtime, bool runtimeOwner)
|
||||
{
|
||||
Q_ASSERT(runtime);
|
||||
this->m_runtime = runtime;
|
||||
@@ -25,7 +25,7 @@ namespace BlackGui
|
||||
this->runtimeHasBeenSet();
|
||||
}
|
||||
|
||||
void CEnableForRuntime::setRuntimeForComponents(BlackCore::CRuntime *runtime, QWidget *parent)
|
||||
void CEnableForRuntime::setRuntimeForComponents(BlackCore::CCoreFacade *runtime, QWidget *parent)
|
||||
{
|
||||
if (!parent) return;
|
||||
|
||||
@@ -39,9 +39,9 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
void CEnableForRuntime::createRuntime(const BlackCore::CRuntimeConfig &config, QObject *parent)
|
||||
void CEnableForRuntime::createRuntime(const BlackCore::CCoreFacadeConfig &config, QObject *parent)
|
||||
{
|
||||
this->m_runtime = new BlackCore::CRuntime(config, parent);
|
||||
this->m_runtime = new BlackCore::CCoreFacade(config, parent);
|
||||
this->m_runtimeOwner = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
#define BLACKGUI_ENABLEFORRUNTIME_H
|
||||
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackcore/contextruntime.h"
|
||||
#include "blackcore/corefacade.h"
|
||||
#include "blackmisc/audio/notificationsounds.h"
|
||||
#include <QTimer>
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
class CRuntime;
|
||||
class CRuntimeConfig;
|
||||
class CCoreFacade;
|
||||
class CCoreFacadeConfig;
|
||||
class IContextApplication;
|
||||
class IContextAudio;
|
||||
class IContextNetwork;
|
||||
@@ -37,15 +37,15 @@ namespace BlackGui
|
||||
//! Component, which provides references to runtime objects
|
||||
//! \details Access to runtime allows to encapsualate many aspects of data access and makes
|
||||
//! the component widely independent from a central data provideer
|
||||
//! \sa BlackCore::CRuntime
|
||||
//! \sa BlackCore::CCoreFacade
|
||||
class BLACKGUI_EXPORT CEnableForRuntime
|
||||
{
|
||||
public:
|
||||
//! Set runtime, usually set by runtime owner (must only be one, usually main window)
|
||||
void setRuntime(BlackCore::CRuntime *runtime, bool runtimeOwner = false);
|
||||
void setRuntime(BlackCore::CCoreFacade *runtime, bool runtimeOwner = false);
|
||||
|
||||
//! Set runtime for each CRuntimeBasedComponent
|
||||
static void setRuntimeForComponents(BlackCore::CRuntime *runtime, QWidget *parent);
|
||||
static void setRuntimeForComponents(BlackCore::CCoreFacade *runtime, QWidget *parent);
|
||||
|
||||
//! Log message category
|
||||
static const BlackMisc::CLogCategoryList &getLogCategories()
|
||||
@@ -58,18 +58,18 @@ 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
|
||||
CEnableForRuntime(BlackCore::CRuntime *runtime = nullptr, bool runtimeOwner = false) :
|
||||
CEnableForRuntime(BlackCore::CCoreFacade *runtime = nullptr, bool runtimeOwner = false) :
|
||||
m_runtime(runtime), m_runtimeOwner(runtimeOwner)
|
||||
{}
|
||||
|
||||
//! Runtime const
|
||||
const BlackCore::CRuntime *getRuntime() const { return this->m_runtime;}
|
||||
const BlackCore::CCoreFacade *getRuntime() const { return this->m_runtime;}
|
||||
|
||||
//! Runtime non const
|
||||
BlackCore::CRuntime *getRuntime() { return this->m_runtime;}
|
||||
BlackCore::CCoreFacade *getRuntime() { return this->m_runtime;}
|
||||
|
||||
//! Create a runtime (becomes owner). Only create one runtime.
|
||||
void createRuntime(const BlackCore::CRuntimeConfig &config, QObject *parent);
|
||||
void createRuntime(const BlackCore::CCoreFacadeConfig &config, QObject *parent);
|
||||
|
||||
//! Context for application
|
||||
const BlackCore::IContextApplication *getIContextApplication() const;
|
||||
@@ -108,14 +108,14 @@ namespace BlackGui
|
||||
//! \remarks use this methods to hook up signal/slots with runtime
|
||||
virtual void runtimeHasBeenSet() {}
|
||||
|
||||
//! \copydoc BlackCore::CRuntime::hasRemoteApplicationContext
|
||||
//! \copydoc BlackCore::CCoreFacade::hasRemoteApplicationContext
|
||||
bool hasRemoteApplicationContext() const { return this->m_runtime->hasRemoteApplicationContext(); }
|
||||
|
||||
//! Play a given notification sound
|
||||
void playNotifcationSound(BlackMisc::Audio::CNotificationSounds::Notification notification) const;
|
||||
|
||||
private:
|
||||
BlackCore::CRuntime *m_runtime;
|
||||
BlackCore::CCoreFacade *m_runtime;
|
||||
bool m_runtimeOwner;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace BlackGui
|
||||
connect(this->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CMainKeypadAreaComponent::ps_connectionStatusChanged);
|
||||
connect(this->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CMainKeypadAreaComponent::ps_ownAircraftCockpitChanged);
|
||||
connect(this->getIContextAudio(), &IContextAudio::changedMute, this, &CMainKeypadAreaComponent::ps_muteChanged);
|
||||
connect(this, &CMainKeypadAreaComponent::commandEntered, this->getRuntime(), &CRuntime::parseCommandLine);
|
||||
connect(this, &CMainKeypadAreaComponent::commandEntered, this->getRuntime(), &CCoreFacade::parseCommandLine);
|
||||
}
|
||||
|
||||
void CMainKeypadAreaComponent::ps_buttonSelected()
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace BlackGui
|
||||
|
||||
connect(this->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CTextMessageComponent::ps_onChangedAircraftCockpit);
|
||||
connect(this->getDockWidgetInfoArea(), &CDockWidgetInfoArea::widgetTopLevelChanged, this, &CTextMessageComponent::ps_topLevelChanged);
|
||||
connect(this, &CTextMessageComponent::commandEntered, this->getRuntime(), &CRuntime::parseCommandLine);
|
||||
connect(this, &CTextMessageComponent::commandEntered, this->getRuntime(), &CCoreFacade::parseCommandLine);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user