mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
Renamings and adjustments of developer flag
This commit is contained in:
@@ -270,9 +270,9 @@ namespace BlackConfig
|
||||
bool ok;
|
||||
const long long btsll = bts.toLongLong(&ok); // at least 64bit
|
||||
if (!ok) { return 0; }
|
||||
// now we have to converto int
|
||||
// now we have to convert to int, otherwise we would fail 2021
|
||||
// max 2147483647 (2^31 - 1)
|
||||
// 1MMddHHmm (years since 2010)
|
||||
// yyMMddHHmm (years since 2010)
|
||||
// yyyyMMddHHmm
|
||||
const long long yearOffset = 201000000000;
|
||||
const int btsInt = btsll - yearOffset;
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace BlackCore
|
||||
m_analyzer(new CAirspaceAnalyzer(ownAircraftProvider, this, network, this))
|
||||
{
|
||||
this->setObjectName("CAirspaceMonitor");
|
||||
m_enableReverseLookupMsgs = sApp->isRunningInDeveloperEnvironment();
|
||||
m_enableReverseLookupMsgs = sApp->isDeveloperFlagSet();
|
||||
|
||||
connect(m_network, &INetwork::atcPositionUpdate, this, &CAirspaceMonitor::onAtcPositionUpdate);
|
||||
connect(m_network, &INetwork::atisReplyReceived, this, &CAirspaceMonitor::onAtisReceived);
|
||||
|
||||
@@ -472,12 +472,12 @@ namespace BlackCore
|
||||
|
||||
const QString &CApplication::versionStringDetailed() const
|
||||
{
|
||||
if (this->isRunningInDeveloperEnvironment() && CBuildConfig::isLocalDeveloperDebugBuild())
|
||||
if (this->isDeveloperFlagSet() && CBuildConfig::isLocalDeveloperDebugBuild())
|
||||
{
|
||||
static const QString s(CBuildConfig::getVersionString() + " [dev,DEVDBG]");
|
||||
return s;
|
||||
}
|
||||
if (isRunningInDeveloperEnvironment())
|
||||
if (isDeveloperFlagSet())
|
||||
{
|
||||
static const QString s(CBuildConfig::getVersionString() + " [dev]");
|
||||
return s;
|
||||
@@ -504,12 +504,17 @@ namespace BlackCore
|
||||
|
||||
bool CApplication::initIsRunningInDeveloperEnvironment() const
|
||||
{
|
||||
//
|
||||
// assumption: restricted distributions are development versions
|
||||
//
|
||||
|
||||
if (this->getApplicationInfo().isSampleOrUnitTest()) { return true; }
|
||||
if (CBuildConfig::isLocalDeveloperDebugBuild()) { return true; }
|
||||
|
||||
const CDistribution d(this->getOwnDistribution());
|
||||
const bool canSetDeveloperEnv = CBuildConfig::isLocalDeveloperDebugBuild() || d.isRestricted();
|
||||
if (canSetDeveloperEnv && this->isSet(m_cmdDevelopment)) { return true; }
|
||||
if (d.isRestricted() && this->isSet(m_cmdDevelopment)) { return true; }
|
||||
|
||||
// we can globally set a dev.flag
|
||||
if (this->isSetupAvailable())
|
||||
{
|
||||
// assume value from setup
|
||||
@@ -560,7 +565,7 @@ namespace BlackCore
|
||||
boolToYesNo(CBuildConfig::isLocalDeveloperDebugBuild()) %
|
||||
separator %
|
||||
QStringLiteral("dev.env.: ") %
|
||||
boolToYesNo(this->isRunningInDeveloperEnvironment()) %
|
||||
boolToYesNo(this->isDeveloperFlagSet()) %
|
||||
separator %
|
||||
QStringLiteral("distribution: ") %
|
||||
this->getOwnDistribution().toQString(true) %
|
||||
@@ -1208,7 +1213,7 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
// dev.
|
||||
m_devEnv = this->initIsRunningInDeveloperEnvironment();
|
||||
m_devFlag = this->initIsRunningInDeveloperEnvironment();
|
||||
|
||||
// Hookin, other parsing
|
||||
if (!this->parsingHookIn()) { return false; }
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace BlackCore
|
||||
|
||||
//! Global setup
|
||||
//! \threadsafe
|
||||
BlackCore::Data::CGlobalSetup getGlobalSetup() const;
|
||||
Data::CGlobalSetup getGlobalSetup() const;
|
||||
|
||||
//! Update info
|
||||
//! \threadsafe
|
||||
@@ -177,8 +177,8 @@ namespace BlackCore
|
||||
//! swift info string
|
||||
const char *swiftVersionChar();
|
||||
|
||||
//! Running in dev.environment?
|
||||
bool isRunningInDeveloperEnvironment() const { return m_devEnv; }
|
||||
//! Running with dev.flag?
|
||||
bool isDeveloperFlagSet() const { return m_devFlag; }
|
||||
|
||||
//! Signal startup automatically or individually
|
||||
void setSignalStartupAutomatically(bool enabled) { m_signalStartup = enabled; }
|
||||
@@ -316,7 +316,7 @@ namespace BlackCore
|
||||
//! Init web data services and start them
|
||||
//! \sa webDataServicesStarted
|
||||
//! \remark requires setup loaded
|
||||
BlackMisc::CStatusMessageList useWebDataServices(const CWebReaderFlags::WebReader webReader, const BlackCore::Db::CDatabaseReaderConfigList &dbReaderConfig);
|
||||
BlackMisc::CStatusMessageList useWebDataServices(const CWebReaderFlags::WebReader webReader, const Db::CDatabaseReaderConfigList &dbReaderConfig);
|
||||
|
||||
//! Get the facade
|
||||
CCoreFacade *getCoreFacade() { return m_coreFacade.data(); }
|
||||
@@ -361,7 +361,7 @@ namespace BlackCore
|
||||
|
||||
//! Access to setup reader
|
||||
//! \remark supposed to be used only in special cases
|
||||
BlackCore::CSetupReader *getSetupReader() const;
|
||||
CSetupReader *getSetupReader() const;
|
||||
|
||||
//! Setup already synchronized
|
||||
bool isSetupAvailable() const;
|
||||
@@ -615,7 +615,7 @@ namespace BlackCore
|
||||
bool m_useContexts = false; //!< use contexts
|
||||
bool m_useWebData = false; //!< use web data
|
||||
bool m_signalStartup = true; //!< signal startup automatically
|
||||
bool m_devEnv = false; //!< dev. environment
|
||||
bool m_devFlag = false; //!< dev. environment
|
||||
bool m_saveSettingsOnShutdown = true; //!< saving all settings on shutdown
|
||||
|
||||
// -------------- crashpad -----------------
|
||||
@@ -625,7 +625,7 @@ namespace BlackCore
|
||||
#ifdef BLACK_USE_CRASHPAD
|
||||
std::unique_ptr<crashpad::CrashpadClient> m_crashpadClient;
|
||||
std::unique_ptr<crashpad::CrashReportDatabase> m_crashReportDatabase;
|
||||
BlackMisc::CSettingReadOnly<BlackCore::Application::TCrashDumpUploadEnabled> m_crashDumpUploadEnabled { this, &CApplication::crashDumpUploadEnabledChanged };
|
||||
BlackMisc::CSettingReadOnly<Application::TCrashDumpUploadEnabled> m_crashDumpUploadEnabled { this, &CApplication::crashDumpUploadEnabledChanged };
|
||||
#endif
|
||||
};
|
||||
} // namespace
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace BlackCore
|
||||
void simulatorStatusChanged(int status);
|
||||
|
||||
//! Simulator plugin loaded / unloaded (default info)
|
||||
void simulatorPluginChanged(BlackMisc::Simulation::CSimulatorPluginInfo info);
|
||||
void simulatorPluginChanged(const BlackMisc::Simulation::CSimulatorPluginInfo &info);
|
||||
|
||||
//! Render restrictions have been changed
|
||||
void renderRestrictionsChanged(bool restricted, bool enabled, int maxAircraft, const BlackMisc::PhysicalQuantities::CLength &maxRenderedDistance);
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace BlackCore
|
||||
this->setObjectName("CContextSimulator");
|
||||
CContextSimulator::registerHelp();
|
||||
|
||||
m_enableMatchingMessages = sApp->isRunningInDeveloperEnvironment();
|
||||
m_enableMatchingMessages = sApp->isDeveloperFlagSet();
|
||||
m_plugins->collectPlugins();
|
||||
this->restoreSimulatorPlugins();
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace BlackGui
|
||||
ui(new Ui::CAircraftPartsHistory)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->cb_PartsHistoryEnabled->setChecked(sApp && sApp->isRunningInDeveloperEnvironment()); // default
|
||||
ui->cb_PartsHistoryEnabled->setChecked(sApp && sApp->isDeveloperFlagSet()); // default
|
||||
|
||||
m_timerUpdateHistory.setInterval(2 * 1000);
|
||||
this->initGui();
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace BlackGui
|
||||
ui(new Ui::CDbDebugDatabaseSetup)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
const bool enabled = sGui->isRunningInDeveloperEnvironment();
|
||||
const bool enabled = sGui->isDeveloperFlagSet();
|
||||
this->setEnabled(enabled);
|
||||
if (!enabled)
|
||||
{
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace BlackGui
|
||||
ui->tbr_InfoAndHints->setHtml(html);
|
||||
ui->tbr_InfoAndHints->setOpenExternalLinks(true);
|
||||
|
||||
const bool devEnv = sGui->isRunningInDeveloperEnvironment();
|
||||
const bool devEnv = sGui->isDeveloperFlagSet();
|
||||
ui->comp_DebugSetup->setVisible(devEnv);
|
||||
|
||||
const QString dbUrl = sGui->getGlobalSetup().getDbHomePageUrl().toQString();
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace BlackGui
|
||||
ui->setupUi(this);
|
||||
|
||||
// normally no system Bus on Windows
|
||||
if (CBuildConfig::isRunningOnWindowsNtPlatform() || !sGui->isRunningInDeveloperEnvironment())
|
||||
if (CBuildConfig::isRunningOnWindowsNtPlatform() || !sGui->isDeveloperFlagSet())
|
||||
{
|
||||
this->setSystemDBusVisible(false);
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace BlackGui
|
||||
CServerList otherServers(m_otherTrafficNetworkServers.getThreadLocal());
|
||||
|
||||
// add a testserver when no servers can be loaded
|
||||
if (otherServers.isEmpty() && (sGui->isRunningInDeveloperEnvironment() || CBuildConfig::isLocalDeveloperDebugBuild()))
|
||||
if (otherServers.isEmpty() && (sGui->isDeveloperFlagSet() || CBuildConfig::isLocalDeveloperDebugBuild()))
|
||||
{
|
||||
otherServers.push_back(sGui->getGlobalSetup().getFsdTestServersPlusHardcodedServers());
|
||||
CLogMessage(this).info("Added servers for testing");
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace BlackGui
|
||||
this->tabBar()->setExpanding(false);
|
||||
this->tabBar()->setUsesScrollButtons(true);
|
||||
this->setCurrentIndex(0); // 1st tab
|
||||
ui->comp_DataLoadOverview->showVisibleDbRefreshButtons(CBuildConfig::isDebugBuild() || sGui->isRunningInDeveloperEnvironment());
|
||||
ui->comp_DataLoadOverview->showVisibleDbRefreshButtons(CBuildConfig::isDebugBuild() || sGui->isDeveloperFlagSet());
|
||||
ui->comp_DataLoadOverview->showVisibleLoadAllButtons(false, false);
|
||||
|
||||
connect(ui->comp_SettingsGuiGeneral, &CSettingsGuiComponent::changedWindowsOpacity, this, &CSettingsComponent::changedWindowsOpacity);
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace BlackGui
|
||||
|
||||
// add swift test servers in case we have no servers:
|
||||
// this is debug/bootstrap feature we can continue to test when something goes wrong
|
||||
if (serverList.isEmpty() && (sGui->isRunningInDeveloperEnvironment()))
|
||||
if (serverList.isEmpty() && (sGui->isDeveloperFlagSet()))
|
||||
{
|
||||
serverList.push_back(sGui->getGlobalSetup().getFsdTestServersPlusHardcodedServers());
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace BlackGui
|
||||
|
||||
void CLoginModeButtons::configureLoginModes()
|
||||
{
|
||||
if (!sGui->isRunningInDeveloperEnvironment() && !sGui->getIContextSimulator()->isSimulatorSimulating())
|
||||
if (!sGui->isDeveloperFlagSet() && !sGui->getIContextSimulator()->isSimulatorSimulating())
|
||||
{
|
||||
// Disable pilot login modes
|
||||
ui->rb_LoginNormal->setEnabled(false);
|
||||
|
||||
@@ -422,7 +422,7 @@ namespace BlackSimPlugin
|
||||
{
|
||||
const CCallsign cs = aircraft.getCallsign();
|
||||
if (!m_interpolators.contains(cs)) { continue; }
|
||||
const bool log = setup.logCallsign(cs);
|
||||
const bool log = setup.isLogCallsign(cs);
|
||||
CInterpolatorMulti *im = m_interpolators[cs];
|
||||
CInterpolationStatus statusInterpolation;
|
||||
CPartsStatus statusParts;
|
||||
|
||||
@@ -62,7 +62,7 @@ void CSwiftData::initDynamicMenus()
|
||||
Q_ASSERT_X(ui->comp_MainInfoArea->getDataInfoAreaComponent(), Q_FUNC_INFO, "Missing DB info area");
|
||||
ui->menu_Mapping->addAction(CIcons::database16(), "Load all DB data", ui->comp_MainInfoArea->getDataInfoAreaComponent(), SLOT(requestUpdateOfAllDbData()));
|
||||
ui->menu_Mapping->addAction(CIcons::load16(), "Load DB test data from disk", ui->comp_MainInfoArea->getDataInfoAreaComponent(), SLOT(readDbDataFromResourceDir()));
|
||||
if (sGui->isRunningInDeveloperEnvironment())
|
||||
if (sGui->isDeveloperFlagSet())
|
||||
{
|
||||
ui->menu_Mapping->addAction(CIcons::save16(), "Save DB test data to disk", ui->comp_MainInfoArea->getDataInfoAreaComponent(), SLOT(writeDbDataToResourceDir()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user