From 5e0f3a05d39f37a16b6d28b0a7e49e75df487d46 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sun, 18 Feb 2024 16:33:16 +0100 Subject: [PATCH] refactor: Read AFV URLs from bootstrap.json This also removes the possibility to change the URL on the fly via the UI. Fixes #257 --- .../share/shared/bootstrap/bootstrap.json | 6 + src/blackcore/afv/model/afvmapreader.cpp | 3 +- src/blackcore/airspacemonitor.cpp | 1 - src/blackcore/context/contextaudio.cpp | 26 +--- src/blackcore/context/contextaudio.h | 11 -- src/blackcore/context/contextnetworkimpl.cpp | 1 - src/blackcore/context/contextnetworkproxy.cpp | 1 - src/blackcore/data/globalsetup.cpp | 8 ++ src/blackcore/data/globalsetup.h | 16 ++- src/blackcore/vatsim/vatsimdatafilereader.cpp | 1 - .../vatsim/vatsimserverfilereader.cpp | 3 +- src/blackgui/CMakeLists.txt | 3 - src/blackgui/components/loginadvcomponent.cpp | 13 +- src/blackgui/components/logincomponent.cpp | 16 --- src/blackgui/components/logincomponent.ui | 35 ----- .../components/networkdetailscomponent.cpp | 15 --- .../components/networkdetailscomponent.h | 8 -- .../components/networkdetailscomponent.ui | 35 ----- src/blackgui/editors/serverform.cpp | 5 +- src/blackgui/editors/serverform.ui | 23 ---- src/blackgui/editors/voicesetupform.cpp | 125 ------------------ src/blackgui/editors/voicesetupform.h | 76 ----------- src/blackgui/editors/voicesetupform.ui | 75 ----------- src/blackmisc/CMakeLists.txt | 2 - src/blackmisc/audio/registermetadataaudio.cpp | 2 - src/blackmisc/audio/voicesetup.cpp | 84 ------------ src/blackmisc/audio/voicesetup.h | 103 --------------- src/blackmisc/network/server.cpp | 14 +- src/blackmisc/network/server.h | 12 +- src/blackmisc/propertyindexref.h | 1 - src/blackmisc/test/testdata.cpp | 3 +- src/swiftguistandard/swiftguistd.cpp | 2 +- .../fsd/testfsdclient/testfsdclient.cpp | 3 +- .../aviation/testaviation/testaviation.cpp | 3 +- 34 files changed, 44 insertions(+), 691 deletions(-) delete mode 100644 src/blackgui/editors/voicesetupform.cpp delete mode 100644 src/blackgui/editors/voicesetupform.h delete mode 100644 src/blackgui/editors/voicesetupform.ui delete mode 100644 src/blackmisc/audio/voicesetup.cpp delete mode 100644 src/blackmisc/audio/voicesetup.h diff --git a/resources/share/shared/bootstrap/bootstrap.json b/resources/share/shared/bootstrap/bootstrap.json index 463f796c0..85fe49eb4 100644 --- a/resources/share/shared/bootstrap/bootstrap.json +++ b/resources/share/shared/bootstrap/bootstrap.json @@ -66,5 +66,11 @@ }, "ssrEquipmentHelpUrl": { "url": "https://en.wikipedia.org/wiki/Equipment_codes#Surveillance_equipment_codes" + }, + "afvApiServerUrl": { + "url": "https://voice1.vatsim.net/" + }, + "afvMapUrl": { + "url": "https://afv-map.vatsim.net/" } } diff --git a/src/blackcore/afv/model/afvmapreader.cpp b/src/blackcore/afv/model/afvmapreader.cpp index cc7d7bc14..7af9b4d3c 100644 --- a/src/blackcore/afv/model/afvmapreader.cpp +++ b/src/blackcore/afv/model/afvmapreader.cpp @@ -30,7 +30,8 @@ namespace BlackCore::Afv::Model QEventLoop loop(sApp); connect(sApp->getNetworkAccessManager(), &QNetworkAccessManager::finished, &loop, &QEventLoop::quit); connect(sApp, &CApplication::aboutToShutdown, &loop, &QEventLoop::quit); - QNetworkReply *reply = sApp->getNetworkAccessManager()->get(QNetworkRequest(QUrl("https://voice1.vatsim.net/api/v1/network/online/callsigns"))); + const QUrl url = sApp->getGlobalSetup().getAfvApiServerUrl().withAppendedPath("/api/v1/network/online/callsigns"); + QNetworkReply *reply = sApp->getNetworkAccessManager()->get(QNetworkRequest(url)); while (reply && !reply->isFinished() && sApp && !sApp->isShuttingDown()) { loop.exec(); diff --git a/src/blackcore/airspacemonitor.cpp b/src/blackcore/airspacemonitor.cpp index 3b84760f8..8ca17067d 100644 --- a/src/blackcore/airspacemonitor.cpp +++ b/src/blackcore/airspacemonitor.cpp @@ -45,7 +45,6 @@ using namespace BlackConfig; using namespace BlackMisc; -using namespace BlackMisc::Audio; using namespace BlackMisc::Aviation; using namespace BlackMisc::Geo; using namespace BlackMisc::Simulation; diff --git a/src/blackcore/context/contextaudio.cpp b/src/blackcore/context/contextaudio.cpp index e299f093b..1a9d0cc76 100644 --- a/src/blackcore/context/contextaudio.cpp +++ b/src/blackcore/context/contextaudio.cpp @@ -152,7 +152,7 @@ namespace BlackCore::Context void CContextAudioBase::initVoiceClient() { - if (m_voiceClient) { return; } + if (m_voiceClient || !sApp) { return; } const CAudioDeviceInfoList devices = CAudioDeviceInfoList::allDevices(); if (devices != m_activeLocalDevices) @@ -179,9 +179,7 @@ namespace BlackCore::Context } #endif - m_voiceClient = new CAfvClient(CVoiceSetup().getAfvVoiceServerUrl(), this); - const CVoiceSetup vs = m_voiceSettings.getThreadLocal(); - m_voiceClient->updateVoiceServerUrl(vs.getAfvVoiceServerUrl()); + m_voiceClient = new CAfvClient(sApp->getGlobalSetup().getAfvApiServerUrl().toQString(), this); Q_ASSERT_X(m_voiceClient->thread() == qApp->thread(), Q_FUNC_INFO, "Should be in main thread"); m_voiceClient->start(); // thread @@ -288,9 +286,6 @@ namespace BlackCore::Context return false; } - const CVoiceSetup vs = m_voiceSettings.getThreadLocal(); - m_voiceClient->updateVoiceServerUrl(vs.getAfvVoiceServerUrl()); - const CUser connectedUser = this->getIContextNetwork()->getConnectedServer().getUser(); const QString client = "swift " % BlackConfig::CBuildConfig::getShortVersionString(); CCallsign cs = connectedUser.getCallsign(); @@ -540,17 +535,6 @@ namespace BlackCore::Context return m_voiceClient->isLoopback(); } - void CContextAudioBase::setVoiceSetup(const CVoiceSetup &setup) - { - // could be recycled for some AFV setup - Q_UNUSED(setup) - } - - CVoiceSetup CContextAudioBase::getVoiceSetup() const - { - return CVoiceSetup(); - } - void CContextAudioBase::setVoiceTransmission(bool enable, PTTCOM com) { if (!m_voiceClient) { return; } @@ -582,12 +566,6 @@ namespace BlackCore::Context this->setComOutputVolume(CComSystem::Com2, s.getOutVolumeCom2()); } - void CContextAudioBase::onChangedVoiceSettings() - { - const CVoiceSetup vs = m_voiceSettings.getThreadLocal(); - m_voiceClient->updateVoiceServerUrl(vs.getAfvVoiceServerUrl()); - } - void CContextAudioBase::audioIncreaseVolume(bool enabled) { if (!enabled) { return; } diff --git a/src/blackcore/context/contextaudio.h b/src/blackcore/context/contextaudio.h index d595224bb..0a0f79aeb 100644 --- a/src/blackcore/context/contextaudio.h +++ b/src/blackcore/context/contextaudio.h @@ -19,7 +19,6 @@ #include "blackmisc/audio/audiodeviceinfolist.h" #include "blackmisc/audio/notificationsounds.h" #include "blackmisc/audio/audiosettings.h" -#include "blackmisc/audio/voicesetup.h" #include "blackmisc/audio/ptt.h" #include "blackmisc/aviation/callsignset.h" #include "blackmisc/aviation/comsystem.h" @@ -196,12 +195,6 @@ namespace BlackCore bool isAudioLoopbackEnabled() const; //! @} - //! @{ - //! Voice setup - BlackMisc::Audio::CVoiceSetup getVoiceSetup() const; - void setVoiceSetup(const BlackMisc::Audio::CVoiceSetup &setup); - //! @} - //! Info string about audio QString audioRunsWhereInfo() const; @@ -328,9 +321,6 @@ namespace BlackCore //! Changed audio settings void onChangedAudioSettings(); - //! Changed voice settings - void onChangedVoiceSettings(); - //! @{ //! Audio increase/decrease volume void audioIncreaseVolume(bool enabled); @@ -366,7 +356,6 @@ namespace BlackCore // settings BlackMisc::CSetting m_audioSettings { this, &CContextAudioBase::onChangedAudioSettings }; - BlackMisc::CSetting m_voiceSettings { this, &CContextAudioBase::onChangedVoiceSettings }; BlackMisc::CSetting m_inputDeviceSetting { this, &CContextAudioBase::changeDeviceSettings }; BlackMisc::CSetting m_outputDeviceSetting { this, &CContextAudioBase::changeDeviceSettings }; diff --git a/src/blackcore/context/contextnetworkimpl.cpp b/src/blackcore/context/contextnetworkimpl.cpp index 35094b020..e7b78a7a7 100644 --- a/src/blackcore/context/contextnetworkimpl.cpp +++ b/src/blackcore/context/contextnetworkimpl.cpp @@ -42,7 +42,6 @@ using namespace BlackMisc::PhysicalQuantities; using namespace BlackMisc::Aviation; using namespace BlackMisc::Network; using namespace BlackMisc::Geo; -using namespace BlackMisc::Audio; using namespace BlackMisc::Simulation; using namespace BlackMisc::Weather; using namespace BlackCore::Fsd; diff --git a/src/blackcore/context/contextnetworkproxy.cpp b/src/blackcore/context/contextnetworkproxy.cpp index c276d8569..673753b37 100644 --- a/src/blackcore/context/contextnetworkproxy.cpp +++ b/src/blackcore/context/contextnetworkproxy.cpp @@ -16,7 +16,6 @@ using namespace BlackMisc; using namespace BlackMisc::Network; using namespace BlackMisc::Aviation; using namespace BlackMisc::PhysicalQuantities; -using namespace BlackMisc::Audio; using namespace BlackMisc::Weather; using namespace BlackMisc::Simulation; diff --git a/src/blackcore/data/globalsetup.cpp b/src/blackcore/data/globalsetup.cpp index 25ce3fdfb..7455d79e5 100644 --- a/src/blackcore/data/globalsetup.cpp +++ b/src/blackcore/data/globalsetup.cpp @@ -192,6 +192,10 @@ namespace BlackCore::Data % u"Predefined servers: " % getPredefinedServers().toQString(i18n) % separator + % u"AFV voice server URL: " % getAfvApiServerUrl().toQString(i18n) % separator + + % u"AFV map URL: " % getAfvMapUrl().toQString(i18n) % separator + % u"Crash report server: " % getCrashReportServerUrl().toQString(i18n); return s; @@ -220,6 +224,8 @@ namespace BlackCore::Data case IndexCrashReportServerUrl: return QVariant::fromValue(m_crashReportServerUrl); case IndexMappingMinimumVersion: return QVariant::fromValue(m_mappingMinimumVersion); case IndexPredefinedServers: return QVariant::fromValue(m_predefinedServers); + case IndexAfvApiServerUrl: return QVariant::fromValue(m_afvApiServerUrl); + case IndexAfvMapUrl: return QVariant::fromValue(m_afvMapUrl); default: return CValueObject::propertyByIndex(index); } } @@ -249,6 +255,8 @@ namespace BlackCore::Data case IndexCrashReportServerUrl: m_crashReportServerUrl = variant.value(); break; case IndexMappingMinimumVersion: m_mappingMinimumVersion = variant.toString(); break; case IndexPredefinedServers: m_predefinedServers = variant.value(); break; + case IndexAfvApiServerUrl: m_afvApiServerUrl = variant.value(); break; + case IndexAfvMapUrl: m_afvMapUrl = variant.value(); break; default: CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackcore/data/globalsetup.h b/src/blackcore/data/globalsetup.h index c60cfcba3..1f4626d8f 100644 --- a/src/blackcore/data/globalsetup.h +++ b/src/blackcore/data/globalsetup.h @@ -50,7 +50,9 @@ namespace BlackCore::Data IndexCrashReportServerUrl, IndexSharedUrls, IndexMappingMinimumVersion, - IndexPredefinedServers + IndexPredefinedServers, + IndexAfvApiServerUrl, + IndexAfvMapUrl }; //! Add info when pinging @@ -179,6 +181,12 @@ namespace BlackCore::Data //! SSR equipment code help URL BlackMisc::Network::CUrl getSsrEquipmentHelpUrl() const { return m_ssrEquipmentHelpUrl; } + //! AFV voice server URL + BlackMisc::Network::CUrl getAfvApiServerUrl() const { return m_afvApiServerUrl; } + + //! AFV map URL + BlackMisc::Network::CUrl getAfvMapUrl() const { return m_afvMapUrl; } + //! \copydoc BlackMisc::Mixin::String::toQString QString convertToQString(bool i18n = false) const; @@ -216,6 +224,8 @@ namespace BlackCore::Data BlackMisc::Network::CUrl m_ncepGlobalForecastSystemUrl25; //!< NCEP GFS url 0.25 degree resolution BlackMisc::Network::CUrl m_comNavEquipmentHelpUrl; //!< Help URL for COM/NAV equipment codes BlackMisc::Network::CUrl m_ssrEquipmentHelpUrl; //!< Help URL for SSR equipment codes + BlackMisc::Network::CUrl m_afvApiServerUrl; //!< AFV API server URL + BlackMisc::Network::CUrl m_afvMapUrl; //!< AFV map URL bool m_dbDebugFlag = false; //!< can trigger DEBUG on the server, so you need to know what you are doing. Only works with CBuildConfig::isLocalDeveloperDebugBuild BLACK_METACLASS( @@ -238,7 +248,9 @@ namespace BlackCore::Data BLACK_METAMEMBER(ncepGlobalForecastSystemUrl25, 0, RequiredForJson), BLACK_METAMEMBER(comNavEquipmentHelpUrl, 0, RequiredForJson), BLACK_METAMEMBER(ssrEquipmentHelpUrl, 0, RequiredForJson), - BLACK_METAMEMBER(dbDebugFlag, 0, RequiredForJson) + BLACK_METAMEMBER(dbDebugFlag, 0, RequiredForJson), + BLACK_METAMEMBER(afvApiServerUrl, 0, RequiredForJson), + BLACK_METAMEMBER(afvMapUrl, 0, RequiredForJson) ); }; } // ns diff --git a/src/blackcore/vatsim/vatsimdatafilereader.cpp b/src/blackcore/vatsim/vatsimdatafilereader.cpp index afaf96bac..063e9b455 100644 --- a/src/blackcore/vatsim/vatsimdatafilereader.cpp +++ b/src/blackcore/vatsim/vatsimdatafilereader.cpp @@ -42,7 +42,6 @@ using namespace BlackMisc; using namespace BlackMisc::Aviation; -using namespace BlackMisc::Audio; using namespace BlackMisc::Network; using namespace BlackMisc::Geo; using namespace BlackMisc::Simulation; diff --git a/src/blackcore/vatsim/vatsimserverfilereader.cpp b/src/blackcore/vatsim/vatsimserverfilereader.cpp index 132a063bf..dfbf0e60b 100644 --- a/src/blackcore/vatsim/vatsimserverfilereader.cpp +++ b/src/blackcore/vatsim/vatsimserverfilereader.cpp @@ -20,7 +20,6 @@ using namespace BlackMisc; using namespace BlackMisc::Aviation; -using namespace BlackMisc::Audio; using namespace BlackMisc::Network; using namespace BlackMisc::Geo; using namespace BlackMisc::Simulation; @@ -142,7 +141,7 @@ namespace BlackCore::Vatsim { return CServer(server["name"].toString(), server["location"].toString(), server["hostname_or_ip"].toString(), 6809, CUser("id", "real name", "email", "password"), - CFsdSetup::vatsimStandard(), CVoiceSetup::vatsimStandard(), CEcosystem::VATSIM, + CFsdSetup::vatsimStandard(), CEcosystem::VATSIM, CServer::FSDServerVatsim, server["clients_connection_allowed"].toInt()); } diff --git a/src/blackgui/CMakeLists.txt b/src/blackgui/CMakeLists.txt index 59ec38d33..0288753ca 100644 --- a/src/blackgui/CMakeLists.txt +++ b/src/blackgui/CMakeLists.txt @@ -227,7 +227,6 @@ add_library(gui SHARED editors/liveryform.h editors/situationform.h editors/aircraftmodelform.h - editors/voicesetupform.h editors/fsdsetupform.ui editors/aircraftpartsform.cpp editors/ownmodelsetform.h @@ -254,7 +253,6 @@ add_library(gui SHARED editors/modelmappingform.cpp editors/distributorform.ui editors/aircrafticaoform.h - editors/voicesetupform.ui editors/aircraftpartsform.ui editors/serverform.cpp editors/modelmappingmodifyform.ui @@ -279,7 +277,6 @@ add_library(gui SHARED editors/interpolationsetupform.cpp editors/aircrafticaoform.ui editors/pbhsform.h - editors/voicesetupform.cpp editors/aircrafticaoform.cpp editors/cockpitcomform.h blackguiexport.h diff --git a/src/blackgui/components/loginadvcomponent.cpp b/src/blackgui/components/loginadvcomponent.cpp index 4a12c2463..944b72d5e 100644 --- a/src/blackgui/components/loginadvcomponent.cpp +++ b/src/blackgui/components/loginadvcomponent.cpp @@ -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()) { diff --git a/src/blackgui/components/logincomponent.cpp b/src/blackgui/components/logincomponent.cpp index 333d74e53..46e5ea9af 100644 --- a/src/blackgui/components/logincomponent.cpp +++ b/src/blackgui/components/logincomponent.cpp @@ -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); diff --git a/src/blackgui/components/logincomponent.ui b/src/blackgui/components/logincomponent.ui index de0a3ac73..5c55eb3ab 100644 --- a/src/blackgui/components/logincomponent.ui +++ b/src/blackgui/components/logincomponent.ui @@ -314,35 +314,6 @@ - - - Voice - - - - 3 - - - 3 - - - 3 - - - 3 - - - - - - 150 - 50 - - - - - - Matching log @@ -883,12 +854,6 @@
blackgui/editors/fsdsetupform.h
1 - - BlackGui::Editors::CVoiceSetupForm - QFrame -
blackgui/editors/voicesetupform.h
- 1 -
BlackGui::Components::CServerListSelector QComboBox diff --git a/src/blackgui/components/networkdetailscomponent.cpp b/src/blackgui/components/networkdetailscomponent.cpp index a92aae1d3..f1be5c1d3 100644 --- a/src/blackgui/components/networkdetailscomponent.cpp +++ b/src/blackgui/components/networkdetailscomponent.cpp @@ -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() diff --git a/src/blackgui/components/networkdetailscomponent.h b/src/blackgui/components/networkdetailscomponent.h index a44ea59a5..7e65e3652 100644 --- a/src/blackgui/components/networkdetailscomponent.h +++ b/src/blackgui/components/networkdetailscomponent.h @@ -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; diff --git a/src/blackgui/components/networkdetailscomponent.ui b/src/blackgui/components/networkdetailscomponent.ui index ca6e8edaf..c7ff3c4b4 100644 --- a/src/blackgui/components/networkdetailscomponent.ui +++ b/src/blackgui/components/networkdetailscomponent.ui @@ -333,35 +333,6 @@
- - - Voice - - - - 3 - - - 3 - - - 3 - - - 3 - - - - - - 150 - 50 - - - - - - @@ -395,12 +366,6 @@
blackgui/editors/fsdsetupform.h
1 - - BlackGui::Editors::CVoiceSetupForm - QFrame -
blackgui/editors/voicesetupform.h
- 1 -
BlackGui::Components::CServerListSelector QComboBox diff --git a/src/blackgui/editors/serverform.cpp b/src/blackgui/editors/serverform.cpp index c68a4c888..ed720e078 100644 --- a/src/blackgui/editors/serverform.cpp +++ b/src/blackgui/editors/serverform.cpp @@ -44,7 +44,6 @@ namespace BlackGui::Editors ui->le_Address->setText(server.getAddress()); ui->le_Port->setText(QString::number(server.getPort())); ui->form_ServerFsd->setValue(server.getFsdSetup()); - ui->form_Voice->setValue(server.getVoiceSetup()); } CServer CServerForm::getServer() const @@ -55,14 +54,13 @@ namespace BlackGui::Editors QString(), ui->le_Password->text().trimmed()); const CFsdSetup fsdSetup(ui->form_ServerFsd->getValue()); - const CVoiceSetup voiceSetup(ui->form_Voice->getValue()); const CServer server( ui->le_Name->text().trimmed().simplified(), ui->le_Description->text().trimmed().simplified(), ui->le_Address->text().trimmed(), ui->le_Port->text().trimmed().toInt(), user, - fsdSetup, voiceSetup, + fsdSetup, ui->cbp_Ecosystem->getSelectedEcosystem(), this->getServerType(), true); @@ -82,7 +80,6 @@ namespace BlackGui::Editors void CServerForm::setReadOnly(bool readOnly) { ui->form_ServerFsd->setReadOnly(readOnly); - ui->form_Voice->setReadOnly(readOnly); ui->le_NetworkId->setReadOnly(readOnly); ui->le_RealName->setReadOnly(readOnly); diff --git a/src/blackgui/editors/serverform.ui b/src/blackgui/editors/serverform.ui index c04281742..62b902119 100644 --- a/src/blackgui/editors/serverform.ui +++ b/src/blackgui/editors/serverform.ui @@ -318,23 +318,6 @@
- - - Voice - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - @@ -346,12 +329,6 @@
blackgui/editors/fsdsetupform.h
1 - - BlackGui::Editors::CVoiceSetupForm - QFrame -
blackgui/editors/voicesetupform.h
- 1 -
BlackGui::CEcosystemComboBox QComboBox diff --git a/src/blackgui/editors/voicesetupform.cpp b/src/blackgui/editors/voicesetupform.cpp deleted file mode 100644 index 631176baf..000000000 --- a/src/blackgui/editors/voicesetupform.cpp +++ /dev/null @@ -1,125 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2018 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -#include "voicesetupform.h" -#include "ui_voicesetupform.h" -#include - -using namespace BlackMisc; -using namespace BlackMisc::Audio; -using namespace BlackMisc::Network; - -namespace BlackGui::Editors -{ - CVoiceSetupForm::CVoiceSetupForm(QWidget *parent) : CForm(parent), - ui(new Ui::CVoiceSetupForm) - { - ui->setupUi(this); - ui->cb_Override->setChecked(true); - this->resetToDefaultValues(); - connect(ui->cb_Override, &QCheckBox::toggled, this, &CVoiceSetupForm::enabledToggled, Qt::QueuedConnection); - connect(ui->pb_SetDefaults, &QPushButton::clicked, this, &CVoiceSetupForm::resetToDefaultValues); - } - - CVoiceSetupForm::~CVoiceSetupForm() - {} - - CVoiceSetup CVoiceSetupForm::getValue() const - { - const CVoiceSetup s(ui->le_AfvVoiceServerUrl->text(), ui->le_AfvMapUrl->text()); - return s; - } - - const CVoiceSetup &CVoiceSetupForm::getDisabledValue() const - { - static const CVoiceSetup s; - return s; - } - - void CVoiceSetupForm::setValue(const CVoiceSetup &setup) - { - ui->le_AfvVoiceServerUrl->setText(setup.getAfvVoiceServerUrl()); - ui->le_AfvMapUrl->setText(setup.getAfvMapUrl()); - } - - bool CVoiceSetupForm::isVoiceSetupEnabled() const - { - return ui->cb_Override->isChecked(); - } - - void CVoiceSetupForm::setVoiceSetupEnabled(bool enabled) - { - ui->cb_Override->setChecked(enabled); - } - - void CVoiceSetupForm::setAlwaysAllowOverride(bool allow) - { - m_alwaysAllowOverride = allow; - if (allow) - { - ui->cb_Override->setEnabled(true); - CGuiUtility::checkBoxReadOnly(ui->cb_Override, false); - } - } - - void CVoiceSetupForm::showEnableInfo(bool visible) - { - m_visibleEnableInfo = visible; - this->visibleEnableInfo(visible); - } - - void CVoiceSetupForm::setReadOnly(bool readonly) - { - ui->pb_SetDefaults->setEnabled(!readonly); - ui->le_AfvVoiceServerUrl->setReadOnly(readonly); - ui->le_AfvMapUrl->setReadOnly(readonly); - CGuiUtility::checkBoxesReadOnly(this, readonly); - if (m_alwaysAllowOverride) - { - ui->cb_Override->setEnabled(true); - CGuiUtility::checkBoxReadOnly(ui->cb_Override, false); - } - - /** - if (readonly && ui->cb_Override->isChecked()) - { - // this is no value which will be stored - ui->cb_Override->setChecked(false); - } - **/ - - this->forceStyleSheetUpdate(); - } - - CStatusMessageList CVoiceSetupForm::validate(bool nested) const - { - Q_UNUSED(nested) - const CVoiceSetup val(this->getValue()); - CStatusMessageList msgs(val.validate()); - if (this->isReadOnly()) - { - // in readonly I cannot change the data anyway, so skip warnings - msgs.removeWarningsAndBelow(); - } - return msgs; - } - - void CVoiceSetupForm::enabledToggled(bool enabled) - { - Q_UNUSED(enabled) - this->setReadOnly(!enabled); - } - - void CVoiceSetupForm::visibleEnableInfo(bool visible) - { - ui->cb_Override->setVisible(visible); - ui->lbl_VoiceSetup->setVisible(visible); - ui->pb_SetDefaults->setVisible(visible); - } - - void CVoiceSetupForm::resetToDefaultValues() - { - CVoiceSetup s; - this->setValue(s); - } -} // ns diff --git a/src/blackgui/editors/voicesetupform.h b/src/blackgui/editors/voicesetupform.h deleted file mode 100644 index 328dc7792..000000000 --- a/src/blackgui/editors/voicesetupform.h +++ /dev/null @@ -1,76 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2018 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -//! \file - -#ifndef BLACKGUI_COMPONENTS_VOICESETUPFORM_H -#define BLACKGUI_COMPONENTS_VOICESETUPFORM_H - -#include "blackmisc/audio/voicesetup.h" -#include "blackmisc/statusmessagelist.h" -#include "blackgui/editors/form.h" -#include -#include - -namespace Ui -{ - class CVoiceSetupForm; -} -namespace BlackGui::Editors -{ - //! Voice form - class CVoiceSetupForm : public CForm - { - Q_OBJECT - - public: - //! Ctor - explicit CVoiceSetupForm(QWidget *parent = nullptr); - - //! Dtor - virtual ~CVoiceSetupForm() override; - - //! Voice setup from GUI - BlackMisc::Audio::CVoiceSetup getValue() const; - - //! Voice setup when disabled - const BlackMisc::Audio::CVoiceSetup &getDisabledValue() const; - - //! Set to GUI - void setValue(const BlackMisc::Audio::CVoiceSetup &setup); - - //! Enabled? - bool isVoiceSetupEnabled() const; - - //! Set enabled / disabled - void setVoiceSetupEnabled(bool enabled); - - //! Allow override even in read only mode - void setAlwaysAllowOverride(bool allow); - - //! Show the enable info - void showEnableInfo(bool visible); - - //! Set default values - void resetToDefaultValues(); - - //! \name Form class implementations - //! @{ - virtual void setReadOnly(bool readonly) override; - virtual BlackMisc::CStatusMessageList validate(bool nested = false) const override; - //! @} - - private: - //! Enable / disable - void enabledToggled(bool enabled); - - //! Show / hide visible "enable" info - void visibleEnableInfo(bool visible); - - QScopedPointer ui; - bool m_alwaysAllowOverride = false; - bool m_visibleEnableInfo = true; - }; -} // ns - -#endif // guard diff --git a/src/blackgui/editors/voicesetupform.ui b/src/blackgui/editors/voicesetupform.ui deleted file mode 100644 index e833b0c2e..000000000 --- a/src/blackgui/editors/voicesetupform.ui +++ /dev/null @@ -1,75 +0,0 @@ - - - CVoiceSetupForm - - - AfV voice setup - - - - 0 - - - 0 - - - 0 - - - 0 - - - 4 - - - - - set defaults - - - - - - - override - - - - - - - AfV voice server URL - - - - - - - - - - Voice setup - - - - - - - AfV map URL - - - - - - - - - - cb_Override - pb_SetDefaults - le_AfvVoiceServerUrl - le_AfvMapUrl - - - - diff --git a/src/blackmisc/CMakeLists.txt b/src/blackmisc/CMakeLists.txt index bb1b6f808..d18cd069d 100644 --- a/src/blackmisc/CMakeLists.txt +++ b/src/blackmisc/CMakeLists.txt @@ -18,8 +18,6 @@ add_library(misc SHARED audio/ptt.h audio/registermetadataaudio.cpp audio/registermetadataaudio.h - audio/voicesetup.cpp - audio/voicesetup.h # Aviation aviation/aircraftcategory.cpp diff --git a/src/blackmisc/audio/registermetadataaudio.cpp b/src/blackmisc/audio/registermetadataaudio.cpp index a61efcb61..f146b9563 100644 --- a/src/blackmisc/audio/registermetadataaudio.cpp +++ b/src/blackmisc/audio/registermetadataaudio.cpp @@ -7,7 +7,6 @@ #include "blackmisc/audio/audiodeviceinfo.h" #include "blackmisc/audio/audiodeviceinfolist.h" #include "blackmisc/audio/audiosettings.h" -#include "blackmisc/audio/voicesetup.h" #include "blackmisc/audio/ptt.h" #include @@ -22,7 +21,6 @@ namespace BlackMisc CAudioDeviceInfo::registerMetadata(); CAudioDeviceInfoList::registerMetadata(); CSettings::registerMetadata(); - CVoiceSetup::registerMetadata(); // ENUMs qDBusRegisterMetaType(); diff --git a/src/blackmisc/audio/voicesetup.cpp b/src/blackmisc/audio/voicesetup.cpp deleted file mode 100644 index 63a7552fc..000000000 --- a/src/blackmisc/audio/voicesetup.cpp +++ /dev/null @@ -1,84 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2018 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -#include "blackmisc/audio/voicesetup.h" -#include "blackmisc/logcategories.h" -#include "blackmisc/stringutils.h" -#include "blackmisc/verify.h" - -#include -#include - -BLACK_DEFINE_VALUEOBJECT_MIXINS(BlackMisc::Audio, CVoiceSetup) - -namespace BlackMisc::Audio -{ - QString CVoiceSetup::convertToQString(bool i18n) const - { - Q_UNUSED(i18n) - return QStringLiteral("Port: %1").arg(getAfvVoiceServerUrl()); - } - - CStatusMessageList CVoiceSetup::validate() const - { - static const CLogCategoryList cats(CLogCategoryList(this).withValidation()); - CStatusMessageList msgs; - if (this->getAfvVoiceServerUrl().isEmpty()) { msgs.push_back(CStatusMessage(CStatusMessage::SeverityError, u"Invalid voice server url")); } - if (this->getAfvMapUrl().isEmpty()) { msgs.push_back(CStatusMessage(CStatusMessage::SeverityError, u"Invalid voice server url")); } - msgs.addCategories(cats); - return msgs; - } - - const CVoiceSetup &CVoiceSetup::vatsimStandard() - { - static const CVoiceSetup s; - return s; - } - - CVoiceSetup::CVoiceSetup(const QString &afvVoiceServerUrl, const QString &afvMapUrl) : m_afvVoiceServerUrl(afvVoiceServerUrl), m_afvMapUrl(afvMapUrl) - {} - - QVariant CVoiceSetup::propertyByIndex(BlackMisc::CPropertyIndexRef index) const - { - if (index.isMyself()) { return QVariant::fromValue(*this); } - const ColumnIndex i = index.frontCasted(); - switch (i) - { - case IndexAfvVoiceServerUrl: return QVariant::fromValue(m_afvVoiceServerUrl); - case IndexAfvMapUrl: return QVariant::fromValue(m_afvMapUrl); - default: return CValueObject::propertyByIndex(index); - } - } - - void CVoiceSetup::setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant) - { - if (index.isMyself()) - { - (*this) = variant.value(); - return; - } - const ColumnIndex i = index.frontCasted(); - switch (i) - { - case IndexAfvVoiceServerUrl: m_afvVoiceServerUrl = variant.toString(); break; - case IndexAfvMapUrl: m_afvMapUrl = variant.toString(); break; - default: - CValueObject::setPropertyByIndex(index, variant); - break; - } - } - - int CVoiceSetup::comparePropertyByIndex(CPropertyIndexRef index, const CVoiceSetup &compareValue) const - { - if (index.isMyself()) { return this->convertToQString(true).compare(compareValue.convertToQString()); } - const ColumnIndex i = index.frontCasted(); - switch (i) - { - case IndexAfvVoiceServerUrl: return m_afvVoiceServerUrl.compare(compareValue.m_afvVoiceServerUrl, Qt::CaseInsensitive); - case IndexAfvMapUrl: return m_afvMapUrl.compare(compareValue.m_afvMapUrl, Qt::CaseInsensitive); - default: break; - } - BLACK_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable("No comparison for index " + index.toQString())); - return 0; - } -} // namespace diff --git a/src/blackmisc/audio/voicesetup.h b/src/blackmisc/audio/voicesetup.h deleted file mode 100644 index 1c4672d50..000000000 --- a/src/blackmisc/audio/voicesetup.h +++ /dev/null @@ -1,103 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2018 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -//! \file - -#ifndef BLACKMISC_AUDIO_VOICESETUP_H -#define BLACKMISC_AUDIO_VOICESETUP_H - -#include "blackmisc/statusmessagelist.h" -#include "blackmisc/settingscache.h" -#include "blackmisc/valueobject.h" -#include "blackmisc/metaclass.h" -#include "blackmisc/propertyindexref.h" -#include "blackmisc/blackmiscexport.h" - -#include -#include - -BLACK_DECLARE_VALUEOBJECT_MIXINS(BlackMisc::Audio, CVoiceSetup) - -namespace BlackMisc::Audio -{ - //! Value object for a voice setup - //! \deprecated - class BLACKMISC_EXPORT CVoiceSetup : public CValueObject - { - public: - //! Properties by index - enum ColumnIndex - { - IndexAfvVoiceServerUrl = CPropertyIndexRef::GlobalIndexCVoiceSetup, - IndexAfvMapUrl - }; - - //! Default constructor. - CVoiceSetup() = default; - - //! Setup with values - CVoiceSetup(const QString &afvVoiceServerUrl, const QString &afvMapUrl); - - //! AFV voice server URL - void setAfvVoiceServerUrl(const QString &serverUrl) { m_afvVoiceServerUrl = serverUrl; } - - //! AFV voice server URL - const QString &getAfvVoiceServerUrl() const { return m_afvVoiceServerUrl; } - - //! AFV map URL - void setAfvMapUrl(const QString &mapUrl) { m_afvMapUrl = mapUrl; } - - //! AFV map URL - const QString &getAfvMapUrl() const { return m_afvMapUrl; } - - //! \copydoc BlackMisc::Mixin::Index::propertyByIndex - QVariant propertyByIndex(CPropertyIndexRef index) const; - - //! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex - void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant); - - //! \copydoc BlackMisc::Mixin::Index::comparePropertyByIndex - int comparePropertyByIndex(CPropertyIndexRef index, const CVoiceSetup &compareValue) const; - - //! \copydoc BlackMisc::Mixin::String::toQString() - QString convertToQString(bool i18n = false) const; - - //! Validate - CStatusMessageList validate() const; - - //! Standard FSD setup for official VATSIM servers - static const CVoiceSetup &vatsimStandard(); - - private: - QString m_afvVoiceServerUrl = "https://voice1.vatsim.net"; - QString m_afvMapUrl = "https://afv-map.vatsim.net/"; - - BLACK_METACLASS( - CVoiceSetup, - BLACK_METAMEMBER(afvVoiceServerUrl), - BLACK_METAMEMBER(afvMapUrl) - ); - }; - - //! Voice settings - //! \deprecated Voice VATLIB specifics - struct TVoiceSetup : public TSettingTrait - { - //! \copydoc BlackMisc::TSettingTrait::key - static const char *key() { return "audio/%Application%/currentvoicesetup"; } - - //! \copydoc BlackMisc::TSettingTrait::humanReadable - static const QString &humanReadable() - { - static const QString name("Voice setup"); - return name; - } - - //! \copydoc BlackMisc::TSettingTrait::isValid - static bool isValid(const CVoiceSetup &setup, QString &) { return setup.validate().isSuccess(); } - }; -} // namespace - -Q_DECLARE_METATYPE(BlackMisc::Audio::CVoiceSetup) - -#endif // guard diff --git a/src/blackmisc/network/server.cpp b/src/blackmisc/network/server.cpp index 18fa48251..57777adf4 100644 --- a/src/blackmisc/network/server.cpp +++ b/src/blackmisc/network/server.cpp @@ -14,8 +14,6 @@ #include #include -using namespace BlackMisc::Audio; - BLACK_DEFINE_VALUEOBJECT_MIXINS(BlackMisc::Network, CServer) namespace BlackMisc::Network @@ -27,11 +25,11 @@ namespace BlackMisc::Network } CServer::CServer(const QString &name, const QString &description, const QString &address, int port, const CUser &user, - const CFsdSetup &fsdSetup, const CVoiceSetup &voiceSetup, const CEcosystem &ecosytem, ServerType serverType, bool isAcceptingConnections) + const CFsdSetup &fsdSetup, const CEcosystem &ecosytem, ServerType serverType, bool isAcceptingConnections) : m_name(CObfuscation::decode(name)), m_description(CObfuscation::decode(description)), m_address(CObfuscation::decode(address)), m_port(port), m_user(user), m_ecosystem(ecosytem), m_serverType(serverType), m_isAcceptingConnections(isAcceptingConnections), - m_fsdSetup(fsdSetup), m_voiceSetup(voiceSetup) + m_fsdSetup(fsdSetup) {} CServer::CServer( @@ -59,7 +57,7 @@ namespace BlackMisc::Network static const CServer fsc = [] { CServer s = CServer("FSC", "FSC e.V.", "OBF:AwJIKfgkQDJEIRnno29DJlB+UK0=", 6809, CUser(), - CFsdSetup(), CVoiceSetup(), CEcosystem(CEcosystem::privateFsd()), CServer::FSDServer); + CFsdSetup(), CEcosystem(CEcosystem::privateFsd()), CServer::FSDServer); s.removeSendReceiveDetails(CFsdSetup::AllInterimPositions); return s; }(); @@ -70,7 +68,7 @@ namespace BlackMisc::Network { static const CServer s = CServer("ES Tower", "Euroscope Tower view", "localhost", 6809, CUser(), - CFsdSetup::vatsimStandard(), CVoiceSetup::vatsimStandard(), CEcosystem(CEcosystem::vatsim()), CServer::VoiceServerVatsim); + CFsdSetup::vatsimStandard(), CEcosystem(CEcosystem::vatsim()), CServer::VoiceServerVatsim); return s; } @@ -157,7 +155,6 @@ namespace BlackMisc::Network if (this->getPort() < 1 || this->getPort() > 65535) { msgs.push_back(CStatusMessage(CStatusMessage::SeverityError, u"Wrong port")); } msgs.push_back(this->getUser().validate()); msgs.push_back(this->getFsdSetup().validate()); - msgs.push_back(this->getVoiceSetup().validate()); msgs.addCategories(cats); msgs.sortBySeverity(); return msgs; @@ -185,7 +182,6 @@ namespace BlackMisc::Network case IndexPort: return QVariant::fromValue(m_port); case IndexUser: return m_user.propertyByIndex(index.copyFrontRemoved()); case IndexFsdSetup: return m_fsdSetup.propertyByIndex(index.copyFrontRemoved()); - case IndexVoiceSetup: return m_voiceSetup.propertyByIndex(index.copyFrontRemoved()); case IndexEcosystem: return m_ecosystem.propertyByIndex(index.copyFrontRemoved()); case IndexIsAcceptingConnections: return QVariant::fromValue(m_isAcceptingConnections); case IndexServerType: return QVariant::fromValue(m_serverType); @@ -216,7 +212,6 @@ namespace BlackMisc::Network case IndexName: this->setName(variant.value()); break; case IndexUser: m_user.setPropertyByIndex(index.copyFrontRemoved(), variant); break; case IndexFsdSetup: m_fsdSetup.setPropertyByIndex(index.copyFrontRemoved(), variant); break; - case IndexVoiceSetup: m_voiceSetup.setPropertyByIndex(index.copyFrontRemoved(), variant); break; case IndexEcosystem: m_ecosystem.setPropertyByIndex(index.copyFrontRemoved(), variant); break; case IndexServerType: this->setServerType(static_cast(variant.toInt())); break; case IndexIsAcceptingConnections: this->setIsAcceptingConnections(variant.value()); break; @@ -234,7 +229,6 @@ namespace BlackMisc::Network case IndexAddress: return this->getAddress().compare(compareValue.getAddress(), Qt::CaseInsensitive); case IndexDescription: return this->getDescription().compare(compareValue.getDescription(), Qt::CaseInsensitive); case IndexFsdSetup: return m_fsdSetup.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getFsdSetup()); - case IndexVoiceSetup: return m_voiceSetup.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getVoiceSetup()); case IndexName: return this->getName().compare(compareValue.getName(), Qt::CaseInsensitive); case IndexPort: return Compare::compare(this->getPort(), compareValue.getPort()); case IndexUser: return this->getUser().comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getUser()); diff --git a/src/blackmisc/network/server.h b/src/blackmisc/network/server.h index 890ad188f..e2e5cba56 100644 --- a/src/blackmisc/network/server.h +++ b/src/blackmisc/network/server.h @@ -9,7 +9,6 @@ #include "blackmisc/network/user.h" #include "blackmisc/network/fsdsetup.h" #include "blackmisc/network/ecosystem.h" -#include "blackmisc/audio/voicesetup.h" #include "blackmisc/blackmiscexport.h" #include "blackmisc/metaclass.h" #include "blackmisc/propertyindexref.h" @@ -39,7 +38,6 @@ namespace BlackMisc::Network IndexPort, IndexUser, IndexFsdSetup, - IndexVoiceSetup, IndexEcosystem, IndexIsAcceptingConnections, IndexServerType, @@ -69,7 +67,7 @@ namespace BlackMisc::Network //! Constructor. CServer(const QString &name, const QString &description, const QString &address, int port, const CUser &user, - const CFsdSetup &fsdSetup, const Audio::CVoiceSetup &voiceSetup, + const CFsdSetup &fsdSetup, const CEcosystem &ecosytem, ServerType serverType, bool isAcceptingConnections = true); @@ -163,12 +161,6 @@ namespace BlackMisc::Network //! Get server type ServerType getServerType() const { return static_cast(m_serverType); } - //! Get voice setup - const Audio::CVoiceSetup &getVoiceSetup() const { return m_voiceSetup; } - - //! Set voice setup - void setVoiceSetup(const Audio::CVoiceSetup &setup) { m_voiceSetup = setup; } - //! Unspecified? bool hasUnspecifiedServerType() const; @@ -224,7 +216,6 @@ namespace BlackMisc::Network int m_serverType = static_cast(Unspecified); bool m_isAcceptingConnections = true; //!< disable server for connections CFsdSetup m_fsdSetup; - Audio::CVoiceSetup m_voiceSetup; BLACK_METACLASS( CServer, @@ -234,7 +225,6 @@ namespace BlackMisc::Network BLACK_METAMEMBER(port), BLACK_METAMEMBER(user), BLACK_METAMEMBER(fsdSetup), - BLACK_METAMEMBER(voiceSetup), BLACK_METAMEMBER(ecosystem), BLACK_METAMEMBER(serverType), BLACK_METAMEMBER(isAcceptingConnections), diff --git a/src/blackmisc/propertyindexref.h b/src/blackmisc/propertyindexref.h index c4dedf7ab..e0cfc9916 100644 --- a/src/blackmisc/propertyindexref.h +++ b/src/blackmisc/propertyindexref.h @@ -73,7 +73,6 @@ namespace BlackMisc GlobalIndexCRole = 6300, GlobalIndexCServer = 6400, GlobalIndexCFsdSetup = 6500, - GlobalIndexCVoiceSetup = 6600, GlobalIndexCUrl = 6800, GlobalIndexCUrlLog = 6900, GlobalIndexCRemoteFile = 7000, diff --git a/src/blackmisc/test/testdata.cpp b/src/blackmisc/test/testdata.cpp index 554eabf6c..46ba97b9e 100644 --- a/src/blackmisc/test/testdata.cpp +++ b/src/blackmisc/test/testdata.cpp @@ -17,7 +17,6 @@ using namespace BlackMisc::Aviation; using namespace BlackMisc::Geo; using namespace BlackMisc::Math; using namespace BlackMisc::Network; -using namespace BlackMisc::Audio; using namespace BlackMisc::PhysicalQuantities; using namespace BlackMisc::Simulation; @@ -33,7 +32,7 @@ namespace BlackMisc::Test { static const CServer trafficServer("fooserver", "a foo server", "localhost", 1234, CUser("112233", "Some real name", "email@xyz.com", "secret"), - CFsdSetup(), CVoiceSetup(), CEcosystem(CEcosystem::VATSIM), CServer::FSDServerVatsim); + CFsdSetup(), CEcosystem(CEcosystem::VATSIM), CServer::FSDServerVatsim); return trafficServer; } diff --git a/src/swiftguistandard/swiftguistd.cpp b/src/swiftguistandard/swiftguistd.cpp index 8233dbaa9..ed9497ef1 100644 --- a/src/swiftguistandard/swiftguistd.cpp +++ b/src/swiftguistandard/swiftguistd.cpp @@ -671,7 +671,7 @@ bool SwiftGuiStd::startAFVMap() //! \todo KB 2019-11 AFV map workaround if (sGui && !sGui->isShuttingDown()) { - sGui->openUrl("https://afv-map.vatsim.net/"); + sGui->openUrl(sGui->getGlobalSetup().getAfvMapUrl()); } return true; diff --git a/tests/blackcore/fsd/testfsdclient/testfsdclient.cpp b/tests/blackcore/fsd/testfsdclient/testfsdclient.cpp index a2f8c9285..2ba85cc8d 100644 --- a/tests/blackcore/fsd/testfsdclient/testfsdclient.cpp +++ b/tests/blackcore/fsd/testfsdclient/testfsdclient.cpp @@ -26,7 +26,6 @@ using namespace BlackMisc; using namespace BlackMisc::Aviation; -using namespace BlackMisc::Audio; using namespace BlackMisc::Geo; using namespace BlackMisc::PhysicalQuantities; using namespace BlackMisc::Network; @@ -118,7 +117,7 @@ namespace BlackFsdTest { static const CServer dvp("Testserver", "Client project testserver", "localhost", 6809, CUser("1234567", "Test User", "", "123456"), - CFsdSetup(), CVoiceSetup(), CEcosystem(CEcosystem::swiftTest()), CServer::FSDServerVatsim); + CFsdSetup(), CEcosystem(CEcosystem::swiftTest()), CServer::FSDServerVatsim); return dvp; } diff --git a/tests/blackmisc/aviation/testaviation/testaviation.cpp b/tests/blackmisc/aviation/testaviation/testaviation.cpp index 78b0fe6cc..78634bd80 100644 --- a/tests/blackmisc/aviation/testaviation/testaviation.cpp +++ b/tests/blackmisc/aviation/testaviation/testaviation.cpp @@ -36,7 +36,6 @@ #include using namespace BlackMisc::Aviation; -using namespace BlackMisc::Audio; using namespace BlackMisc::PhysicalQuantities; using namespace BlackMisc::Network; using namespace BlackMisc::Geo; @@ -315,7 +314,7 @@ namespace BlackMiscTest const CServer server1 = CServer("Testserver", "Client project testserver", "localhost", 6809, CUser("111111", "My Name", "", "123"), - CFsdSetup(), CVoiceSetup(), CEcosystem(CEcosystem::swiftTest()), CServer::FSDServerVatsim); + CFsdSetup(), CEcosystem(CEcosystem::swiftTest()), CServer::FSDServerVatsim); const CServer server2(server1); QVERIFY2(server1 == server2, "server shall be equal");