diff --git a/src/blackgui/components/logincomponent.ui b/src/blackgui/components/logincomponent.ui index 035469608..48083aee5 100644 --- a/src/blackgui/components/logincomponent.ui +++ b/src/blackgui/components/logincomponent.ui @@ -205,7 +205,7 @@ reload - + :/diagona/icons/diagona/icons/arrow-circle-225.png:/diagona/icons/diagona/icons/arrow-circle-225.png @@ -331,7 +331,7 @@ 3 - + @@ -494,7 +494,7 @@ refresh - + :/diagona/icons/diagona/icons/arrow-circle-225.png:/diagona/icons/diagona/icons/arrow-circle-225.png @@ -511,7 +511,7 @@ quick mapping wizard - + :/own/icons/own/swift3D/sw3DGreen-24.png:/own/icons/own/swift3D/sw3DGreen-24.png @@ -896,6 +896,17 @@
blackgui/editors/voicesetupform.h
1 + + BlackGui::Components::CServerListSelector + QComboBox +
blackgui/components/serverlistselector.h
+
+ + BlackGui::CLoginModeButtons + QFrame +
blackgui/loginmodebuttons.h
+ 1 +
BlackGui::CTickLabel QLabel @@ -925,17 +936,6 @@
blackgui/components/dbairlineicaoselectorcomponent.h
1
- - BlackGui::Components::CServerListSelector - QComboBox -
blackgui/components/serverlistselector.h
-
- - BlackGui::CLoginModeButtons - QFrame -
blackgui/loginmodebuttons.h
- 1 -
BlackGui::Editors::CPilotForm QFrame @@ -971,8 +971,6 @@ pb_OverrideCredentialsOtherServers sa_FsdDetails - - - + diff --git a/src/blackgui/editors/serverform.ui b/src/blackgui/editors/serverform.ui index 60215ae9b..c04281742 100644 --- a/src/blackgui/editors/serverform.ui +++ b/src/blackgui/editors/serverform.ui @@ -267,7 +267,7 @@ - + :/diagona/icons/diagona/icons/question-button.png:/diagona/icons/diagona/icons/question-button.png @@ -322,7 +322,7 @@ Voice - + @@ -346,17 +346,17 @@
blackgui/editors/fsdsetupform.h
1
- - BlackGui::CEcosystemComboBox - QComboBox -
blackgui/ecosystemcombobox.h
-
BlackGui::Editors::CVoiceSetupForm QFrame
blackgui/editors/voicesetupform.h
1
+ + BlackGui::CEcosystemComboBox + QComboBox +
blackgui/ecosystemcombobox.h
+
tw_ServerForm @@ -371,8 +371,6 @@ le_Password tb_Unhide - - - + diff --git a/src/blackgui/editors/voicesetupform.cpp b/src/blackgui/editors/voicesetupform.cpp index ebf683c96..d6db62ae3 100644 --- a/src/blackgui/editors/voicesetupform.cpp +++ b/src/blackgui/editors/voicesetupform.cpp @@ -24,8 +24,6 @@ namespace BlackGui { ui->setupUi(this); ui->cb_Override->setChecked(true); - QIntValidator *v = new QIntValidator(0, 65535, ui->le_VatsimUdpPort); - ui->le_VatsimUdpPort->setValidator(v); this->resetToDefaultValues(); connect(ui->cb_Override, &QCheckBox::toggled, this, &CVoiceSetupForm::enabledToggled, Qt::QueuedConnection); connect(ui->pb_SetDefaults, &QPushButton::clicked, this, &CVoiceSetupForm::resetToDefaultValues); @@ -36,7 +34,7 @@ namespace BlackGui CVoiceSetup CVoiceSetupForm::getValue() const { - const CVoiceSetup s = CVoiceSetup(ui->le_VatsimUdpPort->text().toInt()); + const CVoiceSetup s(ui->le_AfvVoiceServerUrl->text(), ui->le_AfvMapUrl->text()); return s; } @@ -48,7 +46,8 @@ namespace BlackGui void CVoiceSetupForm::setValue(const CVoiceSetup &setup) { - ui->le_VatsimUdpPort->setText(QString::number(setup.getVatsimUdpVoicePort())); + ui->le_AfvVoiceServerUrl->setText(setup.getAfvVoiceServerUrl()); + ui->le_AfvMapUrl->setText(setup.getAfvMapUrl()); } bool CVoiceSetupForm::isVoiceSetupEnabled() const @@ -80,7 +79,8 @@ namespace BlackGui void CVoiceSetupForm::setReadOnly(bool readonly) { ui->pb_SetDefaults->setEnabled(!readonly); - ui->le_VatsimUdpPort->setReadOnly(readonly); + ui->le_AfvVoiceServerUrl->setReadOnly(readonly); + ui->le_AfvMapUrl->setReadOnly(readonly); CGuiUtility::checkBoxesReadOnly(this, readonly); if (m_alwaysAllowOverride) { @@ -101,7 +101,7 @@ namespace BlackGui CStatusMessageList CVoiceSetupForm::validate(bool nested) const { - Q_UNUSED(nested); + Q_UNUSED(nested) const CVoiceSetup val(this->getValue()); CStatusMessageList msgs(val.validate()); if (this->isReadOnly()) @@ -114,7 +114,7 @@ namespace BlackGui void CVoiceSetupForm::enabledToggled(bool enabled) { - Q_UNUSED(enabled); + Q_UNUSED(enabled) this->setReadOnly(!enabled); } diff --git a/src/blackgui/editors/voicesetupform.ui b/src/blackgui/editors/voicesetupform.ui index a0f4ab71f..e833b0c2e 100644 --- a/src/blackgui/editors/voicesetupform.ui +++ b/src/blackgui/editors/voicesetupform.ui @@ -2,16 +2,8 @@ CVoiceSetupForm - - - 0 - 0 - 225 - 45 - - - Frame + AfV voice setup @@ -29,6 +21,13 @@ 4 + + + + set defaults + + + @@ -37,14 +36,14 @@ - + - Voice UDP Port + AfV voice server URL - - + + @@ -53,19 +52,23 @@
- - + + - set defaults + AfV map URL + + + cb_Override pb_SetDefaults - le_VatsimUdpPort + le_AfvVoiceServerUrl + le_AfvMapUrl diff --git a/src/blackmisc/audio/voicesetup.cpp b/src/blackmisc/audio/voicesetup.cpp index df84d4f5a..bad83274d 100644 --- a/src/blackmisc/audio/voicesetup.cpp +++ b/src/blackmisc/audio/voicesetup.cpp @@ -21,15 +21,16 @@ namespace BlackMisc { QString CVoiceSetup::convertToQString(bool i18n) const { - Q_UNUSED(i18n); - return QStringLiteral("Port: %1").arg(getVatsimUdpVoicePort()); + Q_UNUSED(i18n) + return QStringLiteral("Port: %1").arg(getAfvVoiceServerUrl()); } CStatusMessageList CVoiceSetup::validate() const { static const CLogCategoryList cats(CLogCategoryList(this).withValidation()); CStatusMessageList msgs; - if (this->getVatsimUdpVoicePort() < 1 || this->getVatsimUdpVoicePort() > 65535) { msgs.push_back(CStatusMessage(CStatusMessage::SeverityError, u"Invalid voice port")); } + 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; } @@ -40,7 +41,8 @@ namespace BlackMisc return s; } - CVoiceSetup::CVoiceSetup(int vatsimUdpPort) : m_vatismVoiceUdpPort(vatsimUdpPort) + CVoiceSetup::CVoiceSetup(const QString &afvVoiceServerUrl, const QString &afvMapUrl) : + m_afvVoiceServerUrl(afvVoiceServerUrl), m_afvMapUrl(afvMapUrl) { } CVariant CVoiceSetup::propertyByIndex(const BlackMisc::CPropertyIndex &index) const @@ -49,7 +51,8 @@ namespace BlackMisc const ColumnIndex i = index.frontCasted(); switch (i) { - case IndexVatsimVoiceUdpPort: return CVariant::fromValue(m_vatismVoiceUdpPort); + case IndexAfvVoiceServerUrl: return CVariant::fromValue(m_afvVoiceServerUrl); + case IndexAfvMapUrl: return CVariant::fromValue(m_afvMapUrl); default: return CValueObject::propertyByIndex(index); } } @@ -60,7 +63,8 @@ namespace BlackMisc const ColumnIndex i = index.frontCasted(); switch (i) { - case IndexVatsimVoiceUdpPort: m_vatismVoiceUdpPort = variant.toInt(); break; + case IndexAfvVoiceServerUrl: m_afvVoiceServerUrl = variant.toQString(); break; + case IndexAfvMapUrl: m_afvMapUrl = variant.toQString(); break; default: CValueObject::setPropertyByIndex(index, variant); break; @@ -73,7 +77,8 @@ namespace BlackMisc const ColumnIndex i = index.frontCasted(); switch (i) { - case IndexVatsimVoiceUdpPort: return Compare::compare(m_vatismVoiceUdpPort, compareValue.m_vatismVoiceUdpPort); + 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())); diff --git a/src/blackmisc/audio/voicesetup.h b/src/blackmisc/audio/voicesetup.h index 2dfc69190..6dcdd9f45 100644 --- a/src/blackmisc/audio/voicesetup.h +++ b/src/blackmisc/audio/voicesetup.h @@ -32,20 +32,27 @@ namespace BlackMisc //! Properties by index enum ColumnIndex { - IndexVatsimVoiceUdpPort = CPropertyIndex::GlobalIndexCVoiceSetup, + IndexAfvVoiceServerUrl = CPropertyIndex::GlobalIndexCVoiceSetup, + IndexAfvMapUrl }; //! Default constructor. CVoiceSetup() {} //! Setup with values - CVoiceSetup(int vatsimUdpPort); + CVoiceSetup(const QString &afvVoiceServerUrl, const QString &afvMapUrl); - //! The voice UDP port - void setVatsimUdpVoicePort(int port) { m_vatismVoiceUdpPort = port;} + //! AFV voice server URL + void setAfvVoiceServerUrl(const QString &serverUrl) { m_afvVoiceServerUrl = serverUrl;} - //! VATSIM UDP voice port - int getVatsimUdpVoicePort() const { return m_vatismVoiceUdpPort; } + //! 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 CVariant propertyByIndex(const CPropertyIndex &index) const; @@ -66,11 +73,13 @@ namespace BlackMisc static const CVoiceSetup &vatsimStandard(); private: - int m_vatismVoiceUdpPort = 3292; + QString m_afvVoiceServerUrl = "https://voice1.vatsim.uk"; + QString m_afvMapUrl = "https://afv-map.vatsim.net/"; BLACK_METACLASS( CVoiceSetup, - BLACK_METAMEMBER(vatismVoiceUdpPort) + BLACK_METAMEMBER(afvVoiceServerUrl), + BLACK_METAMEMBER(afvMapUrl) ); }; } // namespace