Added LoginMode for login from GUI

* updated context method
* updated GUI, checkboxes for mode
* style sheet modified due to GUI update
This commit is contained in:
Klaus Basan
2014-01-26 02:34:56 +01:00
parent 740424ed09
commit 1199f05fe2
7 changed files with 268 additions and 55 deletions

View File

@@ -91,7 +91,7 @@ namespace BlackCore
/*
* Connect to network
*/
CStatusMessageList CContextNetwork::connectToNetwork()
CStatusMessageList CContextNetwork::connectToNetwork(uint loginMode)
{
// this->log(Q_FUNC_INFO);
CStatusMessageList msgs;
@@ -107,8 +107,10 @@ namespace BlackCore
}
else
{
INetwork::LoginMode mode = static_cast<INetwork::LoginMode>(loginMode);
this->m_ownAircraft.setPilot(currentServer.getUser()); // still needed?
this->m_network->presetServer(currentServer);
this->m_network->presetLoginMode(mode);
this->m_network->presetCallsign(this->m_ownAircraft.getCallsign());
this->m_network->presetIcaoCodes(this->m_ownAircraft.getIcaoInfo());
this->m_network->setOwnAircraft(this->m_ownAircraft);

View File

@@ -70,12 +70,12 @@ namespace BlackCore
public slots:
/*!
* \brief Read ATC bookings
* \copydoc IContextNetwork::readAtcBookingsFromSource()
*/
virtual void readAtcBookingsFromSource() const;
/*!
* \brief The "central" ATC list with online ATC controllers
* \copydoc IContextNetwork::getAtcStationsOnline()
* \todo If I make this &getAtcStations XML is not generated correctly, needs to be crosschecked with the latest version of Qt
*/
virtual const BlackMisc::Aviation::CAtcStationList getAtcStationsOnline() const
@@ -85,7 +85,7 @@ namespace BlackCore
}
/*!
* \brief ATC list, with booked controllers
* \copydoc IContextNetwork::getAtcStationsBooked()
* \todo If I make this &getAtcStations XML is not generated correctly
*/
virtual const BlackMisc::Aviation::CAtcStationList getAtcStationsBooked() const
@@ -95,8 +95,7 @@ namespace BlackCore
}
/*!
* \brief Aircraft list
* \return
* \copydoc IContextNetwork::getAircraftsInRange()
*/
virtual const BlackMisc::Aviation::CAircraftList getAircraftsInRange() const
{
@@ -105,19 +104,17 @@ namespace BlackCore
}
/*!
* \brief Connect to Network
* \return a message list showing the connection situation
* \copydoc IContextNetwork::connectToNetwork()
*/
virtual BlackMisc::CStatusMessageList connectToNetwork();
virtual BlackMisc::CStatusMessageList connectToNetwork(uint mode);
/*!
* \brief Disconnect from network
* \return a message list showing the disconnection situation
* \copydoc IContextNetwork::disconnectFromNetwork()
*/
virtual BlackMisc::CStatusMessageList disconnectFromNetwork();
/*!
* \brief Network connected?
* \copydoc IContextNetwork::isConnected()
*/
virtual bool isConnected() const;

View File

@@ -101,9 +101,9 @@ namespace BlackCore
return this->m_dBusInterface->callDBusRet<BlackMisc::Aviation::CAircraft>(QLatin1Literal("getOwnAircraft"));
}
BlackMisc::CStatusMessageList IContextNetwork::connectToNetwork()
BlackMisc::CStatusMessageList IContextNetwork::connectToNetwork(uint loginMode)
{
return this->m_dBusInterface->callDBusRet<BlackMisc::CStatusMessageList>(QLatin1Literal("connectToNetwork"));
return this->m_dBusInterface->callDBusRet<BlackMisc::CStatusMessageList>(QLatin1Literal("connectToNetwork"), loginMode);
}
BlackMisc::CStatusMessageList IContextNetwork::disconnectFromNetwork()

View File

@@ -143,6 +143,7 @@ namespace BlackCore
* \param from old status
* \param to new status
* \remarks If I use the enum, adaptor / interface are not created correctly
* \see INetwork::ConnectionStatus
*/
void connectionStatusChanged(uint from, uint to);
@@ -193,8 +194,9 @@ namespace BlackCore
/*!
* \brief Connect to Network
* \return messages gererated during connecting
* \see INetwork::LoginMode
*/
virtual BlackMisc::CStatusMessageList connectToNetwork();
virtual BlackMisc::CStatusMessageList connectToNetwork(uint loginMode);
/*!
* \brief Disconnect from network