diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-04-07 13:37:37 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-04-07 13:37:37 +0100 |
commit | 988d797b31acd3ecd2a396e5679dd7e74104f855 (patch) | |
tree | ed76f69f1dced3ff5072ecc0ed081f983a67f97e /indra/newview/llpaneleditwearable.cpp | |
parent | b5e12269e18bc9074b96f115085d5540ef1d7545 (diff) | |
parent | adce2ecdf8f3a0efcd4907699d286012124ac496 (diff) |
merge from viewer-trunk
Diffstat (limited to 'indra/newview/llpaneleditwearable.cpp')
-rw-r--r-- | indra/newview/llpaneleditwearable.cpp | 29 |
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 |