mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-14 07:49:35 -06:00
Only display commit hash text overlay if there is information available
Add version and commit information into a global property
This commit is contained in:
@@ -112,6 +112,19 @@ namespace {
|
||||
std::string sceneName;
|
||||
std::string cacheFolder;
|
||||
} commandlineArgumentPlaceholders;
|
||||
|
||||
|
||||
static const openspace::properties::Property::PropertyInfo VersionInfo = {
|
||||
"VersionInfo",
|
||||
"Version Information",
|
||||
"This value contains the full string identifying this OpenSpace Version"
|
||||
};
|
||||
|
||||
static const openspace::properties::Property::PropertyInfo SourceControlInfo = {
|
||||
"SCMInfo",
|
||||
"Source Control Management Information",
|
||||
"This value contains information from the SCM, such as commit hash and branch"
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace openspace {
|
||||
@@ -145,6 +158,10 @@ OpenSpaceEngine::OpenSpaceEngine(std::string programName,
|
||||
, _scriptScheduler(new scripting::ScriptScheduler)
|
||||
, _virtualPropertyManager(new VirtualPropertyManager)
|
||||
, _globalPropertyNamespace(new properties::PropertyOwner({ "" }))
|
||||
, _versionInformation{
|
||||
properties::StringProperty(VersionInfo, OPENSPACE_VERSION_STRING_FULL),
|
||||
properties::StringProperty(SourceControlInfo, OPENSPACE_GIT_FULL)
|
||||
}
|
||||
, _scheduledSceneSwitch(false)
|
||||
, _scenePath("")
|
||||
, _runTime(0.0)
|
||||
@@ -161,6 +178,12 @@ OpenSpaceEngine::OpenSpaceEngine(std::string programName,
|
||||
_globalPropertyNamespace->addPropertySubOwner(_parallelConnection.get());
|
||||
_globalPropertyNamespace->addPropertySubOwner(_console.get());
|
||||
|
||||
|
||||
_versionInformation.versionString.setReadOnly(true);
|
||||
_globalPropertyNamespace->addProperty(_versionInformation.versionString);
|
||||
_versionInformation.sourceControlInformation.setReadOnly(true);
|
||||
_globalPropertyNamespace->addProperty(_versionInformation.sourceControlInformation);
|
||||
|
||||
FactoryManager::initialize();
|
||||
FactoryManager::ref().addFactory(
|
||||
std::make_unique<ghoul::TemplateFactory<Renderable>>(),
|
||||
|
||||
Reference in New Issue
Block a user