Use nested namespaces (C++17 feature)

This commit is contained in:
Mat Sutcliffe
2021-09-15 21:44:54 +01:00
parent 3f2e5b0b69
commit 57d32da826
1345 changed files with 146075 additions and 150376 deletions

View File

@@ -33,129 +33,123 @@
#include <QString>
namespace Ui { class CLoginAdvComponent; }
namespace BlackMisc
namespace BlackMisc::Simulation
{
namespace Simulation
{
class CAircraftModel;
class CSimulatedAircraft;
}
class CAircraftModel;
class CSimulatedAircraft;
}
namespace BlackGui
namespace BlackGui::Components
{
namespace Components
class CDbQuickMappingWizard;
/*!
* Login component to flight network
*/
class BLACKGUI_EXPORT CLoginAdvComponent : public COverlayMessagesFrame
{
class CDbQuickMappingWizard;
Q_OBJECT
/*!
* Login component to flight network
*/
class BLACKGUI_EXPORT CLoginAdvComponent : public COverlayMessagesFrame
{
Q_OBJECT
public:
//! Log categories
static const QStringList &getLogCategories();
public:
//! Log categories
static const QStringList &getLogCategories();
//! Constructor
explicit CLoginAdvComponent(QWidget *parent = nullptr);
//! Constructor
explicit CLoginAdvComponent(QWidget *parent = nullptr);
//! Destructor
virtual ~CLoginAdvComponent() override;
//! Destructor
virtual ~CLoginAdvComponent() override;
//! Automatically popup
void setAutoPopupWizad(bool autoPopup);
//! Automatically popup
void setAutoPopupWizad(bool autoPopup);
//! Set auto logoff
void setAutoLogoff(bool autoLogoff);
//! Set auto logoff
void setAutoLogoff(bool autoLogoff);
//! Login requested
void toggleNetworkConnection();
//! Login requested
void toggleNetworkConnection();
//! Reset state
void resetState();
//! Reset state
void resetState();
signals:
//! Login
void loginOrLogoffSuccessful();
signals:
//! Login
void loginOrLogoffSuccessful();
//! Cancelled
void loginOrLogoffCancelled();
//! Cancelled
void loginOrLogoffCancelled();
//! Request to be shown
void requestLoginPage();
//! Request to be shown
void requestLoginPage();
//! Request server settigs
void requestNetworkSettings();
//! Request server settigs
void requestNetworkSettings();
//! Relevant login data changed (digest version)
void loginDataChangedDigest();
//! Relevant login data changed (digest version)
void loginDataChangedDigest();
private:
// -------------- values from GUI -----------------
private:
// -------------- values from GUI -----------------
//! User from VATSIM data
BlackMisc::Network::CUser getUserFromPilotGuiValues() const;
//! User from VATSIM data
BlackMisc::Network::CUser getUserFromPilotGuiValues() const;
//! Update own callsign (own aircraft from what is set in the GUI)
//! \return changed?
bool updateOwnAircraftCallsignAndPilotFromGuiValues();
//! Update own callsign (own aircraft from what is set in the GUI)
//! \return changed?
bool updateOwnAircraftCallsignAndPilotFromGuiValues();
// -------------- values to GUI -----------------
// -------------- values to GUI -----------------
//! Update GUI values
void updateGui();
//! Update GUI values
void updateGui();
//! Set the "login as" values
void setGuiLoginAsValues(const BlackMisc::Simulation::CSimulatedAircraft &ownAircraft);
//! Set the "login as" values
void setGuiLoginAsValues(const BlackMisc::Simulation::CSimulatedAircraft &ownAircraft);
// -------------- others -----------------
// -------------- others -----------------
//! Selected server (VATSIM)
BlackMisc::Network::CServer getCurrentVatsimServer() const;
//! Selected server (VATSIM)
BlackMisc::Network::CServer getCurrentVatsimServer() const;
//! Selected server (others)
BlackMisc::Network::CServer getCurrentOtherServer() const;
//! Selected server (others)
BlackMisc::Network::CServer getCurrentOtherServer() const;
//! Current server based on selected tab
BlackMisc::Network::CServer getCurrentServer() const;
//! Current server based on selected tab
BlackMisc::Network::CServer getCurrentServer() const;
//! Login cancelled
void loginCancelled();
//! Login cancelled
void loginCancelled();
//! Auto-logoff detection
void autoLogoffDetection();
//! Auto-logoff detection
void autoLogoffDetection();
//! Logoff due to insufficient simulator frame rate
void autoLogoffFrameRate(bool fatal);
//! Logoff due to insufficient simulator frame rate
void autoLogoffFrameRate(bool fatal);
//! Pause/Continue timeout
void toggleTimeout();
//! Pause/Continue timeout
void toggleTimeout();
//! Set OK button string
void setOkButtonString(bool connected);
//! Set OK button string
void setOkButtonString(bool connected);
//! Load from settings
void loadRememberedUserData();
//! Load from settings
void loadRememberedUserData();
//! Copy credentials to pilot
void overrideCredentialsToPilot(const BlackMisc::Network::CUser &user);
//! Copy credentials to pilot
void overrideCredentialsToPilot(const BlackMisc::Network::CUser &user);
//! Simulator status changed
void onSimulatorStatusChanged(int status);
//! Simulator status changed
void onSimulatorStatusChanged(int status);
//! Has contexts?
bool hasValidContexts() const;
//! Has contexts?
bool hasValidContexts() const;
static constexpr int OverlayMessageMs = 5000;
static constexpr int LogoffIntervalSeconds = 20; //!< time before logoff
static constexpr int OverlayMessageMs = 5000;
static constexpr int LogoffIntervalSeconds = 20; //!< time before logoff
QScopedPointer<Ui::CLoginAdvComponent> ui;
BlackMisc::CDigestSignal m_changedLoginDataDigestSignal { this, &CLoginAdvComponent::loginDataChangedDigest, 1500, 10 };
BlackCore::Data::CNetworkSetup m_networkSetup; //!< servers last used
};
} // namespace
QScopedPointer<Ui::CLoginAdvComponent> ui;
BlackMisc::CDigestSignal m_changedLoginDataDigestSignal { this, &CLoginAdvComponent::loginDataChangedDigest, 1500, 10 };
BlackCore::Data::CNetworkSetup m_networkSetup; //!< servers last used
};
} // namespace
#endif // guard