From 357f6d04edb354f12ae052f35c65cfd87ba4cb2d Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Fri, 20 May 2016 01:45:12 +0300 Subject: MAINT-6419 Show the release notes when first starting a new viewer --- indra/newview/app_settings/settings.xml | 11 ++++++++ indra/newview/llappviewer.cpp | 33 ++++++++++++++++++++++ .../default/xui/en/panel_preferences_setup.xml | 12 ++++++++ 3 files changed, 56 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 4912f27e70..7bcbf819e4 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13276,6 +13276,17 @@ Value 1 + UpdaterShowReleaseNotes + + Comment + Enables displaying of the Release notes in a web floater after update. + Persist + 1 + Type + Boolean + Value + 1 + UploadBakedTexOld Comment 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("(?[\\w\\s]+)\\s(?\\d+)\\.(?\\d+)\\.(?\\d+)\\.(?\\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) diff --git a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml index 0b605cf6f7..c20f9b2c51 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml @@ -273,6 +273,18 @@ name="update_willing_to_test" width="400" top_pad="5"/> +