summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2016-05-20 01:45:12 +0300
committerAndreyL ProductEngine <alihatskiy@productengine.com>2016-05-20 01:45:12 +0300
commit357f6d04edb354f12ae052f35c65cfd87ba4cb2d (patch)
treef1f71770b1e3751552827acb2361e477fef6cb42 /indra
parent380bbc01c9e5c69e71e31da414eb4d746df2c9ab (diff)
MAINT-6419 Show the release notes when first starting a new viewer
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llappviewer.cpp33
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_setup.xml12
3 files changed, 56 insertions, 0 deletions
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 @@
<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>
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)
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"/>
+ <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"