Issue #15 [GUI] Use CLogHistoryReplica in CLogComponent and swift applications

This commit is contained in:
Mat Sutcliffe
2020-04-24 19:28:30 +01:00
parent 3b1e10b51e
commit 86dd91a064
19 changed files with 94 additions and 115 deletions

View File

@@ -906,6 +906,18 @@ namespace BlackCore
return this->startCoreFacadeAndWebDataServices(); // will do nothing if setup is not yet loaded
}
CStatusMessageList CApplication::useFacadeNoContexts()
{
Q_ASSERT_X(m_parsed, Q_FUNC_INFO, "Call this function after parsing");
m_useContexts = true; // otherwise startCoreFacadeAndWebDataServices will early-return
m_coreFacadeConfig = CCoreFacadeConfig::allEmpty();
const CStatusMessage msg = this->initLocalSettings();
if (msg.isFailure()) { return msg; }
return this->startCoreFacadeAndWebDataServices(); // will do nothing if setup is not yet loaded
}
CStatusMessageList CApplication::useWebDataServices(const CWebReaderFlags::WebReader webReaders, const CDatabaseReaderConfigList &dbReaderConfig)
{
Q_ASSERT_X(m_webDataServices.isNull(), Q_FUNC_INFO, "Services already started");

View File

@@ -369,6 +369,11 @@ namespace BlackCore
//! \remark requires setup loaded
BlackMisc::CStatusMessageList useContexts(const CCoreFacadeConfig &coreConfig);
//! Init the core facade without any contexts
//! \sa coreFacadeStarted
//! \remark requires setup loaded
BlackMisc::CStatusMessageList useFacadeNoContexts();
//! Init web data services and start them
//! \sa webDataServicesStarted
//! \remark requires setup loaded

View File

@@ -111,6 +111,7 @@ namespace BlackCore
m_dataLinkDBus = new SharedState::CDataLinkDBus(this);
switch (m_config.getModeApplication())
{
case CCoreFacadeConfig::NotUsed:
case CCoreFacadeConfig::Local:
m_dataLinkDBus->initializeLocal(nullptr);
break;
@@ -133,6 +134,12 @@ namespace BlackCore
m_logHistory->initialize(m_dataLinkDBus);
}
if (m_config.all(CCoreFacadeConfig::NotUsed))
{
m_initalized = true;
return;
}
// contexts
if (m_contextApplication) { m_contextApplication->deleteLater(); }
m_contextApplication = IContextApplication::create(this, m_config.getModeApplication(), m_dbusServer, m_dbusConnection);

View File

@@ -37,6 +37,15 @@ namespace BlackCore
m_simulator == mode);
}
bool CCoreFacadeConfig::all(CCoreFacadeConfig::ContextMode mode) const
{
return (m_application == mode &&
m_audio == mode &&
m_network == mode &&
m_ownAircraft == mode &&
m_simulator == mode);
}
bool CCoreFacadeConfig::anyRemote() const
{
return this->any(Remote);

View File

@@ -91,6 +91,9 @@ namespace BlackCore
//! Any context in given mode
bool any(ContextMode mode) const;
//! All contexts in given mode
bool all(ContextMode mode) const;
//! Any remote context?
bool anyRemote() const;