summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneleditwearable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpaneleditwearable.cpp')
-rw-r--r--indra/newview/llpaneleditwearable.cpp29
1 files changed, 20 insertions, 9 deletions
diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp
index e7acc68b93..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,7 +493,7 @@ void LLPanelEditWearable::initializePanel()
updateScrollingPanelUI();
}
-
+ updateVerbs();
}
void LLPanelEditWearable::updateScrollingPanelUI()
@@ -602,7 +606,7 @@ LLPanel* LLPanelEditWearable::getPanel(EWearableType type)
void LLPanelEditWearable::getSortedParams(value_map_t &sorted_params, const std::string &edit_group)
{
LLWearable::visual_param_vec_t param_list;
- ESex avatar_sex = gAgent.getAvatarObject()->getSex();
+ ESex avatar_sex = gAgentAvatarp->getSex();
mWearablePtr->getVisualParams(param_list);
@@ -640,18 +644,25 @@ void LLPanelEditWearable::buildParamList(LLScrollingPanelList *panel_list, value
{
LLPanel::Params p;
p.name("LLScrollingPanelParam");
- p.rect(LLRect(0, LLScrollingPanelParam::PARAM_PANEL_HEIGHT, LLScrollingPanelParam::PARAM_PANEL_WIDTH, 0 ));
LLScrollingPanelParam* panel_param = new LLScrollingPanelParam( p, NULL, (*it).second, TRUE, this->getWearable());
height = panel_list->addPanel( panel_param );
}
-
- S32 width = tab->getRect().getWidth();
-
- tab->reshape(width,height + tab->getHeaderHeight()+10,FALSE);
}
}
+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