Merge branch 'master' into mediafoundation

This commit is contained in:
LordGrey 2021-02-20 18:08:24 +01:00 committed by GitHub
commit 38e133171f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 12 deletions

View File

@ -89,11 +89,13 @@ function loadContent(event, forceRefresh) {
var lastSelectedInstance = getStorage('lastSelectedInstance', false);
if (lastSelectedInstance && (lastSelectedInstance != window.currentHyperionInstance))
if (typeof (window.serverInfo.instance[lastSelectedInstance].running) !== 'undefined' && window.serverInfo.instance[lastSelectedInstance].running)
if (lastSelectedInstance && (lastSelectedInstance != window.currentHyperionInstance)) {
if (window.serverInfo.instance[lastSelectedInstance] && window.serverInfo.instance[lastSelectedInstance].running) {
instanceSwitch(lastSelectedInstance);
else
} else {
removeStorage('lastSelectedInstance', false);
}
}
if (typeof event != "undefined") {
tag = event.currentTarget.hash;
@ -132,13 +134,13 @@ function updateHyperionInstanceListing() {
var currInstMarker = (data[key].instance == window.currentHyperionInstance) ? "component-on" : "";
var html = '<li id="hyperioninstance_' + data[key].instance + '"> \
<a> \
<div> \
<i class="fa fa-circle fa-fw '+ currInstMarker + '"></i> \
<span>'+ data[key].friendly_name + '</span> \
</div> \
</a> \
</li> '
<a> \
<div> \
<i class="fa fa-circle fa-fw '+ currInstMarker + '"></i> \
<span>'+ data[key].friendly_name + '</span> \
</div> \
</a> \
</li> '
if (data.length - 1 > key)
html += '<li class="divider"></li>'
@ -181,7 +183,6 @@ function initLanguageSelection() {
langText = availLangText[langIdx];
}
}
$('#language-select').prop('title', langText);
$("#language-select").val(langIdx);
$("#language-select").selectpicker("refresh");

View File

@ -42,7 +42,7 @@ public:
/// @brief get the full settings object of this instance (with global settings)
/// @return The requested json
///
const QJsonObject & getSettings() const { return _qconfig; }
QJsonObject getSettings() const;
signals:
///

View File

@ -114,6 +114,25 @@ QJsonDocument SettingsManager::getSetting(settings::type type) const
return _sTable->getSettingsRecord(settings::typeToString(type));
}
QJsonObject SettingsManager::getSettings() const
{
QJsonObject config;
for(const auto & key : _qconfig.keys())
{
//Read all records from database to ensure that global settings are read across instances
QJsonDocument doc = _sTable->getSettingsRecord(key);
if(doc.isArray())
{
config.insert(key, doc.array());
}
else
{
config.insert(key, doc.object());
}
}
return config;
}
bool SettingsManager::saveSettings(QJsonObject config, bool correct)
{
// optional data upgrades e.g. imported legacy/older configs