mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 18:35:35 +08:00
Issue #15 [GUI] Use CLogHistoryReplica in CLogComponent and swift applications
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user