diff options
| -rw-r--r-- | indra/llui/lllineeditor.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llpanelgroupnotices.cpp | 3 | ||||
| -rw-r--r-- | indra/newview/llviewerinventory.cpp | 67 | ||||
| -rw-r--r-- | indra/newview/llwearablelist.cpp | 4 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml | 2 | 
5 files changed, 72 insertions, 6 deletions
| diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 843f72d8e4..45f9de8e8d 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -1440,7 +1440,7 @@ BOOL LLLineEditor::handleUnicodeCharHere(llwchar uni_char)  BOOL LLLineEditor::canDoDelete() const  { -	return ( !mReadOnly && (!mPassDelete || (hasSelection() || (getCursor() < mText.length()))) ); +	return ( !mReadOnly && mText.length() > 0 && (!mPassDelete || (hasSelection() || (getCursor() < mText.length()))) );  }  void LLLineEditor::doDelete() diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index 8da19d1574..f7d76bc069 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -656,6 +656,9 @@ void LLPanelGroupNotices::setGroupID(const LLUUID& id)  	if(mViewMessage)   		mViewMessage->clear(); + +	if(mViewInventoryName) +		mViewInventoryName->clear();  	activate();  } diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index f434d15843..a23e42ea9e 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -67,6 +67,40 @@  #include "llviewermessage.h"  ///---------------------------------------------------------------------------- +/// Helper class to store special inventory item names  +///---------------------------------------------------------------------------- +class LLLocalizedInventoryItemsDictionary : public LLSingleton<LLLocalizedInventoryItemsDictionary> +{ +public: +	std::map<std::string, std::string> mInventoryItemsDict; + +	LLLocalizedInventoryItemsDictionary() +	{ +		mInventoryItemsDict["New Shape"]		= LLTrans::getString("New Shape"); +		mInventoryItemsDict["New Skin"]			= LLTrans::getString("New Skin"); +		mInventoryItemsDict["New Hair"]			= LLTrans::getString("New Hair"); +		mInventoryItemsDict["New Eyes"]			= LLTrans::getString("New Eyes"); +		mInventoryItemsDict["New Shirt"]		= LLTrans::getString("New Shirt"); +		mInventoryItemsDict["New Pants"]		= LLTrans::getString("New Pants"); +		mInventoryItemsDict["New Shoes"]		= LLTrans::getString("New Shoes"); +		mInventoryItemsDict["New Socks"]		= LLTrans::getString("New Socks"); +		mInventoryItemsDict["New Jacket"]		= LLTrans::getString("New Jacket"); +		mInventoryItemsDict["New Gloves"]		= LLTrans::getString("New Gloves"); +		mInventoryItemsDict["New Undershirt"]	= LLTrans::getString("New Undershirt"); +		mInventoryItemsDict["New Undershirt"]	= LLTrans::getString("New Undershirt"); +		mInventoryItemsDict["New Skirt"]		= LLTrans::getString("New Skirt"); +		mInventoryItemsDict["New Alpha"]		= LLTrans::getString("New Alpha"); +		mInventoryItemsDict["New Tattoo"]		= LLTrans::getString("New Tattoo"); +		mInventoryItemsDict["Invalid Wearable"] = LLTrans::getString("Invalid Wearable"); + +		mInventoryItemsDict["New Script"]		= LLTrans::getString("New Script"); +		mInventoryItemsDict["New Folder"]		= LLTrans::getString("New Folder"); +		mInventoryItemsDict["Contents"]			= LLTrans::getString("Contents"); +	} +}; + + +///----------------------------------------------------------------------------  /// Local function declarations, constants, enums, and typedefs  ///---------------------------------------------------------------------------- @@ -316,6 +350,18 @@ BOOL LLViewerInventoryItem::unpackMessage(LLSD item)  BOOL LLViewerInventoryItem::unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num)  {  	BOOL rv = LLInventoryItem::unpackMessage(msg, block, block_num); + +	std::string localized_str; + +	std::map<std::string, std::string>::const_iterator dictionary_iter; + +	dictionary_iter = LLLocalizedInventoryItemsDictionary::getInstance()->mInventoryItemsDict.find(mName); + +	if(dictionary_iter != LLLocalizedInventoryItemsDictionary::getInstance()->mInventoryItemsDict.end()) +	{ +		mName = dictionary_iter->second; +	} +  	mIsComplete = TRUE;  	return rv;  } @@ -867,6 +913,25 @@ void create_inventory_item(const LLUUID& agent_id, const LLUUID& session_id,  						   U32 next_owner_perm,  						   LLPointer<LLInventoryCallback> cb)  { +	//check if name is equal to one of special inventory items names +	//EXT-5839 +	std::string server_name = name; + +	{ +		std::map<std::string, std::string>::const_iterator dictionary_iter; + +		for (dictionary_iter = LLLocalizedInventoryItemsDictionary::getInstance()->mInventoryItemsDict.begin(); +			 dictionary_iter != LLLocalizedInventoryItemsDictionary::getInstance()->mInventoryItemsDict.end(); +			 dictionary_iter++) +		{ +			const std::string& localized_name = dictionary_iter->second; +			if(localized_name == name) +			{ +				server_name = dictionary_iter->first; +			} +		} +	} +  	LLMessageSystem* msg = gMessageSystem;  	msg->newMessageFast(_PREHASH_CreateInventoryItem);  	msg->nextBlock(_PREHASH_AgentData); @@ -880,7 +945,7 @@ void create_inventory_item(const LLUUID& agent_id, const LLUUID& session_id,  	msg->addS8Fast(_PREHASH_Type, (S8)asset_type);  	msg->addS8Fast(_PREHASH_InvType, (S8)inv_type);  	msg->addU8Fast(_PREHASH_WearableType, (U8)wtype); -	msg->addStringFast(_PREHASH_Name, name); +	msg->addStringFast(_PREHASH_Name, server_name);  	msg->addStringFast(_PREHASH_Description, desc);  	gAgent.sendReliableMessage(); diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index b2de31218b..20266706da 100644 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -235,9 +235,7 @@ LLWearable* LLWearableList::createNewWearable( EWearableType type )  	LLWearable *wearable = generateNewWearable();  	wearable->setType( type ); -	LLSD item_name = LLSD().with("[WEARABLE_ITEM]", wearable->getTypeLabel()); -	std::string name = LLTrans::getString("NewWearable"); -	LLStringUtil::format(name, item_name); +	std::string name = LLTrans::getString( LLWearableDictionary::getTypeDefaultNewName(wearable->getType()) );  	wearable->setName( name );  	LLPermissions perm; diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml index 184ea54fcb..5dbd8bfe6a 100644 --- a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml @@ -17,7 +17,7 @@       layout="topleft"       left_delta="3"       left="0" -     max_length="512" +     max_length="1024"       name="chat_box"       text_pad_left="5"       text_pad_right="25" | 
