mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-30 14:15:35 +08:00
Ref T703, get partner callsign and validate it
* added functions in network details * validation and login with partner callsign
This commit is contained in:
committed by
Mat Sutcliffe
parent
6adea91618
commit
dd70a67cf0
@@ -17,6 +17,7 @@
|
||||
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackMisc::Audio;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackCore;
|
||||
using namespace BlackCore::Data;
|
||||
|
||||
@@ -59,10 +60,10 @@ namespace BlackGui
|
||||
|
||||
constexpr int MaxLength = 10;
|
||||
constexpr int MinLength = 0;
|
||||
CUpperCaseValidator *ucv = new CUpperCaseValidator(MinLength, MaxLength, ui->le_Copilot);
|
||||
CUpperCaseValidator *ucv = new CUpperCaseValidator(MinLength, MaxLength, ui->le_PartnerCallsign);
|
||||
ucv->setAllowedCharacters09AZ();
|
||||
ui->le_Copilot->setMaxLength(MaxLength);
|
||||
ui->le_Copilot->setValidator(ucv);
|
||||
ui->le_PartnerCallsign->setMaxLength(MaxLength);
|
||||
ui->le_PartnerCallsign->setValidator(ucv);
|
||||
|
||||
const int tab = m_networkSetup.wasLastUsedWithOtherServer() ? LoginOthers : LoginVATSIM;
|
||||
ui->tw_Network->setCurrentIndex(tab);
|
||||
@@ -243,6 +244,17 @@ namespace BlackGui
|
||||
return this->isVatsimServerSelected() ? this->getCurrentVatsimServer() : this->getCurrentOtherServer();
|
||||
}
|
||||
|
||||
bool CNetworkDetailsComponent::hasPartnerCallsign() const
|
||||
{
|
||||
return !ui->le_PartnerCallsign->text().isEmpty();
|
||||
}
|
||||
|
||||
CCallsign CNetworkDetailsComponent::getPartnerCallsign() const
|
||||
{
|
||||
if (ui->le_PartnerCallsign->text().isEmpty()) { return {}; }
|
||||
return CCallsign(ui->le_PartnerCallsign->text(), CCallsign::Aircraft);
|
||||
}
|
||||
|
||||
void CNetworkDetailsComponent::reloadOtherServersSetup()
|
||||
{
|
||||
const CServerList otherServers(m_networkSetup.getOtherServersPlusPredefinedServers());
|
||||
|
||||
Reference in New Issue
Block a user