diff options
author | RunitaiLinden <davep@lindenlab.com> | 2024-03-12 10:19:19 -0500 |
---|---|---|
committer | RunitaiLinden <davep@lindenlab.com> | 2024-03-12 10:19:19 -0500 |
commit | 522c4b4f0925463d5f30a4a0f314999a11d5def3 (patch) | |
tree | 9e6f25155182f643ace380179592516a08792646 /indra/llcommon/llerror.cpp | |
parent | afc943acbc2bb79e2e1aa5d5eaf448e01b6c2b00 (diff) | |
parent | 5fca8915d8f44cdb2a4f7bb4715d61ba47043e5d (diff) |
Merge branch '965-eep-skies-too-bright-after-hdri-local-preview-merge' of https://github.com/secondlife/viewer into 965-eep-skies-too-bright-after-hdri-local-preview-merge
Diffstat (limited to 'indra/llcommon/llerror.cpp')
-rw-r--r-- | indra/llcommon/llerror.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 414515854a..3de641fcba 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -1601,6 +1601,48 @@ namespace LLError { return out << boost::stacktrace::stacktrace(); } + + // LLOutOfMemoryWarning + std::string LLUserWarningMsg::sLocalizedOutOfMemoryTitle; + std::string LLUserWarningMsg::sLocalizedOutOfMemoryWarning; + LLUserWarningMsg::Handler LLUserWarningMsg::sHandler; + + void LLUserWarningMsg::show(const std::string& message) + { + if (sHandler) + { + sHandler(std::string(), message); + } + } + + void LLUserWarningMsg::showOutOfMemory() + { + if (sHandler && !sLocalizedOutOfMemoryTitle.empty()) + { + sHandler(sLocalizedOutOfMemoryTitle, sLocalizedOutOfMemoryWarning); + } + } + + void LLUserWarningMsg::showMissingFiles() + { + // Files Are missing, likely can't localize. + const std::string error_string = + "Second Life viewer couldn't access some of the files it needs and will be closed." + "\n\nPlease reinstall viewer from https://secondlife.com/support/downloads/ and " + "contact https://support.secondlife.com if issue persists after reinstall."; + sHandler("Missing Files", error_string); + } + + void LLUserWarningMsg::setHandler(const LLUserWarningMsg::Handler &handler) + { + sHandler = handler; + } + + void LLUserWarningMsg::setOutOfMemoryStrings(const std::string& title, const std::string& message) + { + sLocalizedOutOfMemoryTitle = title; + sLocalizedOutOfMemoryWarning = message; + } } void crashdriver(void (*callback)(int*)) |