mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-01 22:55:41 +08:00
Ref T192, init for P2P via CDBusServer::coreServiceName(connection)
This commit is contained in:
@@ -32,7 +32,7 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
namespace Context
|
namespace Context
|
||||||
{
|
{
|
||||||
IContextApplication *IContextApplication::create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &connection)
|
IContextApplication *IContextApplication::create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, CDBusServer *server, QDBusConnection &connection)
|
||||||
{
|
{
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
@@ -40,7 +40,7 @@ namespace BlackCore
|
|||||||
case CCoreFacadeConfig::LocalInDBusServer:
|
case CCoreFacadeConfig::LocalInDBusServer:
|
||||||
return (new CContextApplication(mode, parent))->registerWithDBus(server);
|
return (new CContextApplication(mode, parent))->registerWithDBus(server);
|
||||||
case CCoreFacadeConfig::Remote:
|
case CCoreFacadeConfig::Remote:
|
||||||
return new CContextApplicationProxy(BlackMisc::CDBusServer::coreServiceName(), connection, mode, parent);
|
return new CContextApplicationProxy(CDBusServer::coreServiceName(connection), connection, mode, parent);
|
||||||
case CCoreFacadeConfig::NotUsed:
|
case CCoreFacadeConfig::NotUsed:
|
||||||
default:
|
default:
|
||||||
return new CContextApplicationEmpty(parent);
|
return new CContextApplicationEmpty(parent);
|
||||||
@@ -136,14 +136,14 @@ namespace BlackCore
|
|||||||
qFatal("Not implemented"); // avoid losing a change during context interface construction
|
qFatal("Not implemented"); // avoid losing a change during context interface construction
|
||||||
}
|
}
|
||||||
|
|
||||||
void IContextApplication::registerHotkeyActions(const QStringList &actions, const BlackMisc::CIdentifier &origin)
|
void IContextApplication::registerHotkeyActions(const QStringList &actions, const CIdentifier &origin)
|
||||||
{
|
{
|
||||||
Q_UNUSED(actions);
|
Q_UNUSED(actions);
|
||||||
Q_UNUSED(origin);
|
Q_UNUSED(origin);
|
||||||
qFatal("Not implemented"); // avoid losing a change during context interface construction
|
qFatal("Not implemented"); // avoid losing a change during context interface construction
|
||||||
}
|
}
|
||||||
|
|
||||||
void IContextApplication::callHotkeyAction(const QString &action, bool argument, const BlackMisc::CIdentifier &origin)
|
void IContextApplication::callHotkeyAction(const QString &action, bool argument, const CIdentifier &origin)
|
||||||
{
|
{
|
||||||
Q_UNUSED(action);
|
Q_UNUSED(action);
|
||||||
Q_UNUSED(argument);
|
Q_UNUSED(argument);
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ namespace BlackCore
|
|||||||
virtual QString getPathAndContextId() const override { return this->buildPathAndContextId(ObjectPath()); }
|
virtual QString getPathAndContextId() const override { return this->buildPathAndContextId(ObjectPath()); }
|
||||||
|
|
||||||
//! Factory method
|
//! Factory method
|
||||||
static IContextApplication *create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn);
|
static IContextApplication *create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &connection);
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~IContextApplication() {}
|
virtual ~IContextApplication() {}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace BlackCore
|
|||||||
return CIcons::radio16();
|
return CIcons::radio16();
|
||||||
}
|
}
|
||||||
|
|
||||||
IContextAudio *IContextAudio::create(CCoreFacade *runtime, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn)
|
IContextAudio *IContextAudio::create(CCoreFacade *runtime, CCoreFacadeConfig::ContextMode mode, CDBusServer *server, QDBusConnection &connection)
|
||||||
{
|
{
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
@@ -53,7 +53,7 @@ namespace BlackCore
|
|||||||
case CCoreFacadeConfig::LocalInDBusServer:
|
case CCoreFacadeConfig::LocalInDBusServer:
|
||||||
return (new CContextAudio(mode, runtime))->registerWithDBus(server);
|
return (new CContextAudio(mode, runtime))->registerWithDBus(server);
|
||||||
case CCoreFacadeConfig::Remote:
|
case CCoreFacadeConfig::Remote:
|
||||||
return new CContextAudioProxy(BlackMisc::CDBusServer::coreServiceName(), conn, mode, runtime);
|
return new CContextAudioProxy(CDBusServer::coreServiceName(connection), connection, mode, runtime);
|
||||||
default:
|
default:
|
||||||
return new CContextAudioEmpty(runtime); // audio not mandatory
|
return new CContextAudioEmpty(runtime); // audio not mandatory
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ namespace BlackCore
|
|||||||
virtual QString getPathAndContextId() const override { return this->buildPathAndContextId(ObjectPath()); }
|
virtual QString getPathAndContextId() const override { return this->buildPathAndContextId(ObjectPath()); }
|
||||||
|
|
||||||
//! Factory method
|
//! Factory method
|
||||||
static IContextAudio *create(CCoreFacade *runtime, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn);
|
static IContextAudio *create(CCoreFacade *runtime, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &connection);
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~IContextAudio() {}
|
virtual ~IContextAudio() {}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace BlackCore
|
|||||||
case CCoreFacadeConfig::LocalInDBusServer:
|
case CCoreFacadeConfig::LocalInDBusServer:
|
||||||
return (new CContextNetwork(mode, runtime))->registerWithDBus(server);
|
return (new CContextNetwork(mode, runtime))->registerWithDBus(server);
|
||||||
case CCoreFacadeConfig::Remote:
|
case CCoreFacadeConfig::Remote:
|
||||||
return new CContextNetworkProxy(CDBusServer::coreServiceName(), connection, mode, runtime);
|
return new CContextNetworkProxy(CDBusServer::coreServiceName(connection), connection, mode, runtime);
|
||||||
case CCoreFacadeConfig::NotUsed:
|
case CCoreFacadeConfig::NotUsed:
|
||||||
default:
|
default:
|
||||||
return new CContextNetworkEmpty(runtime);
|
return new CContextNetworkEmpty(runtime);
|
||||||
|
|||||||
@@ -141,9 +141,6 @@ namespace BlackCore
|
|||||||
//! Connection status changed for online station
|
//! Connection status changed for online station
|
||||||
void changedAtcStationOnlineConnectionStatus(const BlackMisc::Aviation::CAtcStation &atcStation, bool connected);
|
void changedAtcStationOnlineConnectionStatus(const BlackMisc::Aviation::CAtcStation &atcStation, bool connected);
|
||||||
|
|
||||||
//! Terminated connection
|
|
||||||
void connectionTerminated();
|
|
||||||
|
|
||||||
//! User has been kicked from network
|
//! User has been kicked from network
|
||||||
void kicked(const QString &kickMessage);
|
void kicked(const QString &kickMessage);
|
||||||
|
|
||||||
|
|||||||
@@ -400,7 +400,7 @@ namespace BlackCore
|
|||||||
return sApp->getWebDataServices()->getVatsimVoiceServers();
|
return sApp->getWebDataServices()->getVatsimVoiceServers();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextNetwork::fsdConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to)
|
void CContextNetwork::fsdConnectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to)
|
||||||
{
|
{
|
||||||
if (this->isDebugEnabled()) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << from << to; }
|
if (this->isDebugEnabled()) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << from << to; }
|
||||||
auto fromOld = m_currentStatus; // own status cached
|
auto fromOld = m_currentStatus; // own status cached
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
CContextNetworkProxy::CContextNetworkProxy(const QString &serviceName, QDBusConnection &connection, CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContextNetwork(mode, runtime), m_dBusInterface(nullptr)
|
CContextNetworkProxy::CContextNetworkProxy(const QString &serviceName, QDBusConnection &connection, CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContextNetwork(mode, runtime), m_dBusInterface(nullptr)
|
||||||
{
|
{
|
||||||
m_dBusInterface = new BlackMisc::CGenericDBusInterface(
|
m_dBusInterface = new CGenericDBusInterface(
|
||||||
serviceName , IContextNetwork::ObjectPath(), IContextNetwork::InterfaceName(),
|
serviceName , IContextNetwork::ObjectPath(), IContextNetwork::InterfaceName(),
|
||||||
connection, this);
|
connection, this);
|
||||||
this->relaySignals(serviceName, connection);
|
this->relaySignals(serviceName, connection);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#include "blackmisc/aviation/aircraftsituation.h"
|
#include "blackmisc/aviation/aircraftsituation.h"
|
||||||
#include "blackmisc/dbusserver.h"
|
#include "blackmisc/dbusserver.h"
|
||||||
|
|
||||||
|
using namespace BlackMisc;
|
||||||
using namespace BlackMisc::Aviation;
|
using namespace BlackMisc::Aviation;
|
||||||
using namespace BlackMisc::PhysicalQuantities;
|
using namespace BlackMisc::PhysicalQuantities;
|
||||||
using namespace BlackMisc::Geo;
|
using namespace BlackMisc::Geo;
|
||||||
@@ -25,7 +26,7 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
namespace Context
|
namespace Context
|
||||||
{
|
{
|
||||||
IContextOwnAircraft *IContextOwnAircraft::create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn)
|
IContextOwnAircraft *IContextOwnAircraft::create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, CDBusServer *server, QDBusConnection &connection)
|
||||||
{
|
{
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
@@ -33,7 +34,7 @@ namespace BlackCore
|
|||||||
case CCoreFacadeConfig::LocalInDBusServer:
|
case CCoreFacadeConfig::LocalInDBusServer:
|
||||||
return (new CContextOwnAircraft(mode, parent))->registerWithDBus(server);
|
return (new CContextOwnAircraft(mode, parent))->registerWithDBus(server);
|
||||||
case CCoreFacadeConfig::Remote:
|
case CCoreFacadeConfig::Remote:
|
||||||
return new CContextOwnAircraftProxy(BlackMisc::CDBusServer::coreServiceName(), conn, mode, parent);
|
return new CContextOwnAircraftProxy(CDBusServer::coreServiceName(), connection, mode, parent);
|
||||||
case CCoreFacadeConfig::NotUsed:
|
case CCoreFacadeConfig::NotUsed:
|
||||||
default:
|
default:
|
||||||
return new CContextOwnAircraftEmpty(parent);
|
return new CContextOwnAircraftEmpty(parent);
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ namespace BlackCore
|
|||||||
virtual QString getPathAndContextId() const override { return this->buildPathAndContextId(ObjectPath()); }
|
virtual QString getPathAndContextId() const override { return this->buildPathAndContextId(ObjectPath()); }
|
||||||
|
|
||||||
//! Factory method
|
//! Factory method
|
||||||
static IContextOwnAircraft *create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn);
|
static IContextOwnAircraft *create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &connection);
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~IContextOwnAircraft() {}
|
virtual ~IContextOwnAircraft() {}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
#include <QFlag>
|
#include <QFlag>
|
||||||
|
|
||||||
|
using namespace BlackMisc;
|
||||||
using namespace BlackMisc::PhysicalQuantities;
|
using namespace BlackMisc::PhysicalQuantities;
|
||||||
|
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
@@ -34,13 +35,13 @@ namespace BlackCore
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
const BlackMisc::PhysicalQuantities::CTime &IContextSimulator::HighlightTime()
|
const PhysicalQuantities::CTime &IContextSimulator::HighlightTime()
|
||||||
{
|
{
|
||||||
static const CTime t(10.0, CTimeUnit::s());
|
static const CTime t(10.0, CTimeUnit::s());
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
IContextSimulator *IContextSimulator::create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn)
|
IContextSimulator *IContextSimulator::create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, CDBusServer *server, QDBusConnection &connection)
|
||||||
{
|
{
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
@@ -48,7 +49,7 @@ namespace BlackCore
|
|||||||
case CCoreFacadeConfig::LocalInDBusServer:
|
case CCoreFacadeConfig::LocalInDBusServer:
|
||||||
return (new CContextSimulator(mode, parent))->registerWithDBus(server);
|
return (new CContextSimulator(mode, parent))->registerWithDBus(server);
|
||||||
case CCoreFacadeConfig::Remote:
|
case CCoreFacadeConfig::Remote:
|
||||||
return new CContextSimulatorProxy(BlackMisc::CDBusServer::coreServiceName(), conn, mode, parent);
|
return new CContextSimulatorProxy(CDBusServer::coreServiceName(connection), connection, mode, parent);
|
||||||
case CCoreFacadeConfig::NotUsed:
|
case CCoreFacadeConfig::NotUsed:
|
||||||
default:
|
default:
|
||||||
return new CContextSimulatorEmpty(parent);
|
return new CContextSimulatorEmpty(parent);
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ namespace BlackCore
|
|||||||
virtual QString getPathAndContextId() const override { return this->buildPathAndContextId(ObjectPath()); }
|
virtual QString getPathAndContextId() const override { return this->buildPathAndContextId(ObjectPath()); }
|
||||||
|
|
||||||
//! Factory method
|
//! Factory method
|
||||||
static IContextSimulator *create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn);
|
static IContextSimulator *create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &connection);
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~IContextSimulator() {}
|
virtual ~IContextSimulator() {}
|
||||||
|
|||||||
Reference in New Issue
Block a user