refs #472 Removed static_cast<int> for enums in blackcore, no longer needed.

This commit is contained in:
Mathew Sutcliffe
2015-09-27 18:39:41 +01:00
parent d13e863218
commit a6d17efc31
37 changed files with 99 additions and 124 deletions

View File

@@ -117,12 +117,10 @@ namespace BlackGui
this->tabBar()->setTabText(ap, aps);
}
void CAircraftComponent::ps_connectionStatusChanged(int from, int to)
void CAircraftComponent::ps_connectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to)
{
INetwork::ConnectionStatus fromStatus = static_cast<INetwork::ConnectionStatus>(from);
INetwork::ConnectionStatus toStatus = static_cast<INetwork::ConnectionStatus>(to);
Q_UNUSED(fromStatus);
if (INetwork::isDisconnectedStatus(toStatus))
Q_UNUSED(from);
if (INetwork::isDisconnectedStatus(to))
{
this->ui->tvp_AircraftInRange->clear();
}

View File

@@ -16,6 +16,7 @@
#include "blackgui/components/enableforruntime.h"
#include "blackgui/components/enablefordockwidgetinfoarea.h"
#include "blackgui/components/updatetimer.h"
#include "blackcore/network.h"
#include <QTabWidget>
#include <QScopedPointer>
@@ -72,7 +73,7 @@ namespace BlackGui
void ps_onRowCountChanged(int count, bool withFilter);
//! Connection status has been changed
void ps_connectionStatusChanged(int from, int to);
void ps_connectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to);
//! Highlight in simulator
void ps_onMenuHighlightInSimulator(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);

View File

@@ -200,12 +200,10 @@ namespace BlackGui
this->m_timestampBookedStationsChanged = QDateTime::currentDateTimeUtc();
}
void CAtcStationComponent::ps_connectionStatusChanged(uint from, uint to)
void CAtcStationComponent::ps_connectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to)
{
INetwork::ConnectionStatus fromStatus = static_cast<INetwork::ConnectionStatus>(from);
INetwork::ConnectionStatus toStatus = static_cast<INetwork::ConnectionStatus>(to);
Q_UNUSED(fromStatus);
if (INetwork::isDisconnectedStatus(toStatus))
Q_UNUSED(from);
if (INetwork::isDisconnectedStatus(to))
{
this->ui->tvp_AtcStationsOnline->clear();
this->updateTreeView();
@@ -255,7 +253,7 @@ namespace BlackGui
{
if (unit != CComSystem::Com1 && unit != CComSystem::Com2) { return; }
if (!CComSystem::isValidComFrequency(frequency)) { return; }
this->getIContextOwnAircraft()->updateActiveComFrequency(frequency, static_cast<int>(unit), identifier());
this->getIContextOwnAircraft()->updateActiveComFrequency(frequency, unit, identifier());
}
void CAtcStationComponent::updateTreeView()

View File

@@ -16,6 +16,7 @@
#include "blackgui/components/enableforruntime.h"
#include "blackgui/components/enablefordockwidgetinfoarea.h"
#include "blackgui/components/updatetimer.h"
#include "blackcore/network.h"
#include "blackmisc/identifiable.h"
#include "blackmisc/aviation/atcstation.h"
#include <QTabWidget>
@@ -94,7 +95,7 @@ namespace BlackGui
void ps_changedAtcStationsOnline();
//! Connection status has been changed
void ps_connectionStatusChanged(uint from, uint to);
void ps_connectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to);
//! Request dummy ATC online stations
void ps_testCreateDummyOnlineAtcStations(int number);

View File

@@ -118,7 +118,7 @@ namespace BlackGui
void CEnableForRuntime::playNotifcationSound(BlackSound::CNotificationSounds::Notification notification) const
{
if (!this->getIContextAudio()) return;
this->getIContextAudio()->playNotification(static_cast<uint>(notification), true);
this->getIContextAudio()->playNotification(notification, true);
}
}
}

