diff options
| author | Vadim Savchuk <vsavchuk@productengine.com> | 2010-01-13 19:49:51 +0200 | 
|---|---|---|
| committer | Vadim Savchuk <vsavchuk@productengine.com> | 2010-01-13 19:49:51 +0200 | 
| commit | 6ad8674a8c5a87f438aa5ad6230396a859ba268e (patch) | |
| tree | 13c56aae408067f130e7619f4bac6c9a2e73cd57 | |
| parent | 3398ed6f890def2ab9fa31536d13a38f85847d93 (diff) | |
Fixed bug EXT-4210 (Partner in Profile not a Link).
Added an optional "link" parameter to LLNameBox to display the name as a link.
--HG--
branch : product-engine
| -rw-r--r-- | indra/newview/llnamebox.cpp | 24 | ||||
| -rw-r--r-- | indra/newview/llnamebox.h | 5 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_my_profile.xml | 1 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_profile.xml | 1 | 
4 files changed, 29 insertions, 2 deletions
| diff --git a/indra/newview/llnamebox.cpp b/indra/newview/llnamebox.cpp index 2f4a266198..d434017804 100644 --- a/indra/newview/llnamebox.cpp +++ b/indra/newview/llnamebox.cpp @@ -52,6 +52,7 @@ LLNameBox::LLNameBox(const Params& p)  :	LLTextBox(p)  {  	mNameID = LLUUID::null; +	mLink = p.link;  	LLNameBox::sInstances.insert(this);  	setText(LLStringUtil::null);  } @@ -76,7 +77,7 @@ void LLNameBox::setNameID(const LLUUID& name_id, BOOL is_group)  		gCacheName->getGroupName(name_id, name);  	} -	setText(name); +	setName(name, is_group);  }  void LLNameBox::refresh(const LLUUID& id, const std::string& firstname, @@ -93,7 +94,7 @@ void LLNameBox::refresh(const LLUUID& id, const std::string& firstname,  		{  			name = firstname;  		} -		setText(name); +		setName(name, is_group);  	}  } @@ -109,3 +110,22 @@ void LLNameBox::refreshAll(const LLUUID& id, const std::string& firstname,  		box->refresh(id, firstname, lastname, is_group);  	}  } + +void LLNameBox::setName(const std::string& name, BOOL is_group) +{ +	if (mLink) +	{ +		std::string url; + +		if (is_group) +			url = "[secondlife:///app/group/" + LLURI::escape(name) + "/about " + name + "]"; +		else +			url = "[secondlife:///app/agent/" + mNameID.asString() + "/about " + name + "]"; + +		setText(url); +	} +	else +	{ +		setText(name); +	} +} diff --git a/indra/newview/llnamebox.h b/indra/newview/llnamebox.h index 3edb36883f..0109525e85 100644 --- a/indra/newview/llnamebox.h +++ b/indra/newview/llnamebox.h @@ -47,9 +47,11 @@ public:  	struct Params : public LLInitParam::Block<Params, LLTextBox::Params>  	{  		Optional<bool>		is_group; +		Optional<bool>		link;  		Params()  		:	is_group("is_group", false) +		,	link("link", false)  		{}  	}; @@ -67,10 +69,13 @@ protected:  	friend class LLUICtrlFactory;  private: +	void setName(const std::string& name, BOOL is_group); +  	static std::set<LLNameBox*> sInstances;  private:  	LLUUID mNameID; +	BOOL mLink;  }; diff --git a/indra/newview/skins/default/xui/en/panel_my_profile.xml b/indra/newview/skins/default/xui/en/panel_my_profile.xml index 038d48cdd6..a9ff9362a0 100644 --- a/indra/newview/skins/default/xui/en/panel_my_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_my_profile.xml @@ -269,6 +269,7 @@                 height="10"                 layout="topleft"                 left="0" +               link="true"                 name="partner_text"                 top="0"             width="300" diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml index ec697838f6..2cd8940014 100644 --- a/indra/newview/skins/default/xui/en/panel_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_profile.xml @@ -249,6 +249,7 @@                 height="10"                 layout="topleft"                 left="0" +               link="true"                 name="partner_text"                 top="0"             width="300" | 
