mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-30 13:57:01 +08:00
refactor: Read AFV URLs from bootstrap.json
This also removes the possibility to change the URL on the fly via the UI. Fixes #257
This commit is contained in:
@@ -82,7 +82,7 @@ namespace BlackGui::Components
|
||||
this->setForceSmall(true);
|
||||
this->showKillButton(false);
|
||||
|
||||
// override details/voice
|
||||
// override details
|
||||
ui->comp_NetworkDetails->setAlwaysAllowOverride(true);
|
||||
|
||||
// Stored data
|
||||
@@ -164,12 +164,6 @@ namespace BlackGui::Components
|
||||
currentServer.setFsdSetup(fsd);
|
||||
}
|
||||
|
||||
if (ui->comp_NetworkDetails->isVoiceSetupOverrideEnabled())
|
||||
{
|
||||
const CVoiceSetup voice = ui->comp_NetworkDetails->getVoiceSetup();
|
||||
currentServer.setVoiceSetup(voice);
|
||||
}
|
||||
|
||||
// update for own aircraft context
|
||||
sGui->getIContextOwnAircraft()->updateOwnAircraftPilot(currentServer.getUser());
|
||||
|
||||
@@ -196,11 +190,6 @@ namespace BlackGui::Components
|
||||
}
|
||||
|
||||
// Login
|
||||
if (sGui && sGui->getCContextAudioBase())
|
||||
{
|
||||
sGui->getCContextAudioBase()->setVoiceSetup(currentServer.getVoiceSetup());
|
||||
}
|
||||
|
||||
msg = sGui->getIContextNetwork()->connectToNetwork(currentServer, values.ownLiverySend, values.useLivery, values.ownAircraftModelStringSend, values.useModelString, partnerCs, mode);
|
||||
if (msg.isSuccess())
|
||||
{
|
||||
|
||||
@@ -95,10 +95,6 @@ namespace BlackGui::Components
|
||||
ui->form_FsdDetails->setFsdSetupEnabled(false);
|
||||
ui->form_FsdDetails->setAlwaysAllowOverride(true);
|
||||
|
||||
ui->form_Voice->showEnableInfo(true);
|
||||
ui->form_Voice->setVoiceSetupEnabled(false);
|
||||
ui->form_Voice->setAlwaysAllowOverride(true);
|
||||
|
||||
ui->lblp_AircraftCombinedType->setToolTips("ok", "wrong");
|
||||
ui->lblp_AirlineIcao->setToolTips("ok", "wrong");
|
||||
ui->lblp_AircraftIcao->setToolTips("ok", "wrong");
|
||||
@@ -273,12 +269,6 @@ namespace BlackGui::Components
|
||||
currentServer.setFsdSetup(fsd);
|
||||
}
|
||||
|
||||
if (ui->form_Voice->isVoiceSetupEnabled())
|
||||
{
|
||||
const CVoiceSetup voice = ui->form_Voice->getValue();
|
||||
currentServer.setVoiceSetup(voice);
|
||||
}
|
||||
|
||||
ui->frp_CurrentServer->setServer(currentServer);
|
||||
sGui->getIContextOwnAircraft()->updateOwnAircraftPilot(currentServer.getUser());
|
||||
|
||||
@@ -286,11 +276,6 @@ namespace BlackGui::Components
|
||||
ownAircraft = sGui->getIContextOwnAircraft()->getOwnAircraft();
|
||||
|
||||
// Login
|
||||
if (sGui->getCContextAudioBase())
|
||||
{
|
||||
sGui->getCContextAudioBase()->setVoiceSetup(currentServer.getVoiceSetup());
|
||||
}
|
||||
|
||||
msg = sGui->getIContextNetwork()->connectToNetwork(currentServer, {}, true, {}, true, {}, mode);
|
||||
if (msg.isSuccess())
|
||||
{
|
||||
@@ -460,7 +445,6 @@ namespace BlackGui::Components
|
||||
|
||||
// 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_Details->setMinimumHeight(showNetwork ? 0 : 125);
|
||||
|
||||
@@ -314,35 +314,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tb_Voice">
|
||||
<attribute name="title">
|
||||
<string>Voice</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="vl_Voice">
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item alignment="Qt::AlignTop">
|
||||
<widget class="BlackGui::Editors::CVoiceSetupForm" name="form_Voice">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tb_MatchingLog">
|
||||
<attribute name="title">
|
||||
<string>Matching log</string>
|
||||
@@ -883,12 +854,6 @@
|
||||
<header>blackgui/editors/fsdsetupform.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Editors::CVoiceSetupForm</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>blackgui/editors/voicesetupform.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Components::CServerListSelector</class>
|
||||
<extends>QComboBox</extends>
|
||||
|
||||
@@ -46,9 +46,6 @@ namespace BlackGui::Components
|
||||
ui->form_FsdDetails->showEnableInfo(true);
|
||||
ui->form_FsdDetails->setFsdSetupEnabled(false);
|
||||
ui->form_FsdDetails->setReadOnly(false);
|
||||
ui->form_Voice->showEnableInfo(true);
|
||||
ui->form_Voice->setVoiceSetupEnabled(false);
|
||||
ui->form_Voice->setReadOnly(false);
|
||||
|
||||
constexpr int MaxLength = 10;
|
||||
constexpr int MinLength = 0;
|
||||
@@ -94,16 +91,6 @@ namespace BlackGui::Components
|
||||
return ui->tw_Details->currentWidget() == ui->tb_OtherServers;
|
||||
}
|
||||
|
||||
CVoiceSetup CNetworkDetailsComponent::getVoiceSetup() const
|
||||
{
|
||||
return ui->form_Voice->getValue();
|
||||
}
|
||||
|
||||
bool CNetworkDetailsComponent::isVoiceSetupOverrideEnabled() const
|
||||
{
|
||||
return ui->form_Voice->isVoiceSetupEnabled();
|
||||
}
|
||||
|
||||
CFsdSetup CNetworkDetailsComponent::getFsdSetup() const
|
||||
{
|
||||
return ui->form_FsdDetails->getValue();
|
||||
@@ -112,7 +99,6 @@ namespace BlackGui::Components
|
||||
void CNetworkDetailsComponent::setAlwaysAllowOverride(bool allow)
|
||||
{
|
||||
ui->form_FsdDetails->setAlwaysAllowOverride(allow);
|
||||
ui->form_Voice->setAlwaysAllowOverride(allow);
|
||||
}
|
||||
|
||||
bool CNetworkDetailsComponent::isFsdSetupOverrideEnabled() const
|
||||
@@ -139,7 +125,6 @@ namespace BlackGui::Components
|
||||
|
||||
// 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()); }
|
||||
}
|
||||
|
||||
void CNetworkDetailsComponent::onOverrideCredentialsToPilot()
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include "blackmisc/network/data/lastserver.h"
|
||||
#include "blackmisc/network/entityflags.h"
|
||||
#include "blackmisc/network/fsdsetup.h"
|
||||
#include "blackmisc/audio/voicesetup.h"
|
||||
#include "blackmisc/settingscache.h"
|
||||
#include "blackmisc/datacache.h"
|
||||
#include "blackmisc/network/connectionstatus.h"
|
||||
@@ -49,7 +48,6 @@ namespace BlackGui::Components
|
||||
enum Details
|
||||
{
|
||||
DetailsServer,
|
||||
DetailsVoice,
|
||||
DetailsBack
|
||||
};
|
||||
|
||||
@@ -68,12 +66,6 @@ namespace BlackGui::Components
|
||||
//! Specific setup enabled?
|
||||
bool isFsdSetupOverrideEnabled() const;
|
||||
|
||||
//! Voice setup
|
||||
BlackMisc::Audio::CVoiceSetup getVoiceSetup() const;
|
||||
|
||||
//! Specific setup enabled?
|
||||
bool isVoiceSetupOverrideEnabled() const;
|
||||
|
||||
//! Login mode
|
||||
BlackMisc::Network::CLoginMode getLoginMode() const;
|
||||
|
||||
|
||||
@@ -333,35 +333,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tb_Voice">
|
||||
<attribute name="title">
|
||||
<string>Voice</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="vl_Voice">
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item alignment="Qt::AlignLeft|Qt::AlignTop">
|
||||
<widget class="BlackGui::Editors::CVoiceSetupForm" name="form_Voice">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tb_BackToServer">
|
||||
<attribute name="icon">
|
||||
<iconset resource="../../blackmisc/blackmisc.qrc">
|
||||
@@ -395,12 +366,6 @@
|
||||
<header>blackgui/editors/fsdsetupform.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Editors::CVoiceSetupForm</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>blackgui/editors/voicesetupform.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Components::CServerListSelector</class>
|
||||
<extends>QComboBox</extends>
|
||||
|
||||
Reference in New Issue
Block a user