mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-09 05:28:09 +08:00
Login component set FSD/voice details based on current server selection
This commit is contained in:
@@ -76,9 +76,8 @@ namespace BlackGui
|
||||
ui(new Ui::CLoginComponent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->tw_Details->setCurrentWidget(ui->tb_LoginMode);
|
||||
m_logoffCountdownTimer.setObjectName("CLoginComponent:m_logoffCountdownTimer");
|
||||
this->setLogoffCountdown();
|
||||
connect(&m_logoffCountdownTimer, &QTimer::timeout, this, &CLoginComponent::logoffCountdown);
|
||||
|
||||
ui->tw_Network->setCurrentIndex(0);
|
||||
ui->selector_AircraftIcao->displayWithIcaoDescription(false);
|
||||
@@ -86,6 +85,8 @@ namespace BlackGui
|
||||
ui->selector_AircraftIcao->displayMode(CDbAircraftIcaoSelectorComponent::DisplayIcaoAndId);
|
||||
ui->selector_AirlineIcao->displayMode(CDbAirlineIcaoSelectorComponent::DisplayVDesignatorAndId);
|
||||
|
||||
this->setLogoffCountdown();
|
||||
connect(&m_logoffCountdownTimer, &QTimer::timeout, this, &CLoginComponent::logoffCountdown);
|
||||
connect(ui->comp_OtherServers, &CServerListSelector::serverChanged, this, &CLoginComponent::onSelectedServerChanged);
|
||||
connect(ui->comp_VatsimServers, &CServerListSelector::serverChanged, this, &CLoginComponent::onSelectedServerChanged);
|
||||
connect(ui->tw_Network, &QTabWidget::currentChanged, this, &CLoginComponent::onServerTabWidgetChanged);
|
||||
@@ -272,7 +273,7 @@ namespace BlackGui
|
||||
}
|
||||
|
||||
// Server
|
||||
currentServer = vatsimLogin ? this->getCurrentVatsimServer() : this->getCurrentOtherServer();
|
||||
currentServer = this->getCurrentServer();
|
||||
const CUser user = this->getUserFromPilotGuiValues();
|
||||
currentServer.setUser(user);
|
||||
|
||||
@@ -436,8 +437,14 @@ namespace BlackGui
|
||||
{
|
||||
Q_UNUSED(index);
|
||||
const bool showNetwork = (ui->tw_Details->currentWidget() != ui->tb_FsdDetails);
|
||||
|
||||
const CServer server = this->getCurrentServer();
|
||||
|
||||
// only override if not yet enabled
|
||||
if (!ui->form_FsdDetails->isFsdSetupEnabled()) { ui->form_FsdDetails->setValue(server.getFsdSetup()); }
|
||||
if (!ui->form_Voice->isVoiceSetupEnabled()) { ui->form_Voice->setValue(server.getVoiceSetup()); }
|
||||
|
||||
ui->tw_Network->setVisible(showNetwork);
|
||||
// this->setServerButtonsVisible(showNetwork);
|
||||
ui->tw_Details->setMinimumHeight(showNetwork ? 0 : 125);
|
||||
}
|
||||
|
||||
@@ -482,6 +489,11 @@ namespace BlackGui
|
||||
return ui->comp_OtherServers->currentServer();
|
||||
}
|
||||
|
||||
CServer CLoginComponent::getCurrentServer() const
|
||||
{
|
||||
return this->isVatsimNetworkTabSelected() ? this->getCurrentVatsimServer() : this->getCurrentOtherServer();
|
||||
}
|
||||
|
||||
void CLoginComponent::startLogoffTimerCountdown()
|
||||
{
|
||||
ui->pb_LogoffTimeout->setValue(m_logoffIntervalSeconds);
|
||||
|
||||
@@ -150,6 +150,9 @@ namespace BlackGui
|
||||
//! Selected server (others)
|
||||
BlackMisc::Network::CServer getCurrentOtherServer() const;
|
||||
|
||||
//! Current server based on selected tab
|
||||
BlackMisc::Network::CServer getCurrentServer() const;
|
||||
|
||||
//! Get a prefill model
|
||||
BlackMisc::Simulation::CAircraftModel getPrefillModel() const;
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@
|
||||
<item alignment="Qt::AlignTop">
|
||||
<widget class="QTabWidget" name="tw_Details">
|
||||
<property name="currentIndex">
|
||||
<number>3</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tb_LoginMode">
|
||||
<attribute name="title">
|
||||
@@ -277,7 +277,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>236</width>
|
||||
<width>259</width>
|
||||
<height>55</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
||||
Reference in New Issue
Block a user