View File

@@ -133,13 +133,11 @@ namespace BlackGui
}
}
void CInfoBarStatusComponent::ps_onNetworkConnectionChanged(int from, int to)
void CInfoBarStatusComponent::ps_onNetworkConnectionChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to)
{
INetwork::ConnectionStatus fromStatus = static_cast<INetwork::ConnectionStatus>(from);
INetwork::ConnectionStatus toStatus = static_cast<INetwork::ConnectionStatus>(to);
Q_UNUSED(fromStatus);
Q_UNUSED(from);
switch (toStatus)
switch (to)
{
case INetwork::Disconnected:
case INetwork::DisconnectedError:

View File

@@ -14,6 +14,7 @@
#include "blackgui/blackguiexport.h"
#include "enableforruntime.h"
#include "blackcore/network.h"
#include "../led.h"
#include <QFrame>
#include <QScopedPointer>
@@ -58,7 +59,7 @@ namespace BlackGui
void ps_onSimulatorStatusChanged(int status);
//! Network connection has been changed
void ps_onNetworkConnectionChanged(int from, int to);
void ps_onNetworkConnectionChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to);
//! Context menu requested
void ps_customAudioContextMenuRequested(const QPoint &position);

View File

@@ -244,7 +244,7 @@ namespace BlackGui
this->getIContextOwnAircraft()->updateOwnAircraftPilot(currentServer.getUser());
// Login
msg = this->getIContextNetwork()->connectToNetwork(currentServer, static_cast<uint>(mode));
msg = this->getIContextNetwork()->connectToNetwork(currentServer, mode);
}
else
{

View File

@@ -133,15 +133,12 @@ namespace BlackGui
}
}
void CMainKeypadAreaComponent::ps_connectionStatusChanged(uint from, uint to)
void CMainKeypadAreaComponent::ps_connectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to)
{
INetwork::ConnectionStatus statusFrom = static_cast<INetwork::ConnectionStatus>(from);
INetwork::ConnectionStatus statusTo = static_cast<INetwork::ConnectionStatus>(to);
Q_UNUSED(statusFrom);
Q_UNUSED(from);
// Connected button
if (statusTo == INetwork::Connected)
if (to == INetwork::Connected)
{
this->ui->pb_Connect->setText("Disconnect");
this->ui->pb_Connect->setStyleSheet("background-color: green");

View File

@@ -15,6 +15,7 @@
#include "blackgui/blackguiexport.h"
#include "maininfoareacomponent.h"
#include "enableforruntime.h"
#include "blackcore/network.h"
#include "blackmisc/identifier.h"
#include <QFrame>
@@ -76,7 +77,7 @@ namespace BlackGui
void ps_buttonSelected();
//! \copydoc BlackCore::IContextNetwork::connectionStatusChanged
void ps_connectionStatusChanged(uint from, uint to);
void ps_connectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to);
//! Command line entered
void ps_commandEntered();

View File

@@ -330,12 +330,10 @@ namespace BlackGui
Q_UNUSED(aircraft);
}
void CMappingComponent::ps_onConnectionStatusChanged(uint from, uint to)
void CMappingComponent::ps_onConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to)
{
INetwork::ConnectionStatus fromStatus = static_cast<INetwork::ConnectionStatus>(from);
INetwork::ConnectionStatus toStatus = static_cast<INetwork::ConnectionStatus>(to);
Q_UNUSED(fromStatus);
if (INetwork::isDisconnectedStatus(toStatus))
Q_UNUSED(from);
if (INetwork::isDisconnectedStatus(to))
{
this->ui->tvp_SimulatedAircraft->clear();
}

View File

@@ -17,6 +17,7 @@
#include "blackgui/components/enablefordockwidgetinfoarea.h"
#include "blackgui/components/updatetimer.h"
#include "blackgui/views/checkboxdelegate.h"
#include "blackcore/network.h"
#include "blackmisc/identifier.h"
#include "blackmisc/simulation/simulatedaircraft.h"
#include "blackmisc/simulation/aircraftmodellist.h"
@@ -104,7 +105,7 @@ namespace BlackGui
void ps_onFastPositionUpdatesEnabled(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::CIdentifier &originator);
//! Connection status has been changed
void ps_onConnectionStatusChanged(uint from, uint to);
void ps_onConnectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to);
//! Simulator has handled airspace snapshot
void ps_onAirspaceSnapshotHandled();

