From 8a5b11f0c3d2c8f539eb2d779be439e33222e89b Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Mon, 4 Jan 2010 21:30:03 -0600 Subject: Added LLFloater::setTitleArg and LLFloater::setShortTitleArg. This allows doing "[ARG]" replacement in floater titles. --- linden/indra/llui/llfloater.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'linden/indra/llui/llfloater.cpp') diff --git a/linden/indra/llui/llfloater.cpp b/linden/indra/llui/llfloater.cpp index defe200..e667bd4 100644 --- a/linden/indra/llui/llfloater.cpp +++ b/linden/indra/llui/llfloater.cpp @@ -691,11 +691,11 @@ void LLFloater::applyTitle() if (isMinimized() && !mShortTitle.empty()) { - mDragHandle->setTitle( mShortTitle ); + mDragHandle->setTitle( mShortTitle.getString() ); } else { - mDragHandle->setTitle ( mTitle ); + mDragHandle->setTitle ( mTitle.getString() ); } } @@ -706,7 +706,7 @@ const std::string& LLFloater::getCurrentTitle() const void LLFloater::setTitle( const std::string& title ) { - mTitle = title; + mTitle.assign(title); applyTitle(); } @@ -718,13 +718,13 @@ std::string LLFloater::getTitle() } else { - return mTitle; + return mTitle.getString(); } } void LLFloater::setShortTitle( const std::string& short_title ) { - mShortTitle = short_title; + mShortTitle.assign(short_title); applyTitle(); } @@ -736,11 +736,25 @@ std::string LLFloater::getShortTitle() } else { - return mShortTitle; + return mShortTitle.getString(); } } +BOOL LLFloater::setTitleArg( const std::string& key, const LLStringExplicit& text ) +{ + mTitle.setArg(key, text); + applyTitle(); + return TRUE; +} + +BOOL LLFloater::setShortTitleArg( const std::string& key, const LLStringExplicit& text ) +{ + mShortTitle.setArg(key, text); + applyTitle(); + return TRUE; +} + BOOL LLFloater::canSnapTo(const LLView* other_view) { -- cgit v1.1