Replace INetwork::CConnectionStatus with proper value object

This commit is contained in:
Roland Rossgotterer
2019-09-13 10:55:48 +02:00
parent 865b25df87
commit 4772aadc1a
42 changed files with 206 additions and 121 deletions

View File

@@ -22,7 +22,6 @@
#include "blackcore/context/contextaudio.h"
#include "blackcore/context/contextnetwork.h"
#include "blackcore/context/contextsimulator.h"
#include "blackcore/network.h"
#include "blackcore/webdataservices.h"
#include "blackcore/corefacadeconfig.h"
#include "blackmisc/audio/notificationsounds.h"
@@ -304,17 +303,16 @@ void SwiftGuiStd::onKickedFromNetwork(const QString &kickMessage)
// this->displayInOverlayWindow(CStatusMessage(this, CStatusMessage::SeverityError, msgText));
}
void SwiftGuiStd::onConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to)
void SwiftGuiStd::onConnectionStatusChanged(const CConnectionStatus &from, const CConnectionStatus &to)
{
Q_UNUSED(from);
this->updateGuiStatusInformation();
// sounds
switch (to)
switch (to.getConnectionStatus())
{
case INetwork::Connected: this->playNotifcationSound(CNotificationSounds::NotificationLogin); break;
case INetwork::Disconnected: this->playNotifcationSound(CNotificationSounds::NotificationLogoff); break;
case INetwork::DisconnectedError: this->playNotifcationSound(CNotificationSounds::NotificationError); break;
case CConnectionStatus::Connected: this->playNotifcationSound(CNotificationSounds::NotificationLogin); break;
case CConnectionStatus::Disconnected: this->playNotifcationSound(CNotificationSounds::NotificationLogoff); break;
default: break;
}
}

View File

@@ -25,7 +25,7 @@
#include "blackgui/managedstatusbar.h"
#include "blackgui/guiactionbind.h"
#include "blackcore/actionbind.h"
#include "blackcore/network.h"
#include "blackmisc/network/connectionstatus.h"
#include "blackmisc/simulation/simulatedaircraft.h"
#include "blackmisc/simulation/autopublishdata.h"
#include "blackmisc/audio/notificationsounds.h"
@@ -209,7 +209,7 @@ private:
//! Connection status changed
//! \param from old status
//! \param to new status
void onConnectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to);
void onConnectionStatusChanged(const BlackMisc::Network::CConnectionStatus &from, const BlackMisc::Network::CConnectionStatus &to);
//
// GUI related functions