Ref T168, relay kicked message thru context to UI

* new signal in context, connected with VATLIB
* display in UI
This commit is contained in:
Klaus Basan
2017-09-30 00:48:31 +02:00
committed by Mathew Sutcliffe
parent 2aa5ed431f
commit 27ebf3e43d
7 changed files with 28 additions and 9 deletions

View File

@@ -242,6 +242,14 @@ void SwiftGuiStd::onConnectionTerminated()
this->updateGuiStatusInformation();
}
void SwiftGuiStd::onKickedFromNetwork(const QString &kickMessage)
{
this->updateGuiStatusInformation();
this->displayInOverlayWindow(CStatusMessage(
this, CStatusMessage::SeverityError,
kickMessage.isEmpty() ? "You have been kicked from the network" : kickMessage));
}
void SwiftGuiStd::onConnectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to)
{
Q_UNUSED(from);

View File

@@ -210,6 +210,9 @@ private:
//! Terminated connection
void onConnectionTerminated();
//! Kicked from network
void onKickedFromNetwork(const QString &kickMessage);
//! Update timer
void handleTimerBasedUpdates();

View File

@@ -124,6 +124,7 @@ void SwiftGuiStd::init()
connect(sGui->getWebDataServices(), &CWebDataServices::sharedInfoObjectsRead, this, &SwiftGuiStd::sharedInfoObjectsLoaded);
connect(sGui->getIContextNetwork(), &IContextNetwork::connectionTerminated, this, &SwiftGuiStd::onConnectionTerminated);
connect(sGui->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &SwiftGuiStd::onConnectionStatusChanged);
connect(sGui->getIContextNetwork(), &IContextNetwork::kicked, this, &SwiftGuiStd::onKickedFromNetwork);
connect(sGui->getIContextNetwork(), &IContextNetwork::textMessagesReceived, ui->comp_MainInfoArea->getTextMessageComponent(), &CTextMessageComponent::onTextMessageReceived);
connect(sGui->getIContextNetwork(), &IContextNetwork::textMessageSent, ui->comp_MainInfoArea->getTextMessageComponent(), &CTextMessageComponent::onTextMessageSent);
connect(m_timerContextWatchdog, &QTimer::timeout, this, &SwiftGuiStd::handleTimerBasedUpdates);