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 ++++++++++++++++++++------ linden/indra/llui/llfloater.h | 6 ++++-- 2 files changed, 24 insertions(+), 8 deletions(-) (limited to 'linden/indra/llui') 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) { diff --git a/linden/indra/llui/llfloater.h b/linden/indra/llui/llfloater.h index 0e3d148..4906e85 100644 --- a/linden/indra/llui/llfloater.h +++ b/linden/indra/llui/llfloater.h @@ -165,6 +165,8 @@ public: std::string getTitle(); void setShortTitle( const std::string& short_title ); std::string getShortTitle(); + BOOL setTitleArg( const std::string& key, const LLStringExplicit& text ); + BOOL setShortTitleArg( const std::string& key, const LLStringExplicit& text ); void setTitleVisible(bool visible); virtual void setMinimized(BOOL b); void moveResizeHandlesToFront(); @@ -276,8 +278,8 @@ private: BOOL mMinimized; BOOL mForeground; LLHandle mDependeeHandle; - std::string mTitle; - std::string mShortTitle; + LLUIString mTitle; + LLUIString mShortTitle; BOOL mFirstLook; // TRUE if the _next_ time this floater is visible will be the first time in the session that it is visible. -- cgit v1.1