Added avatar full name to the window header - base and Windows platform (still needs Mac and Linux)

master
Tozh 2011-03-20 12:22:57 -04:00
parent e8b829058b
commit f4e30cccd8
6 changed files with 42 additions and 1 deletions

View File

@ -162,6 +162,10 @@ public:
// Provide native key event data
virtual LLSD getNativeKeyData() { return LLSD::emptyMap(); }
//-TT Window Title Access
//this needs to be overridden for all platforms
virtual void setTitle(const std::string& win_title) {};
//-TT
protected:
LLWindow(LLWindowCallbacks* callbacks, BOOL fullscreen, U32 flags);
virtual ~LLWindow();

View File

@ -2853,6 +2853,23 @@ void LLWindowWin32::swapBuffers()
SwapBuffers(mhDC);
}
//-TT Window Title Access
void LLWindowWin32::setTitle(const std::string& win_title)
{
// Set the window title
if (win_title.empty())
{
wsprintf(mWindowTitle, L"OpenGL Window");
}
else
{
mbstowcs(mWindowTitle, win_title.c_str(), 255);
mWindowTitle[255] = 0;
}
SetWindowText(mWindowHandle, mWindowTitle);
}
//-TT
//
// LLSplashScreenImp

View File

@ -111,6 +111,9 @@ public:
/*virtual*/ void spawnWebBrowser(const std::string& escaped_url, bool async);
void openFile(const std::string& file_name);
//-TT Window Title Access
/*virtual*/ void setTitle(const std::string& win_title);
//-TT
LLWindowCallbacks::DragNDropResult completeDragNDropRequest( const LLCoordGL gl_coord, const MASK mask, LLWindowCallbacks::DragNDropAction action, const std::string url );
static std::vector<std::string> getDynamicFallbackFontList();

View File

@ -2351,7 +2351,8 @@ bool LLAppViewer::initConfiguration()
//
// Set the name of the window
//
gWindowTitle = llformat("Phoenix %s v%d.%d.%d.%d",LL_CHANNEL, LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VERSION_BUILD) ;
gWindowTitle = llformat("Phoenix %s v%d.%d.%d.%d",LL_CHANNEL, LL_VERSION_MAJOR, LL_VERSION_MINOR,
LL_VERSION_PATCH, LL_VERSION_BUILD) ;
#if LL_DEBUG
gWindowTitle += std::string(" [DEBUG] ") + gArgs;
#else
@ -4590,6 +4591,11 @@ void LLAppViewer::handleLoginComplete()
mOnLoginCompleted();
//-TT Window Title Access
gWindowTitle += std::string(" - ") + gAgentAvatarp->getFullname();
gViewerWindow->setTitle(gWindowTitle);
//-TT
writeDebugInfo();
}

View File

@ -2184,6 +2184,14 @@ void LLViewerWindow::draw()
//#endif
}
//-TT Window Title Access
void LLViewerWindow::setTitle(const std::string& win_title)
{
mWindow->setTitle(win_title);
}
//-TT
// Takes a single keydown event, usually when UI is visible
BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
{

View File

@ -379,6 +379,9 @@ public:
const LLVector2& getDisplayScale() const { return mDisplayScale; }
void calcDisplayScale();
static LLRect calcScaledRect(const LLRect & rect, const LLVector2& display_scale);
//-TT Window Title Access
void setTitle(const std::string& win_title);
//-TT
private:
bool shouldShowToolTipFor(LLMouseHandler *mh);