View File

@@ -91,12 +91,10 @@ namespace BlackGui
this->tabBar()->setTabText(ic, c);
}
void CUserComponent::ps_connectionStatusChanged(uint from, uint to)
void CUserComponent::ps_connectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to)
{
INetwork::ConnectionStatus fromStatus = static_cast<INetwork::ConnectionStatus>(from);
INetwork::ConnectionStatus toStatus = static_cast<INetwork::ConnectionStatus>(to);
Q_UNUSED(fromStatus);
if (INetwork::isDisconnectedStatus(toStatus))
Q_UNUSED(from);
if (INetwork::isDisconnectedStatus(to))
{
this->ui->tvp_AllUsers->clear();
this->ui->tvp_Clients->clear();

View File

@@ -16,7 +16,7 @@
#include "blackgui/components/enableforruntime.h"
#include "blackgui/components/enablefordockwidgetinfoarea.h"
#include "blackgui/components/updatetimer.h"
#include "blackcore/network.h"
#include <QTabWidget>
#include <QTimer>
#include <QScopedPointer>
@@ -67,7 +67,7 @@ namespace BlackGui
void ps_onCountChanged(int count, bool withFilter);
//! Connection status
void ps_connectionStatusChanged(uint from, uint to);
void ps_connectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to);
private:
QScopedPointer<Ui::CUserComponent> ui;

View File

@@ -82,7 +82,7 @@ namespace BlackGui
if (room1.isConnected())
{
this->ui->le_CockpitVoiceRoomCom1->setStyleSheet("background: green");
if (this->getIContextAudio()) this->ui->tvp_CockpitVoiceRoom1->updateContainer(this->getIContextAudio()->getRoomUsers(IContextAudio::Com1));
if (this->getIContextAudio()) this->ui->tvp_CockpitVoiceRoom1->updateContainer(this->getIContextAudio()->getRoomUsers(BlackMisc::Aviation::CComSystem::Com1));
}
else
{
@@ -111,7 +111,7 @@ namespace BlackGui
CNotificationSounds::Notification sound = connected ?
CNotificationSounds::NotificationVoiceRoomJoined :
CNotificationSounds::NotificationVoiceRoomLeft;
this->getIContextAudio()->playNotification(static_cast<uint>(sound), true);
this->getIContextAudio()->playNotification(sound, true);
}
}
}
@@ -121,7 +121,7 @@ namespace BlackGui
if (!this->getIContextAudio()) { return; }
if (!this->ui->le_CockpitVoiceRoomCom1->text().trimmed().isEmpty())
{
this->ui->tvp_CockpitVoiceRoom1->updateContainer(this->getIContextAudio()->getRoomUsers(IContextAudio::Com1));
this->ui->tvp_CockpitVoiceRoom1->updateContainer(this->getIContextAudio()->getRoomUsers(BlackMisc::Aviation::CComSystem::Com1));
}
else
{
@@ -130,7 +130,7 @@ namespace BlackGui
if (!this->ui->le_CockpitVoiceRoomCom2->text().trimmed().isEmpty())
{
this->ui->tvp_CockpitVoiceRoom2->updateContainer(this->getIContextAudio()->getRoomUsers(IContextAudio::Com2));
this->ui->tvp_CockpitVoiceRoom2->updateContainer(this->getIContextAudio()->getRoomUsers(BlackMisc::Aviation::CComSystem::Com2));
}
else
{