mirror of
https://github.com/overte-org/overte.git
synced 2025-04-15 06:08:22 +02:00
Update system to use a checkbox + setting instead.
This commit is contained in:
parent
8eb12a873b
commit
9f3978d3d5
5 changed files with 24 additions and 1 deletions
|
@ -354,6 +354,7 @@ static const QString DESKTOP_DISPLAY_PLUGIN_NAME = "Desktop";
|
||||||
static const QString ACTIVE_DISPLAY_PLUGIN_SETTING_NAME = "activeDisplayPlugin";
|
static const QString ACTIVE_DISPLAY_PLUGIN_SETTING_NAME = "activeDisplayPlugin";
|
||||||
static const QString SYSTEM_TABLET = "com.highfidelity.interface.tablet.system";
|
static const QString SYSTEM_TABLET = "com.highfidelity.interface.tablet.system";
|
||||||
static const QString KEEP_ME_LOGGED_IN_SETTING_NAME = "keepMeLoggedIn";
|
static const QString KEEP_ME_LOGGED_IN_SETTING_NAME = "keepMeLoggedIn";
|
||||||
|
static const QString CACHEBUST_SCRIPT_REQUIRE_SETTING_NAME = "cachebustScriptRequire";
|
||||||
|
|
||||||
static const float FOCUS_HIGHLIGHT_EXPANSION_FACTOR = 1.05f;
|
static const float FOCUS_HIGHLIGHT_EXPANSION_FACTOR = 1.05f;
|
||||||
|
|
||||||
|
@ -1958,6 +1959,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
loadSettings();
|
loadSettings();
|
||||||
|
|
||||||
updateVerboseLogging();
|
updateVerboseLogging();
|
||||||
|
|
||||||
|
setCachebustRequire();
|
||||||
|
|
||||||
// Make sure we don't time out during slow operations at startup
|
// Make sure we don't time out during slow operations at startup
|
||||||
updateHeartbeat();
|
updateHeartbeat();
|
||||||
|
@ -2591,6 +2594,16 @@ void Application::updateVerboseLogging() {
|
||||||
QLoggingCategory::setFilterRules(rules);
|
QLoggingCategory::setFilterRules(rules);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Application::setCachebustRequire() {
|
||||||
|
auto menu = Menu::getInstance();
|
||||||
|
if (!menu) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
bool enable = menu->isOptionChecked(MenuOption::CachebustRequire);
|
||||||
|
|
||||||
|
Setting::Handle<bool>{ CACHEBUST_SCRIPT_REQUIRE_SETTING_NAME, false }.set(enable);
|
||||||
|
}
|
||||||
|
|
||||||
void Application::domainConnectionRefused(const QString& reasonMessage, int reasonCodeInt, const QString& extraInfo) {
|
void Application::domainConnectionRefused(const QString& reasonMessage, int reasonCodeInt, const QString& extraInfo) {
|
||||||
DomainHandler::ConnectionRefusedReason reasonCode = static_cast<DomainHandler::ConnectionRefusedReason>(reasonCodeInt);
|
DomainHandler::ConnectionRefusedReason reasonCode = static_cast<DomainHandler::ConnectionRefusedReason>(reasonCodeInt);
|
||||||
|
|
||||||
|
|
|
@ -470,6 +470,8 @@ public slots:
|
||||||
void setIsInterstitialMode(bool interstitialMode);
|
void setIsInterstitialMode(bool interstitialMode);
|
||||||
|
|
||||||
void updateVerboseLogging();
|
void updateVerboseLogging();
|
||||||
|
|
||||||
|
void setCachebustRequire();
|
||||||
|
|
||||||
void changeViewAsNeeded(float boomLength);
|
void changeViewAsNeeded(float boomLength);
|
||||||
|
|
||||||
|
|
|
@ -365,6 +365,10 @@ Menu::Menu() {
|
||||||
// Developer > Scripting > Verbose Logging
|
// Developer > Scripting > Verbose Logging
|
||||||
addCheckableActionToQMenuAndActionHash(scriptingOptionsMenu, MenuOption::VerboseLogging, 0, false,
|
addCheckableActionToQMenuAndActionHash(scriptingOptionsMenu, MenuOption::VerboseLogging, 0, false,
|
||||||
qApp, SLOT(updateVerboseLogging()));
|
qApp, SLOT(updateVerboseLogging()));
|
||||||
|
|
||||||
|
// Developer > Scripting > Enable Cachebusting of Script.require
|
||||||
|
addCheckableActionToQMenuAndActionHash(scriptingOptionsMenu, MenuOption::CachebustRequire, 0, false,
|
||||||
|
qApp, SLOT(setCachebustRequire()));
|
||||||
|
|
||||||
// Developer > Scripting > Enable Speech Control API
|
// Developer > Scripting > Enable Speech Control API
|
||||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
||||||
|
|
|
@ -54,6 +54,7 @@ namespace MenuOption {
|
||||||
const QString BookmarkAvatarEntities = "Bookmark Avatar Entities";
|
const QString BookmarkAvatarEntities = "Bookmark Avatar Entities";
|
||||||
const QString BookmarkLocation = "Bookmark Location";
|
const QString BookmarkLocation = "Bookmark Location";
|
||||||
const QString CalibrateCamera = "Calibrate Camera";
|
const QString CalibrateCamera = "Calibrate Camera";
|
||||||
|
const QString CachebustRequire = "Enable Cachebusting of Script.require";
|
||||||
const QString CenterPlayerInView = "Center Player In View";
|
const QString CenterPlayerInView = "Center Player In View";
|
||||||
const QString Chat = "Chat...";
|
const QString Chat = "Chat...";
|
||||||
const QString ClearDiskCaches = "Clear Disk Caches (requires restart)";
|
const QString ClearDiskCaches = "Clear Disk Caches (requires restart)";
|
||||||
|
|
|
@ -1873,9 +1873,12 @@ QScriptValue ScriptEngine::require(const QString& moduleId) {
|
||||||
// modules get cached in `Script.require.cache` and (similar to Node.js) users can access it
|
// modules get cached in `Script.require.cache` and (similar to Node.js) users can access it
|
||||||
// to inspect particular entries and invalidate them by deleting the key:
|
// to inspect particular entries and invalidate them by deleting the key:
|
||||||
// `delete Script.require.cache[Script.require.resolve(moduleId)];`
|
// `delete Script.require.cache[Script.require.resolve(moduleId)];`
|
||||||
|
|
||||||
|
// Check to see if
|
||||||
|
Setting::Handle<bool> getCachebustSetting {"cachebustScriptRequire", false };
|
||||||
|
|
||||||
// cacheMeta is just used right now to tell deleted keys apart from undefined ones
|
// cacheMeta is just used right now to tell deleted keys apart from undefined ones
|
||||||
bool invalidateCache = module.isUndefined() && cacheMeta.property(moduleId).isValid();
|
bool invalidateCache = getCachebustSetting.get() || (module.isUndefined() && cacheMeta.property(moduleId).isValid());
|
||||||
|
|
||||||
// reset the cacheMeta record so invalidation won't apply next time, even if the module fails to load
|
// reset the cacheMeta record so invalidation won't apply next time, even if the module fails to load
|
||||||
cacheMeta.setProperty(modulePath, QScriptValue());
|
cacheMeta.setProperty(modulePath, QScriptValue());
|
||||||
|
|
Loading…
Reference in a new issue