diff options
| author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-03-25 22:58:26 +0200 | 
|---|---|---|
| committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-03-25 22:58:26 +0200 | 
| commit | b2d339ff066340add19092a3f79b3f48d5ade957 (patch) | |
| tree | 44d58dc436ad0721e4c8ea97d0b639d31e5fb88c | |
| parent | d38c2d8cd8b5588263b0bd01bfcb122282fb6af9 (diff) | |
SL-14855 Disable edit button for uneditable items
| -rw-r--r-- | indra/newview/llpanellandmarkinfo.cpp | 5 | ||||
| -rw-r--r-- | indra/newview/llpanellandmarkinfo.h | 1 | ||||
| -rw-r--r-- | indra/newview/llpanelplaces.cpp | 7 | 
3 files changed, 12 insertions, 1 deletions
| diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 6751c25fb9..5b24800038 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -360,6 +360,11 @@ void LLPanelLandmarkInfo::toggleLandmarkEditMode(BOOL enabled)  	setFocus(TRUE);  } +void LLPanelLandmarkInfo::setCanEdit(BOOL enabled) +{ +    getChild<LLButton>("edit_btn")->setEnabled(enabled); +} +  const std::string& LLPanelLandmarkInfo::getLandmarkTitle() const  {  	return mLandmarkTitleEditor->getText(); diff --git a/indra/newview/llpanellandmarkinfo.h b/indra/newview/llpanellandmarkinfo.h index 9712736182..f303d87ccf 100644 --- a/indra/newview/llpanellandmarkinfo.h +++ b/indra/newview/llpanellandmarkinfo.h @@ -51,6 +51,7 @@ public:  	void displayItemInfo(const LLInventoryItem* pItem);  	void toggleLandmarkEditMode(BOOL enabled); +	void setCanEdit(BOOL enabled);  	const std::string& getLandmarkTitle() const;  	const std::string getLandmarkNotes() const; diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 53870fb5c7..5dfeb7f619 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -430,10 +430,15 @@ void LLPanelPlaces::onOpen(const LLSD& key)  			{  				mLandmarkInfo->setInfoType(LLPanelPlaceInfo::LANDMARK); -				LLInventoryItem* item = gInventory.getItem(key["id"].asUUID()); +				LLUUID id = key["id"].asUUID(); +				LLInventoryItem* item = gInventory.getItem(id);  				if (!item)  					return; +                BOOL is_editable = gInventory.isObjectDescendentOf(id, gInventory.getRootFolderID()) +                                   && item->getPermissions().allowModifyBy(gAgent.getID()); +                mLandmarkInfo->setCanEdit(is_editable); +  				setItem(item);  			}  			else if (mPlaceInfoType == REMOTE_PLACE_INFO_TYPE) | 
