diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2019-05-31 16:47:20 -0400 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-03-24 17:49:20 +0200 |
commit | f5d74ec8272a5a4bc5b53db60fc5d3fe73923974 (patch) | |
tree | 1b2b25f5a6e05f19d0cdba48a0ae81716ca48c51 /indra/newview/llstartup.cpp | |
parent | 3e9a13dc07ae0eeb5f5f0fc06dde660f9f851283 (diff) |
SL-11216: To display release notes, listen on "relnotes" LLEventPump.
Now, when the viewer decides it's appropriate to display release notes on the
login screen, wait for SLVersionChecker to post the release-notes URL before
opening the web floater.
Diffstat (limited to 'indra/newview/llstartup.cpp')
-rw-r--r-- | indra/newview/llstartup.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 2c0bbbc850..2f6853ba7b 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2366,13 +2366,29 @@ void login_callback(S32 option, void *userdata) void show_release_notes_if_required() { static bool release_notes_shown = false; + // We happen to know that instantiating LLVersionInfo implicitly + // instantiates the LLEventMailDrop named "relnotes", which we (might) use + // below. If viewer release notes stop working, might be because that + // LLEventMailDrop got moved out of LLVersionInfo and hasn't yet been + // instantiated. if (!release_notes_shown && (LLVersionInfo::instance().getChannelAndVersion() != gLastRunVersion) && LLVersionInfo::instance().getViewerMaturity() != LLVersionInfo::TEST_VIEWER // don't show Release Notes for the test builds && gSavedSettings.getBOOL("UpdaterShowReleaseNotes") && !gSavedSettings.getBOOL("FirstLoginThisInstall")) { - LLSD info(LLAppViewer::instance()->getViewerInfo()); - LLWeb::loadURLInternal(info["VIEWER_RELEASE_NOTES_URL"]); + // Instantiate a "relnotes" listener which assumes any arriving event + // is the release notes URL string. Since "relnotes" is an + // LLEventMailDrop, this listener will be invoked whether or not the + // URL has already been posted. If so, it will fire immediately; + // otherwise it will fire whenever the URL is (later) posted. Either + // way, it will display the release notes as soon as the URL becomes + // available. + LLEventPumps::instance().obtain("relnotes").listen( + "showrelnotes", + [](const LLSD& url){ + LLWeb::loadURLInternal(url.asString()); + return false; + }); release_notes_shown = true; } } |