mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 10:25:36 +08:00
refs #621, use getXX for setup members, no idea why I have not used our standard
This commit is contained in:
@@ -800,7 +800,7 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
if (this->m_setupReader)
|
if (this->m_setupReader)
|
||||||
{
|
{
|
||||||
return this->m_setupReader->getSetup().vatsimMetarsUrls();
|
return this->m_setupReader->getSetup().getVatsimMetarsUrls();
|
||||||
}
|
}
|
||||||
return CUrlList();
|
return CUrlList();
|
||||||
}
|
}
|
||||||
@@ -814,7 +814,7 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
if (this->m_setupReader)
|
if (this->m_setupReader)
|
||||||
{
|
{
|
||||||
return this->m_setupReader->getSetup().vatsimDataFileUrls();
|
return this->m_setupReader->getSetup().getVatsimDataFileUrls();
|
||||||
}
|
}
|
||||||
return CUrlList();
|
return CUrlList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
using namespace BlackMisc;
|
using namespace BlackMisc;
|
||||||
|
using namespace BlackMisc::Json;
|
||||||
using namespace BlackMisc::Math;
|
using namespace BlackMisc::Math;
|
||||||
using namespace BlackMisc::Network;
|
using namespace BlackMisc::Network;
|
||||||
|
|
||||||
@@ -32,24 +33,24 @@ namespace BlackCore
|
|||||||
m_newsUrls(QStringList({ "http://swift-project.org/" }))
|
m_newsUrls(QStringList({ "http://swift-project.org/" }))
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
CUrl CGlobalSetup::dbIcaoReaderUrl() const
|
CUrl CGlobalSetup::getDbIcaoReaderUrl() const
|
||||||
{
|
{
|
||||||
return dbRootDirectoryUrl();
|
return getDbRootDirectoryUrl();
|
||||||
}
|
}
|
||||||
|
|
||||||
CUrl CGlobalSetup::dbModelReaderUrl() const
|
CUrl CGlobalSetup::getDbModelReaderUrl() const
|
||||||
{
|
{
|
||||||
return dbRootDirectoryUrl();
|
return getDbRootDirectoryUrl();
|
||||||
}
|
}
|
||||||
|
|
||||||
CUrl CGlobalSetup::dbHomePageUrl() const
|
CUrl CGlobalSetup::getDbHomePageUrl() const
|
||||||
{
|
{
|
||||||
return dbRootDirectoryUrl().withAppendedPath("/page/index.php");
|
return getDbRootDirectoryUrl().withAppendedPath("/page/index.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
CUrl CGlobalSetup::dbLoginServiceUrl() const
|
CUrl CGlobalSetup::getDbLoginServiceUrl() const
|
||||||
{
|
{
|
||||||
return dbRootDirectoryUrl().
|
return getDbRootDirectoryUrl().
|
||||||
withAppendedPath("/service/jsonauthenticate.php").
|
withAppendedPath("/service/jsonauthenticate.php").
|
||||||
withSwitchedScheme("https", m_dbHttpsPort);
|
withSwitchedScheme("https", m_dbHttpsPort);
|
||||||
}
|
}
|
||||||
@@ -73,7 +74,7 @@ namespace BlackCore
|
|||||||
return this->isDevelopment() == otherSetup.isDevelopment();
|
return this->isDevelopment() == otherSetup.isDevelopment();
|
||||||
}
|
}
|
||||||
|
|
||||||
CUrlList CGlobalSetup::bootstrapFileUrls() const
|
CUrlList CGlobalSetup::getBootstrapFileUrls() const
|
||||||
{
|
{
|
||||||
CUrlList urls(m_sharedUrls);
|
CUrlList urls(m_sharedUrls);
|
||||||
return urls.appendPath(CGlobalSetup::versionString() + "/bootstrap/bootstrap.json");
|
return urls.appendPath(CGlobalSetup::versionString() + "/bootstrap/bootstrap.json");
|
||||||
@@ -103,19 +104,26 @@ namespace BlackCore
|
|||||||
return url.getFullUrl();
|
return url.getFullUrl();
|
||||||
}
|
}
|
||||||
|
|
||||||
CUrlList CGlobalSetup::updateInfoFileUrls() const
|
CGlobalSetup CGlobalSetup::fromJsonFile(const QString &fileNameAndPath)
|
||||||
|
{
|
||||||
|
CGlobalSetup setup;
|
||||||
|
loadFromJsonFile(setup, fileNameAndPath);
|
||||||
|
return setup;
|
||||||
|
}
|
||||||
|
|
||||||
|
CUrlList CGlobalSetup::getUpdateInfoFileUrls() const
|
||||||
{
|
{
|
||||||
const CUrlList urls(m_sharedUrls);
|
const CUrlList urls(m_sharedUrls);
|
||||||
return urls.appendPath(CGlobalSetup::versionString() + "/development/updateinfo/updateinfo.json");
|
return urls.appendPath(CGlobalSetup::versionString() + "/development/updateinfo/updateinfo.json");
|
||||||
}
|
}
|
||||||
|
|
||||||
CUrlList CGlobalSetup::swiftDbDataFileLocationUrls() const
|
CUrlList CGlobalSetup::getSwiftDbDataFileLocationUrls() const
|
||||||
{
|
{
|
||||||
const CUrlList urls(m_sharedUrls);
|
const CUrlList urls(m_sharedUrls);
|
||||||
return urls.appendPath(CGlobalSetup::versionString() + "/dbdata/");
|
return urls.appendPath(CGlobalSetup::versionString() + "/dbdata/");
|
||||||
}
|
}
|
||||||
|
|
||||||
CServerList CGlobalSetup::fsdTestServersPlusHardcodedServers() const
|
CServerList CGlobalSetup::getFsdTestServersPlusHardcodedServers() const
|
||||||
{
|
{
|
||||||
static const CServerList hardcoded({ CServer("swift", "swift Testserver", "vatsim-germany.org", 6809, CUser("1234567", "swift Test User", "", "123456"), true) });
|
static const CServerList hardcoded({ CServer("swift", "swift Testserver", "vatsim-germany.org", 6809, CUser("1234567", "swift Test User", "", "123456"), true) });
|
||||||
CServerList testServers(m_fsdTestServers);
|
CServerList testServers(m_fsdTestServers);
|
||||||
@@ -143,46 +151,46 @@ namespace BlackCore
|
|||||||
s.append(separator);
|
s.append(separator);
|
||||||
|
|
||||||
s.append("Update info URLs: ");
|
s.append("Update info URLs: ");
|
||||||
s.append(updateInfoFileUrls().toQString(i18n));
|
s.append(getUpdateInfoFileUrls().toQString(i18n));
|
||||||
s.append(separator);
|
s.append(separator);
|
||||||
s.append("Bootstrap URLs: ");
|
s.append("Bootstrap URLs: ");
|
||||||
s.append(bootstrapFileUrls().toQString(i18n));
|
s.append(getBootstrapFileUrls().toQString(i18n));
|
||||||
s.append(separator);
|
s.append(separator);
|
||||||
s.append("News URLs: ");
|
s.append("News URLs: ");
|
||||||
s.append(swiftLatestNewsUrls().toQString(i18n));
|
s.append(getSwiftLatestNewsUrls().toQString(i18n));
|
||||||
s.append(separator);
|
s.append(separator);
|
||||||
|
|
||||||
s.append("DB root directory: ");
|
s.append("DB root directory: ");
|
||||||
s.append(dbRootDirectoryUrl().toQString(i18n));
|
s.append(getDbRootDirectoryUrl().toQString(i18n));
|
||||||
s.append(separator);
|
s.append(separator);
|
||||||
s.append("ICAO DB reader: ");
|
s.append("ICAO DB reader: ");
|
||||||
s.append(dbIcaoReaderUrl().toQString(i18n));
|
s.append(getDbIcaoReaderUrl().toQString(i18n));
|
||||||
s.append(separator);
|
s.append(separator);
|
||||||
s.append("Model DB reader: ");
|
s.append("Model DB reader: ");
|
||||||
s.append(dbModelReaderUrl().toQString(i18n));
|
s.append(getDbModelReaderUrl().toQString(i18n));
|
||||||
s.append(separator);
|
s.append(separator);
|
||||||
s.append("DB home page: ");
|
s.append("DB home page: ");
|
||||||
s.append(dbHomePageUrl().toQString(i18n));
|
s.append(getDbHomePageUrl().toQString(i18n));
|
||||||
s.append(separator);
|
s.append(separator);
|
||||||
s.append("DB login service: ");
|
s.append("DB login service: ");
|
||||||
s.append(dbLoginServiceUrl().toQString(i18n));
|
s.append(getDbLoginServiceUrl().toQString(i18n));
|
||||||
s.append(separator);
|
s.append(separator);
|
||||||
s.append("swift DB datafile locations: ");
|
s.append("swift DB datafile locations: ");
|
||||||
s.append(swiftDbDataFileLocationUrls().toQString(i18n));
|
s.append(getSwiftDbDataFileLocationUrls().toQString(i18n));
|
||||||
s.append(separator);
|
s.append(separator);
|
||||||
|
|
||||||
s.append("VATSIM bookings: ");
|
s.append("VATSIM bookings: ");
|
||||||
s.append(vatsimBookingsUrl().toQString(i18n));
|
s.append(getVatsimBookingsUrl().toQString(i18n));
|
||||||
s.append(separator);
|
s.append(separator);
|
||||||
s.append("VATSIM METARs: ");
|
s.append("VATSIM METARs: ");
|
||||||
s.append(vatsimMetarsUrls().toQString(i18n));
|
s.append(getVatsimMetarsUrls().toQString(i18n));
|
||||||
s.append(separator);
|
s.append(separator);
|
||||||
s.append("VATSIM data file: ");
|
s.append("VATSIM data file: ");
|
||||||
s.append(vatsimDataFileUrls().toQString(i18n));
|
s.append(getVatsimDataFileUrls().toQString(i18n));
|
||||||
s.append(separator);
|
s.append(separator);
|
||||||
|
|
||||||
s.append("FSD test servers: ");
|
s.append("FSD test servers: ");
|
||||||
s.append(fsdTestServers().toQString(i18n));
|
s.append(getFsdTestServers().toQString(i18n));
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,7 +209,7 @@ namespace BlackCore
|
|||||||
case IndexDbHttpsPort:
|
case IndexDbHttpsPort:
|
||||||
return CVariant::fromValue(this->m_dbHttpsPort);
|
return CVariant::fromValue(this->m_dbHttpsPort);
|
||||||
case IndexDbLoginService:
|
case IndexDbLoginService:
|
||||||
return CVariant::fromValue(this->dbLoginServiceUrl());
|
return CVariant::fromValue(this->getDbLoginServiceUrl());
|
||||||
case IndexVatsimStatus:
|
case IndexVatsimStatus:
|
||||||
return CVariant::fromValue(this->m_vatsimStatusFileUrls);
|
return CVariant::fromValue(this->m_vatsimStatusFileUrls);
|
||||||
case IndexVatsimData:
|
case IndexVatsimData:
|
||||||
@@ -211,11 +219,11 @@ namespace BlackCore
|
|||||||
case IndexVatsimMetars:
|
case IndexVatsimMetars:
|
||||||
return CVariant::fromValue(this->m_vatsimMetarsUrls);
|
return CVariant::fromValue(this->m_vatsimMetarsUrls);
|
||||||
case IndexUpdateInfo:
|
case IndexUpdateInfo:
|
||||||
return CVariant::fromValue(this->updateInfoFileUrls());
|
return CVariant::fromValue(this->getUpdateInfoFileUrls());
|
||||||
case IndexBootstrap:
|
case IndexBootstrap:
|
||||||
return CVariant::fromValue(this->bootstrapFileUrls());
|
return CVariant::fromValue(this->getBootstrapFileUrls());
|
||||||
case IndexSwiftDbFiles:
|
case IndexSwiftDbFiles:
|
||||||
return CVariant::fromValue(this->swiftDbDataFileLocationUrls());
|
return CVariant::fromValue(this->getSwiftDbDataFileLocationUrls());
|
||||||
case IndexShared:
|
case IndexShared:
|
||||||
return CVariant::fromValue(this->m_sharedUrls);
|
return CVariant::fromValue(this->m_sharedUrls);
|
||||||
case IndexWasLoaded:
|
case IndexWasLoaded:
|
||||||
|
|||||||
@@ -61,10 +61,10 @@ namespace BlackCore
|
|||||||
void markAsLoaded(bool loaded) { this->m_wasLoaded = loaded; }
|
void markAsLoaded(bool loaded) { this->m_wasLoaded = loaded; }
|
||||||
|
|
||||||
//! Http port
|
//! Http port
|
||||||
int dbHttpPort() const { return m_dbHttpPort; }
|
int getDbHttpPort() const { return m_dbHttpPort; }
|
||||||
|
|
||||||
//! Https port
|
//! Https port
|
||||||
int dbHttpsPort() const { return m_dbHttpsPort; }
|
int getDbHttpsPort() const { return m_dbHttpsPort; }
|
||||||
|
|
||||||
//! Debug flag
|
//! Debug flag
|
||||||
bool dbDebugFlag() const;
|
bool dbDebugFlag() const;
|
||||||
@@ -76,49 +76,49 @@ namespace BlackCore
|
|||||||
bool hasSameType(const CGlobalSetup &otherSetup) const;
|
bool hasSameType(const CGlobalSetup &otherSetup) const;
|
||||||
|
|
||||||
//! Home page url
|
//! Home page url
|
||||||
BlackMisc::Network::CUrl dbHomePageUrl() const;
|
BlackMisc::Network::CUrl getDbHomePageUrl() const;
|
||||||
|
|
||||||
//! Login service
|
//! Login service
|
||||||
BlackMisc::Network::CUrl dbLoginServiceUrl() const;
|
BlackMisc::Network::CUrl getDbLoginServiceUrl() const;
|
||||||
|
|
||||||
//! Root directory of DB
|
//! Root directory of DB
|
||||||
const BlackMisc::Network::CUrl &dbRootDirectoryUrl() const { return m_dbRootDirectoryUrl; }
|
const BlackMisc::Network::CUrl &getDbRootDirectoryUrl() const { return m_dbRootDirectoryUrl; }
|
||||||
|
|
||||||
//! ICAO Reader location
|
//! ICAO Reader location
|
||||||
BlackMisc::Network::CUrl dbIcaoReaderUrl() const;
|
BlackMisc::Network::CUrl getDbIcaoReaderUrl() const;
|
||||||
|
|
||||||
//! Model Reader protocol
|
//! Model Reader protocol
|
||||||
BlackMisc::Network::CUrl dbModelReaderUrl() const;
|
BlackMisc::Network::CUrl getDbModelReaderUrl() const;
|
||||||
|
|
||||||
//! URL to read VATSIM bookings
|
//! URL to read VATSIM bookings
|
||||||
const BlackMisc::Network::CUrl &vatsimBookingsUrl() const { return m_vatsimBookingsUrl; }
|
const BlackMisc::Network::CUrl &getVatsimBookingsUrl() const { return m_vatsimBookingsUrl; }
|
||||||
|
|
||||||
//! VATSIM METAR URL
|
//! VATSIM METAR URL
|
||||||
const BlackMisc::Network::CUrlList &vatsimMetarsUrls() const { return this->m_vatsimMetarsUrls; }
|
const BlackMisc::Network::CUrlList &getVatsimMetarsUrls() const { return this->m_vatsimMetarsUrls; }
|
||||||
|
|
||||||
//! VATSIM status file URLs
|
//! VATSIM status file URLs
|
||||||
const BlackMisc::Network::CUrlList &vatsimStatusFileUrls() const { return m_vatsimStatusFileUrls; }
|
const BlackMisc::Network::CUrlList &getVatsimStatusFileUrls() const { return m_vatsimStatusFileUrls; }
|
||||||
|
|
||||||
//! VATSIM data file URLs
|
//! VATSIM data file URLs
|
||||||
const BlackMisc::Network::CUrlList &vatsimDataFileUrls() const { return m_vatsimDataFileUrls; }
|
const BlackMisc::Network::CUrlList &getVatsimDataFileUrls() const { return m_vatsimDataFileUrls; }
|
||||||
|
|
||||||
//! Bootstrap URLs (where the data for the setup itself can be downloaded)
|
//! Bootstrap URLs (where the data for the setup itself can be downloaded)
|
||||||
BlackMisc::Network::CUrlList bootstrapFileUrls() const;
|
BlackMisc::Network::CUrlList getBootstrapFileUrls() const;
|
||||||
|
|
||||||
//! Version and download locations
|
//! Version and download locations
|
||||||
BlackMisc::Network::CUrlList updateInfoFileUrls() const;
|
BlackMisc::Network::CUrlList getUpdateInfoFileUrls() const;
|
||||||
|
|
||||||
//! Alternative locations of swift DB data files
|
//! Alternative locations of swift DB data files
|
||||||
BlackMisc::Network::CUrlList swiftDbDataFileLocationUrls() const;
|
BlackMisc::Network::CUrlList getSwiftDbDataFileLocationUrls() const;
|
||||||
|
|
||||||
//! Locations of swift DB news
|
//! Locations of swift DB news
|
||||||
const BlackMisc::Network::CUrlList &swiftLatestNewsUrls() const { return m_newsUrls; }
|
const BlackMisc::Network::CUrlList &getSwiftLatestNewsUrls() const { return m_newsUrls; }
|
||||||
|
|
||||||
//! FSD test servers
|
//! FSD test servers
|
||||||
const BlackMisc::Network::CServerList &fsdTestServers() const { return m_fsdTestServers; }
|
const BlackMisc::Network::CServerList &getFsdTestServers() const { return m_fsdTestServers; }
|
||||||
|
|
||||||
//! FSD test servers plus hardcoded
|
//! FSD test servers plus hardcoded
|
||||||
BlackMisc::Network::CServerList fsdTestServersPlusHardcodedServers() const;
|
BlackMisc::Network::CServerList getFsdTestServersPlusHardcodedServers() const;
|
||||||
|
|
||||||
//! Productive settings?
|
//! Productive settings?
|
||||||
bool isDevelopment() const { return m_development; }
|
bool isDevelopment() const { return m_development; }
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ namespace BlackCore
|
|||||||
if (pw.isEmpty()) { msgs.push_back(CStatusMessage(cats, CStatusMessage::SeverityError, "No password")); }
|
if (pw.isEmpty()) { msgs.push_back(CStatusMessage(cats, CStatusMessage::SeverityError, "No password")); }
|
||||||
if (!msgs.isEmpty()) { return msgs; }
|
if (!msgs.isEmpty()) { return msgs; }
|
||||||
|
|
||||||
const CUrl url(sApp->getGlobalSetup().dbLoginServiceUrl());
|
const CUrl url(sApp->getGlobalSetup().getDbLoginServiceUrl());
|
||||||
QString msg;
|
QString msg;
|
||||||
if (!CNetworkUtils::canConnect(url, msg))
|
if (!CNetworkUtils::canConnect(url, msg))
|
||||||
{
|
{
|
||||||
@@ -74,7 +74,7 @@ namespace BlackCore
|
|||||||
|
|
||||||
void CDatabaseAuthenticationService::logoff()
|
void CDatabaseAuthenticationService::logoff()
|
||||||
{
|
{
|
||||||
CUrl url(sApp->getGlobalSetup().dbLoginServiceUrl());
|
CUrl url(sApp->getGlobalSetup().getDbLoginServiceUrl());
|
||||||
url.setQuery("logoff=true");
|
url.setQuery("logoff=true");
|
||||||
QNetworkRequest request(CNetworkUtils::getNetworkRequest(url));
|
QNetworkRequest request(CNetworkUtils::getNetworkRequest(url));
|
||||||
sApp->getFromNetwork(request, { this, &CDatabaseAuthenticationService::ps_parseServerResponse });
|
sApp->getFromNetwork(request, { this, &CDatabaseAuthenticationService::ps_parseServerResponse });
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ namespace BlackCore
|
|||||||
|
|
||||||
CUrl CIcaoDataReader::getBaseUrl() const
|
CUrl CIcaoDataReader::getBaseUrl() const
|
||||||
{
|
{
|
||||||
const CUrl baseUrl(sApp->getGlobalSetup().dbIcaoReaderUrl());
|
const CUrl baseUrl(sApp->getGlobalSetup().getDbIcaoReaderUrl());
|
||||||
return baseUrl;
|
return baseUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -418,7 +418,7 @@ namespace BlackCore
|
|||||||
|
|
||||||
CUrl CModelDataReader::getBaseUrl() const
|
CUrl CModelDataReader::getBaseUrl() const
|
||||||
{
|
{
|
||||||
const CUrl baseUrl(sApp->getGlobalSetup().dbModelReaderUrl());
|
const CUrl baseUrl(sApp->getGlobalSetup().getDbModelReaderUrl());
|
||||||
return baseUrl;
|
return baseUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
this->threadAssertCheck();
|
this->threadAssertCheck();
|
||||||
Q_ASSERT_X(sApp, Q_FUNC_INFO, "No application");
|
Q_ASSERT_X(sApp, Q_FUNC_INFO, "No application");
|
||||||
const QUrl url(sApp->getGlobalSetup().vatsimBookingsUrl());
|
const QUrl url(sApp->getGlobalSetup().getVatsimBookingsUrl());
|
||||||
if (url.isEmpty()) { return; }
|
if (url.isEmpty()) { return; }
|
||||||
|
|
||||||
sApp->getFromNetwork(url, { this, &CVatsimBookingReader::ps_parseBookings});
|
sApp->getFromNetwork(url, { this, &CVatsimBookingReader::ps_parseBookings});
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ namespace BlackCore
|
|||||||
this->threadAssertCheck();
|
this->threadAssertCheck();
|
||||||
|
|
||||||
Q_ASSERT_X(sApp, Q_FUNC_INFO, "Missing application");
|
Q_ASSERT_X(sApp, Q_FUNC_INFO, "Missing application");
|
||||||
CFailoverUrlList urls(sApp->getGlobalSetup().vatsimStatusFileUrls());
|
CFailoverUrlList urls(sApp->getGlobalSetup().getVatsimStatusFileUrls());
|
||||||
const CUrl url(urls.obtainNextWorkingUrl(true)); // random working URL
|
const CUrl url(urls.obtainNextWorkingUrl(true)); // random working URL
|
||||||
if (url.isEmpty()) { return; }
|
if (url.isEmpty()) { return; }
|
||||||
sApp->getFromNetwork(url, { this, &CVatsimStatusFileReader::ps_parseVatsimFile});
|
sApp->getFromNetwork(url, { this, &CVatsimStatusFileReader::ps_parseVatsimFile});
|
||||||
|
|||||||
@@ -489,7 +489,7 @@ namespace BlackCore
|
|||||||
void CWebDataServices::initWriters()
|
void CWebDataServices::initWriters()
|
||||||
{
|
{
|
||||||
this->m_databaseWriter = new CDatabaseWriter(
|
this->m_databaseWriter = new CDatabaseWriter(
|
||||||
sApp->getGlobalSetup().dbRootDirectoryUrl(),
|
sApp->getGlobalSetup().getDbRootDirectoryUrl(),
|
||||||
this);
|
this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
this->setModeLogin(true);
|
this->setModeLogin(true);
|
||||||
CUrl url(sGui->getGlobalSetup().dbHomePageUrl());
|
CUrl url(sGui->getGlobalSetup().getDbHomePageUrl());
|
||||||
ui->lbl_SwiftDB->setText("<a href=\"" + url.getFullUrl() + "\">swift DB@" + url.getHost() + "</a>");
|
ui->lbl_SwiftDB->setText("<a href=\"" + url.getFullUrl() + "\">swift DB@" + url.getHost() + "</a>");
|
||||||
ui->lbl_SwiftDB->setTextFormat(Qt::RichText);
|
ui->lbl_SwiftDB->setTextFormat(Qt::RichText);
|
||||||
ui->lbl_SwiftDB->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
ui->lbl_SwiftDB->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ namespace BlackGui
|
|||||||
// add a testserver when no servers can be loaded
|
// add a testserver when no servers can be loaded
|
||||||
if (otherServers.isEmpty() && (sGui->isRunningInDeveloperEnvironment() || CProject::isBetaTest()))
|
if (otherServers.isEmpty() && (sGui->isRunningInDeveloperEnvironment() || CProject::isBetaTest()))
|
||||||
{
|
{
|
||||||
otherServers.push_back(sGui->getGlobalSetup().fsdTestServersPlusHardcodedServers());
|
otherServers.push_back(sGui->getGlobalSetup().getFsdTestServersPlusHardcodedServers());
|
||||||
CLogMessage(this).info("Added servers for testing");
|
CLogMessage(this).info("Added servers for testing");
|
||||||
}
|
}
|
||||||
this->ui->cbp_OtherServers->setServers(otherServers);
|
this->ui->cbp_OtherServers->setServers(otherServers);
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ namespace BlackGui
|
|||||||
// this is debug/bootstrap feature we can continue to test when something goes wrong
|
// this is debug/bootstrap feature we can continue to test when something goes wrong
|
||||||
if (serverList.isEmpty() && (CProject::isBetaTest() || sGui->isRunningInDeveloperEnvironment()))
|
if (serverList.isEmpty() && (CProject::isBetaTest() || sGui->isRunningInDeveloperEnvironment()))
|
||||||
{
|
{
|
||||||
serverList.push_back(sGui->getGlobalSetup().fsdTestServersPlusHardcodedServers());
|
serverList.push_back(sGui->getGlobalSetup().getFsdTestServersPlusHardcodedServers());
|
||||||
this->ui->tvp_Servers->updateContainer(serverList);
|
this->ui->tvp_Servers->updateContainer(serverList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -942,9 +942,9 @@ namespace BlackGui
|
|||||||
CStatusMessage CViewBase<ModelClass, ContainerType, ObjectType>::ps_loadJson()
|
CStatusMessage CViewBase<ModelClass, ContainerType, ObjectType>::ps_loadJson()
|
||||||
{
|
{
|
||||||
static const CLogCategoryList cats(CLogCategoryList(this).join({ CLogCategory::validation()}));
|
static const CLogCategoryList cats(CLogCategoryList(this).join({ CLogCategory::validation()}));
|
||||||
QString fileName = QFileDialog::getOpenFileName(nullptr,
|
const QString fileName = QFileDialog::getOpenFileName(nullptr,
|
||||||
tr("Load data file"), getDefaultFilename(),
|
tr("Load data file"), getDefaultFilename(),
|
||||||
tr("swift (*.json *.txt)"));
|
tr("swift (*.json *.txt)"));
|
||||||
if (fileName.isEmpty()) { return CStatusMessage(cats, CStatusMessage::SeverityDebug, "Load canceled"); }
|
if (fileName.isEmpty()) { return CStatusMessage(cats, CStatusMessage::SeverityDebug, "Load canceled"); }
|
||||||
QString json(CFileUtils::readFileToString(fileName));
|
QString json(CFileUtils::readFileToString(fileName));
|
||||||
if (json.isEmpty())
|
if (json.isEmpty())
|
||||||
@@ -961,9 +961,9 @@ namespace BlackGui
|
|||||||
CStatusMessage CViewBase<ModelClass, ContainerType, ObjectType>::ps_saveJson() const
|
CStatusMessage CViewBase<ModelClass, ContainerType, ObjectType>::ps_saveJson() const
|
||||||
{
|
{
|
||||||
static const CLogCategoryList cats(CLogCategoryList(this).join({ CLogCategory::validation()}));
|
static const CLogCategoryList cats(CLogCategoryList(this).join({ CLogCategory::validation()}));
|
||||||
QString fileName = QFileDialog::getSaveFileName(nullptr,
|
const QString fileName = QFileDialog::getSaveFileName(nullptr,
|
||||||
tr("Save data file"), getDefaultFilename(),
|
tr("Save data file"), getDefaultFilename(),
|
||||||
tr("swift (*.json *.txt)"));
|
tr("swift (*.json *.txt)"));
|
||||||
if (fileName.isEmpty()) { return CStatusMessage(cats, CStatusMessage::SeverityDebug, "Save canceled"); }
|
if (fileName.isEmpty()) { return CStatusMessage(cats, CStatusMessage::SeverityDebug, "Save canceled"); }
|
||||||
const QString json(this->toJsonString());
|
const QString json(this->toJsonString());
|
||||||
bool ok = CFileUtils::writeStringToFileInBackground(json, fileName);
|
bool ok = CFileUtils::writeStringToFileInBackground(json, fileName);
|
||||||
|
|||||||
@@ -307,7 +307,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
QString getSwiftStaticDbFilesDirImpl()
|
QString getSwiftStaticDbFilesDirImpl()
|
||||||
{
|
{
|
||||||
QString d(CProject::getSwiftResourceDir());
|
const QString d(CProject::getSwiftResourceDir());
|
||||||
if (d.isEmpty()) { return ""; }
|
if (d.isEmpty()) { return ""; }
|
||||||
QDir dir(CFileUtils::appendFilePaths(d, "shared/dbdata"));
|
QDir dir(CFileUtils::appendFilePaths(d, "shared/dbdata"));
|
||||||
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
||||||
@@ -322,7 +322,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
QString getImagesDirImpl()
|
QString getImagesDirImpl()
|
||||||
{
|
{
|
||||||
QString d(CProject::getSwiftResourceDir());
|
const QString d(CProject::getSwiftResourceDir());
|
||||||
QDir dir(CFileUtils::appendFilePaths(d, "data/images"));
|
QDir dir(CFileUtils::appendFilePaths(d, "data/images"));
|
||||||
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
||||||
return dir.absolutePath();
|
return dir.absolutePath();
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ void CSwiftLauncher::initStyleSheet()
|
|||||||
|
|
||||||
void CSwiftLauncher::loadLatestNews()
|
void CSwiftLauncher::loadLatestNews()
|
||||||
{
|
{
|
||||||
CFailoverUrlList newsUrls(sGui->getGlobalSetup().swiftLatestNewsUrls());
|
CFailoverUrlList newsUrls(sGui->getGlobalSetup().getSwiftLatestNewsUrls());
|
||||||
const CUrl newsUrl(newsUrls.obtainNextWorkingUrl());
|
const CUrl newsUrl(newsUrls.obtainNextWorkingUrl());
|
||||||
if (newsUrl.isEmpty()) { return; }
|
if (newsUrl.isEmpty()) { return; }
|
||||||
sGui->getFromNetwork(newsUrl, { this, &CSwiftLauncher::ps_displayLatestNews});
|
sGui->getFromNetwork(newsUrl, { this, &CSwiftLauncher::ps_displayLatestNews});
|
||||||
@@ -346,7 +346,7 @@ void CSwiftLauncher::ps_startButtonPressed()
|
|||||||
}
|
}
|
||||||
else if (sender == this->ui->tb_Database)
|
else if (sender == this->ui->tb_Database)
|
||||||
{
|
{
|
||||||
const CUrl homePage(sApp->getGlobalSetup().dbHomePageUrl());
|
const CUrl homePage(sApp->getGlobalSetup().getDbHomePageUrl());
|
||||||
QDesktopServices::openUrl(homePage);
|
QDesktopServices::openUrl(homePage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace BlackCoreTest
|
|||||||
|
|
||||||
void CTestReaders::readIcaoData()
|
void CTestReaders::readIcaoData()
|
||||||
{
|
{
|
||||||
const CUrl url(sApp->getGlobalSetup().dbIcaoReaderUrl());
|
const CUrl url(sApp->getGlobalSetup().getDbIcaoReaderUrl());
|
||||||
if (!this->pingServer(url)) { return; }
|
if (!this->pingServer(url)) { return; }
|
||||||
m_icaoReader->start();
|
m_icaoReader->start();
|
||||||
m_icaoReader->readInBackgroundThread(CEntityFlags::AllIcaoEntities, QDateTime());
|
m_icaoReader->readInBackgroundThread(CEntityFlags::AllIcaoEntities, QDateTime());
|
||||||
@@ -69,7 +69,7 @@ namespace BlackCoreTest
|
|||||||
|
|
||||||
void CTestReaders::readModelData()
|
void CTestReaders::readModelData()
|
||||||
{
|
{
|
||||||
const CUrl url(sApp->getGlobalSetup().dbModelReaderUrl());
|
const CUrl url(sApp->getGlobalSetup().getDbModelReaderUrl());
|
||||||
if (!this->pingServer(url)) { return; }
|
if (!this->pingServer(url)) { return; }
|
||||||
m_modelReader->start();
|
m_modelReader->start();
|
||||||
m_modelReader->readInBackgroundThread(CEntityFlags::ModelEntity, QDateTime());
|
m_modelReader->readInBackgroundThread(CEntityFlags::ModelEntity, QDateTime());
|
||||||
|
|||||||
Reference in New Issue
Block a user