summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneleditwearable.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-04-07 14:47:25 -0400
committerLoren Shih <seraph@lindenlab.com>2010-04-07 14:47:25 -0400
commit52293aa4bb7af45d2c3733f20982f4acb030c2d8 (patch)
treef963815f91b6259ea403d41807d19b69e759897e /indra/newview/llpaneleditwearable.cpp
parent516ec63f52245a777725d29efe3c35e4e4e72936 (diff)
parent8ac6310020bd2d524c97c729c29a0afe4a529ecf (diff)
automated merge
Diffstat (limited to 'indra/newview/llpaneleditwearable.cpp')
-rw-r--r--indra/newview/llpaneleditwearable.cpp21
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