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