summaryrefslogtreecommitdiff
path: root/indra/newview/llteleporthistory.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2022-05-26 03:07:05 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2022-05-26 03:07:05 +0300
commit91606c7b60de4270050f373e1efe49eb3074951b (patch)
tree5523b2c78c73d22881c0ae8bfbfcbb29ffdc5df4 /indra/newview/llteleporthistory.cpp
parente6245adce883d62f18a2d8b8af5061d3183d9be9 (diff)
parentcdbd06e8ed6e3f4285a61f5c0b607a65dfdf8dfd (diff)
Merge branch 'master' into DRTVWR-548-maint-N
Diffstat (limited to 'indra/newview/llteleporthistory.cpp')
-rw-r--r--indra/newview/llteleporthistory.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/indra/newview/llteleporthistory.cpp b/indra/newview/llteleporthistory.cpp
index 3c3c1c96ef..3ece12931c 100644
--- a/indra/newview/llteleporthistory.cpp
+++ b/indra/newview/llteleporthistory.cpp
@@ -39,6 +39,11 @@
#include "llviewerregion.h"
#include "llworldmap.h"
#include "llagentui.h"
+#include "llwindow.h"
+#include "llviewerwindow.h"
+#include "llavatarname.h"
+#include "llavatarnamecache.h"
+
//////////////////////////////////////////////////////////////////////////////
// LLTeleportHistoryItem
@@ -113,6 +118,20 @@ void LLTeleportHistory::handleLoginComplete()
updateCurrentLocation(gAgent.getPositionGlobal());
}
+static void on_avatar_name_update_title(const LLAvatarName& av_name)
+{
+ if (gAgent.getRegion() && gViewerWindow && gViewerWindow->getWindow())
+ {
+ std::string region = gAgent.getRegion()->getName();
+ std::string username = av_name.getUserName();
+
+ // this first pass simply displays username and region name
+ // but could easily be extended to include other details like
+ // X/Y/Z location within a region etc.
+ std::string new_title = STRINGIZE(username << " @ " << region);
+ gViewerWindow->getWindow()->setTitle(new_title);
+ }
+}
void LLTeleportHistory::updateCurrentLocation(const LLVector3d& new_pos)
{
@@ -174,6 +193,14 @@ void LLTeleportHistory::updateCurrentLocation(const LLVector3d& new_pos)
if (!mGotInitialUpdate)
mGotInitialUpdate = true;
+ // update Viewer window title with username and region name
+ // if we are in "non-interactive mode" (SL-15999) or the debug
+ // setting to allow it is enabled (may be useful in other situations)
+ if (gNonInteractive || gSavedSettings.getBOOL("UpdateAppWindowTitleBar"))
+ {
+ LLAvatarNameCache::get(gAgent.getID(), boost::bind(&on_avatar_name_update_title, _2));
+ }
+
// Signal the interesting party that we've changed.
onHistoryChanged();
}