mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 10:25:36 +08:00
Ref T659, adjustments of login component, so login in dialog is reflected
This commit is contained in:
committed by
Mat Sutcliffe
parent
3e1e3fad0b
commit
7e4e4f0d37
@@ -134,8 +134,8 @@ namespace BlackGui
|
|||||||
ui->le_AircraftCombinedType->setMaxLength(3);
|
ui->le_AircraftCombinedType->setMaxLength(3);
|
||||||
ui->le_AircraftCombinedType->setValidator(new CUpperCaseValidator(this));
|
ui->le_AircraftCombinedType->setValidator(new CUpperCaseValidator(this));
|
||||||
connect(ui->le_AircraftCombinedType, &QLineEdit::editingFinished, this, &CLoginComponent::validateAircraftValues);
|
connect(ui->le_AircraftCombinedType, &QLineEdit::editingFinished, this, &CLoginComponent::validateAircraftValues);
|
||||||
connect(ui->selector_AircraftIcao, &CDbAircraftIcaoSelectorComponent::changedAircraftIcao, this, &CLoginComponent::changedAircraftIcao, Qt::QueuedConnection);
|
connect(ui->selector_AircraftIcao, &CDbAircraftIcaoSelectorComponent::changedAircraftIcao, this, &CLoginComponent::onChangedAircraftIcao, Qt::QueuedConnection);
|
||||||
connect(ui->selector_AirlineIcao, &CDbAirlineIcaoSelectorComponent::changedAirlineIcao, this, &CLoginComponent::changedAirlineIcao, Qt::QueuedConnection);
|
connect(ui->selector_AirlineIcao, &CDbAirlineIcaoSelectorComponent::changedAirlineIcao, this, &CLoginComponent::onChangedAirlineIcao, Qt::QueuedConnection);
|
||||||
connect(ui->pb_SimulatorLookup, &QToolButton::clicked, this, &CLoginComponent::lookupOwnAircraftModel);
|
connect(ui->pb_SimulatorLookup, &QToolButton::clicked, this, &CLoginComponent::lookupOwnAircraftModel);
|
||||||
connect(ui->tw_Details, &QTabWidget::currentChanged, this, &CLoginComponent::onDetailsTabChanged);
|
connect(ui->tw_Details, &QTabWidget::currentChanged, this, &CLoginComponent::onDetailsTabChanged);
|
||||||
|
|
||||||
@@ -146,6 +146,11 @@ namespace BlackGui
|
|||||||
connect(sGui->getIContextSimulator(), &IContextSimulator::simulatorStatusChanged, this, &CLoginComponent::onSimulatorStatusChanged, Qt::QueuedConnection);
|
connect(sGui->getIContextSimulator(), &IContextSimulator::simulatorStatusChanged, this, &CLoginComponent::onSimulatorStatusChanged, Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sGui && sGui->getIContextNetwork())
|
||||||
|
{
|
||||||
|
connect(sGui->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CLoginComponent::onNetworkStatusChanged, Qt::QueuedConnection);
|
||||||
|
}
|
||||||
|
|
||||||
// server and UI elements when in disconnect state
|
// server and UI elements when in disconnect state
|
||||||
ui->frp_CurrentServer->setReadOnly(true);
|
ui->frp_CurrentServer->setReadOnly(true);
|
||||||
ui->frp_CurrentServer->showPasswordField(false);
|
ui->frp_CurrentServer->showPasswordField(false);
|
||||||
@@ -438,6 +443,15 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CLoginComponent::onNetworkStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to)
|
||||||
|
{
|
||||||
|
Q_UNUSED(from);
|
||||||
|
if (to != INetwork::Connected) { return; }
|
||||||
|
|
||||||
|
this->setUiLoginState(true);
|
||||||
|
this->updateGui();
|
||||||
|
}
|
||||||
|
|
||||||
void CLoginComponent::onServerTabWidgetChanged(int index)
|
void CLoginComponent::onServerTabWidgetChanged(int index)
|
||||||
{
|
{
|
||||||
Q_UNUSED(index);
|
Q_UNUSED(index);
|
||||||
@@ -655,7 +669,7 @@ namespace BlackGui
|
|||||||
return validCombinedType && validAirlineDesignator && validAircraftDesignator && validCallsign;
|
return validCombinedType && validAirlineDesignator && validAircraftDesignator && validCallsign;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLoginComponent::changedAircraftIcao(const CAircraftIcaoCode &icao)
|
void CLoginComponent::onChangedAircraftIcao(const CAircraftIcaoCode &icao)
|
||||||
{
|
{
|
||||||
if (icao.isLoadedFromDb())
|
if (icao.isLoadedFromDb())
|
||||||
{
|
{
|
||||||
@@ -664,7 +678,7 @@ namespace BlackGui
|
|||||||
this->validateAircraftValues();
|
this->validateAircraftValues();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLoginComponent::changedAirlineIcao(const CAirlineIcaoCode &icao)
|
void CLoginComponent::onChangedAirlineIcao(const CAirlineIcaoCode &icao)
|
||||||
{
|
{
|
||||||
Q_UNUSED(icao);
|
Q_UNUSED(icao);
|
||||||
this->validateAircraftValues();
|
this->validateAircraftValues();
|
||||||
@@ -876,7 +890,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
if (!this->hasValidContexts()) { return; }
|
if (!this->hasValidContexts()) { return; }
|
||||||
if (!sGui->getIContextNetwork()) { return; }
|
if (!sGui->getIContextNetwork()) { return; }
|
||||||
IContextNetwork *nwc = sGui->getIContextNetwork();
|
const IContextNetwork *nwc = sGui->getIContextNetwork();
|
||||||
const bool connected = nwc->isConnected();
|
const bool connected = nwc->isConnected();
|
||||||
if (!connected) { return; }
|
if (!connected) { return; }
|
||||||
this->setUiLoginState(connected);
|
this->setUiLoginState(connected);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include "blackcore/vatsim/vatsimsettings.h"
|
#include "blackcore/vatsim/vatsimsettings.h"
|
||||||
#include "blackcore/data/networksetup.h"
|
#include "blackcore/data/networksetup.h"
|
||||||
|
#include "blackcore/network.h"
|
||||||
#include "blackgui/settings/guisettings.h"
|
#include "blackgui/settings/guisettings.h"
|
||||||
#include "blackgui/overlaymessagesframe.h"
|
#include "blackgui/overlaymessagesframe.h"
|
||||||
#include "blackgui/blackguiexport.h"
|
#include "blackgui/blackguiexport.h"
|
||||||
@@ -61,8 +62,7 @@ namespace BlackGui
|
|||||||
enum Tab
|
enum Tab
|
||||||
{
|
{
|
||||||
LoginVATSIM,
|
LoginVATSIM,
|
||||||
LoginOthers,
|
LoginOthers
|
||||||
LoginFSD
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Log categories
|
//! Log categories
|
||||||
@@ -168,10 +168,10 @@ namespace BlackGui
|
|||||||
bool validateAircraftValues();
|
bool validateAircraftValues();
|
||||||
|
|
||||||
//! Aircraft ICAO code has been changed
|
//! Aircraft ICAO code has been changed
|
||||||
void changedAircraftIcao(const BlackMisc::Aviation::CAircraftIcaoCode &icao);
|
void onChangedAircraftIcao(const BlackMisc::Aviation::CAircraftIcaoCode &icao);
|
||||||
|
|
||||||
//! Airline ICAO code has been changed
|
//! Airline ICAO code has been changed
|
||||||
void changedAirlineIcao(const BlackMisc::Aviation::CAirlineIcaoCode &icao);
|
void onChangedAirlineIcao(const BlackMisc::Aviation::CAirlineIcaoCode &icao);
|
||||||
|
|
||||||
//! Settings have been changed
|
//! Settings have been changed
|
||||||
void reloadOtherServersSetup();
|
void reloadOtherServersSetup();
|
||||||
@@ -224,6 +224,9 @@ namespace BlackGui
|
|||||||
//! Simulator status changed
|
//! Simulator status changed
|
||||||
void onSimulatorStatusChanged(int status);
|
void onSimulatorStatusChanged(int status);
|
||||||
|
|
||||||
|
//! Network status has changed
|
||||||
|
void onNetworkStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to);
|
||||||
|
|
||||||
//! Tab widget (server) changed
|
//! Tab widget (server) changed
|
||||||
void onServerTabWidgetChanged(int index);
|
void onServerTabWidgetChanged(int index);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user