diff options
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r-- | indra/newview/llappviewer.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 6bc1f67e32..29680093f9 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1220,6 +1220,8 @@ bool LLAppViewer::init() boost::bind(&LLControlGroup::getU32, boost::ref(gSavedSettings), _1), boost::bind(&LLControlGroup::declareU32, boost::ref(gSavedSettings), _1, _2, _3, LLControlVariable::PERSIST_ALWAYS)); + showReleaseNotesIfRequired(); + return true; } @@ -5799,6 +5801,37 @@ void LLAppViewer::launchUpdater() // LLAppViewer::instance()->forceQuit(); } +/** +* Check if user is running a new version of the viewer. +* Display the Release Notes if it's not overriden by the "UpdaterShowReleaseNotes" setting. +*/ +void LLAppViewer::showReleaseNotesIfRequired() +{ + if (!gLastRunVersion.empty() && gSavedSettings.getBOOL("UpdaterShowReleaseNotes")) + { + try + { + boost::regex expr("(?<chan>[\\w\\s]+)\\s(?<maj>\\d+)\\.(?<min>\\d+)\\.(?<patch>\\d+)\\.(?<build>\\d+)", boost::regex::perl | boost::regex::icase); + boost::smatch matches; + if (boost::regex_search(gLastRunVersion, matches, expr)) + { + if (LLVersionInfo::getChannel() == matches["chan"] && // don't show Release Notes when changing a channel + (LLVersionInfo::getBuild() > std::stoi(matches["build"]) + || LLVersionInfo::getPatch() > std::stoi(matches["patch"]) + || LLVersionInfo::getMinor() > std::stoi(matches["min"]) + || LLVersionInfo::getMajor() > std::stoi(matches["maj"]))) + { + LLSD info(getViewerInfo()); + LLWeb::loadURLInternal(info["VIEWER_RELEASE_NOTES_URL"]); + } + } + } + catch (boost::regex_error& e) + { + LL_WARNS() << "Can't parse previous run version, regex errpr: " << e.what() << LL_ENDL; + } + } +} //virtual void LLAppViewer::setMasterSystemAudioMute(bool mute) |