summaryrefslogtreecommitdiff
path: root/indra/newview/llteleporthistory.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2021-09-29 16:50:57 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2021-09-29 16:50:57 +0100
commit19154bec157a4e05c8b988531e84095a8124d3ec (patch)
treef09c2641c65ef410117eb2344ce3454154630080 /indra/newview/llteleporthistory.cpp
parent3c4198e4b50de0221020f3b5bbf7d3f7ff7cf984 (diff)
parent391500b5f7f2fb251acdd192d80e1da7eea02c4c (diff)
Merge branch 'SL-15999' of ssh://bitbucket.org/lindenlab/viewer into SL-15999
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..b872053d3f 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
@@ -174,6 +179,28 @@ 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"))
+ {
+ LLAvatarName av_name;
+ if (LLAvatarNameCache::get(gAgent.getID(), &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);
+ }
+ }
+ }
+
// Signal the interesting party that we've changed.
onHistoryChanged();
}