diff options
| author | Dmitry Zaporozhan <dzaporozhan@productengine.com> | 2010-04-07 10:45:39 +0300 |
|---|---|---|
| committer | Dmitry Zaporozhan <dzaporozhan@productengine.com> | 2010-04-07 10:45:39 +0300 |
| commit | 05a4e9dd8bb13caadd25ef3e71aab43e9b857cd1 (patch) | |
| tree | cce5de2695a9482875abcd550671f7858c8eb903 /indra/newview/llpaneleditwearable.cpp | |
| parent | bb3abe5c17c92fec08da5490c3d66b411d25eacd (diff) | |
(work in progress) EXT-6564(major) - Fix wearable editing panels.
Updated layout of all Edit Wearable panels.
Disabled editing of no-modify wearable.
Disabled "Save As" for no-copy wearable.
Reviewed by Mike Antipov https://codereview.productengine.com/secondlife/r/170/
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llpaneleditwearable.cpp')
| -rw-r--r-- | indra/newview/llpaneleditwearable.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index c0528da999..da74295f9e 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -270,6 +270,8 @@ LLEditWearableDictionary::SubpartEntry::SubpartEntry(ESubpart part, LLPanelEditWearable::LLPanelEditWearable() : LLPanel() + , mWearablePtr(NULL) + , mWearableItem(NULL) { } @@ -338,8 +340,7 @@ BOOL LLPanelEditWearable::isDirty() const //virtual void LLPanelEditWearable::draw() { - BOOL is_dirty = isDirty(); - mBtnRevert->setEnabled(is_dirty); + updateVerbs(); LLPanel::draw(); } @@ -401,6 +402,9 @@ void LLPanelEditWearable::showWearable(LLWearable* wearable, BOOL show) return; } + mWearableItem = gInventory.getItem(mWearablePtr->getItemID()); + llassert(mWearableItem); + EWearableType type = wearable->getType(); LLPanel *targetPanel = NULL; std::string title; @@ -489,6 +493,7 @@ void LLPanelEditWearable::initializePanel() updateScrollingPanelUI(); } + updateVerbs(); } void LLPanelEditWearable::updateScrollingPanelUI() @@ -645,7 +650,19 @@ void LLPanelEditWearable::buildParamList(LLScrollingPanelList *panel_list, value } } +void LLPanelEditWearable::updateVerbs() +{ + bool can_copy = false; + if(mWearableItem) + { + can_copy = mWearableItem->getPermissions().allowCopyBy(gAgentID); + } + BOOL is_dirty = isDirty(); + mBtnRevert->setEnabled(is_dirty); + childSetEnabled("save_as_button", is_dirty && can_copy); +} +// EOF |
