mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 02:45:33 +08:00
refs #199, sendStatusMessage now in application context (an only done via application context)
This commit is contained in:
@@ -6,12 +6,12 @@
|
|||||||
#include "context_application_impl.h"
|
#include "context_application_impl.h"
|
||||||
#include "context_runtime.h"
|
#include "context_runtime.h"
|
||||||
#include "blackmisc/settingutilities.h"
|
#include "blackmisc/settingutilities.h"
|
||||||
|
#include <QtMsgHandler>
|
||||||
|
|
||||||
using namespace BlackMisc;
|
using namespace BlackMisc;
|
||||||
|
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Init this context
|
* Init this context
|
||||||
*/
|
*/
|
||||||
@@ -26,6 +26,24 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Status message
|
||||||
|
*/
|
||||||
|
void CContextApplication::sendStatusMessage(const CStatusMessage &message)
|
||||||
|
{
|
||||||
|
emit this->statusMessage(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Status messages
|
||||||
|
*/
|
||||||
|
void CContextApplication::sendStatusMessages(const CStatusMessageList &messages)
|
||||||
|
{
|
||||||
|
emit this->statusMessages(messages);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
* Re-emit signal
|
* Re-emit signal
|
||||||
*/
|
*/
|
||||||
void CContextApplication::signalFromProxy(const QString &signalName)
|
void CContextApplication::signalFromProxy(const QString &signalName)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#ifndef BLACKCORE_CONTEXTAPPLICATION_IMPL_H
|
#ifndef BLACKCORE_CONTEXTAPPLICATION_IMPL_H
|
||||||
#define BLACKCORE_CONTEXTAPPLICATION_IMPL_H
|
#define BLACKCORE_CONTEXTAPPLICATION_IMPL_H
|
||||||
|
|
||||||
#include "context_application.h"
|
#include "context_application_base.h"
|
||||||
#include "context_runtime.h"
|
#include "context_runtime.h"
|
||||||
#include "dbus_server.h"
|
#include "dbus_server.h"
|
||||||
|
|
||||||
@@ -23,6 +23,16 @@ namespace BlackCore
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
friend class CRuntime;
|
friend class CRuntime;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
//! \copydoc IContextApplication::ping()
|
||||||
|
virtual qint64 ping(qint64 token) const override;
|
||||||
|
|
||||||
|
//! \brief Status message
|
||||||
|
virtual void sendStatusMessage(const BlackMisc::CStatusMessage &message) override;
|
||||||
|
|
||||||
|
//! Send status messages
|
||||||
|
virtual void sendStatusMessages(const BlackMisc::CStatusMessageList &messages) override;
|
||||||
|
|
||||||
//! \copydoc CContext::reEmitSignalFromProxy
|
//! \copydoc CContext::reEmitSignalFromProxy
|
||||||
virtual void signalFromProxy(const QString &signalName) override;
|
virtual void signalFromProxy(const QString &signalName) override;
|
||||||
|
|
||||||
@@ -37,13 +47,6 @@ namespace BlackCore
|
|||||||
server->addObject(IContextApplication::ObjectPath(), this);
|
server->addObject(IContextApplication::ObjectPath(), this);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
public:
|
|
||||||
//! Destructor
|
|
||||||
virtual ~CContextApplication() {}
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
//! \copydoc IContextApplication::ping()
|
|
||||||
virtual qint64 ping(qint64 token) const override;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,4 +59,20 @@ namespace BlackCore
|
|||||||
this->m_dBusInterface->callDBus(QLatin1Literal("signalFromProxy"), signalName);
|
this->m_dBusInterface->callDBus(QLatin1Literal("signalFromProxy"), signalName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Status messages
|
||||||
|
*/
|
||||||
|
void CContextApplicationProxy::sendStatusMessage(const BlackMisc::CStatusMessage &message)
|
||||||
|
{
|
||||||
|
this->m_dBusInterface->callDBus(QLatin1Literal("sendStatusMessage"), message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Status messages
|
||||||
|
*/
|
||||||
|
void CContextApplicationProxy::sendStatusMessages(const BlackMisc::CStatusMessageList &messages)
|
||||||
|
{
|
||||||
|
this->m_dBusInterface->callDBus(QLatin1Literal("sendStatusMessages"), messages);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#ifndef BLACKCORE_CONTEXTAPPLICATION_PROXY_H
|
#ifndef BLACKCORE_CONTEXTAPPLICATION_PROXY_H
|
||||||
#define BLACKCORE_CONTEXTAPPLICATION_PROXY_H
|
#define BLACKCORE_CONTEXTAPPLICATION_PROXY_H
|
||||||
|
|
||||||
#include "context_application.h"
|
#include "context_application_base.h"
|
||||||
#include "blackmisc/genericdbusinterface.h"
|
#include "blackmisc/genericdbusinterface.h"
|
||||||
|
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
@@ -28,6 +28,12 @@ namespace BlackCore
|
|||||||
//! \copydoc IContextApplication::ping()
|
//! \copydoc IContextApplication::ping()
|
||||||
virtual qint64 ping(qint64 token) const override;
|
virtual qint64 ping(qint64 token) const override;
|
||||||
|
|
||||||
|
//! \brief Status message
|
||||||
|
virtual void sendStatusMessage(const BlackMisc::CStatusMessage &message) override;
|
||||||
|
|
||||||
|
//! Send status messages
|
||||||
|
virtual void sendStatusMessages(const BlackMisc::CStatusMessageList &messages) override;
|
||||||
|
|
||||||
//! \copydoc CContext::reEmitSignalFromProxy
|
//! \copydoc CContext::reEmitSignalFromProxy
|
||||||
void signalFromProxy(const QString &signalName) override;
|
void signalFromProxy(const QString &signalName) override;
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ namespace BlackCore
|
|||||||
this->connect(this->m_network, &INetwork::aircraftPositionUpdate, this, &CContextNetwork::psFsdAircraftUpdateReceived);
|
this->connect(this->m_network, &INetwork::aircraftPositionUpdate, this, &CContextNetwork::psFsdAircraftUpdateReceived);
|
||||||
this->connect(this->m_network, &INetwork::frequencyReplyReceived, this, &CContextNetwork::psFsdFrequencyReceived);
|
this->connect(this->m_network, &INetwork::frequencyReplyReceived, this, &CContextNetwork::psFsdFrequencyReceived);
|
||||||
this->connect(this->m_network, &INetwork::textMessagesReceived, this, &CContextNetwork::psFsdTextMessageReceived);
|
this->connect(this->m_network, &INetwork::textMessagesReceived, this, &CContextNetwork::psFsdTextMessageReceived);
|
||||||
this->connect(this->m_network, &INetwork::statusMessage, this, &CContextNetwork::statusMessage);
|
if (this->getIContextApplication()) this->connect(this->m_network, &INetwork::statusMessage, this->getIContextApplication(), &IContextApplication::sendStatusMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user