mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-15 01:05:35 +08:00
Ref T659, login (new/advanced) component for dialog
* using new components * removed unused parts (now in components)
This commit is contained in:
committed by
Mat Sutcliffe
parent
83254e97aa
commit
c97bb2288c
@@ -19,8 +19,6 @@
|
||||
#include "blackmisc/simulation/data/lastmodel.h"
|
||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||
#include "blackmisc/aviation/callsign.h"
|
||||
#include "blackmisc/network/data/lastserver.h"
|
||||
#include "blackmisc/network/entityflags.h"
|
||||
#include "blackmisc/network/server.h"
|
||||
#include "blackmisc/network/user.h"
|
||||
#include "blackmisc/digestsignal.h"
|
||||
@@ -57,14 +55,6 @@ namespace BlackGui
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! The tabs
|
||||
enum Tab
|
||||
{
|
||||
LoginVATSIM,
|
||||
LoginOthers,
|
||||
LoginFSD
|
||||
};
|
||||
|
||||
//! Log categories
|
||||
static const BlackMisc::CLogCategoryList &getLogCategories();
|
||||
|
||||
@@ -80,9 +70,6 @@ namespace BlackGui
|
||||
//! Main info area changed
|
||||
void mainInfoAreaChanged(const QWidget *currentWidget);
|
||||
|
||||
//! Set a logoff time
|
||||
void setLogoffCountdown(int timeoutSeconds = -1);
|
||||
|
||||
//! Login requested
|
||||
void toggleNetworkConnection();
|
||||
|
||||
@@ -93,54 +80,33 @@ namespace BlackGui
|
||||
//! Cancelled
|
||||
void loginOrLogoffCancelled();
|
||||
|
||||
//! Request network settings
|
||||
void requestNetworkSettings();
|
||||
|
||||
//! Request to be shown
|
||||
void requestLoginPage();
|
||||
|
||||
//! Request server settigs
|
||||
void requestNetworkSettings();
|
||||
|
||||
//! Relevant login data changed (digest version)
|
||||
void loginDataChangedDigest();
|
||||
|
||||
private:
|
||||
//! GUI aircraft values, formatted
|
||||
struct CGuiAircraftValues
|
||||
{
|
||||
BlackMisc::Aviation::CCallsign ownCallsign;
|
||||
BlackMisc::Aviation::CAircraftIcaoCode ownAircraftIcao;
|
||||
BlackMisc::Aviation::CAirlineIcaoCode ownAirlineIcao;
|
||||
QString ownAircraftCombinedType;
|
||||
QString ownAircraftSimulatorModel;
|
||||
};
|
||||
|
||||
// -------------- values from GUI -----------------
|
||||
|
||||
//! Values from GUI
|
||||
CGuiAircraftValues getAircraftValuesFromGui() const;
|
||||
|
||||
//! User from VATSIM data
|
||||
BlackMisc::Network::CUser getUserFromPilotGuiValues() const;
|
||||
|
||||
//! Callsign from GUI
|
||||
BlackMisc::Aviation::CCallsign getCallsignFromGui() const;
|
||||
// BlackMisc::Aviation::CCallsign getCallsignFromGui() const;
|
||||
|
||||
//! Update own callsign (own aircraft from what is set in the GUI)
|
||||
//! \return changed?
|
||||
bool updateOwnAircraftCallsignAndPilotFromGuiValues();
|
||||
|
||||
//! Update own ICAO values (own aircraft from what is set in the GUI)
|
||||
//! \return changed?
|
||||
bool updateOwnAircaftIcaoValuesFromGuiValues();
|
||||
|
||||
// -------------- values to GUI -----------------
|
||||
|
||||
//! Update GUI values
|
||||
void updateGui();
|
||||
|
||||
//! Set ICAO values
|
||||
//! \return changed values?
|
||||
bool setGuiIcaoValues(const BlackMisc::Simulation::CAircraftModel &model, bool onlyIfEmpty);
|
||||
|
||||
//! Set the "login as" values
|
||||
void setGuiLoginAsValues(const BlackMisc::Simulation::CSimulatedAircraft &ownAircraft);
|
||||
|
||||
@@ -155,102 +121,36 @@ namespace BlackGui
|
||||
//! Current server based on selected tab
|
||||
BlackMisc::Network::CServer getCurrentServer() const;
|
||||
|
||||
//! Get a prefill model
|
||||
BlackMisc::Simulation::CAircraftModel getPrefillModel() const;
|
||||
|
||||
//! Login cancelled
|
||||
void loginCancelled();
|
||||
|
||||
//! VATSIM data file was loaded
|
||||
void onWebServiceDataRead(BlackMisc::Network::CEntityFlags::Entity entity, BlackMisc::Network::CEntityFlags::ReadState state, int number);
|
||||
|
||||
//! Validate aircaft
|
||||
bool validateAircraftValues();
|
||||
|
||||
//! Aircraft ICAO code has been changed
|
||||
void changedAircraftIcao(const BlackMisc::Aviation::CAircraftIcaoCode &icao);
|
||||
|
||||
//! Airline ICAO code has been changed
|
||||
void changedAirlineIcao(const BlackMisc::Aviation::CAirlineIcaoCode &icao);
|
||||
|
||||
//! Settings have been changed
|
||||
void reloadOtherServersSetup();
|
||||
|
||||
//! Logoff countdown
|
||||
void logoffCountdown();
|
||||
|
||||
//! Auto-logoff detection
|
||||
void autoLogoffDetection();
|
||||
|
||||
//! Lookup own model
|
||||
void lookupOwnAircraftModel();
|
||||
|
||||
//! Simulator model has been changed
|
||||
void onSimulatorModelChanged(const BlackMisc::Simulation::CAircraftModel &model);
|
||||
|
||||
//! Launch mapping wizard
|
||||
void mappingWizard();
|
||||
|
||||
//! Pause/Continue timeout
|
||||
void toggleTimeout();
|
||||
|
||||
//! Show / hide elements for UI depending on login state
|
||||
void setUiLoginState(bool connected);
|
||||
|
||||
//! Own model and ICAO data for GUI and own aircraft
|
||||
void setOwnModelAndIcaoValues(const BlackMisc::Simulation::CAircraftModel &ownModel = {});
|
||||
|
||||
//! Set OK button string
|
||||
void setOkButtonString(bool connected);
|
||||
|
||||
//! Logoff countdown
|
||||
void startLogoffTimerCountdown();
|
||||
|
||||
//! Highlight model field according to model data
|
||||
void highlightModelField(const BlackMisc::Simulation::CAircraftModel &model = {});
|
||||
|
||||
//! Is the VATSIM network tab selected?
|
||||
bool isVatsimNetworkTabSelected() const;
|
||||
|
||||
//! Load from settings
|
||||
void loadRememberedUserData();
|
||||
|
||||
//! Copy credentials to pilot
|
||||
void overrideCredentialsToPilot();
|
||||
|
||||
//! Server changed
|
||||
void onSelectedServerChanged(const BlackMisc::Network::CServer &server);
|
||||
void overrideCredentialsToPilot(const BlackMisc::Network::CUser &user);
|
||||
|
||||
//! Simulator status changed
|
||||
void onSimulatorStatusChanged(int status);
|
||||
|
||||
//! Tab widget (server) changed
|
||||
void onServerTabWidgetChanged(int index);
|
||||
|
||||
//! Has contexts?
|
||||
bool hasValidContexts() const;
|
||||
|
||||
//! Set the server buttons visible
|
||||
void setServerButtonsVisible(bool visible);
|
||||
|
||||
//! Tab index changed
|
||||
void onDetailsTabChanged(int index);
|
||||
|
||||
static constexpr int OverlayMessageMs = 5000;
|
||||
static constexpr int LogoffIntervalSeconds = 20; //!< time before logoff
|
||||
|
||||
QScopedPointer<Ui::CLoginAdvComponent> ui;
|
||||
QScopedPointer<CDbQuickMappingWizard> m_mappingWizard; //!< mapping wizard
|
||||
BlackMisc::CDigestSignal m_changedLoginDataDigestSignal { this, &CLoginAdvComponent::loginDataChangedDigest, 1500, 10 };
|
||||
bool m_autoPopupWizard = false; //!< automatically popup wizard if mapping is needed
|
||||
bool m_visible = false; //!< is this component selected?
|
||||
bool m_updatePilotOnServerChanges = true;
|
||||
const QIcon m_iconPlay {":/famfamfam/icons/famfamfam/icons/silk/control_play_blue.png"};
|
||||
const QIcon m_iconPause {":/famfamfam/icons/famfamfam/icons/silk/control_pause_blue.png"};
|
||||
int m_logoffIntervalSeconds = LogoffIntervalSeconds;
|
||||
QTimer m_logoffCountdownTimer; //!< timer for logoff countdown
|
||||
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::TLastModel> m_lastAircraftModel { this }; //!< recently used aircraft model
|
||||
BlackCore::Data::CNetworkSetup m_networkSetup; //!< servers last used
|
||||
};
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user