diff --git a/src/blackgui/components/logincomponent.cpp b/src/blackgui/components/logincomponent.cpp index 2318c9bf9..6dcbd3153 100644 --- a/src/blackgui/components/logincomponent.cpp +++ b/src/blackgui/components/logincomponent.cpp @@ -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); diff --git a/src/blackgui/components/logincomponent.h b/src/blackgui/components/logincomponent.h index be47b585f..ec5b2a984 100644 --- a/src/blackgui/components/logincomponent.h +++ b/src/blackgui/components/logincomponent.h @@ -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; diff --git a/src/blackgui/components/logincomponent.ui b/src/blackgui/components/logincomponent.ui index 05c40d869..6588536ef 100644 --- a/src/blackgui/components/logincomponent.ui +++ b/src/blackgui/components/logincomponent.ui @@ -226,7 +226,7 @@ - 3 + 0 @@ -277,7 +277,7 @@ 0 0 - 236 + 259 55 diff --git a/src/blackgui/editors/voicesetupform.ui b/src/blackgui/editors/voicesetupform.ui index 516fcabed..dc459e8cf 100644 --- a/src/blackgui/editors/voicesetupform.ui +++ b/src/blackgui/editors/voicesetupform.ui @@ -6,7 +6,7 @@ 0 0 - 236 + 225 45 @@ -39,7 +39,7 @@ - VATSIM UDP Port: + Voice UDP Port: