mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 06:45:37 +08:00
@@ -79,6 +79,8 @@ namespace swift::gui::components
|
|||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
connect(ui->comp_NetworkDetails, &CNetworkDetailsComponent::requestNetworkSettings, this,
|
connect(ui->comp_NetworkDetails, &CNetworkDetailsComponent::requestNetworkSettings, this,
|
||||||
&CLoginComponent::requestNetworkSettings, Qt::QueuedConnection);
|
&CLoginComponent::requestNetworkSettings, Qt::QueuedConnection);
|
||||||
|
connect(ui->comp_NetworkDetails, &CNetworkDetailsComponent::currentServerChanged, this,
|
||||||
|
&CLoginComponent::onSelectedServerChanged, Qt::QueuedConnection);
|
||||||
|
|
||||||
// overlay
|
// overlay
|
||||||
this->setOverlaySizeFactors(0.8, 0.5);
|
this->setOverlaySizeFactors(0.8, 0.5);
|
||||||
@@ -298,7 +300,7 @@ namespace swift::gui::components
|
|||||||
if (!m_updatePilotOnServerChanges) { return; }
|
if (!m_updatePilotOnServerChanges) { return; }
|
||||||
const bool vatsim = this->isVatsimNetworkTabSelected();
|
const bool vatsim = this->isVatsimNetworkTabSelected();
|
||||||
const CUser user = vatsim ? this->getCurrentVatsimServer().getUser() : server.getUser();
|
const CUser user = vatsim ? this->getCurrentVatsimServer().getUser() : server.getUser();
|
||||||
ui->form_Pilot->setUser(user, true);
|
ui->form_Pilot->setUser(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLoginComponent::onSimulatorStatusChanged(int status)
|
void CLoginComponent::onSimulatorStatusChanged(int status)
|
||||||
@@ -333,7 +335,7 @@ namespace swift::gui::components
|
|||||||
if (!m_updatePilotOnServerChanges) { return; }
|
if (!m_updatePilotOnServerChanges) { return; }
|
||||||
const bool vatsim = this->isVatsimNetworkTabSelected();
|
const bool vatsim = this->isVatsimNetworkTabSelected();
|
||||||
const CServer server = vatsim ? this->getCurrentVatsimServer() : this->getCurrentOtherServer();
|
const CServer server = vatsim ? this->getCurrentVatsimServer() : this->getCurrentOtherServer();
|
||||||
ui->form_Pilot->setUser(server.getUser(), true);
|
ui->form_Pilot->setUser(server.getUser());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CLoginComponent::hasValidContexts() const
|
bool CLoginComponent::hasValidContexts() const
|
||||||
|
|||||||
@@ -52,6 +52,14 @@ namespace swift::gui::components
|
|||||||
const int tab = m_networkSetup.wasLastUsedWithOtherServer() ? LoginOthers : LoginVATSIM;
|
const int tab = m_networkSetup.wasLastUsedWithOtherServer() ? LoginOthers : LoginVATSIM;
|
||||||
ui->tw_Network->setCurrentIndex(tab);
|
ui->tw_Network->setCurrentIndex(tab);
|
||||||
|
|
||||||
|
connect(
|
||||||
|
ui->tw_Network, &QTabWidget::currentChanged, this,
|
||||||
|
[this](int) { emit this->currentServerChanged(getCurrentServer()); }, Qt::QueuedConnection);
|
||||||
|
connect(ui->comp_OtherServers, &CServerListSelector::serverChanged, this,
|
||||||
|
&CNetworkDetailsComponent::currentServerChanged, Qt::QueuedConnection);
|
||||||
|
connect(ui->comp_VatsimServers, &CServerListSelector::serverChanged, this,
|
||||||
|
&CNetworkDetailsComponent::currentServerChanged, Qt::QueuedConnection);
|
||||||
|
|
||||||
this->reloadOtherServersSetup();
|
this->reloadOtherServersSetup();
|
||||||
this->onWebServiceDataRead(CEntityFlags::VatsimDataFile, CEntityFlags::ReadFinished, -1, {});
|
this->onWebServiceDataRead(CEntityFlags::VatsimDataFile, CEntityFlags::ReadFinished, -1, {});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,13 +10,9 @@
|
|||||||
#include <QScopedPointer>
|
#include <QScopedPointer>
|
||||||
|
|
||||||
#include "core/data/networksetup.h"
|
#include "core/data/networksetup.h"
|
||||||
#include "misc/datacache.h"
|
|
||||||
#include "misc/network/connectionstatus.h"
|
|
||||||
#include "misc/network/data/lastserver.h"
|
#include "misc/network/data/lastserver.h"
|
||||||
#include "misc/network/entityflags.h"
|
#include "misc/network/entityflags.h"
|
||||||
#include "misc/network/fsdsetup.h"
|
|
||||||
#include "misc/network/loginmode.h"
|
#include "misc/network/loginmode.h"
|
||||||
#include "misc/settingscache.h"
|
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
@@ -77,6 +73,9 @@ namespace swift::gui::components
|
|||||||
//! Request network settings
|
//! Request network settings
|
||||||
void requestNetworkSettings();
|
void requestNetworkSettings();
|
||||||
|
|
||||||
|
//! Current selected server changed
|
||||||
|
void currentServerChanged(const misc::network::CServer &server);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//! Settings have been changed
|
//! Settings have been changed
|
||||||
void reloadOtherServersSetup();
|
void reloadOtherServersSetup();
|
||||||
|
|||||||
@@ -56,25 +56,13 @@ namespace swift::gui::editors
|
|||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CPilotForm::setUser(const CUser &user, bool ignoreEmptyUser)
|
void CPilotForm::setUser(const CUser &user)
|
||||||
{
|
{
|
||||||
if (ignoreEmptyUser && user.isNull()) { return false; }
|
ui->le_Id->setText(user.getId());
|
||||||
if (user.isValid())
|
ui->le_Password->setText(user.getPassword());
|
||||||
{
|
ui->le_RealName->setText(user.getRealName());
|
||||||
ui->le_Id->setText(user.getId());
|
if (user.hasHomeBase()) { ui->comp_HomeAirport->setAirportIcaoCode(user.getHomeBase()); }
|
||||||
ui->le_Password->setText(user.getPassword());
|
|
||||||
ui->le_RealName->setText(user.getRealName());
|
|
||||||
if (user.hasHomeBase()) { ui->comp_HomeAirport->setAirportIcaoCode(user.getHomeBase()); }
|
|
||||||
}
|
|
||||||
else if (CBuildConfig::isLocalDeveloperDebugBuild())
|
|
||||||
{
|
|
||||||
ui->le_Id->setText("1288459");
|
|
||||||
ui->le_Password->setText("4769");
|
|
||||||
ui->comp_HomeAirport->setAirportIcaoCode("LOWI");
|
|
||||||
ui->le_RealName->setText("Swift Project");
|
|
||||||
}
|
|
||||||
this->validate();
|
this->validate();
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPilotForm::clear()
|
void CPilotForm::clear()
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace swift::gui::editors
|
|||||||
swift::misc::network::CUser getUser() const;
|
swift::misc::network::CUser getUser() const;
|
||||||
|
|
||||||
//! Set user values
|
//! Set user values
|
||||||
bool setUser(const swift::misc::network::CUser &user, bool ignoreEmptyUser = false);
|
void setUser(const swift::misc::network::CUser &user);
|
||||||
|
|
||||||
//! Clear values
|
//! Clear values
|
||||||
void clear();
|
void clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user