mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +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(new Ui::CLoginComponent)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
ui->tw_Details->setCurrentWidget(ui->tb_LoginMode);
|
||||||
m_logoffCountdownTimer.setObjectName("CLoginComponent:m_logoffCountdownTimer");
|
m_logoffCountdownTimer.setObjectName("CLoginComponent:m_logoffCountdownTimer");
|
||||||
this->setLogoffCountdown();
|
|
||||||
connect(&m_logoffCountdownTimer, &QTimer::timeout, this, &CLoginComponent::logoffCountdown);
|
|
||||||
|
|
||||||
ui->tw_Network->setCurrentIndex(0);
|
ui->tw_Network->setCurrentIndex(0);
|
||||||
ui->selector_AircraftIcao->displayWithIcaoDescription(false);
|
ui->selector_AircraftIcao->displayWithIcaoDescription(false);
|
||||||
@@ -86,6 +85,8 @@ namespace BlackGui
|
|||||||
ui->selector_AircraftIcao->displayMode(CDbAircraftIcaoSelectorComponent::DisplayIcaoAndId);
|
ui->selector_AircraftIcao->displayMode(CDbAircraftIcaoSelectorComponent::DisplayIcaoAndId);
|
||||||
ui->selector_AirlineIcao->displayMode(CDbAirlineIcaoSelectorComponent::DisplayVDesignatorAndId);
|
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_OtherServers, &CServerListSelector::serverChanged, this, &CLoginComponent::onSelectedServerChanged);
|
||||||
connect(ui->comp_VatsimServers, &CServerListSelector::serverChanged, this, &CLoginComponent::onSelectedServerChanged);
|
connect(ui->comp_VatsimServers, &CServerListSelector::serverChanged, this, &CLoginComponent::onSelectedServerChanged);
|
||||||
connect(ui->tw_Network, &QTabWidget::currentChanged, this, &CLoginComponent::onServerTabWidgetChanged);
|
connect(ui->tw_Network, &QTabWidget::currentChanged, this, &CLoginComponent::onServerTabWidgetChanged);
|
||||||
@@ -272,7 +273,7 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Server
|
// Server
|
||||||
currentServer = vatsimLogin ? this->getCurrentVatsimServer() : this->getCurrentOtherServer();
|
currentServer = this->getCurrentServer();
|
||||||
const CUser user = this->getUserFromPilotGuiValues();
|
const CUser user = this->getUserFromPilotGuiValues();
|
||||||
currentServer.setUser(user);
|
currentServer.setUser(user);
|
||||||
|
|
||||||
@@ -436,8 +437,14 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
Q_UNUSED(index);
|
Q_UNUSED(index);
|
||||||
const bool showNetwork = (ui->tw_Details->currentWidget() != ui->tb_FsdDetails);
|
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);
|
ui->tw_Network->setVisible(showNetwork);
|
||||||
// this->setServerButtonsVisible(showNetwork);
|
|
||||||
ui->tw_Details->setMinimumHeight(showNetwork ? 0 : 125);
|
ui->tw_Details->setMinimumHeight(showNetwork ? 0 : 125);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -482,6 +489,11 @@ namespace BlackGui
|
|||||||
return ui->comp_OtherServers->currentServer();
|
return ui->comp_OtherServers->currentServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CServer CLoginComponent::getCurrentServer() const
|
||||||
|
{
|
||||||
|
return this->isVatsimNetworkTabSelected() ? this->getCurrentVatsimServer() : this->getCurrentOtherServer();
|
||||||
|
}
|
||||||
|
|
||||||
void CLoginComponent::startLogoffTimerCountdown()
|
void CLoginComponent::startLogoffTimerCountdown()
|
||||||
{
|
{
|
||||||
ui->pb_LogoffTimeout->setValue(m_logoffIntervalSeconds);
|
ui->pb_LogoffTimeout->setValue(m_logoffIntervalSeconds);
|
||||||
|
|||||||
@@ -150,6 +150,9 @@ namespace BlackGui
|
|||||||
//! Selected server (others)
|
//! Selected server (others)
|
||||||
BlackMisc::Network::CServer getCurrentOtherServer() const;
|
BlackMisc::Network::CServer getCurrentOtherServer() const;
|
||||||
|
|
||||||
|
//! Current server based on selected tab
|
||||||
|
BlackMisc::Network::CServer getCurrentServer() const;
|
||||||
|
|
||||||
//! Get a prefill model
|
//! Get a prefill model
|
||||||
BlackMisc::Simulation::CAircraftModel getPrefillModel() const;
|
BlackMisc::Simulation::CAircraftModel getPrefillModel() const;
|
||||||
|
|
||||||
|
|||||||
@@ -226,7 +226,7 @@
|
|||||||
<item alignment="Qt::AlignTop">
|
<item alignment="Qt::AlignTop">
|
||||||
<widget class="QTabWidget" name="tw_Details">
|
<widget class="QTabWidget" name="tw_Details">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>3</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tb_LoginMode">
|
<widget class="QWidget" name="tb_LoginMode">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@@ -277,7 +277,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>236</width>
|
<width>259</width>
|
||||||
<height>55</height>
|
<height>55</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>236</width>
|
<width>225</width>
|
||||||
<height>45</height>
|
<height>45</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="lbl_VatsimUdpPort">
|
<widget class="QLabel" name="lbl_VatsimUdpPort">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>VATSIM UDP Port:</string>
|
<string>Voice UDP Port:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
Reference in New Issue
Block a user