MAINT-6419 Show the release notes when first starting a new viewer

meow-7.2.2
AndreyL ProductEngine 2016-05-20 01:45:12 +03:00
parent 380bbc01c9
commit 357f6d04ed
3 changed files with 56 additions and 0 deletions

View File

@ -13276,6 +13276,17 @@
<key>Value</key>
<string>1</string>
</map>
<key>UpdaterShowReleaseNotes</key>
<map>
<key>Comment</key>
<string>Enables displaying of the Release notes in a web floater after update.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<string>1</string>
</map>
<key>UploadBakedTexOld</key>
<map>
<key>Comment</key>

View File

@ -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)

View File

@ -273,6 +273,18 @@
name="update_willing_to_test"
width="400"
top_pad="5"/>
<check_box
top_delta="4"
enabled="true"
follows="left|top"
height="14"
control_name="UpdaterShowReleaseNotes"
label="Show Release Notes after update"
left_delta="0"
mouse_opaque="true"
name="update_show_release_notes"
width="400"
top_pad="5"/>
<text
type="string"
length="1"