diff options
| -rw-r--r-- | indra/llui/llaccordionctrltab.cpp | 3 | ||||
| -rw-r--r-- | indra/llui/llaccordionctrltab.h | 3 | ||||
| -rw-r--r-- | indra/newview/llpanelpermissions.cpp | 51 | ||||
| -rw-r--r-- | indra/newview/llpanelpermissions.h | 3 | ||||
| -rw-r--r-- | indra/newview/llpanelwearing.cpp | 1 | 
5 files changed, 53 insertions, 8 deletions
| diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index 53720a6044..f8ef5289db 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -361,6 +361,7 @@ LLAccordionCtrlTab::LLAccordionCtrlTab(const LLAccordionCtrlTab::Params&p)  {  	mStoredOpenCloseState = false;  	mWasStateStored = false; +	mSkipChangesOnNotifyParent = false;  	mDropdownBGColor = LLColor4::white;  	LLAccordionCtrlTabHeader::Params headerParams; @@ -691,7 +692,7 @@ S32	LLAccordionCtrlTab::notifyParent(const LLSD& info)  			mExpandedHeight = height; -			if(isExpanded()) +			if(isExpanded() && !mSkipChangesOnNotifyParent)  			{  				LLRect panel_rect = getRect();  				panel_rect.setLeftTopAndSize( panel_rect.mLeft, panel_rect.mTop, panel_rect.getWidth(), height); diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h index 7a78700e0f..0263bce4be 100644 --- a/indra/llui/llaccordionctrltab.h +++ b/indra/llui/llaccordionctrltab.h @@ -195,6 +195,8 @@ public:  	void setFitPanel( bool fit ) { mFitPanel = true; }  	bool getFitParent() const { return mFitPanel; } +	void setIgnoreResizeNotification(bool ignore) { mSkipChangesOnNotifyParent = ignore;} +  protected:  	void adjustContainerPanel	(const LLRect& child_rect);  	void adjustContainerPanel	(); @@ -235,6 +237,7 @@ private:  	bool mStoredOpenCloseState;  	bool mWasStateStored; +	bool mSkipChangesOnNotifyParent;  	bool mSelectionEnabled; diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 6e677bbce5..203c57b732 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -63,6 +63,7 @@  #include "roles_constants.h"  #include "llgroupactions.h"  #include "lltrans.h" +#include "llinventorymodel.h"  U8 string_value_to_click_action(std::string p_value); @@ -1016,13 +1017,26 @@ void LLPanelPermissions::onCommitNextOwnerTransfer(LLUICtrl* ctrl, void* data)  // static  void LLPanelPermissions::onCommitName(LLUICtrl*, void* data)  { -	//LL_INFOS() << "LLPanelPermissions::onCommitName()" << LL_ENDL;  	LLPanelPermissions* self = (LLPanelPermissions*)data;  	LLLineEditor*	tb = self->getChild<LLLineEditor>("Object Name"); -	if(tb) +	if (!tb)  	{ -		LLSelectMgr::getInstance()->selectionSetObjectName(tb->getText()); -//		LLSelectMgr::getInstance()->selectionSetObjectName(self->mLabelObjectName->getText()); +		return; +	} +	LLSelectMgr::getInstance()->selectionSetObjectName(tb->getText()); +	LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); +	if (selection->isAttachment() && (selection->getNumNodes() == 1) && !tb->getText().empty()) +	{ +		LLUUID object_id = selection->getFirstObject()->getAttachmentItemID(); +		LLViewerInventoryItem* item = findItem(object_id); +		if (item) +		{ +			LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); +			new_item->rename(tb->getText()); +			new_item->updateServer(FALSE); +			gInventory.updateItem(new_item); +			gInventory.notifyObservers(); +		}  	}  } @@ -1030,12 +1044,26 @@ void LLPanelPermissions::onCommitName(LLUICtrl*, void* data)  // static  void LLPanelPermissions::onCommitDesc(LLUICtrl*, void* data)  { -	//LL_INFOS() << "LLPanelPermissions::onCommitDesc()" << LL_ENDL;  	LLPanelPermissions* self = (LLPanelPermissions*)data;  	LLLineEditor*	le = self->getChild<LLLineEditor>("Object Description"); -	if(le) +	if (!le)  	{ -		LLSelectMgr::getInstance()->selectionSetObjectDescription(le->getText()); +		return; +	} +	LLSelectMgr::getInstance()->selectionSetObjectDescription(le->getText()); +	LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); +	if (selection->isAttachment() && (selection->getNumNodes() == 1)) +	{ +		LLUUID object_id = selection->getFirstObject()->getAttachmentItemID(); +		LLViewerInventoryItem* item = findItem(object_id); +		if (item) +		{ +			LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); +			new_item->setDescription(le->getText()); +			new_item->updateServer(FALSE); +			gInventory.updateItem(new_item); +			gInventory.notifyObservers(); +		}  	}  } @@ -1159,3 +1187,12 @@ void LLPanelPermissions::onCommitIncludeInSearch(LLUICtrl* ctrl, void*)  	LLSelectMgr::getInstance()->selectionSetIncludeInSearch(box->get());  } + +LLViewerInventoryItem* LLPanelPermissions::findItem(LLUUID &object_id) +{ +	if (!object_id.isNull()) +	{ +		return gInventory.getItem(object_id); +	} +	return NULL; +} diff --git a/indra/newview/llpanelpermissions.h b/indra/newview/llpanelpermissions.h index 87805bbf90..2d15954baa 100644 --- a/indra/newview/llpanelpermissions.h +++ b/indra/newview/llpanelpermissions.h @@ -37,6 +37,7 @@  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  class LLNameBox; +class LLViewerInventoryItem;  class LLPanelPermissions : public LLPanel  { @@ -77,6 +78,8 @@ protected:  	static void	onCommitClickAction(LLUICtrl* ctrl, void*);  	static void onCommitIncludeInSearch(LLUICtrl* ctrl, void*); +	static LLViewerInventoryItem* findItem(LLUUID &object_id); +  protected:  	void disableAll(); diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index 796372ba04..a150007177 100644 --- a/indra/newview/llpanelwearing.cpp +++ b/indra/newview/llpanelwearing.cpp @@ -232,6 +232,7 @@ BOOL LLPanelWearing::postBuild()  {  	mAccordionCtrl = getChild<LLAccordionCtrl>("wearables_accordion");  	mWearablesTab = getChild<LLAccordionCtrlTab>("tab_wearables"); +	mWearablesTab->setIgnoreResizeNotification(true);  	mAttachmentsTab = getChild<LLAccordionCtrlTab>("tab_temp_attachments");  	mAttachmentsTab->setDropDownStateChangedCallback(boost::bind(&LLPanelWearing::onAccordionTabStateChanged, this)); | 
