mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 03:15:34 +08:00
Add VATSIM server JSON to CGlobalSetup
This commit is contained in:
@@ -52,6 +52,7 @@ namespace BlackCore::Data
|
||||
m_vatsimMetarsUrls = CUrlList{"http://metar.vatsim.net/metar.php"};
|
||||
m_vatsimStatusFileUrls = CUrlList{ "https://status.vatsim.net" };
|
||||
m_vatsimDataFileUrls = CUrlList{ "https://data.vatsim.net/v3/vatsim-data.json" };
|
||||
m_vatsimServerFileUrl = CUrl("https://data.vatsim.net/v3/vatsim-servers.json");
|
||||
m_sharedUrls = CUrlList
|
||||
{
|
||||
"http://download.swift-project.org/shared/",
|
||||
@@ -341,6 +342,9 @@ namespace BlackCore::Data
|
||||
% u"VATSIM data file: "
|
||||
% getVatsimDataFileUrls().toQString(i18n)
|
||||
% separator
|
||||
% u"VATSIM server file: "
|
||||
% getVatsimServerFileUrl().toQString(i18n)
|
||||
% separator
|
||||
|
||||
% u"Predefined servers: "
|
||||
% getPredefinedServers().toQString(i18n)
|
||||
@@ -368,6 +372,7 @@ namespace BlackCore::Data
|
||||
case IndexVatsimStatus: return QVariant::fromValue(m_vatsimStatusFileUrls);
|
||||
case IndexVatsimData: return QVariant::fromValue(m_vatsimDataFileUrls);
|
||||
case IndexVatsimBookings: return QVariant::fromValue(m_vatsimBookingsUrl);
|
||||
case IndexVatsimServer: return QVariant::fromValue(m_vatsimServerFileUrl);
|
||||
case IndexVatsimMetars: return QVariant::fromValue(m_vatsimMetarsUrls);
|
||||
case IndexBootstrapFileUrls: return QVariant::fromValue(this->getSwiftBootstrapFileUrls());
|
||||
case IndexUpdateInfoFileUrls: return QVariant::fromValue(this->getSwiftUpdateInfoFileUrls());
|
||||
@@ -401,6 +406,7 @@ namespace BlackCore::Data
|
||||
case IndexDbClientPingService: break; // cannot be changed
|
||||
case IndexVatsimData: m_vatsimDataFileUrls = variant.value<CUrlList>(); break;
|
||||
case IndexVatsimBookings: m_vatsimBookingsUrl.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
|
||||
case IndexVatsimServer: m_vatsimServerFileUrl = variant.value<CUrl>(); break;
|
||||
case IndexVatsimMetars: m_vatsimMetarsUrls = variant.value<CUrlList>(); break;
|
||||
case IndexSharedUrls: m_sharedUrls = variant.value<CUrlList>(); break;
|
||||
case IndexOnlineHelpUrls: m_onlineHelpUrls = variant.value<CUrlList>(); break;
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace BlackCore::Data
|
||||
IndexVatsimBookings,
|
||||
IndexVatsimMetars,
|
||||
IndexVatsimData,
|
||||
IndexVatsimServer,
|
||||
IndexSwiftDbFiles,
|
||||
IndexBootstrapFileUrls,
|
||||
IndexUpdateInfoFileUrls,
|
||||
@@ -181,6 +182,9 @@ namespace BlackCore::Data
|
||||
//! VATSIM data file URLs
|
||||
const BlackMisc::Network::CUrlList &getVatsimDataFileUrls() const { return m_vatsimDataFileUrls; }
|
||||
|
||||
//! VATSIM server file URL
|
||||
BlackMisc::Network::CUrl getVatsimServerFileUrl() const { return m_vatsimServerFileUrl; }
|
||||
|
||||
//! Help page URL
|
||||
//! \remark working URL evaluated at runtime, based on getOnlineHelpUrls
|
||||
BlackMisc::Network::CUrl getHelpPageUrl(const QString &context = {}) const;
|
||||
@@ -249,6 +253,7 @@ namespace BlackCore::Data
|
||||
BlackMisc::Network::CUrlList m_vatsimMetarsUrls; //!< METAR data
|
||||
BlackMisc::Network::CUrlList m_vatsimStatusFileUrls; //!< Status file, where to find the VATSIM files (METAR, data, ATIS, other status files)
|
||||
BlackMisc::Network::CUrlList m_vatsimDataFileUrls; //!< Overall VATSIM data file / merely for bootstrapping the first time
|
||||
BlackMisc::Network::CUrl m_vatsimServerFileUrl; //!< UR to list of VATSIM servers
|
||||
BlackMisc::Network::CUrlList m_sharedUrls; //!< where we can obtain shared info files such as bootstrap, ..
|
||||
BlackMisc::Network::CUrlList m_onlineHelpUrls; //!< online help URLs
|
||||
BlackMisc::Network::CServerList m_predefinedServers; //!< Predefined servers loaded from setup file
|
||||
@@ -273,6 +278,7 @@ namespace BlackCore::Data
|
||||
BLACK_METAMEMBER(pingIntervalSecs),
|
||||
BLACK_METAMEMBER(vatsimStatusFileUrls),
|
||||
BLACK_METAMEMBER(vatsimDataFileUrls),
|
||||
BLACK_METAMEMBER(vatsimServerFileUrl),
|
||||
BLACK_METAMEMBER(vatsimBookingsUrl),
|
||||
BLACK_METAMEMBER(vatsimMetarsUrls),
|
||||
BLACK_METAMEMBER(sharedUrls),
|
||||
|
||||
Reference in New Issue
Block a user